Package detail

deep-freeze-node

AnatoliyGatt2.4kMIT1.1.3

Recursively Object.freeze() objects.

deep, recursive, object, array

readme

deep-freeze-node Logo

Recursively Object.freeze() objects.

NPM Package Version NPM Package License NPM Package Downloads devDependencies Status

Node Version Travis CI Build Status Code Climate Status Code Climate Test Coverage Status Inch CI Documentation Coverage Status Styled with Prettier

NPM Package Statistics

Installation

npm install deep-freeze-node

Usage Example

var freeze = require('deep-freeze-node');

var person = {
    name: 'John',
    surname: 'Johnson',
    age: 26,
    address: {
        street: '1st Street',
        city: 'Los Angeles',
        country: 'USA'
    },
    vehicles: [
        'BMW',
        'Ferrari',
        'Lamborghini'
    ]
};

person = freeze(person);

person.name = 'Jack';
person.surname = 'Jackson';
person.nickname = 'JJ';
person.age = 18;
person.address.street = 'Third Street';
person.address.city = 'San Francisco';
person.address.country = 'USA';
person.vehicles[0] = 'Toyota';
delete person.vehicles[1]
delete person.vehicles[2]
person.occupation = 'Lawyer';

console.log(person.name);
console.log(person.surname);
console.log(person.nickname);
console.log(person.age);
console.log(person.address);
console.log(person.vehicles);
console.log(person.occupation);

John
Johnson
undefined
26
{
    street: '1st Street',
    city: 'Los Angeles',
    country: 'USA'
}
[
    'BMW',
    'Ferrari',
    'Lamborghini'
]
undefined

Tests

To run the test suite, first install the dependencies, then run npm test:

$ npm install
$ npm test

License

Distributed under the MIT License.

changelog

1.1.3 / 2017-08-05

  • Support only node v6+ and npm v3+
  • Update .travis.yml
  • Remove artifacts
  • Add package-lock.json
  • Update dev dependencies
  • Update README.md
  • Integrate prettier
  • Tests are now changing deep properties instead of only top-level properties
  • Update .gitignore

1.1.2 / 2016-03-02

  • Update copyright in deep-freeze.js
  • Update copyright in index.js
  • Update copyright in LICENSE
  • Update dev dependencies
  • Fix invalid publishConfig value in package.json
  • Update package.json
  • Add keywords to package.json
  • Update .travis.yml to run tests against node v5.0.0
  • Remove node v4.2.0 from testing environments in .travis.yml
  • Remove node v4.1.0 from testing environments in .travis.yml

1.1.1 / 2015-10-25

  • Fix anonymous functions declaration coding style in deep-freeze.js tests
  • Fix anonymous function declaration coding style in deep-freeze.js
  • Fix 'if statement' coding style in deep-freeze.js
  • Update dev dependencies
  • Update .travis.yml to run tests against node v4.2.0
  • Remove manual deletion script of coverage directory in .travis.yml
  • Replace unencrypted CodeClimate repo_token with encrypted one in .travis.yml
  • Update .travis.yml to run tests against node v4.1.0

1.1.0 / 2015-10-02

  • Add author.url to package.json
  • Replace " with ' in definitions of all strings in README.md code samples
  • Replace " with ' in definitions of all strings in index.js
  • Replace " with ' in definitions of all strings in deep-freeze.js tests
  • Replace " with ' in definitions of all strings in deep-freeze.js
  • Update .travis.yml to run tests against node v4.0.0
  • Update .travis.yml to run tests against all major versions of iojs from 1.0.0 to 3.0.0
  • Add iojs (>= 1.0.0) to engines in package.json
  • [CodeClimate] Fix 'The body of a for in should be wrapped in an if statement to filter unwanted properties from the prototype' in deep-freeze.js
  • [CodeClimate] Fix 'Confusing use of negation operator' in deep-freeze.js
  • Add npm (>= 1.2.14) to engines in package.json
  • Fix node-download-page-url in README.md
  • Change node version from (>= 0.10.x) to (>= 0.10.0) in package.json

1.0.9 / 2015-08-23

  • Add logo to README.md
  • Add test coverage badge to README.md
  • Add support for Code Climate test coverage in .travis.yml
  • Add additional test scripts to package.json
  • Add codeclimate-test-reporter as dev dependency
  • Add istanbul as dev dependency
  • Set sudo to false in .travis.yml
  • Update .travis.yml to run tests against all major versions of node from 0.10 to 0.12
  • Change node version from (*) to (>= 0.10.x) in package.json
  • Add Inch CI documentation coverage badge to README.md
  • Add node version badge to README.md
  • Add code climate badge to README.md
  • Add devDependencies badge to README.md
  • Change badges style from flat to flat-square in README.md

1.0.8 / 2015-07-31

  • Turn on strict mode for deep-freeze.js

1.0.7 / 2015-07-29

  • Update README.md

1.0.6 / 2015-07-29

  • Update README.md
  • Update deep-freeze.js tests

1.0.5 / 2015-07-28

  • Update package on NPM

1.0.4 / 2015-07-28

  • Fix critical mistake in README.md

1.0.3 / 2015-07-28

  • Update index.js documentation comments
  • Update deep-freeze.js documentation comments

1.0.2 / 2015-07-28

  • Update index.js documentation comments
  • Update README.md
  • Update deep-freeze.js documentation comments

1.0.1 / 2015-07-27

  • Update README.md

1.0.0 / 2015-07-27

  • Initial release