Comparing version 0.2.97 to 0.2.98
@@ -26,3 +26,4 @@ #!/usr/bin/env node | ||
json: 'application/json', | ||
xml: 'application/xml' | ||
xml: 'application/xml', | ||
wasm: 'application/wasm' | ||
} | ||
@@ -29,0 +30,0 @@ |
@@ -45,2 +45,14 @@ export function create(): { | ||
}): boolean; | ||
/** | ||
* Make an object immutable. This hurts performance and is usually not needed if you perform good | ||
* coding practices. | ||
*/ | ||
export const freeze: { | ||
<T extends Function>(f: T): T; | ||
<T_1 extends { | ||
[idx: string]: object | U | null | undefined; | ||
}, U extends string | number | bigint | boolean | symbol>(o: T_1): Readonly<T_1>; | ||
<T_2>(o: T_2): Readonly<T_2>; | ||
}; | ||
export function deepFreeze<T extends unknown>(o: T): Readonly<T>; | ||
//# sourceMappingURL=object.d.ts.map |
export function testObject(_tc: t.TestCase): void; | ||
export function testFreeze(_tc: t.TestCase): void; | ||
import * as t from './testing.js'; | ||
//# sourceMappingURL=object.test.d.ts.map |
/** | ||
* Isomorphic module to work access the environment (query params, env variables). | ||
* | ||
* @module map | ||
* @module environment | ||
*/ | ||
@@ -6,0 +6,0 @@ |
@@ -45,2 +45,14 @@ export function create(): { | ||
}): boolean; | ||
/** | ||
* Make an object immutable. This hurts performance and is usually not needed if you perform good | ||
* coding practices. | ||
*/ | ||
export const freeze: { | ||
<T extends Function>(f: T): T; | ||
<T_1 extends { | ||
[idx: string]: object | U | null | undefined; | ||
}, U extends string | number | bigint | boolean | symbol>(o: T_1): Readonly<T_1>; | ||
<T_2>(o: T_2): Readonly<T_2>; | ||
}; | ||
export function deepFreeze<T extends unknown>(o: T): Readonly<T>; | ||
//# sourceMappingURL=object.d.ts.map |
@@ -116,1 +116,25 @@ /** | ||
export const equalFlat = (a, b) => a === b || (size(a) === size(b) && every(a, (val, key) => (val !== undefined || hasProperty(b, key)) && b[key] === val)) | ||
/** | ||
* Make an object immutable. This hurts performance and is usually not needed if you perform good | ||
* coding practices. | ||
*/ | ||
export const freeze = Object.freeze | ||
/** | ||
* Make an object and all its children immutable. | ||
* This *really* hurts performance and is usually not needed if you perform good coding practices. | ||
* | ||
* @template {any} T | ||
* @param {T} o | ||
* @return {Readonly<T>} | ||
*/ | ||
export const deepFreeze = (o) => { | ||
for (const key in o) { | ||
const c = o[key] | ||
if (typeof c === 'object' || typeof c === 'function') { | ||
deepFreeze(o[key]) | ||
} | ||
} | ||
return freeze(o) | ||
} |
export function testObject(_tc: t.TestCase): void; | ||
export function testFreeze(_tc: t.TestCase): void; | ||
import * as t from './testing.js'; | ||
//# sourceMappingURL=object.test.d.ts.map |
{ | ||
"name": "lib0", | ||
"version": "0.2.97", | ||
"version": "0.2.98", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "sideEffects": false, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1906741
24979
1417