Migrate util/appMatchPatterns to TypeScript
Summary: Migrated appMatchPatterns.js to appMatchPatterns.tsx Reviewed By: danielbuechele Differential Revision: D17133610 fbshipit-source-id: 1a819e2b32a233372e08578352290eff1264ef43
This commit is contained in:
committed by
Facebook Github Bot
parent
d5d0b0cd49
commit
950bbbf97d
@@ -25,7 +25,7 @@ import {
|
|||||||
bookmarksToAutoCompleteProvider,
|
bookmarksToAutoCompleteProvider,
|
||||||
DefaultProvider,
|
DefaultProvider,
|
||||||
} from './util/autoCompleteProvider.tsx';
|
} from './util/autoCompleteProvider.tsx';
|
||||||
import {getAppMatchPatterns} from './util/appMatchPatterns';
|
import {getAppMatchPatterns} from './util/appMatchPatterns.tsx';
|
||||||
import {getRequiredParameters, filterOptionalParameters} from './util/uri.tsx';
|
import {getRequiredParameters, filterOptionalParameters} from './util/uri.tsx';
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
|
|||||||
@@ -3,15 +3,14 @@
|
|||||||
* This source code is licensed under the MIT license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
* @format
|
* @format
|
||||||
* @flow strict-local
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
import type {AppMatchPattern} from '../flow-types';
|
import {AppMatchPattern} from '../types';
|
||||||
|
|
||||||
const extractAppNameFromSelectedApp = (selectedApp: ?string) => {
|
const extractAppNameFromSelectedApp = (selectedApp: string | null) => {
|
||||||
if (selectedApp == null) {
|
if (selectedApp == null) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
@@ -19,7 +18,7 @@ const extractAppNameFromSelectedApp = (selectedApp: ?string) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getAppMatchPatterns = (selectedApp: ?string) => {
|
export const getAppMatchPatterns = (selectedApp: string | null) => {
|
||||||
return new Promise<Array<AppMatchPattern>>((resolve, reject) => {
|
return new Promise<Array<AppMatchPattern>>((resolve, reject) => {
|
||||||
const appName = extractAppNameFromSelectedApp(selectedApp);
|
const appName = extractAppNameFromSelectedApp(selectedApp);
|
||||||
if (appName === 'Facebook') {
|
if (appName === 'Facebook') {
|
||||||
Reference in New Issue
Block a user