Skip to content

gajus/object-unfreeze

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

object-unfreeze

Travis build status NPM version

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

About

Unfreeze an object frozen with Object.freeze.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published