object-unfreeze
Unfreeze an object frozen with Object.freeze.
Last updated 9 years ago by gajus .
BSD-3-Clause · Repository · Bugs · Original npm
$ cnpm install object-unfreeze 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.1.0                                ...           latest (9 years ago)

1 Versions

  • 1.1.0                                ...           9 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (2)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org