{"_id":"shallow-copy","_rev":"41036","name":"shallow-copy","description":"make a shallow copy of an object or array","dist-tags":{"latest":"0.0.1"},"maintainers":[{"name":"nopersonsmodules","email":"nopersonsmodules@gmail.com"}],"time":{"modified":"2023-03-24T09:07:00.000Z","created":"2013-07-25T04:34:59.273Z","0.0.1":"2013-07-25T06:24:34.297Z","0.0.0":"2013-07-25T04:34:59.273Z"},"users":{},"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"repository":{"type":"git","url":"git://github.com/substack/shallow-copy.git"},"versions":{"0.0.1":{"name":"shallow-copy","version":"0.0.1","description":"make a shallow copy of an object or array","main":"index.js","dependencies":{},"devDependencies":{"tape":"~1.0.4"},"scripts":{"test":"tape test/*.js"},"testling":{"files":"test/*.js","browsers":["ie/8..latest","ff/latest","chrome/latest","safari/latest","opera/latest","android/latest","iphone/latest","ipad/latest"]},"repository":{"type":"git","url":"git://github.com/substack/shallow-copy.git"},"homepage":"https://github.com/substack/shallow-copy","keywords":["shallow","copy","data","object","array"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT","readmeFilename":"readme.markdown","bugs":{"url":"https://github.com/substack/shallow-copy/issues"},"_id":"shallow-copy@0.0.1","dist":{"shasum":"415f42702d73d810330292cc5ee86eae1a11a170","size":2330,"noattachment":false,"key":"/shallow-copy/-/shallow-copy-0.0.1.tgz","tarball":"http://name.csiicloud.com:7001/shallow-copy/download/shallow-copy-0.0.1.tgz"},"_from":".","_npmVersion":"1.3.0","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"nopersonsmodules","email":"nopersonsmodules@gmail.com"}],"directories":{},"publish_time":1374733474297,"_hasShrinkwrap":false,"_cnpm_publish_time":1374733474297},"0.0.0":{"name":"shallow-copy","version":"0.0.0","description":"make a shallow copy of an object or array","main":"index.js","dependencies":{},"devDependencies":{"tape":"~1.0.4"},"scripts":{"test":"tape test/*.js"},"testling":{"files":"test/*.js","browsers":["ie/8..latest","ff/latest","chrome/latest","safari/latest","opera/latest","android/latest","iphone/latest","ipad/latest"]},"repository":{"type":"git","url":"git://github.com/substack/shallow-copy.git"},"homepage":"https://github.com/substack/shallow-copy","keywords":["shallow","copy","data","object","array"],"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"license":"MIT","readmeFilename":"readme.markdown","bugs":{"url":"https://github.com/substack/shallow-copy/issues"},"_id":"shallow-copy@0.0.0","dist":{"shasum":"9c719d8e7e2d11ed283579a091a83bdc1080d34b","size":2327,"noattachment":false,"key":"/shallow-copy/-/shallow-copy-0.0.0.tgz","tarball":"http://name.csiicloud.com:7001/shallow-copy/download/shallow-copy-0.0.0.tgz"},"_from":".","_npmVersion":"1.3.0","_npmUser":{"name":"substack","email":"mail@substack.net"},"maintainers":[{"name":"nopersonsmodules","email":"nopersonsmodules@gmail.com"}],"directories":{},"publish_time":1374726899273,"_hasShrinkwrap":false,"_cnpm_publish_time":1374726899273}},"readme":"# shallow-copy\n\nmake a shallow copy of an object or array\n\n[![testling badge](https://ci.testling.com/substack/shallow-copy.png)](https://ci.testling.com/substack/shallow-copy)\n\n[![build status](https://secure.travis-ci.org/substack/shallow-copy.png)](http://travis-ci.org/substack/shallow-copy)\n\n# example\n\nyou can copy objects shallowly:\n\n``` js\nvar copy = require('shallow-copy');\n\nvar obj = { a: 3, b: 4, c: [5,6] };\nvar dup = copy(obj);\ndup.b *= 111;\ndup.c.push(7);\n\nconsole.log('original: ', obj);\nconsole.log('copy: ', dup);\n```\n\nand you can copy arrays shallowly:\n\n``` js\nvar copy = require('shallow-copy');\n\nvar xs = [ 3, 4, 5, { f: 6, g: 7 } ];\nvar dup = copy(xs);\ndup.unshift(1, 2);\ndup[5].g += 100;\n\nconsole.log('original: ', xs);\nconsole.log('copy: ', dup);\n```\n\n# methods\n\n``` js\nvar copy = require('shallow-copy')\n```\n\n## copy(obj)\n\nReturn a copy of the enumerable properties of the object `obj` without making\ncopies of nested objects inside of `obj`.\n\nIf `obj` is an array, the result will be an array.\nIf `obj` is an object, the result will be an object.\nIf `obj` is not an object, its value is returned.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install shallow-copy\n```\n\n# license\n\nMIT\n","_attachments":{},"readmeFilename":"readme.markdown","homepage":"https://github.com/substack/shallow-copy","bugs":{"url":"https://github.com/substack/shallow-copy/issues"},"license":"MIT"}