Package Exports
- ice-barrage
- ice-barrage/src/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ice-barrage) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
ice-barrage
Node.js module to recursively freeze objects, arrays, and functions
Overview
ice-barrage is a drop-in replacement for deep-freeze, with added TypeScript support, improved performance, and handling of edge cases such as circular references.
Installation
Install using npm:
npm i ice-barrageExample usage
Please refer to the JSDoc comments in the source code or the generated type definitions for information on the available options.
const iceBarrage = require("ice-barrage");
const exampleObject = {
a: 1,
b: {
c: 2,
d: [3, 4, 5],
},
};
iceBarrage(exampleObject); // iceBarrage mutates the input object
console.log(Object.isFrozen(exampleObject)); // true
console.log(Object.isFrozen(exampleObject.b)); // true
console.log(Object.isFrozen(exampleObject.b.d)); // trueContributing
Contributions are welcome, and any help is greatly appreciated!
See the contributing guide for details on how to get started. Please adhere to this project's Code of Conduct when contributing.
License
ice-barrage is licensed under the MIT license.