move node types, stub node modules
Summary: This diff stubs all node modules when running in the browser, so that, albeit with a lot of errors and without plugins, the UI loads in a browser. To be continued in the rest of this diff Reviewed By: antonk52 Differential Revision: D32665705 fbshipit-source-id: 4632e241f59c5b9712a41d01a26878afb01f69b5
This commit is contained in:
committed by
Facebook GitHub Bot
parent
d0402d7268
commit
ad4a55f263
@@ -20,10 +20,6 @@ declare global {
|
||||
| undefined
|
||||
| (StoreEnhancerStoreCreator & StoreEnhancerStateSanitizer);
|
||||
|
||||
Flipper: {
|
||||
init: () => void;
|
||||
};
|
||||
|
||||
FlipperRenderHostInstance: RenderHost;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,20 +9,21 @@
|
||||
|
||||
import util from 'util';
|
||||
import {exec as execImport} from 'child_process';
|
||||
const exec = util.promisify(execImport);
|
||||
|
||||
const cmd = 'klist --json';
|
||||
const endWith = '@THEFACEBOOK.COM';
|
||||
|
||||
export async function isFBEmployee(): Promise<boolean> {
|
||||
return exec(cmd).then(
|
||||
(stdobj: {stderr: string; stdout: string}) => {
|
||||
const principal = String(JSON.parse(stdobj.stdout).principal);
|
||||
return util
|
||||
.promisify(execImport)(cmd)
|
||||
.then(
|
||||
(stdobj: {stderr: string; stdout: string}) => {
|
||||
const principal = String(JSON.parse(stdobj.stdout).principal);
|
||||
|
||||
return principal.endsWith(endWith);
|
||||
},
|
||||
(_err: Error) => {
|
||||
return false;
|
||||
},
|
||||
);
|
||||
return principal.endsWith(endWith);
|
||||
},
|
||||
(_err: Error) => {
|
||||
return false;
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user