-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprimordials-defaults.ts
More file actions
82 lines (79 loc) · 2.72 KB
/
Copy pathprimordials-defaults.ts
File metadata and controls
82 lines (79 loc) · 2.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/**
* @file GENERATED — do not edit by hand. Run `node
* scripts/post-build/make-primordials-defaults.mts` (also runs as part of
* `pnpm run build`) to regenerate from the `globals` npm package's
* globals.json crossed against src/primordials/*.ts `Ctor` exports. Source:
* globals@<bumped via taze>, env = builtin ∪ node. Filter: identifiers
* socket-lib exports as `<name>Ctor`.
*/
import { ObjectFreeze } from '../primordials/object'
/**
* Fleet-canonical alias map: socket-lib mirrors standard JS + Node globals with
* a `Ctor` suffix. Downstream repos that destructure raw `primordials` use this
* map to resolve the source-side name to socket-lib's export.
*/
export const DEFAULT_ALIAS_MAP: Readonly<Record<string, string>> = ObjectFreeze(
{
__proto__: null,
AggregateError: 'AggregateErrorCtor',
Array: 'ArrayCtor',
ArrayBuffer: 'ArrayBufferCtor',
BigInt: 'BigIntCtor',
Boolean: 'BooleanCtor',
Buffer: 'BufferCtor',
DataView: 'DataViewCtor',
Date: 'DateCtor',
Error: 'ErrorCtor',
EvalError: 'EvalErrorCtor',
Float32Array: 'Float32ArrayCtor',
Float64Array: 'Float64ArrayCtor',
Int16Array: 'Int16ArrayCtor',
Int32Array: 'Int32ArrayCtor',
Int8Array: 'Int8ArrayCtor',
Map: 'MapCtor',
Number: 'NumberCtor',
Object: 'ObjectCtor',
Promise: 'PromiseCtor',
Proxy: 'ProxyCtor',
RangeError: 'RangeErrorCtor',
ReferenceError: 'ReferenceErrorCtor',
RegExp: 'RegExpCtor',
Set: 'SetCtor',
SharedArrayBuffer: 'SharedArrayBufferCtor',
String: 'StringCtor',
Symbol: 'SymbolCtor',
SyntaxError: 'SyntaxErrorCtor',
TypeError: 'TypeErrorCtor',
URIError: 'URIErrorCtor',
URL: 'URLCtor',
URLSearchParams: 'URLSearchParamsCtor',
Uint16Array: 'Uint16ArrayCtor',
Uint32Array: 'Uint32ArrayCtor',
Uint8Array: 'Uint8ArrayCtor',
Uint8ClampedArray: 'Uint8ClampedArrayCtor',
WeakMap: 'WeakMapCtor',
WeakRef: 'WeakRefCtor',
WeakSet: 'WeakSetCtor',
atob: 'GlobalAtob',
btoa: 'GlobalBtoa',
decodeURIComponent: 'GlobalDecodeUriComponent',
encodeURIComponent: 'GlobalEncodeUriComponent',
globalThis: 'GlobalThis',
},
) as unknown as Readonly<Record<string, string>>
/**
* Names that exist in Node's internal `primordials` but are intentionally NOT
* mirrored to socket-lib (mostly Safe* wrappers and prototype-method aliases).
* Adding to this set is a per-name decision; the list is hand-maintained.
*/
export const DEFAULT_NODE_INTERNAL_ONLY: readonly string[] = ObjectFreeze([
'DataViewPrototypeGetInt32',
'DataViewPrototypeGetUint32',
'SafeMap',
'SafePromise',
'SafePromiseAllReturnVoid',
'SafePromiseAllSettled',
'SafeSet',
'SafeWeakMap',
'SafeWeakSet',
]) as readonly string[]