%PDF- %PDF-
Direktori : /home/opti/.npm/registry.npmjs.org/map-visit/ |
Current File : /home/opti/.npm/registry.npmjs.org/map-visit/.cache.json |
{"_id":"map-visit","_rev":"8-bf08c012d8ddcc1e0f98bb4030e5d60f","name":"map-visit","description":"Map `visit` over an array of objects.","dist-tags":{"latest":"1.0.0"},"versions":{"0.1.0":{"name":"map-visit","description":"Map `visit` over an array of objects.","version":"0.1.0","homepage":"https://github.com/jonschlinkert/map-visit","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/map-visit.git"},"bugs":{"url":"https://github.com/jonschlinkert/map-visit/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"object-visit":"^0.1.0"},"devDependencies":{"lodash":"^3.10.0","mocha":"*","should":"*"},"keywords":["array","arrays","function","helper","invoke","key","map","method","object","objects","value","visit","visitor"],"_id":"map-visit@0.1.0","_shasum":"d71b0db4c51ea42bdad81d769d6d9689827a13d1","_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":"d71b0db4c51ea42bdad81d769d6d9689827a13d1","tarball":"https://registry.npmjs.org/map-visit/-/map-visit-0.1.0.tgz"},"directories":{}},"0.1.1":{"name":"map-visit","description":"Map `visit` over an array of objects.","version":"0.1.1","homepage":"https://github.com/jonschlinkert/map-visit","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/map-visit.git"},"bugs":{"url":"https://github.com/jonschlinkert/map-visit/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"object-visit":"^0.1.0"},"devDependencies":{"lodash":"^3.10.0","mocha":"*","should":"*"},"keywords":["array","arrays","function","helper","invoke","key","map","method","object","objects","value","visit","visitor"],"verbiage":{"related":{"list":["collection-visit","object-visit"]}},"gitHead":"72864009d12c4ddb366a04bbf03c8822a83f75fe","_id":"map-visit@0.1.1","_shasum":"655cce40c43c558d1873ee9326e35d07fb51db44","_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":"655cce40c43c558d1873ee9326e35d07fb51db44","tarball":"https://registry.npmjs.org/map-visit/-/map-visit-0.1.1.tgz"},"directories":{}},"0.1.2":{"name":"map-visit","description":"Map `visit` over an array of objects.","version":"0.1.2","homepage":"https://github.com/jonschlinkert/map-visit","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/map-visit.git"},"bugs":{"url":"https://github.com/jonschlinkert/map-visit/issues"},"license":"MIT","files":["index.js","utils.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"lazy-cache":"^0.2.3","object-visit":"^0.1.0"},"devDependencies":{"lodash":"^3.10.0","mocha":"*","should":"*"},"keywords":["array","arrays","function","helper","invoke","key","map","method","object","objects","value","visit","visitor"],"verbiage":{"related":{"list":["collection-visit","object-visit"]}},"gitHead":"4468727c74d2d4c28e8d68f6bb9a8d4703eeeb4d","_id":"map-visit@0.1.2","_shasum":"ac3d91d9e81f14c358de82e6e7d3d3f18cd37ae2","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.1","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"ac3d91d9e81f14c358de82e6e7d3d3f18cd37ae2","tarball":"https://registry.npmjs.org/map-visit/-/map-visit-0.1.2.tgz"},"directories":{}},"0.1.3":{"name":"map-visit","description":"Map `visit` over an array of objects.","version":"0.1.3","homepage":"https://github.com/jonschlinkert/map-visit","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/map-visit.git"},"bugs":{"url":"https://github.com/jonschlinkert/map-visit/issues"},"license":"MIT","files":["index.js","utils.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"lazy-cache":"^0.2.3","object-visit":"^0.1.0"},"devDependencies":{"lodash":"^3.10.0","mocha":"*","should":"*"},"keywords":["array","arrays","function","helper","invoke","key","map","method","object","objects","value","visit","visitor"],"verbiage":{"related":{"list":["collection-visit","object-visit"]}},"gitHead":"fca416c78615b453ca60c0cb7de7f6a5387de9f7","_id":"map-visit@0.1.3","_shasum":"d4df0772e9584dcbcb675d62c3cc62d13f5aba43","_from":".","_npmVersion":"2.14.4","_nodeVersion":"4.1.1","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"d4df0772e9584dcbcb675d62c3cc62d13f5aba43","tarball":"https://registry.npmjs.org/map-visit/-/map-visit-0.1.3.tgz"},"directories":{}},"0.1.4":{"name":"map-visit","description":"Map `visit` over an array of objects.","version":"0.1.4","homepage":"https://github.com/jonschlinkert/map-visit","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/map-visit.git"},"bugs":{"url":"https://github.com/jonschlinkert/map-visit/issues"},"license":"MIT","files":["index.js","utils.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"lazy-cache":"^0.2.4","object-visit":"^0.3.1"},"devDependencies":{"mocha":"*","should":"*"},"keywords":["array","arrays","function","helper","invoke","key","map","method","object","objects","value","visit","visitor"],"verb":{"related":{"list":["collection-visit","object-visit"]}},"gitHead":"ae7d63cd041d641511503af16327b1c8766ce75f","_id":"map-visit@0.1.4","_shasum":"4cd79abdc6985324e324204af330d772e48df6bd","_from":".","_npmVersion":"3.3.6","_nodeVersion":"5.0.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"4cd79abdc6985324e324204af330d772e48df6bd","tarball":"https://registry.npmjs.org/map-visit/-/map-visit-0.1.4.tgz"},"directories":{}},"0.1.5":{"name":"map-visit","description":"Map `visit` over an array of objects.","version":"0.1.5","homepage":"https://github.com/jonschlinkert/map-visit","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/map-visit.git"},"bugs":{"url":"https://github.com/jonschlinkert/map-visit/issues"},"license":"MIT","files":["index.js","utils.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"lazy-cache":"^2.0.1","object-visit":"^0.3.4"},"devDependencies":{"gulp-format-md":"^0.1.10","lodash":"^4.14.1","mocha":"^3.0.1","should":"^10.0.0"},"keywords":["array","arrays","function","helper","invoke","key","map","method","object","objects","value","visit","visitor"],"verb":{"related":{"list":["collection-visit","object-visit"]},"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"lint":{"reflinks":true},"reflinks":["verb","verb-generate-readme"]},"gitHead":"7b0b53047682dda683b4a2f5ab144d7460b02b2b","_id":"map-visit@0.1.5","_shasum":"dbe43927ce5525b80dfc1573a44d68c51f26816b","_from":".","_npmVersion":"3.7.5","_nodeVersion":"5.1.1","_npmUser":{"name":"doowb","email":"brian.woodward@gmail.com"},"dist":{"shasum":"dbe43927ce5525b80dfc1573a44d68c51f26816b","tarball":"https://registry.npmjs.org/map-visit/-/map-visit-0.1.5.tgz"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/map-visit-0.1.5.tgz_1470434073338_0.894326905021444"},"directories":{}},"1.0.0":{"name":"map-visit","description":"Map `visit` over an array of objects.","version":"1.0.0","homepage":"https://github.com/jonschlinkert/map-visit","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"contributors":[{"name":"Brian Woodward","email":"brian.woodward@gmail.com","url":"https://twitter.com/doowb"},{"name":"Jon Schlinkert","email":"jon.schlinkert@sellside.com","url":"http://twitter.com/jonschlinkert"}],"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/map-visit.git"},"bugs":{"url":"https://github.com/jonschlinkert/map-visit/issues"},"license":"MIT","files":["index.js"],"main":"index.js","engines":{"node":">=0.10.0"},"scripts":{"test":"mocha"},"dependencies":{"object-visit":"^1.0.0"},"devDependencies":{"clone-deep":"^0.2.4","extend-shallow":"^2.0.1","gulp-format-md":"^0.1.12","lodash":"^4.17.4","mocha":"^3.2.0"},"keywords":["array","arrays","function","helper","invoke","key","map","method","object","objects","value","visit","visitor"],"verb":{"toc":false,"layout":"default","tasks":["readme"],"plugins":["gulp-format-md"],"lint":{"reflinks":true},"related":{"list":["collection-visit","object-visit"]},"reflinks":["verb","verb-generate-readme"]},"gitHead":"73bcd8385c9520c595a825486f19623a5e0550f0","_id":"map-visit@1.0.0","_shasum":"ecdca8f13144e660f1b5bd41f12f3479d98dfb8f","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.7.3","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"ecdca8f13144e660f1b5bd41f12f3479d98dfb8f","tarball":"https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/map-visit-1.0.0.tgz_1491774214052_0.825954457744956"},"directories":{}}},"readme":"# map-visit [](https://www.npmjs.com/package/map-visit) [](https://npmjs.org/package/map-visit) [](https://npmjs.org/package/map-visit) [](https://travis-ci.org/jonschlinkert/map-visit)\n\n> Map `visit` over an array of objects.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save map-visit\n```\n\n## Usage\n\n```js\nvar mapVisit = require('map-visit');\n```\n\n## What does this do?\n\n**Assign/Merge/Extend vs. Visit**\n\nLet's say you want to add a `set` method to your application that will:\n\n* set key-value pairs on a `data` object\n* extend objects onto the `data` object\n* extend arrays of objects onto the data object\n\n**Example using `extend`**\n\nHere is one way to accomplish this using Lo-Dash's `extend` (comparable to `Object.assign`):\n\n```js\nvar _ = require('lodash');\n\nvar obj = {\n data: {},\n set: function (key, value) {\n if (Array.isArray(key)) {\n _.extend.apply(_, [obj.data].concat(key));\n } else if (typeof key === 'object') {\n _.extend(obj.data, key);\n } else {\n obj.data[key] = value;\n }\n }\n};\n\nobj.set('a', 'a');\nobj.set([{b: 'b'}, {c: 'c'}]);\nobj.set({d: {e: 'f'}});\n\nconsole.log(obj.data);\n//=> {a: 'a', b: 'b', c: 'c', d: { e: 'f' }}\n```\n\nThe above approach works fine for most use cases. However, **if you also want to emit an event** each time a property is added to the `data` object, or you want more control over what happens as the object is extended, a better approach would be to use `visit`.\n\n**Example using `visit`**\n\nIn this approach:\n\n* when an array is passed to `set`, the `mapVisit` library calls the `set` method on each object in the array.\n* when an object is passed, `visit` calls `set` on each property in the object.\n\nAs a result, the `data` event will be emitted every time a property is added to `data` (events are just an example, you can use this approach to perform any necessary logic every time the method is called).\n\n```js\nvar mapVisit = require('map-visit');\nvar visit = require('object-visit');\n\nvar obj = {\n data: {},\n set: function (key, value) {\n if (Array.isArray(key)) {\n mapVisit(obj, 'set', key);\n } else if (typeof key === 'object') {\n visit(obj, 'set', key);\n } else {\n // simulate an event-emitter\n console.log('emit', key, value);\n obj.data[key] = value;\n }\n }\n};\n\nobj.set('a', 'a');\nobj.set([{b: 'b'}, {c: 'c'}]);\nobj.set({d: {e: 'f'}});\nobj.set({g: 'h', i: 'j', k: 'l'});\n\nconsole.log(obj.data);\n//=> {a: 'a', b: 'b', c: 'c', d: { e: 'f' }, g: 'h', i: 'j', k: 'l'}\n\n// events would look something like:\n// emit a a\n// emit b b\n// emit c c\n// emit d { e: 'f' }\n// emit g h\n// emit i j\n// emit k l\n```\n\n## About\n\n### Related projects\n\n* [collection-visit](https://www.npmjs.com/package/collection-visit): Visit a method over the items in an object, or map visit over the objects… [more](https://github.com/jonschlinkert/collection-visit) | [homepage](https://github.com/jonschlinkert/collection-visit \"Visit a method over the items in an object, or map visit over the objects in an array.\")\n* [object-visit](https://www.npmjs.com/package/object-visit): Call a specified method on each value in the given object. | [homepage](https://github.com/jonschlinkert/object-visit \"Call a specified method on each value in the given object.\")\n\n### Contributing\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n### Contributors\n\n| **Commits** | **Contributor** | \n| --- | --- |\n| 15 | [jonschlinkert](https://github.com/jonschlinkert) |\n| 7 | [doowb](https://github.com/doowb) |\n\n### Building docs\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### Running tests\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### Author\n\n**Jon Schlinkert**\n\n* [github/jonschlinkert](https://github.com/jonschlinkert)\n* [twitter/jonschlinkert](https://twitter.com/jonschlinkert)\n\n### License\n\nCopyright © 2017, [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.5.0, on April 09, 2017._","maintainers":[{"name":"doowb","email":"brian.woodward@gmail.com"},{"name":"jonschlinkert","email":"github@sellside.com"}],"time":{"modified":"2017-04-09T21:43:35.689Z","created":"2015-07-04T20:27:34.082Z","0.1.0":"2015-07-04T20:27:34.082Z","0.1.1":"2015-08-07T04:07:05.349Z","0.1.2":"2015-10-06T13:09:05.144Z","0.1.3":"2015-10-06T13:11:32.060Z","0.1.4":"2015-11-08T19:04:55.608Z","0.1.5":"2016-08-05T21:54:35.306Z","1.0.0":"2017-04-09T21:43:35.689Z"},"homepage":"https://github.com/jonschlinkert/map-visit","keywords":["array","arrays","function","helper","invoke","key","map","method","object","objects","value","visit","visitor"],"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/map-visit.git"},"author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"bugs":{"url":"https://github.com/jonschlinkert/map-visit/issues"},"license":"MIT","readmeFilename":"README.md","contributors":[{"name":"Brian Woodward","email":"brian.woodward@gmail.com","url":"https://twitter.com/doowb"},{"name":"Jon Schlinkert","email":"jon.schlinkert@sellside.com","url":"http://twitter.com/jonschlinkert"}],"_attachments":{},"_etag":"W/\"fcf6893e102475079e5382a1fd622dc3\"","_lastModified":"Sun, 27 May 2018 07:23:40 GMT"}