source: trip-planner-front/node_modules/assign-symbols/README.md@ 571e0df

Last change on this file since 571e0df was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 2.7 KB
Line 
1# assign-symbols [![NPM version](https://badge.fury.io/js/assign-symbols.svg)](http://badge.fury.io/js/assign-symbols)
2
3> Assign the enumerable es6 Symbol properties from an object (or objects) to the first object passed on the arguments. Can be used as a supplement to other extend, assign or merge methods as a polyfill for the Symbols part of the es6 Object.assign method.
4
5From the [Mozilla Developer docs for Symbol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol):
6
7> A symbol is a unique and immutable data type and may be used as an identifier for object properties. The symbol object is an implicit object wrapper for the symbol primitive data type.
8
9## Install
10
11Install with [npm](https://www.npmjs.com/)
12
13```sh
14$ npm i assign-symbols --save
15```
16
17## Usage
18
19```js
20var assignSymbols = require('assign-symbols');
21var obj = {};
22
23var one = {};
24var symbolOne = Symbol('aaa');
25one[symbolOne] = 'bbb';
26
27var two = {};
28var symbolTwo = Symbol('ccc');
29two[symbolTwo] = 'ddd';
30
31assignSymbols(obj, one, two);
32
33console.log(obj[symbolOne]);
34//=> 'bbb'
35console.log(obj[symbolTwo]);
36//=> 'ddd'
37```
38
39## Similar projects
40
41* [assign-deep](https://www.npmjs.com/package/assign-deep): Deeply assign the enumerable properties of source objects to a destination object. | [homepage](https://github.com/jonschlinkert/assign-deep)
42* [clone-deep](https://www.npmjs.com/package/clone-deep): Recursively (deep) clone JavaScript native types, like Object, Array, RegExp, Date as well as primitives. | [homepage](https://github.com/jonschlinkert/clone-deep)
43* [extend-shallow](https://www.npmjs.com/package/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util. | [homepage](https://github.com/jonschlinkert/extend-shallow)
44* [merge-deep](https://www.npmjs.com/package/merge-deep): Recursively merge values in a javascript object. | [homepage](https://github.com/jonschlinkert/merge-deep)
45* [mixin-deep](https://www.npmjs.com/package/mixin-deep): Deeply mix the properties of objects into the first object. Like merge-deep, but doesn't clone. | [homepage](https://github.com/jonschlinkert/mixin-deep)
46
47## Running tests
48
49Install dev dependencies:
50
51```sh
52$ npm i -d && npm test
53```
54
55## Contributing
56
57Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/assign-symbols/issues/new).
58
59## Author
60
61**Jon Schlinkert**
62
63+ [github/jonschlinkert](https://github.com/jonschlinkert)
64+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
65
66## License
67
68Copyright © 2015 Jon Schlinkert
69Released under the MIT license.
70
71***
72
73_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on November 06, 2015._
Note: See TracBrowser for help on using the repository browser.