object-unfreeze
v1.1.0
Published
Unfreeze an object frozen with Object.freeze.
Downloads
79,923
Readme
object-unfreeze
Unfreeze an object frozen with Object.freeze.
Usage
import objectUnfreeze from 'object-unfreeze';
let subject,
shallowCopy;
subject = {};
Object.freeze(subject);
// Throws an error.
// subject.foo = 'FOO';
shallowCopy = objectUnfreeze(subject);
shallowCopy.foo = 'FOO';
import objectUnfreeze from 'object-unfreeze';
let subject,
shallowCopy;
subject = [];
Object.freeze(subject);
// Throws an error.
// subject.push('FOO');
shallowCopy = objectUnfreeze(subject);
shallowCopy.push('FOO');
Download
Download using NPM:
npm install object-unfreeze