5.0.7 ā€¢ Published 8 years ago

is-deep-frozen v5.0.7

Weekly downloads
1
License
BSD 3-Clause Lice...
Repository
github
Last release
8 years ago

is-deep-frozen? npm version Build Status

dkconfused.png

The question that has plagued monkey-kind and human-kind for millions of years. šŸ™‰šŸ™ŠšŸ™ˆ

##About:

Find out if your javascript object, function, or class is deeply frozen.

#####What this module checks:

  1. This module checks that any object, function, or class you input, or any object, function, or class that is inside your input value will be frozen.

  2. If your Node version is greater or equal to 6, this module checks that any buffers you input, or any buffers inside your input value are sealed (buffers cannot be frozen).

Note: Primitive javascript types (e.g. string or number) are considered to be frozen in this module.

#####If you want to deeply freeze your objects, you can use the following:

  1. subzero
  2. deep-freeze
  3. immutablejs

##install:

npm install is-deep-frozen

##usage:

'use strict';

const isDeepFrozen = require( 'is-deep-frozen' );


const o = Object.freeze({ xxx: 69 });

const passingResult = isDeepFrozen( o );

// passingResult will be {}, indicating o is deeply frozen


const f = function() {};

f.a = Object.freeze({ b: {} });

const failingResult = isDeepFrozen( f );

// failingResult.notDeeplyFrozen will be set to true

console.log( failingResult.error );

/*
    the resulting log is:

    { NotDeeplyFrozenError: property: inputValue, value: function () {}
        property: inputValue[ "prototype" ], value: {}
        property: inputValue[ "a" ][ "b" ], value: {}
            at isDeepFrozen (/Users/test_dir/index.js:20:23)
            ...
    }
*/
5.0.7

8 years ago

5.0.6

8 years ago

5.0.5

8 years ago

5.0.4

8 years ago

5.0.3

8 years ago

5.0.2

8 years ago

5.0.1

8 years ago

4.0.4

8 years ago

4.0.3

8 years ago

4.0.2

8 years ago

4.0.1

8 years ago

3.2.5

8 years ago

3.2.4

8 years ago

3.2.3

8 years ago

3.2.2

8 years ago

3.2.1

8 years ago

3.1.5

8 years ago

3.1.4

8 years ago

3.1.3

8 years ago

3.1.2

8 years ago

3.1.1

8 years ago

3.0.15

8 years ago

3.0.14

8 years ago

3.0.13

8 years ago

3.0.12

8 years ago

3.0.11

8 years ago

3.0.10

8 years ago

3.0.9

8 years ago

3.0.8

8 years ago

3.0.7

8 years ago

3.0.6

8 years ago

3.0.5

8 years ago

3.0.4

8 years ago

3.0.3

8 years ago

3.0.2

8 years ago

3.0.1

8 years ago

2.0.5

8 years ago

2.0.4

8 years ago

2.0.3

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago