{"name":"shallow-clone","description":"Make a shallow clone of an object, array or primitive.","version":"0.1.1","homepage":"https://github.com/jonschlinkert/shallow-clone","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/shallow-clone.git"},"bugs":{"url":"https://github.com/jonschlinkert/shallow-clone/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"is-extendable":"^0.1.1","kind-of":"^2.0.0","lazy-cache":"^0.1.0","mixin-object":"^2.0.0"},"devDependencies":{"mocha":"*","should":"*"},"keywords":["array","clone","copy","extend","mixin","object","primitive","shallow"],"verb":{"related":{"list":["clone-deep","is-plain-object","mixin-object","mixin-deep","extend-shallow","assign-deep"]}},"_id":"shallow-clone@0.1.1","_shasum":"d114e09ff7c3b198e92f764277c28444a219ea1a","_from":".","_npmVersion":"2.10.1","_nodeVersion":"0.12.4","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"d114e09ff7c3b198e92f764277c28444a219ea1a","tarball":"http://registry-npm.ywwl.com/shallow-clone/download/shallow-clone-0.1.1.tgz","integrity":"sha512-edGqnvFjNmrpRpzvGImm7zX3mDLjPn65SEb94O6mMG7vEdAVMTVZ/0qvLae/YYnHfPxdQ3oobnPRJRVa+wC+HA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGSufbBIVJesXbH60jE39c5RRHkPTlUc0bCeZVbps06KAiBCVyR8TdykXPUmFA80xm3Tksa2R7A6DQqQ7eCBi1D0vA=="}],"size":2659,"noattachment":false,"key":"/shallow-clone/-/shallow-clone-0.1.1.tgz"},"directories":{},"readme":"# shallow-clone [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=W8YFZ425KND68) [![NPM version](https://img.shields.io/npm/v/shallow-clone.svg?style=flat)](https://www.npmjs.com/package/shallow-clone) [![NPM monthly downloads](https://img.shields.io/npm/dm/shallow-clone.svg?style=flat)](https://npmjs.org/package/shallow-clone) [![NPM total downloads](https://img.shields.io/npm/dt/shallow-clone.svg?style=flat)](https://npmjs.org/package/shallow-clone) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/shallow-clone.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/shallow-clone)\n\n> Creates a shallow clone of any JavaScript value.\n\nPlease consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save shallow-clone\n```\n\n## Usage\n\n```js\nconst clone = require('shallow-clone');\n```\n\n**Supports**\n\n* array buffers\n* arrays\n* buffers\n* dates\n* errors\n* float32 arrays\n* float64 arrays\n* int16 arrays\n* int32 arrays\n* int8 arrays\n* maps\n* objects\n* primitives\n* regular expressions\n* sets\n* symbols\n* uint16 arrays\n* uint32 arrays\n* uint8 arrays\n* uint8clamped arrays\n\n## Arrays\n\nBy default, only the array itself is cloned (shallow), use [clone-deep](https://github.com/jonschlinkert/clone-deep) if you also need the elements in the array to be cloned.\n\n```js\nconst arr = [{ a: 0 }, { b: 1 }];\nconst foo = clone(arr);\n// foo =>  [{ 'a': 0 }, { 'b': 1 }]\n\n// array is cloned\nassert(actual === expected); // false\n\n// array elements are not\nassert.deepEqual(actual[0], expected[0]); // true\n```\n\n## Objects\n\nOnly the object is shallow cloned, use [clone-deep](https://github.com/jonschlinkert/clone-deep) if you also need the values in the object to be cloned.\n\n```js\nconsole.log(clone({ a: 1, b: 2, c: 3 }));\n//=> {a: 1, b: 2, c: 3 }\n```\n\n## RegExp\n\nClones regular expressions and flags, and preserves the `.lastIndex`.\n\n```js\nconst regex = clone(/foo/g); //=> /foo/g\n// you can manually reset lastIndex if necessary\nregex.lastIndex = 0;\n```\n\n## Primitives\n\nSimply returns primitives unchanged.\n\n```js\nclone(0); //=> 0\nclone('foo'); //=> 'foo'\n```\n\n## About\n\n<details>\n<summary><strong>Contributing</strong></summary>\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n</details>\n\n<details>\n<summary><strong>Running Tests</strong></summary>\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install && npm test\n```\n\n</details>\n\n<details>\n<summary><strong>Building docs</strong></summary>\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme && verb\n```\n\n</details>\n\n### Related projects\n\nYou might also be interested in these projects:\n\n* [assign-deep](https://www.npmjs.com/package/assign-deep): Deeply assign the values of all enumerable-own-properties and symbols from one or more source objects… [more](https://github.com/jonschlinkert/assign-deep) | [homepage](https://github.com/jonschlinkert/assign-deep \"Deeply assign the values of all enumerable-own-properties and symbols from one or more source objects to a target object. Returns the target object.\")\n* [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 \"Recursively (deep) clone JavaScript native types, like Object, Array, RegExp, Date as well as primitives.\")\n* [is-plain-object](https://www.npmjs.com/package/is-plain-object): Returns true if an object was created by the `Object` constructor. | [homepage](https://github.com/jonschlinkert/is-plain-object \"Returns true if an object was created by the `Object` constructor.\")\n* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of \"Get the native type of a value.\")\n\n### Contributors\n\n| **Commits** | **Contributor** |  \n| --- | --- |  \n| 20 | [jonschlinkert](https://github.com/jonschlinkert) |  \n| 2  | [doowb](https://github.com/doowb) |  \n| 1  | [jakub-g](https://github.com/jakub-g) |  \n\n### Author\n\n**Jon Schlinkert**\n\n* [GitHub Profile](https://github.com/jonschlinkert)\n* [Twitter Profile](https://twitter.com/jonschlinkert)\n* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)\n\n### License\n\nCopyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 15, 2019._","publish_time":1439240514541,"_cnpm_publish_time":1439240514541,"dist-tags":{"latest":"3.0.1"}}