mirror of
https://github.com/pezkuwichain/pezkuwi-common.git
synced 2026-11-03 06:51:06 +00:00
x-randomvalues: declare NativeModules locally; resolve braces to @pezkuwi/braces
x-randomvalues read one export from react-native, NativeModules, and took its types from the deprecated @types/react-native, which depends on react-native itself: react-native 0.83, metro 0.83 and with them image-size (open advisory, fixed only in 2.x, which metro 0.83 does not accept). The two native modules it looks for are now declared in src/react-native-modules.d.ts; the casts to RNExt are gone and each module is checked before use. The published react-native.d.ts does not reference react-native, and react-native/metro leave the dependency tree. braces resolves to @pezkuwi/braces 3.0.4: braces 3.0.3, the latest upstream release, has an open advisory with no fixed version (CVE-2026-93687, stack exhaustion through deeply nested patterns); the fork rejects nesting deeper than maxDepth (500) with a SyntaxError.
This commit is contained in:
1 parent
090f7f35e2
commit
81e25b008b
5 files changed
+80
-1885
No files matched your search
@@ -0,0 +1,18 @@
|
||||
// Copyright 2017-2026 @pezkuwi/x-randomvalues authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// The one React Native export react-native.ts reads, and only the native
|
||||
// modules it looks for. Declared here instead of installing react-native for
|
||||
// its types, which brought in its metro and CLI tree as well.
|
||||
declare module 'react-native' {
|
||||
interface RandomModules {
|
||||
ExpoRandom?: {
|
||||
getRandomBase64String: (length: number) => string;
|
||||
};
|
||||
RNGetRandomValues?: {
|
||||
getRandomBase64: (length: number) => string;
|
||||
};
|
||||
}
|
||||
|
||||
export const NativeModules: RandomModules;
|
||||
}
|
||||
Reference in new issue
Block a user