Formatting cleanups for nested conditionals (#902)

* Formatting cleanups for nested conditionals

* Transports
This commit is contained in:
Jaco Greeff
2021-02-27 11:30:18 +01:00
committed by GitHub
parent 3143e9df1c
commit 843cb3d00a
11 changed files with 50 additions and 40 deletions
+8 -6
View File
@@ -31,9 +31,11 @@ function getRandomValuesGlobal <T extends Uint8Array> (arr: T): T {
return crypto.getRandomValues(arr);
}
export const getRandomValues = typeof xglobal.crypto === 'object' && typeof xglobal.crypto.getRandomValues === 'function'
? getRandomValuesGlobal
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-explicit-any
: (typeof (xglobal as any).nativeCallSyncHook === 'undefined' || !NativeModules.ExpoRandom)
? insecureRandomValues
: getRandomValuesNative;
export const getRandomValues = (
typeof xglobal.crypto === 'object' && typeof xglobal.crypto.getRandomValues === 'function'
? getRandomValuesGlobal
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access,@typescript-eslint/no-explicit-any
: (typeof (xglobal as any).nativeCallSyncHook === 'undefined' || !NativeModules.ExpoRandom)
? insecureRandomValues
: getRandomValuesNative
);