@hyperfrontend/immutable-api-utils 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/README.md +68 -8
- package/built-in-copy/array/index.cjs.js +40 -0
- package/built-in-copy/array/index.cjs.js.map +1 -0
- package/built-in-copy/array/index.d.ts +40 -0
- package/built-in-copy/array/index.d.ts.map +1 -0
- package/built-in-copy/array/index.esm.js +35 -0
- package/built-in-copy/array/index.esm.js.map +1 -0
- package/built-in-copy/console/index.cjs.js +130 -0
- package/built-in-copy/console/index.cjs.js.map +1 -0
- package/built-in-copy/console/index.d.ts +105 -0
- package/built-in-copy/console/index.d.ts.map +1 -0
- package/built-in-copy/console/index.esm.js +110 -0
- package/built-in-copy/console/index.esm.js.map +1 -0
- package/built-in-copy/date/index.cjs.js +49 -0
- package/built-in-copy/date/index.cjs.js.map +1 -0
- package/built-in-copy/date/index.d.ts +49 -0
- package/built-in-copy/date/index.d.ts.map +1 -0
- package/built-in-copy/date/index.esm.js +43 -0
- package/built-in-copy/date/index.esm.js.map +1 -0
- package/built-in-copy/encoding/index.cjs.js +67 -0
- package/built-in-copy/encoding/index.cjs.js.map +1 -0
- package/built-in-copy/encoding/index.d.ts +52 -0
- package/built-in-copy/encoding/index.d.ts.map +1 -0
- package/built-in-copy/encoding/index.esm.js +61 -0
- package/built-in-copy/encoding/index.esm.js.map +1 -0
- package/built-in-copy/error/index.cjs.js +122 -0
- package/built-in-copy/error/index.cjs.js.map +1 -0
- package/built-in-copy/error/index.d.ts +99 -0
- package/built-in-copy/error/index.d.ts.map +1 -0
- package/built-in-copy/error/index.esm.js +112 -0
- package/built-in-copy/error/index.esm.js.map +1 -0
- package/built-in-copy/function/index.cjs.js +61 -0
- package/built-in-copy/function/index.cjs.js.map +1 -0
- package/built-in-copy/function/index.d.ts +47 -0
- package/built-in-copy/function/index.d.ts.map +1 -0
- package/built-in-copy/function/index.esm.js +54 -0
- package/built-in-copy/function/index.esm.js.map +1 -0
- package/built-in-copy/json/index.cjs.js +34 -0
- package/built-in-copy/json/index.cjs.js.map +1 -0
- package/built-in-copy/json/index.d.ts +31 -0
- package/built-in-copy/json/index.d.ts.map +1 -0
- package/built-in-copy/json/index.esm.js +30 -0
- package/built-in-copy/json/index.esm.js.map +1 -0
- package/built-in-copy/map/index.cjs.js +44 -0
- package/built-in-copy/map/index.cjs.js.map +1 -0
- package/built-in-copy/map/index.d.ts +33 -0
- package/built-in-copy/map/index.d.ts.map +1 -0
- package/built-in-copy/map/index.esm.js +40 -0
- package/built-in-copy/map/index.esm.js.map +1 -0
- package/built-in-copy/math/index.cjs.js +317 -0
- package/built-in-copy/math/index.cjs.js.map +1 -0
- package/built-in-copy/math/index.d.ts +232 -0
- package/built-in-copy/math/index.d.ts.map +1 -0
- package/built-in-copy/math/index.esm.js +272 -0
- package/built-in-copy/math/index.esm.js.map +1 -0
- package/built-in-copy/messaging/index.cjs.js +123 -0
- package/built-in-copy/messaging/index.cjs.js.map +1 -0
- package/built-in-copy/messaging/index.d.ts +95 -0
- package/built-in-copy/messaging/index.d.ts.map +1 -0
- package/built-in-copy/messaging/index.esm.js +114 -0
- package/built-in-copy/messaging/index.esm.js.map +1 -0
- package/built-in-copy/number/index.cjs.js +141 -0
- package/built-in-copy/number/index.cjs.js.map +1 -0
- package/built-in-copy/number/index.d.ts +95 -0
- package/built-in-copy/number/index.d.ts.map +1 -0
- package/built-in-copy/number/index.esm.js +123 -0
- package/built-in-copy/number/index.esm.js.map +1 -0
- package/built-in-copy/object/index.cjs.js +174 -0
- package/built-in-copy/object/index.cjs.js.map +1 -0
- package/built-in-copy/object/index.d.ts +209 -0
- package/built-in-copy/object/index.d.ts.map +1 -0
- package/built-in-copy/object/index.esm.js +149 -0
- package/built-in-copy/object/index.esm.js.map +1 -0
- package/built-in-copy/promise/index.cjs.js +80 -0
- package/built-in-copy/promise/index.cjs.js.map +1 -0
- package/built-in-copy/promise/index.d.ts +63 -0
- package/built-in-copy/promise/index.d.ts.map +1 -0
- package/built-in-copy/promise/index.esm.js +70 -0
- package/built-in-copy/promise/index.esm.js.map +1 -0
- package/built-in-copy/reflect/index.cjs.js +101 -0
- package/built-in-copy/reflect/index.cjs.js.map +1 -0
- package/built-in-copy/reflect/index.d.ts +81 -0
- package/built-in-copy/reflect/index.d.ts.map +1 -0
- package/built-in-copy/reflect/index.esm.js +86 -0
- package/built-in-copy/reflect/index.esm.js.map +1 -0
- package/built-in-copy/regexp/index.cjs.js +37 -0
- package/built-in-copy/regexp/index.cjs.js.map +1 -0
- package/built-in-copy/regexp/index.d.ts +28 -0
- package/built-in-copy/regexp/index.d.ts.map +1 -0
- package/built-in-copy/regexp/index.esm.js +34 -0
- package/built-in-copy/regexp/index.esm.js.map +1 -0
- package/built-in-copy/set/index.cjs.js +36 -0
- package/built-in-copy/set/index.cjs.js.map +1 -0
- package/built-in-copy/set/index.d.ts +27 -0
- package/built-in-copy/set/index.d.ts.map +1 -0
- package/built-in-copy/set/index.esm.js +33 -0
- package/built-in-copy/set/index.esm.js.map +1 -0
- package/built-in-copy/string/index.cjs.js +46 -0
- package/built-in-copy/string/index.cjs.js.map +1 -0
- package/built-in-copy/string/index.d.ts +34 -0
- package/built-in-copy/string/index.d.ts.map +1 -0
- package/built-in-copy/string/index.esm.js +41 -0
- package/built-in-copy/string/index.esm.js.map +1 -0
- package/built-in-copy/symbol/index.cjs.js +123 -0
- package/built-in-copy/symbol/index.cjs.js.map +1 -0
- package/built-in-copy/symbol/index.d.ts +99 -0
- package/built-in-copy/symbol/index.d.ts.map +1 -0
- package/built-in-copy/symbol/index.esm.js +105 -0
- package/built-in-copy/symbol/index.esm.js.map +1 -0
- package/built-in-copy/timers/index.cjs.js +105 -0
- package/built-in-copy/timers/index.cjs.js.map +1 -0
- package/built-in-copy/timers/index.d.ts +73 -0
- package/built-in-copy/timers/index.d.ts.map +1 -0
- package/built-in-copy/timers/index.esm.js +96 -0
- package/built-in-copy/timers/index.esm.js.map +1 -0
- package/built-in-copy/typed-arrays/index.cjs.js +360 -0
- package/built-in-copy/typed-arrays/index.cjs.js.map +1 -0
- package/built-in-copy/typed-arrays/index.d.ts +321 -0
- package/built-in-copy/typed-arrays/index.d.ts.map +1 -0
- package/built-in-copy/typed-arrays/index.esm.js +321 -0
- package/built-in-copy/typed-arrays/index.esm.js.map +1 -0
- package/built-in-copy/url/index.cjs.js +103 -0
- package/built-in-copy/url/index.cjs.js.map +1 -0
- package/built-in-copy/url/index.d.ts +71 -0
- package/built-in-copy/url/index.d.ts.map +1 -0
- package/built-in-copy/url/index.esm.js +95 -0
- package/built-in-copy/url/index.esm.js.map +1 -0
- package/built-in-copy/weak-map/index.cjs.js +36 -0
- package/built-in-copy/weak-map/index.cjs.js.map +1 -0
- package/built-in-copy/weak-map/index.d.ts +27 -0
- package/built-in-copy/weak-map/index.d.ts.map +1 -0
- package/built-in-copy/weak-map/index.esm.js +33 -0
- package/built-in-copy/weak-map/index.esm.js.map +1 -0
- package/built-in-copy/weak-set/index.cjs.js +36 -0
- package/built-in-copy/weak-set/index.cjs.js.map +1 -0
- package/built-in-copy/weak-set/index.d.ts +27 -0
- package/built-in-copy/weak-set/index.d.ts.map +1 -0
- package/built-in-copy/weak-set/index.esm.js +33 -0
- package/built-in-copy/weak-set/index.esm.js.map +1 -0
- package/built-in-copy/websocket/index.cjs.js +50 -0
- package/built-in-copy/websocket/index.cjs.js.map +1 -0
- package/built-in-copy/websocket/index.d.ts +37 -0
- package/built-in-copy/websocket/index.d.ts.map +1 -0
- package/built-in-copy/websocket/index.esm.js +43 -0
- package/built-in-copy/websocket/index.esm.js.map +1 -0
- package/bundle/index.iife.js +1167 -5
- package/bundle/index.iife.js.map +1 -1
- package/bundle/index.iife.min.js +1 -1
- package/bundle/index.iife.min.js.map +1 -1
- package/bundle/index.umd.js +1167 -5
- package/bundle/index.umd.js.map +1 -1
- package/bundle/index.umd.min.js +1 -1
- package/bundle/index.umd.min.js.map +1 -1
- package/index.cjs.js +1167 -5
- package/index.cjs.js.map +1 -1
- package/index.d.ts +32 -3
- package/index.d.ts.map +1 -1
- package/index.esm.js +1151 -6
- package/index.esm.js.map +1 -1
- package/lib/locked-prop-descriptors.d.ts.map +1 -0
- package/lib/locked-props.d.ts.map +1 -0
- package/{locked.d.ts → lib/locked.d.ts} +12 -1
- package/lib/locked.d.ts.map +1 -0
- package/locked/index.cjs.js +107 -0
- package/locked/index.cjs.js.map +1 -0
- package/locked/index.d.ts +2 -0
- package/locked/index.d.ts.map +1 -0
- package/locked/index.esm.js +105 -0
- package/locked/index.esm.js.map +1 -0
- package/locked-prop-descriptors/index.cjs.js +11 -0
- package/locked-prop-descriptors/index.cjs.js.map +1 -0
- package/locked-prop-descriptors/index.d.ts +2 -0
- package/locked-prop-descriptors/index.d.ts.map +1 -0
- package/locked-prop-descriptors/index.esm.js +9 -0
- package/locked-prop-descriptors/index.esm.js.map +1 -0
- package/locked-props/index.cjs.js +32 -0
- package/locked-props/index.cjs.js.map +1 -0
- package/locked-props/index.d.ts +2 -0
- package/locked-props/index.d.ts.map +1 -0
- package/locked-props/index.esm.js +30 -0
- package/locked-props/index.esm.js.map +1 -0
- package/package.json +149 -14
- package/locked-prop-descriptors.d.ts.map +0 -1
- package/locked-props.d.ts.map +0 -1
- package/locked.d.ts.map +0 -1
- /package/{locked-prop-descriptors.d.ts → lib/locked-prop-descriptors.d.ts} +0 -0
- /package/{locked-props.d.ts → lib/locked-props.d.ts} +0 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Safe copies of URL built-ins via factory functions.
|
|
5
|
+
*
|
|
6
|
+
* Provides safe references to URL and URLSearchParams.
|
|
7
|
+
* These references are captured at module initialization time to protect against
|
|
8
|
+
* prototype pollution attacks. Import only what you need for tree-shaking.
|
|
9
|
+
*
|
|
10
|
+
* @module @hyperfrontend/immutable-api-utils/built-in-copy/url
|
|
11
|
+
*/
|
|
12
|
+
// Capture references at module initialization time
|
|
13
|
+
const _URL = globalThis.URL;
|
|
14
|
+
const _URLSearchParams = globalThis.URLSearchParams;
|
|
15
|
+
const _Reflect = globalThis.Reflect;
|
|
16
|
+
const _freeze = globalThis.Object.freeze;
|
|
17
|
+
// ============================================================================
|
|
18
|
+
// URL
|
|
19
|
+
// ============================================================================
|
|
20
|
+
/**
|
|
21
|
+
* (Safe copy) Creates a new URL using the captured URL constructor.
|
|
22
|
+
* Use this instead of `new URL()`.
|
|
23
|
+
*
|
|
24
|
+
* @param url - The URL string to parse.
|
|
25
|
+
* @param base - Optional base URL for relative URLs.
|
|
26
|
+
* @returns A new URL instance.
|
|
27
|
+
*/
|
|
28
|
+
const createURL = (url, base) => _Reflect.construct(_URL, [url, base]);
|
|
29
|
+
/**
|
|
30
|
+
* (Safe copy) Returns whether the provided string is a valid URL.
|
|
31
|
+
* Use this instead of `URL.canParse()`.
|
|
32
|
+
*
|
|
33
|
+
* @param url - The URL string to validate.
|
|
34
|
+
* @param base - Optional base URL for relative URLs.
|
|
35
|
+
* @returns True if the URL is valid, false otherwise.
|
|
36
|
+
*/
|
|
37
|
+
const canParse = _URL.canParse;
|
|
38
|
+
/**
|
|
39
|
+
* (Safe copy) Creates an object URL for the given object.
|
|
40
|
+
* Use this instead of `URL.createObjectURL()`.
|
|
41
|
+
*
|
|
42
|
+
* Note: This is a browser-only API. In Node.js environments, this will throw.
|
|
43
|
+
*/
|
|
44
|
+
const createObjectURL = typeof _URL.createObjectURL === 'function'
|
|
45
|
+
? _URL.createObjectURL.bind(_URL)
|
|
46
|
+
: () => {
|
|
47
|
+
throw new Error('URL.createObjectURL is not available in this environment');
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* (Safe copy) Revokes an object URL previously created with createObjectURL.
|
|
51
|
+
* Use this instead of `URL.revokeObjectURL()`.
|
|
52
|
+
*
|
|
53
|
+
* Note: This is a browser-only API. In Node.js environments, this will throw.
|
|
54
|
+
*/
|
|
55
|
+
const revokeObjectURL = typeof _URL.revokeObjectURL === 'function'
|
|
56
|
+
? _URL.revokeObjectURL.bind(_URL)
|
|
57
|
+
: () => {
|
|
58
|
+
throw new Error('URL.revokeObjectURL is not available in this environment');
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* (Safe copy) Parses a URL string and returns a URL object, or null if invalid.
|
|
62
|
+
* Use this instead of `URL.parse()`.
|
|
63
|
+
*
|
|
64
|
+
* @param url - The URL string to parse.
|
|
65
|
+
* @param base - Optional base URL for relative URLs.
|
|
66
|
+
* @returns A URL instance or null if parsing fails.
|
|
67
|
+
*/
|
|
68
|
+
const parseURL = _URL.parse;
|
|
69
|
+
// ============================================================================
|
|
70
|
+
// URLSearchParams
|
|
71
|
+
// ============================================================================
|
|
72
|
+
/**
|
|
73
|
+
* (Safe copy) Creates a new URLSearchParams using the captured URLSearchParams constructor.
|
|
74
|
+
* Use this instead of `new URLSearchParams()`.
|
|
75
|
+
*
|
|
76
|
+
* @param init - Optional initialization value (string, object, or iterable).
|
|
77
|
+
* @returns A new URLSearchParams instance.
|
|
78
|
+
*/
|
|
79
|
+
const createURLSearchParams = (init) => _Reflect.construct(_URLSearchParams, [init]);
|
|
80
|
+
// ============================================================================
|
|
81
|
+
// Namespace Export
|
|
82
|
+
// ============================================================================
|
|
83
|
+
/**
|
|
84
|
+
* (Safe copy) Namespace object containing all URL utilities.
|
|
85
|
+
* Note: Importing this imports all methods in this namespace (no tree-shaking).
|
|
86
|
+
*/
|
|
87
|
+
const URL = _freeze({
|
|
88
|
+
createURL,
|
|
89
|
+
canParse,
|
|
90
|
+
createObjectURL,
|
|
91
|
+
revokeObjectURL,
|
|
92
|
+
parseURL,
|
|
93
|
+
createURLSearchParams,
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
exports.URL = URL;
|
|
97
|
+
exports.canParse = canParse;
|
|
98
|
+
exports.createObjectURL = createObjectURL;
|
|
99
|
+
exports.createURL = createURL;
|
|
100
|
+
exports.createURLSearchParams = createURLSearchParams;
|
|
101
|
+
exports.parseURL = parseURL;
|
|
102
|
+
exports.revokeObjectURL = revokeObjectURL;
|
|
103
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../../../../../../../../../libs/utils/immutable-api/src/built-in-copy/url/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;;;;;;AAQG;AAEH;AACA,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG;AAC3B,MAAM,gBAAgB,GAAG,UAAU,CAAC,eAAe;AACnD,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO;AACnC,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,MAAM;AAExC;AACA;AACA;AAEA;;;;;;;AAOG;MACU,SAAS,GAAG,CAAC,GAAiB,EAAE,IAAmB,KAAe,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC;AAEnH;;;;;;;AAOG;AACI,MAAM,QAAQ,GAAG,IAAI,CAAC;AAE7B;;;;;AAKG;MACU,eAAe,GAC1B,OAAO,IAAI,CAAC,eAAe,KAAK;MAC5B,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI;MAC9B,MAAK;AACH,QAAA,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC;AAC7E,IAAA;AAEN;;;;;AAKG;MACU,eAAe,GAC1B,OAAO,IAAI,CAAC,eAAe,KAAK;MAC5B,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI;MAC9B,MAAK;AACH,QAAA,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC;AAC7E,IAAA;AAEN;;;;;;;AAOG;AACI,MAAM,QAAQ,GAAG,IAAI,CAAC;AAE7B;AACA;AACA;AAEA;;;;;;AAMG;AACI,MAAM,qBAAqB,GAAG,CACnC,IAAqF,KAChD,QAAQ,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC,IAAI,CAAC;AAElF;AACA;AACA;AAEA;;;AAGG;AACI,MAAM,GAAG,GAAG,OAAO,CAAQ;IAChC,SAAS;IACT,QAAQ;IACR,eAAe;IACf,eAAe;IACf,QAAQ;IACR,qBAAqB;AACtB,CAAA;;;;;;;;;;"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Safe copies of URL built-ins via factory functions.
|
|
3
|
+
*
|
|
4
|
+
* Provides safe references to URL and URLSearchParams.
|
|
5
|
+
* These references are captured at module initialization time to protect against
|
|
6
|
+
* prototype pollution attacks. Import only what you need for tree-shaking.
|
|
7
|
+
*
|
|
8
|
+
* @module @hyperfrontend/immutable-api-utils/built-in-copy/url
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* (Safe copy) Creates a new URL using the captured URL constructor.
|
|
12
|
+
* Use this instead of `new URL()`.
|
|
13
|
+
*
|
|
14
|
+
* @param url - The URL string to parse.
|
|
15
|
+
* @param base - Optional base URL for relative URLs.
|
|
16
|
+
* @returns A new URL instance.
|
|
17
|
+
*/
|
|
18
|
+
export declare const createURL: (url: string | URL, base?: string | URL) => URL;
|
|
19
|
+
/**
|
|
20
|
+
* (Safe copy) Returns whether the provided string is a valid URL.
|
|
21
|
+
* Use this instead of `URL.canParse()`.
|
|
22
|
+
*
|
|
23
|
+
* @param url - The URL string to validate.
|
|
24
|
+
* @param base - Optional base URL for relative URLs.
|
|
25
|
+
* @returns True if the URL is valid, false otherwise.
|
|
26
|
+
*/
|
|
27
|
+
export declare const canParse: (url: string | URL, base?: string | URL) => boolean;
|
|
28
|
+
/**
|
|
29
|
+
* (Safe copy) Creates an object URL for the given object.
|
|
30
|
+
* Use this instead of `URL.createObjectURL()`.
|
|
31
|
+
*
|
|
32
|
+
* Note: This is a browser-only API. In Node.js environments, this will throw.
|
|
33
|
+
*/
|
|
34
|
+
export declare const createObjectURL: (typeof globalThis.URL)['createObjectURL'];
|
|
35
|
+
/**
|
|
36
|
+
* (Safe copy) Revokes an object URL previously created with createObjectURL.
|
|
37
|
+
* Use this instead of `URL.revokeObjectURL()`.
|
|
38
|
+
*
|
|
39
|
+
* Note: This is a browser-only API. In Node.js environments, this will throw.
|
|
40
|
+
*/
|
|
41
|
+
export declare const revokeObjectURL: (typeof globalThis.URL)['revokeObjectURL'];
|
|
42
|
+
/**
|
|
43
|
+
* (Safe copy) Parses a URL string and returns a URL object, or null if invalid.
|
|
44
|
+
* Use this instead of `URL.parse()`.
|
|
45
|
+
*
|
|
46
|
+
* @param url - The URL string to parse.
|
|
47
|
+
* @param base - Optional base URL for relative URLs.
|
|
48
|
+
* @returns A URL instance or null if parsing fails.
|
|
49
|
+
*/
|
|
50
|
+
export declare const parseURL: (url: string | URL, base?: string | URL) => URL | null;
|
|
51
|
+
/**
|
|
52
|
+
* (Safe copy) Creates a new URLSearchParams using the captured URLSearchParams constructor.
|
|
53
|
+
* Use this instead of `new URLSearchParams()`.
|
|
54
|
+
*
|
|
55
|
+
* @param init - Optional initialization value (string, object, or iterable).
|
|
56
|
+
* @returns A new URLSearchParams instance.
|
|
57
|
+
*/
|
|
58
|
+
export declare const createURLSearchParams: (init?: string | URLSearchParams | Record<string, string> | Iterable<[string, string]>) => URLSearchParams;
|
|
59
|
+
/**
|
|
60
|
+
* (Safe copy) Namespace object containing all URL utilities.
|
|
61
|
+
* Note: Importing this imports all methods in this namespace (no tree-shaking).
|
|
62
|
+
*/
|
|
63
|
+
export declare const URL: Readonly<{
|
|
64
|
+
readonly createURL: (url: string | URL, base?: string | URL) => URL;
|
|
65
|
+
readonly canParse: (url: string | URL, base?: string | URL) => boolean;
|
|
66
|
+
readonly createObjectURL: (obj: Blob | MediaSource) => string;
|
|
67
|
+
readonly revokeObjectURL: (url: string) => void;
|
|
68
|
+
readonly parseURL: (url: string | URL, base?: string | URL) => URL | null;
|
|
69
|
+
readonly createURLSearchParams: (init?: string | URLSearchParams | Record<string, string> | Iterable<[string, string]>) => URLSearchParams;
|
|
70
|
+
}>;
|
|
71
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../../libs/utils/immutable-api/src/built-in-copy/url/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAYH;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,GAAG,GAAG,EAAE,OAAO,MAAM,GAAG,GAAG,KAAG,GAAiD,CAAA;AAEpH;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,qDAAgB,CAAA;AAErC;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,CAAC,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,iBAAiB,CAKhE,CAAA;AAEP;;;;;GAKG;AACH,eAAO,MAAM,eAAe,EAAE,CAAC,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,iBAAiB,CAKhE,CAAA;AAEP;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,wDAAa,CAAA;AAMlC;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,GAChC,OAAO,MAAM,GAAG,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,KACpF,eAAgF,CAAA;AAMnF;;;GAGG;AACH,eAAO,MAAM,GAAG;8BAvEe,MAAM,GAAG,GAAG,SAAS,MAAM,GAAG,GAAG,KAAG,GAAG;;;;;4CA4D7D,MAAM,GAAG,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,KACpF,eAAe;EAiBhB,CAAA"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Safe copies of URL built-ins via factory functions.
|
|
3
|
+
*
|
|
4
|
+
* Provides safe references to URL and URLSearchParams.
|
|
5
|
+
* These references are captured at module initialization time to protect against
|
|
6
|
+
* prototype pollution attacks. Import only what you need for tree-shaking.
|
|
7
|
+
*
|
|
8
|
+
* @module @hyperfrontend/immutable-api-utils/built-in-copy/url
|
|
9
|
+
*/
|
|
10
|
+
// Capture references at module initialization time
|
|
11
|
+
const _URL = globalThis.URL;
|
|
12
|
+
const _URLSearchParams = globalThis.URLSearchParams;
|
|
13
|
+
const _Reflect = globalThis.Reflect;
|
|
14
|
+
const _freeze = globalThis.Object.freeze;
|
|
15
|
+
// ============================================================================
|
|
16
|
+
// URL
|
|
17
|
+
// ============================================================================
|
|
18
|
+
/**
|
|
19
|
+
* (Safe copy) Creates a new URL using the captured URL constructor.
|
|
20
|
+
* Use this instead of `new URL()`.
|
|
21
|
+
*
|
|
22
|
+
* @param url - The URL string to parse.
|
|
23
|
+
* @param base - Optional base URL for relative URLs.
|
|
24
|
+
* @returns A new URL instance.
|
|
25
|
+
*/
|
|
26
|
+
const createURL = (url, base) => _Reflect.construct(_URL, [url, base]);
|
|
27
|
+
/**
|
|
28
|
+
* (Safe copy) Returns whether the provided string is a valid URL.
|
|
29
|
+
* Use this instead of `URL.canParse()`.
|
|
30
|
+
*
|
|
31
|
+
* @param url - The URL string to validate.
|
|
32
|
+
* @param base - Optional base URL for relative URLs.
|
|
33
|
+
* @returns True if the URL is valid, false otherwise.
|
|
34
|
+
*/
|
|
35
|
+
const canParse = _URL.canParse;
|
|
36
|
+
/**
|
|
37
|
+
* (Safe copy) Creates an object URL for the given object.
|
|
38
|
+
* Use this instead of `URL.createObjectURL()`.
|
|
39
|
+
*
|
|
40
|
+
* Note: This is a browser-only API. In Node.js environments, this will throw.
|
|
41
|
+
*/
|
|
42
|
+
const createObjectURL = typeof _URL.createObjectURL === 'function'
|
|
43
|
+
? _URL.createObjectURL.bind(_URL)
|
|
44
|
+
: () => {
|
|
45
|
+
throw new Error('URL.createObjectURL is not available in this environment');
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* (Safe copy) Revokes an object URL previously created with createObjectURL.
|
|
49
|
+
* Use this instead of `URL.revokeObjectURL()`.
|
|
50
|
+
*
|
|
51
|
+
* Note: This is a browser-only API. In Node.js environments, this will throw.
|
|
52
|
+
*/
|
|
53
|
+
const revokeObjectURL = typeof _URL.revokeObjectURL === 'function'
|
|
54
|
+
? _URL.revokeObjectURL.bind(_URL)
|
|
55
|
+
: () => {
|
|
56
|
+
throw new Error('URL.revokeObjectURL is not available in this environment');
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* (Safe copy) Parses a URL string and returns a URL object, or null if invalid.
|
|
60
|
+
* Use this instead of `URL.parse()`.
|
|
61
|
+
*
|
|
62
|
+
* @param url - The URL string to parse.
|
|
63
|
+
* @param base - Optional base URL for relative URLs.
|
|
64
|
+
* @returns A URL instance or null if parsing fails.
|
|
65
|
+
*/
|
|
66
|
+
const parseURL = _URL.parse;
|
|
67
|
+
// ============================================================================
|
|
68
|
+
// URLSearchParams
|
|
69
|
+
// ============================================================================
|
|
70
|
+
/**
|
|
71
|
+
* (Safe copy) Creates a new URLSearchParams using the captured URLSearchParams constructor.
|
|
72
|
+
* Use this instead of `new URLSearchParams()`.
|
|
73
|
+
*
|
|
74
|
+
* @param init - Optional initialization value (string, object, or iterable).
|
|
75
|
+
* @returns A new URLSearchParams instance.
|
|
76
|
+
*/
|
|
77
|
+
const createURLSearchParams = (init) => _Reflect.construct(_URLSearchParams, [init]);
|
|
78
|
+
// ============================================================================
|
|
79
|
+
// Namespace Export
|
|
80
|
+
// ============================================================================
|
|
81
|
+
/**
|
|
82
|
+
* (Safe copy) Namespace object containing all URL utilities.
|
|
83
|
+
* Note: Importing this imports all methods in this namespace (no tree-shaking).
|
|
84
|
+
*/
|
|
85
|
+
const URL = _freeze({
|
|
86
|
+
createURL,
|
|
87
|
+
canParse,
|
|
88
|
+
createObjectURL,
|
|
89
|
+
revokeObjectURL,
|
|
90
|
+
parseURL,
|
|
91
|
+
createURLSearchParams,
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
export { URL, canParse, createObjectURL, createURL, createURLSearchParams, parseURL, revokeObjectURL };
|
|
95
|
+
//# sourceMappingURL=index.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../../../../../../../../../libs/utils/immutable-api/src/built-in-copy/url/index.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;;AAQG;AAEH;AACA,MAAM,IAAI,GAAG,UAAU,CAAC,GAAG;AAC3B,MAAM,gBAAgB,GAAG,UAAU,CAAC,eAAe;AACnD,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO;AACnC,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,MAAM;AAExC;AACA;AACA;AAEA;;;;;;;AAOG;MACU,SAAS,GAAG,CAAC,GAAiB,EAAE,IAAmB,KAAe,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,IAAI,CAAC;AAEnH;;;;;;;AAOG;AACI,MAAM,QAAQ,GAAG,IAAI,CAAC;AAE7B;;;;;AAKG;MACU,eAAe,GAC1B,OAAO,IAAI,CAAC,eAAe,KAAK;MAC5B,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI;MAC9B,MAAK;AACH,QAAA,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC;AAC7E,IAAA;AAEN;;;;;AAKG;MACU,eAAe,GAC1B,OAAO,IAAI,CAAC,eAAe,KAAK;MAC5B,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI;MAC9B,MAAK;AACH,QAAA,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC;AAC7E,IAAA;AAEN;;;;;;;AAOG;AACI,MAAM,QAAQ,GAAG,IAAI,CAAC;AAE7B;AACA;AACA;AAEA;;;;;;AAMG;AACI,MAAM,qBAAqB,GAAG,CACnC,IAAqF,KAChD,QAAQ,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC,IAAI,CAAC;AAElF;AACA;AACA;AAEA;;;AAGG;AACI,MAAM,GAAG,GAAG,OAAO,CAAQ;IAChC,SAAS;IACT,QAAQ;IACR,eAAe;IACf,eAAe;IACf,QAAQ;IACR,qBAAqB;AACtB,CAAA;;;;"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Safe copies of WeakMap built-in via factory function.
|
|
5
|
+
*
|
|
6
|
+
* Since constructors cannot be safely captured via Object.assign, this module
|
|
7
|
+
* provides a factory function that uses Reflect.construct internally.
|
|
8
|
+
*
|
|
9
|
+
* These references are captured at module initialization time to protect against
|
|
10
|
+
* prototype pollution attacks. Import only what you need for tree-shaking.
|
|
11
|
+
*
|
|
12
|
+
* @module @hyperfrontend/immutable-api-utils/built-in-copy/weak-map
|
|
13
|
+
*/
|
|
14
|
+
// Capture references at module initialization time
|
|
15
|
+
const _WeakMap = globalThis.WeakMap;
|
|
16
|
+
const _Reflect = globalThis.Reflect;
|
|
17
|
+
const _freeze = globalThis.Object.freeze;
|
|
18
|
+
/**
|
|
19
|
+
* (Safe copy) Creates a new WeakMap using the captured WeakMap constructor.
|
|
20
|
+
* Use this instead of `new WeakMap()`.
|
|
21
|
+
*
|
|
22
|
+
* @param iterable - Optional iterable of key-value pairs.
|
|
23
|
+
* @returns A new WeakMap instance.
|
|
24
|
+
*/
|
|
25
|
+
const createWeakMap = (iterable) => _Reflect.construct(_WeakMap, iterable ? [iterable] : []);
|
|
26
|
+
/**
|
|
27
|
+
* (Safe copy) Namespace object containing WeakMap factory.
|
|
28
|
+
* Note: Importing this imports all methods in this namespace (no tree-shaking).
|
|
29
|
+
*/
|
|
30
|
+
const WeakMap = _freeze({
|
|
31
|
+
create: createWeakMap,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
exports.WeakMap = WeakMap;
|
|
35
|
+
exports.createWeakMap = createWeakMap;
|
|
36
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../../../../../../../../../libs/utils/immutable-api/src/built-in-copy/weak-map/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;;;;;;;;AAUG;AAEH;AACA,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO;AACnC,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO;AACnC,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,MAAM;AAExC;;;;;;AAMG;AACI,MAAM,aAAa,GAAG,CAAuB,QAA2C,KAC9E,QAAQ,CAAC,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE;AAExE;;;AAGG;AACI,MAAM,OAAO,GAAG,OAAO,CAAQ;AACpC,IAAA,MAAM,EAAE,aAAa;AACtB,CAAA;;;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Safe copies of WeakMap built-in via factory function.
|
|
3
|
+
*
|
|
4
|
+
* Since constructors cannot be safely captured via Object.assign, this module
|
|
5
|
+
* provides a factory function that uses Reflect.construct internally.
|
|
6
|
+
*
|
|
7
|
+
* These references are captured at module initialization time to protect against
|
|
8
|
+
* prototype pollution attacks. Import only what you need for tree-shaking.
|
|
9
|
+
*
|
|
10
|
+
* @module @hyperfrontend/immutable-api-utils/built-in-copy/weak-map
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* (Safe copy) Creates a new WeakMap using the captured WeakMap constructor.
|
|
14
|
+
* Use this instead of `new WeakMap()`.
|
|
15
|
+
*
|
|
16
|
+
* @param iterable - Optional iterable of key-value pairs.
|
|
17
|
+
* @returns A new WeakMap instance.
|
|
18
|
+
*/
|
|
19
|
+
export declare const createWeakMap: <K extends WeakKey, V>(iterable?: Iterable<readonly [K, V]> | null) => WeakMap<K, V>;
|
|
20
|
+
/**
|
|
21
|
+
* (Safe copy) Namespace object containing WeakMap factory.
|
|
22
|
+
* Note: Importing this imports all methods in this namespace (no tree-shaking).
|
|
23
|
+
*/
|
|
24
|
+
export declare const WeakMap: Readonly<{
|
|
25
|
+
readonly create: <K extends WeakKey, V>(iterable?: Iterable<readonly [K, V]> | null) => WeakMap<K, V>;
|
|
26
|
+
}>;
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../../libs/utils/immutable-api/src/built-in-copy/weak-map/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,OAAO,EAAE,CAAC,EAAE,WAAW,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,KAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CACrC,CAAA;AAEzE;;;GAGG;AACH,eAAO,MAAM,OAAO;sBAPU,CAAC,SAAS,OAAO,EAAE,CAAC,aAAa,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,IAAI,KAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;EAS7G,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Safe copies of WeakMap built-in via factory function.
|
|
3
|
+
*
|
|
4
|
+
* Since constructors cannot be safely captured via Object.assign, this module
|
|
5
|
+
* provides a factory function that uses Reflect.construct internally.
|
|
6
|
+
*
|
|
7
|
+
* These references are captured at module initialization time to protect against
|
|
8
|
+
* prototype pollution attacks. Import only what you need for tree-shaking.
|
|
9
|
+
*
|
|
10
|
+
* @module @hyperfrontend/immutable-api-utils/built-in-copy/weak-map
|
|
11
|
+
*/
|
|
12
|
+
// Capture references at module initialization time
|
|
13
|
+
const _WeakMap = globalThis.WeakMap;
|
|
14
|
+
const _Reflect = globalThis.Reflect;
|
|
15
|
+
const _freeze = globalThis.Object.freeze;
|
|
16
|
+
/**
|
|
17
|
+
* (Safe copy) Creates a new WeakMap using the captured WeakMap constructor.
|
|
18
|
+
* Use this instead of `new WeakMap()`.
|
|
19
|
+
*
|
|
20
|
+
* @param iterable - Optional iterable of key-value pairs.
|
|
21
|
+
* @returns A new WeakMap instance.
|
|
22
|
+
*/
|
|
23
|
+
const createWeakMap = (iterable) => _Reflect.construct(_WeakMap, iterable ? [iterable] : []);
|
|
24
|
+
/**
|
|
25
|
+
* (Safe copy) Namespace object containing WeakMap factory.
|
|
26
|
+
* Note: Importing this imports all methods in this namespace (no tree-shaking).
|
|
27
|
+
*/
|
|
28
|
+
const WeakMap = _freeze({
|
|
29
|
+
create: createWeakMap,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export { WeakMap, createWeakMap };
|
|
33
|
+
//# sourceMappingURL=index.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../../../../../../../../../libs/utils/immutable-api/src/built-in-copy/weak-map/index.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;;;;AAUG;AAEH;AACA,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO;AACnC,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO;AACnC,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,MAAM;AAExC;;;;;;AAMG;AACI,MAAM,aAAa,GAAG,CAAuB,QAA2C,KAC9E,QAAQ,CAAC,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE;AAExE;;;AAGG;AACI,MAAM,OAAO,GAAG,OAAO,CAAQ;AACpC,IAAA,MAAM,EAAE,aAAa;AACtB,CAAA;;;;"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Safe copies of WeakSet built-in via factory function.
|
|
5
|
+
*
|
|
6
|
+
* Since constructors cannot be safely captured via Object.assign, this module
|
|
7
|
+
* provides a factory function that uses Reflect.construct internally.
|
|
8
|
+
*
|
|
9
|
+
* These references are captured at module initialization time to protect against
|
|
10
|
+
* prototype pollution attacks. Import only what you need for tree-shaking.
|
|
11
|
+
*
|
|
12
|
+
* @module @hyperfrontend/immutable-api-utils/built-in-copy/weak-set
|
|
13
|
+
*/
|
|
14
|
+
// Capture references at module initialization time
|
|
15
|
+
const _WeakSet = globalThis.WeakSet;
|
|
16
|
+
const _Reflect = globalThis.Reflect;
|
|
17
|
+
const _freeze = globalThis.Object.freeze;
|
|
18
|
+
/**
|
|
19
|
+
* (Safe copy) Creates a new WeakSet using the captured WeakSet constructor.
|
|
20
|
+
* Use this instead of `new WeakSet()`.
|
|
21
|
+
*
|
|
22
|
+
* @param iterable - Optional iterable of values.
|
|
23
|
+
* @returns A new WeakSet instance.
|
|
24
|
+
*/
|
|
25
|
+
const createWeakSet = (iterable) => _Reflect.construct(_WeakSet, iterable ? [iterable] : []);
|
|
26
|
+
/**
|
|
27
|
+
* (Safe copy) Namespace object containing WeakSet factory.
|
|
28
|
+
* Note: Importing this imports all methods in this namespace (no tree-shaking).
|
|
29
|
+
*/
|
|
30
|
+
const WeakSet = _freeze({
|
|
31
|
+
create: createWeakSet,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
exports.WeakSet = WeakSet;
|
|
35
|
+
exports.createWeakSet = createWeakSet;
|
|
36
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../../../../../../../../../libs/utils/immutable-api/src/built-in-copy/weak-set/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;;;;;;;;AAUG;AAEH;AACA,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO;AACnC,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO;AACnC,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,MAAM;AAExC;;;;;;AAMG;AACI,MAAM,aAAa,GAAG,CAAoB,QAA6B,KAChE,QAAQ,CAAC,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE;AAErE;;;AAGG;AACI,MAAM,OAAO,GAAG,OAAO,CAAQ;AACpC,IAAA,MAAM,EAAE,aAAa;AACtB,CAAA;;;;;"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Safe copies of WeakSet built-in via factory function.
|
|
3
|
+
*
|
|
4
|
+
* Since constructors cannot be safely captured via Object.assign, this module
|
|
5
|
+
* provides a factory function that uses Reflect.construct internally.
|
|
6
|
+
*
|
|
7
|
+
* These references are captured at module initialization time to protect against
|
|
8
|
+
* prototype pollution attacks. Import only what you need for tree-shaking.
|
|
9
|
+
*
|
|
10
|
+
* @module @hyperfrontend/immutable-api-utils/built-in-copy/weak-set
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* (Safe copy) Creates a new WeakSet using the captured WeakSet constructor.
|
|
14
|
+
* Use this instead of `new WeakSet()`.
|
|
15
|
+
*
|
|
16
|
+
* @param iterable - Optional iterable of values.
|
|
17
|
+
* @returns A new WeakSet instance.
|
|
18
|
+
*/
|
|
19
|
+
export declare const createWeakSet: <T extends WeakKey>(iterable?: Iterable<T> | null) => WeakSet<T>;
|
|
20
|
+
/**
|
|
21
|
+
* (Safe copy) Namespace object containing WeakSet factory.
|
|
22
|
+
* Note: Importing this imports all methods in this namespace (no tree-shaking).
|
|
23
|
+
*/
|
|
24
|
+
export declare const WeakSet: Readonly<{
|
|
25
|
+
readonly create: <T extends WeakKey>(iterable?: Iterable<T> | null) => WeakSet<T>;
|
|
26
|
+
}>;
|
|
27
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../../libs/utils/immutable-api/src/built-in-copy/weak-set/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GAAI,CAAC,SAAS,OAAO,EAAE,WAAW,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,KAAG,OAAO,CAAC,CAAC,CACpB,CAAA;AAEtE;;;GAGG;AACH,eAAO,MAAM,OAAO;sBAPU,CAAC,SAAS,OAAO,aAAa,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,KAAG,OAAO,CAAC,CAAC,CAAC;EASzF,CAAA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Safe copies of WeakSet built-in via factory function.
|
|
3
|
+
*
|
|
4
|
+
* Since constructors cannot be safely captured via Object.assign, this module
|
|
5
|
+
* provides a factory function that uses Reflect.construct internally.
|
|
6
|
+
*
|
|
7
|
+
* These references are captured at module initialization time to protect against
|
|
8
|
+
* prototype pollution attacks. Import only what you need for tree-shaking.
|
|
9
|
+
*
|
|
10
|
+
* @module @hyperfrontend/immutable-api-utils/built-in-copy/weak-set
|
|
11
|
+
*/
|
|
12
|
+
// Capture references at module initialization time
|
|
13
|
+
const _WeakSet = globalThis.WeakSet;
|
|
14
|
+
const _Reflect = globalThis.Reflect;
|
|
15
|
+
const _freeze = globalThis.Object.freeze;
|
|
16
|
+
/**
|
|
17
|
+
* (Safe copy) Creates a new WeakSet using the captured WeakSet constructor.
|
|
18
|
+
* Use this instead of `new WeakSet()`.
|
|
19
|
+
*
|
|
20
|
+
* @param iterable - Optional iterable of values.
|
|
21
|
+
* @returns A new WeakSet instance.
|
|
22
|
+
*/
|
|
23
|
+
const createWeakSet = (iterable) => _Reflect.construct(_WeakSet, iterable ? [iterable] : []);
|
|
24
|
+
/**
|
|
25
|
+
* (Safe copy) Namespace object containing WeakSet factory.
|
|
26
|
+
* Note: Importing this imports all methods in this namespace (no tree-shaking).
|
|
27
|
+
*/
|
|
28
|
+
const WeakSet = _freeze({
|
|
29
|
+
create: createWeakSet,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
export { WeakSet, createWeakSet };
|
|
33
|
+
//# sourceMappingURL=index.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../../../../../../../../../libs/utils/immutable-api/src/built-in-copy/weak-set/index.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;;;;AAUG;AAEH;AACA,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO;AACnC,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO;AACnC,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,MAAM;AAExC;;;;;;AAMG;AACI,MAAM,aAAa,GAAG,CAAoB,QAA6B,KAChE,QAAQ,CAAC,SAAS,CAAC,QAAQ,EAAE,QAAQ,GAAG,CAAC,QAAQ,CAAC,GAAG,EAAE;AAErE;;;AAGG;AACI,MAAM,OAAO,GAAG,OAAO,CAAQ;AACpC,IAAA,MAAM,EAAE,aAAa;AACtB,CAAA;;;;"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Safe copies of WebSocket built-ins via factory functions.
|
|
5
|
+
*
|
|
6
|
+
* Provides safe references to WebSocket.
|
|
7
|
+
* These references are captured at module initialization time to protect against
|
|
8
|
+
* prototype pollution attacks. Import only what you need for tree-shaking.
|
|
9
|
+
*
|
|
10
|
+
* @module @hyperfrontend/immutable-api-utils/built-in-copy/websocket
|
|
11
|
+
*/
|
|
12
|
+
// Capture references at module initialization time
|
|
13
|
+
const _WebSocket = globalThis.WebSocket;
|
|
14
|
+
const _Reflect = globalThis.Reflect;
|
|
15
|
+
const _freeze = globalThis.Object.freeze;
|
|
16
|
+
/**
|
|
17
|
+
* (Safe copy) Creates a new WebSocket using the captured WebSocket constructor.
|
|
18
|
+
* Use this instead of `new WebSocket()`.
|
|
19
|
+
*
|
|
20
|
+
* @param url - The URL to connect to.
|
|
21
|
+
* @param protocols - Optional sub-protocol string or array of strings.
|
|
22
|
+
* @returns A new WebSocket instance.
|
|
23
|
+
*/
|
|
24
|
+
const createWebSocket = (url, protocols) => _Reflect.construct(_WebSocket, [url, protocols]);
|
|
25
|
+
/**
|
|
26
|
+
* WebSocket ready state constants (safe copies).
|
|
27
|
+
*/
|
|
28
|
+
const CONNECTING = _WebSocket.CONNECTING;
|
|
29
|
+
const OPEN = _WebSocket.OPEN;
|
|
30
|
+
const CLOSING = _WebSocket.CLOSING;
|
|
31
|
+
const CLOSED = _WebSocket.CLOSED;
|
|
32
|
+
/**
|
|
33
|
+
* (Safe copy) Namespace object containing all WebSocket utilities.
|
|
34
|
+
* Note: Importing this imports all methods in this namespace (no tree-shaking).
|
|
35
|
+
*/
|
|
36
|
+
const WebSocket = _freeze({
|
|
37
|
+
createWebSocket,
|
|
38
|
+
CONNECTING,
|
|
39
|
+
OPEN,
|
|
40
|
+
CLOSING,
|
|
41
|
+
CLOSED,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
exports.CLOSED = CLOSED;
|
|
45
|
+
exports.CLOSING = CLOSING;
|
|
46
|
+
exports.CONNECTING = CONNECTING;
|
|
47
|
+
exports.OPEN = OPEN;
|
|
48
|
+
exports.WebSocket = WebSocket;
|
|
49
|
+
exports.createWebSocket = createWebSocket;
|
|
50
|
+
//# sourceMappingURL=index.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../../../../../../../../../../../libs/utils/immutable-api/src/built-in-copy/websocket/index.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;;;;;;;;AAQG;AAEH;AACA,MAAM,UAAU,GAAG,UAAU,CAAC,SAAS;AACvC,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO;AACnC,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,MAAM;AAExC;;;;;;;AAOG;MACU,eAAe,GAAG,CAAC,GAAiB,EAAE,SAA6B,KACnE,QAAQ,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC,GAAG,EAAE,SAAS,CAAC;AAE5D;;AAEG;AACI,MAAM,UAAU,GAAG,UAAU,CAAC;AAC9B,MAAM,IAAI,GAAG,UAAU,CAAC;AACxB,MAAM,OAAO,GAAG,UAAU,CAAC;AAC3B,MAAM,MAAM,GAAG,UAAU,CAAC;AAEjC;;;AAGG;AACI,MAAM,SAAS,GAAG,OAAO,CAAQ;IACtC,eAAe;IACf,UAAU;IACV,IAAI;IACJ,OAAO;IACP,MAAM;AACP,CAAA;;;;;;;;;"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Safe copies of WebSocket built-ins via factory functions.
|
|
3
|
+
*
|
|
4
|
+
* Provides safe references to WebSocket.
|
|
5
|
+
* These references are captured at module initialization time to protect against
|
|
6
|
+
* prototype pollution attacks. Import only what you need for tree-shaking.
|
|
7
|
+
*
|
|
8
|
+
* @module @hyperfrontend/immutable-api-utils/built-in-copy/websocket
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* (Safe copy) Creates a new WebSocket using the captured WebSocket constructor.
|
|
12
|
+
* Use this instead of `new WebSocket()`.
|
|
13
|
+
*
|
|
14
|
+
* @param url - The URL to connect to.
|
|
15
|
+
* @param protocols - Optional sub-protocol string or array of strings.
|
|
16
|
+
* @returns A new WebSocket instance.
|
|
17
|
+
*/
|
|
18
|
+
export declare const createWebSocket: (url: string | URL, protocols?: string | string[]) => WebSocket;
|
|
19
|
+
/**
|
|
20
|
+
* WebSocket ready state constants (safe copies).
|
|
21
|
+
*/
|
|
22
|
+
export declare const CONNECTING: 0;
|
|
23
|
+
export declare const OPEN: 1;
|
|
24
|
+
export declare const CLOSING: 2;
|
|
25
|
+
export declare const CLOSED: 3;
|
|
26
|
+
/**
|
|
27
|
+
* (Safe copy) Namespace object containing all WebSocket utilities.
|
|
28
|
+
* Note: Importing this imports all methods in this namespace (no tree-shaking).
|
|
29
|
+
*/
|
|
30
|
+
export declare const WebSocket: Readonly<{
|
|
31
|
+
readonly createWebSocket: (url: string | URL, protocols?: string | string[]) => WebSocket;
|
|
32
|
+
readonly CONNECTING: 0;
|
|
33
|
+
readonly OPEN: 1;
|
|
34
|
+
readonly CLOSING: 2;
|
|
35
|
+
readonly CLOSED: 3;
|
|
36
|
+
}>;
|
|
37
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../../libs/utils/immutable-api/src/built-in-copy/websocket/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,KAAK,MAAM,GAAG,GAAG,EAAE,YAAY,MAAM,GAAG,MAAM,EAAE,KAAG,SACtB,CAAA;AAE7D;;GAEG;AACH,eAAO,MAAM,UAAU,GAAwB,CAAA;AAC/C,eAAO,MAAM,IAAI,GAAkB,CAAA;AACnC,eAAO,MAAM,OAAO,GAAqB,CAAA;AACzC,eAAO,MAAM,MAAM,GAAoB,CAAA;AAEvC;;;GAGG;AACH,eAAO,MAAM,SAAS;oCAfe,MAAM,GAAG,GAAG,cAAc,MAAM,GAAG,MAAM,EAAE,KAAG,SAAS;;;;;EAqB1F,CAAA"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Safe copies of WebSocket built-ins via factory functions.
|
|
3
|
+
*
|
|
4
|
+
* Provides safe references to WebSocket.
|
|
5
|
+
* These references are captured at module initialization time to protect against
|
|
6
|
+
* prototype pollution attacks. Import only what you need for tree-shaking.
|
|
7
|
+
*
|
|
8
|
+
* @module @hyperfrontend/immutable-api-utils/built-in-copy/websocket
|
|
9
|
+
*/
|
|
10
|
+
// Capture references at module initialization time
|
|
11
|
+
const _WebSocket = globalThis.WebSocket;
|
|
12
|
+
const _Reflect = globalThis.Reflect;
|
|
13
|
+
const _freeze = globalThis.Object.freeze;
|
|
14
|
+
/**
|
|
15
|
+
* (Safe copy) Creates a new WebSocket using the captured WebSocket constructor.
|
|
16
|
+
* Use this instead of `new WebSocket()`.
|
|
17
|
+
*
|
|
18
|
+
* @param url - The URL to connect to.
|
|
19
|
+
* @param protocols - Optional sub-protocol string or array of strings.
|
|
20
|
+
* @returns A new WebSocket instance.
|
|
21
|
+
*/
|
|
22
|
+
const createWebSocket = (url, protocols) => _Reflect.construct(_WebSocket, [url, protocols]);
|
|
23
|
+
/**
|
|
24
|
+
* WebSocket ready state constants (safe copies).
|
|
25
|
+
*/
|
|
26
|
+
const CONNECTING = _WebSocket.CONNECTING;
|
|
27
|
+
const OPEN = _WebSocket.OPEN;
|
|
28
|
+
const CLOSING = _WebSocket.CLOSING;
|
|
29
|
+
const CLOSED = _WebSocket.CLOSED;
|
|
30
|
+
/**
|
|
31
|
+
* (Safe copy) Namespace object containing all WebSocket utilities.
|
|
32
|
+
* Note: Importing this imports all methods in this namespace (no tree-shaking).
|
|
33
|
+
*/
|
|
34
|
+
const WebSocket = _freeze({
|
|
35
|
+
createWebSocket,
|
|
36
|
+
CONNECTING,
|
|
37
|
+
OPEN,
|
|
38
|
+
CLOSING,
|
|
39
|
+
CLOSED,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export { CLOSED, CLOSING, CONNECTING, OPEN, WebSocket, createWebSocket };
|
|
43
|
+
//# sourceMappingURL=index.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../../../../../../../../../../../libs/utils/immutable-api/src/built-in-copy/websocket/index.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;;AAQG;AAEH;AACA,MAAM,UAAU,GAAG,UAAU,CAAC,SAAS;AACvC,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO;AACnC,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,MAAM;AAExC;;;;;;;AAOG;MACU,eAAe,GAAG,CAAC,GAAiB,EAAE,SAA6B,KACnE,QAAQ,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC,GAAG,EAAE,SAAS,CAAC;AAE5D;;AAEG;AACI,MAAM,UAAU,GAAG,UAAU,CAAC;AAC9B,MAAM,IAAI,GAAG,UAAU,CAAC;AACxB,MAAM,OAAO,GAAG,UAAU,CAAC;AAC3B,MAAM,MAAM,GAAG,UAAU,CAAC;AAEjC;;;AAGG;AACI,MAAM,SAAS,GAAG,OAAO,CAAQ;IACtC,eAAe;IACf,UAAU;IACV,IAAI;IACJ,OAAO;IACP,MAAM;AACP,CAAA;;;;"}
|