2.8.14 • Published 2 years ago

assign.js v2.8.14

Weekly downloads
590
License
MIT
Repository
github
Last release
2 years ago

Assign.js - dependency-free very minimal assign function

NPM

js-standard-style

========

Assign.js is an extremely tiny helper function to assign objects

Usage Rules

Usage

Command line:

npm install assign.js --save

In JS code:

var assigner = require('assign.js');
...
assigner.assign( obj1, obj2[, obj3[, objN]] );

Respect will force assignment if property already exist

Options:

assigner.validvalues( true )

Assign.js will set only non 'null'-like values from source object. False by default.

assigner.respect( true )

Assign.js will respect the already existing non-empty values of keys. False by default.

assigner.recursive( true )

Tells assigner to walk recursively when assigning objects. Yes by default.

assigner.attributes( [] )

Defines the list of keys allowed to be assigned.

assigner.attributes( [] )

Defines the list of keys excluded to be assigned.

assigner.primitives( [] )

Defines the list of keys considered as values to be assigned preventing to recursively processed.

assigner.blueprinting( true )

If it is set to 'true', Assign.js will consider the keyset of the destination object as reference otherwise key-set will be read from the object assigned from.

assigner.forceful( true )

This option will follow the path of the source object eventually overwriting the one found in the dest object.

Other services:

assigner.pick(object, properties)

This will project the object into a new object possessing the properties defined by the 2nd parameter which might be given as array or varargs as well.

assigner.cloneObject( source )

This created a cloned object from the source copied recursively.

assigner.mask( source, mask )

This created an object with the references only allowed by the mask object.

assigner.purify( source, mask )

This created an object with the references only not denifed by the mask object.

2.8.14

2 years ago

2.8.12

3 years ago

2.8.13

3 years ago

2.8.11

4 years ago

2.8.10

4 years ago

2.8.9

4 years ago

2.8.8

5 years ago

2.8.7

6 years ago

2.8.6

6 years ago

2.8.5

6 years ago

2.8.2

6 years ago

2.8.1

6 years ago

2.8.0

6 years ago

2.7.9

6 years ago

2.7.8

7 years ago

2.7.6

7 years ago

2.7.5

7 years ago

2.6.0

7 years ago

2.5.6

7 years ago

2.5.5

7 years ago

2.5.0

7 years ago

2.4.0

7 years ago

2.3.1

7 years ago

2.3.0

8 years ago

2.2.5

8 years ago

2.2.1

8 years ago

2.2.0

8 years ago

2.1.7

8 years ago

2.1.5

8 years ago

2.0.0

8 years ago

1.9.8

8 years ago

1.9.5

8 years ago

1.9.0

8 years ago

1.8.2

8 years ago

1.8.1

8 years ago

1.8.0

8 years ago

1.7.5

8 years ago

1.7.0

8 years ago

1.6.8

8 years ago

1.6.7

8 years ago

1.6.6

8 years ago

1.6.5

8 years ago

1.6.0

8 years ago

1.0.0

8 years ago

0.2.0

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago