From 03d4a7d750819ba602a4231ff334226bbe332b80 Mon Sep 17 00:00:00 2001 From: Pascal Hartig Date: Thu, 15 Aug 2019 09:40:52 -0700 Subject: [PATCH] Migrate fbEmployee Summary: _typescript_ Reviewed By: jknoxville Differential Revision: D16827958 fbshipit-source-id: f2ab616b2682ede7da6c1e401fcc6d0644a1b960 --- src/init.tsx | 2 +- src/utils/{fbEmployee.js => fbEmployee.tsx} | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) rename src/utils/{fbEmployee.js => fbEmployee.tsx} (79%) diff --git a/src/init.tsx b/src/init.tsx index 13bd7fe47..3f4253218 100644 --- a/src/init.tsx +++ b/src/init.tsx @@ -24,7 +24,7 @@ import {stateSanitizer} from './utils/reduxDevToolsConfig'; import {initLauncherHooks} from './utils/launcher'; import initCrashReporter from './utils/electronCrashReporter'; import fbConfig from './fb-stubs/config'; -import {isFBEmployee} from './utils/fbEmployee.js'; +import {isFBEmployee} from './utils/fbEmployee'; import WarningEmployee from './chrome/WarningEmployee'; import React from 'react'; diff --git a/src/utils/fbEmployee.js b/src/utils/fbEmployee.tsx similarity index 79% rename from src/utils/fbEmployee.js rename to src/utils/fbEmployee.tsx index 4641d34df..8a0114f62 100644 --- a/src/utils/fbEmployee.js +++ b/src/utils/fbEmployee.tsx @@ -11,14 +11,14 @@ const exec = util.promisify(require('child_process').exec); const cmd = 'klist --json'; const endWith = '@THEFACEBOOK.COM'; -export function isFBEmployee(): Promise { +export async function isFBEmployee(): Promise { return exec(cmd).then( - (stdobj: {stderr: string, stdout: string}) => { + (stdobj: {stderr: string; stdout: string}) => { const principal = String(JSON.parse(stdobj.stdout).principal); return principal.endsWith(endWith); }, - err => { + (_err: Error) => { return false; }, );