Debian Codegraph @

workspaces/arborist/test/fixtures/registry-mocks/content/map-visit.json

raw
1 {
2 "_id": "map-visit",
3 "_rev": "8-bf08c012d8ddcc1e0f98bb4030e5d60f",
4 "name": "map-visit",
5 "description": "Map `visit` over an array of objects.",
6 "dist-tags": {
7 "latest": "1.0.0"
8 },
9 "versions": {
10 "0.1.0": {
11 "name": "map-visit",
12 "description": "Map `visit` over an array of objects.",
13 "version": "0.1.0",
14 "homepage": "https://github.com/jonschlinkert/map-visit",
15 "author": {
16 "name": "Jon Schlinkert",
17 "url": "https://github.com/jonschlinkert"
18 },
19 "repository": {
20 "type": "git",
21 "url": "git+https://github.com/jonschlinkert/map-visit.git"
22 },
23 "bugs": {
24 "url": "https://github.com/jonschlinkert/map-visit/issues"
25 },
26 "license": "MIT",
27 "files": [
28 "index.js"
29 ],
30 "main": "index.js",
31 "engines": {
32 "node": ">=0.10.0"
33 },
34 "scripts": {
35 "test": "mocha"
36 },
37 "dependencies": {
38 "object-visit": "^0.1.0"
39 },
40 "devDependencies": {
41 "lodash": "^3.10.0",
42 "mocha": "*",
43 "should": "*"
44 },
45 "keywords": [
46 "array",
47 "arrays",
48 "function",
49 "helper",
50 "invoke",
51 "key",
52 "map",
53 "method",
54 "object",
55 "objects",
56 "value",
57 "visit",
58 "visitor"
59 ],
60 "_id": "[email protected]",
61 "_shasum": "d71b0db4c51ea42bdad81d769d6d9689827a13d1",
62 "_from": ".",
63 "_npmVersion": "2.10.1",
64 "_nodeVersion": "0.12.4",
65 "_npmUser": {
66 "name": "jonschlinkert",
67 "email": "[email protected]"
68 },
69 "maintainers": [
70 {
71 "name": "jonschlinkert",
72 "email": "[email protected]"
73 }
74 ],
75 "dist": {
76 "shasum": "d71b0db4c51ea42bdad81d769d6d9689827a13d1",
77 "tarball": "https://registry.npmjs.org/map-visit/-/map-visit-0.1.0.tgz"
78 },
79 "directories": {}
80 },
81 "0.1.1": {
82 "name": "map-visit",
83 "description": "Map `visit` over an array of objects.",
84 "version": "0.1.1",
85 "homepage": "https://github.com/jonschlinkert/map-visit",
86 "author": {
87 "name": "Jon Schlinkert",
88 "url": "https://github.com/jonschlinkert"
89 },
90 "repository": {
91 "type": "git",
92 "url": "git+https://github.com/jonschlinkert/map-visit.git"
93 },
94 "bugs": {
95 "url": "https://github.com/jonschlinkert/map-visit/issues"
96 },
97 "license": "MIT",
98 "files": [
99 "index.js"
100 ],
101 "main": "index.js",
102 "engines": {
103 "node": ">=0.10.0"
104 },
105 "scripts": {
106 "test": "mocha"
107 },
108 "dependencies": {
109 "object-visit": "^0.1.0"
110 },
111 "devDependencies": {
112 "lodash": "^3.10.0",
113 "mocha": "*",
114 "should": "*"
115 },
116 "keywords": [
117 "array",
118 "arrays",
119 "function",
120 "helper",
121 "invoke",
122 "key",
123 "map",
124 "method",
125 "object",
126 "objects",
127 "value",
128 "visit",
129 "visitor"
130 ],
131 "verbiage": {
132 "related": {
133 "list": [
134 "collection-visit",
135 "object-visit"
136 ]
137 }
138 },
139 "gitHead": "72864009d12c4ddb366a04bbf03c8822a83f75fe",
140 "_id": "[email protected]",
141 "_shasum": "655cce40c43c558d1873ee9326e35d07fb51db44",
142 "_from": ".",
143 "_npmVersion": "2.10.1",
144 "_nodeVersion": "0.12.4",
145 "_npmUser": {
146 "name": "jonschlinkert",
147 "email": "[email protected]"
148 },
149 "maintainers": [
150 {
151 "name": "jonschlinkert",
152 "email": "[email protected]"
153 }
154 ],
155 "dist": {
156 "shasum": "655cce40c43c558d1873ee9326e35d07fb51db44",
157 "tarball": "https://registry.npmjs.org/map-visit/-/map-visit-0.1.1.tgz"
158 },
159 "directories": {}
160 },
161 "0.1.2": {
162 "name": "map-visit",
163 "description": "Map `visit` over an array of objects.",
164 "version": "0.1.2",
165 "homepage": "https://github.com/jonschlinkert/map-visit",
166 "author": {
167 "name": "Jon Schlinkert",
168 "url": "https://github.com/jonschlinkert"
169 },
170 "repository": {
171 "type": "git",
172 "url": "git+https://github.com/jonschlinkert/map-visit.git"
173 },
174 "bugs": {
175 "url": "https://github.com/jonschlinkert/map-visit/issues"
176 },
177 "license": "MIT",
178 "files": [
179 "index.js",
180 "utils.js"
181 ],
182 "main": "index.js",
183 "engines": {
184 "node": ">=0.10.0"
185 },
186 "scripts": {
187 "test": "mocha"
188 },
189 "dependencies": {
190 "lazy-cache": "^0.2.3",
191 "object-visit": "^0.1.0"
192 },
193 "devDependencies": {
194 "lodash": "^3.10.0",
195 "mocha": "*",
196 "should": "*"
197 },
198 "keywords": [
199 "array",
200 "arrays",
201 "function",
202 "helper",
203 "invoke",
204 "key",
205 "map",
206 "method",
207 "object",
208 "objects",
209 "value",
210 "visit",
211 "visitor"
212 ],
213 "verbiage": {
214 "related": {
215 "list": [
216 "collection-visit",
217 "object-visit"
218 ]
219 }
220 },
221 "gitHead": "4468727c74d2d4c28e8d68f6bb9a8d4703eeeb4d",
222 "_id": "[email protected]",
223 "_shasum": "ac3d91d9e81f14c358de82e6e7d3d3f18cd37ae2",
224 "_from": ".",
225 "_npmVersion": "2.14.4",
226 "_nodeVersion": "4.1.1",
227 "_npmUser": {
228 "name": "jonschlinkert",
229 "email": "[email protected]"
230 },
231 "maintainers": [
232 {
233 "name": "jonschlinkert",
234 "email": "[email protected]"
235 }
236 ],
237 "dist": {
238 "shasum": "ac3d91d9e81f14c358de82e6e7d3d3f18cd37ae2",
239 "tarball": "https://registry.npmjs.org/map-visit/-/map-visit-0.1.2.tgz"
240 },
241 "directories": {}
242 },
243 "0.1.3": {
244 "name": "map-visit",
245 "description": "Map `visit` over an array of objects.",
246 "version": "0.1.3",
247 "homepage": "https://github.com/jonschlinkert/map-visit",
248 "author": {
249 "name": "Jon Schlinkert",
250 "url": "https://github.com/jonschlinkert"
251 },
252 "repository": {
253 "type": "git",
254 "url": "git+https://github.com/jonschlinkert/map-visit.git"
255 },
256 "bugs": {
257 "url": "https://github.com/jonschlinkert/map-visit/issues"
258 },
259 "license": "MIT",
260 "files": [
261 "index.js",
262 "utils.js"
263 ],
264 "main": "index.js",
265 "engines": {
266 "node": ">=0.10.0"
267 },
268 "scripts": {
269 "test": "mocha"
270 },
271 "dependencies": {
272 "lazy-cache": "^0.2.3",
273 "object-visit": "^0.1.0"
274 },
275 "devDependencies": {
276 "lodash": "^3.10.0",
277 "mocha": "*",
278 "should": "*"
279 },
280 "keywords": [
281 "array",
282 "arrays",
283 "function",
284 "helper",
285 "invoke",
286 "key",
287 "map",
288 "method",
289 "object",
290 "objects",
291 "value",
292 "visit",
293 "visitor"
294 ],
295 "verbiage": {
296 "related": {
297 "list": [
298 "collection-visit",
299 "object-visit"
300 ]
301 }
302 },
303 "gitHead": "fca416c78615b453ca60c0cb7de7f6a5387de9f7",
304 "_id": "[email protected]",
305 "_shasum": "d4df0772e9584dcbcb675d62c3cc62d13f5aba43",
306 "_from": ".",
307 "_npmVersion": "2.14.4",
308 "_nodeVersion": "4.1.1",
309 "_npmUser": {
310 "name": "jonschlinkert",
311 "email": "[email protected]"
312 },
313 "maintainers": [
314 {
315 "name": "jonschlinkert",
316 "email": "[email protected]"
317 }
318 ],
319 "dist": {
320 "shasum": "d4df0772e9584dcbcb675d62c3cc62d13f5aba43",
321 "tarball": "https://registry.npmjs.org/map-visit/-/map-visit-0.1.3.tgz"
322 },
323 "directories": {}
324 },
325 "0.1.4": {
326 "name": "map-visit",
327 "description": "Map `visit` over an array of objects.",
328 "version": "0.1.4",
329 "homepage": "https://github.com/jonschlinkert/map-visit",
330 "author": {
331 "name": "Jon Schlinkert",
332 "url": "https://github.com/jonschlinkert"
333 },
334 "repository": {
335 "type": "git",
336 "url": "git+https://github.com/jonschlinkert/map-visit.git"
337 },
338 "bugs": {
339 "url": "https://github.com/jonschlinkert/map-visit/issues"
340 },
341 "license": "MIT",
342 "files": [
343 "index.js",
344 "utils.js"
345 ],
346 "main": "index.js",
347 "engines": {
348 "node": ">=0.10.0"
349 },
350 "scripts": {
351 "test": "mocha"
352 },
353 "dependencies": {
354 "lazy-cache": "^0.2.4",
355 "object-visit": "^0.3.1"
356 },
357 "devDependencies": {
358 "mocha": "*",
359 "should": "*"
360 },
361 "keywords": [
362 "array",
363 "arrays",
364 "function",
365 "helper",
366 "invoke",
367 "key",
368 "map",
369 "method",
370 "object",
371 "objects",
372 "value",
373 "visit",
374 "visitor"
375 ],
376 "verb": {
377 "related": {
378 "list": [
379 "collection-visit",
380 "object-visit"
381 ]
382 }
383 },
384 "gitHead": "ae7d63cd041d641511503af16327b1c8766ce75f",
385 "_id": "[email protected]",
386 "_shasum": "4cd79abdc6985324e324204af330d772e48df6bd",
387 "_from": ".",
388 "_npmVersion": "3.3.6",
389 "_nodeVersion": "5.0.0",
390 "_npmUser": {
391 "name": "jonschlinkert",
392 "email": "[email protected]"
393 },
394 "maintainers": [
395 {
396 "name": "jonschlinkert",
397 "email": "[email protected]"
398 }
399 ],
400 "dist": {
401 "shasum": "4cd79abdc6985324e324204af330d772e48df6bd",
402 "tarball": "https://registry.npmjs.org/map-visit/-/map-visit-0.1.4.tgz"
403 },
404 "directories": {}
405 },
406 "0.1.5": {
407 "name": "map-visit",
408 "description": "Map `visit` over an array of objects.",
409 "version": "0.1.5",
410 "homepage": "https://github.com/jonschlinkert/map-visit",
411 "author": {
412 "name": "Jon Schlinkert",
413 "url": "https://github.com/jonschlinkert"
414 },
415 "repository": {
416 "type": "git",
417 "url": "git+https://github.com/jonschlinkert/map-visit.git"
418 },
419 "bugs": {
420 "url": "https://github.com/jonschlinkert/map-visit/issues"
421 },
422 "license": "MIT",
423 "files": [
424 "index.js",
425 "utils.js"
426 ],
427 "main": "index.js",
428 "engines": {
429 "node": ">=0.10.0"
430 },
431 "scripts": {
432 "test": "mocha"
433 },
434 "dependencies": {
435 "lazy-cache": "^2.0.1",
436 "object-visit": "^0.3.4"
437 },
438 "devDependencies": {
439 "gulp-format-md": "^0.1.10",
440 "lodash": "^4.14.1",
441 "mocha": "^3.0.1",
442 "should": "^10.0.0"
443 },
444 "keywords": [
445 "array",
446 "arrays",
447 "function",
448 "helper",
449 "invoke",
450 "key",
451 "map",
452 "method",
453 "object",
454 "objects",
455 "value",
456 "visit",
457 "visitor"
458 ],
459 "verb": {
460 "related": {
461 "list": [
462 "collection-visit",
463 "object-visit"
464 ]
465 },
466 "toc": false,
467 "layout": "default",
468 "tasks": [
469 "readme"
470 ],
471 "plugins": [
472 "gulp-format-md"
473 ],
474 "lint": {
475 "reflinks": true
476 },
477 "reflinks": [
478 "verb",
479 "verb-generate-readme"
480 ]
481 },
482 "gitHead": "7b0b53047682dda683b4a2f5ab144d7460b02b2b",
483 "_id": "[email protected]",
484 "_shasum": "dbe43927ce5525b80dfc1573a44d68c51f26816b",
485 "_from": ".",
486 "_npmVersion": "3.7.5",
487 "_nodeVersion": "5.1.1",
488 "_npmUser": {
489 "name": "doowb",
490 "email": "[email protected]"
491 },
492 "dist": {
493 "shasum": "dbe43927ce5525b80dfc1573a44d68c51f26816b",
494 "tarball": "https://registry.npmjs.org/map-visit/-/map-visit-0.1.5.tgz"
495 },
496 "maintainers": [
497 {
498 "name": "doowb",
499 "email": "[email protected]"
500 },
501 {
502 "name": "jonschlinkert",
503 "email": "[email protected]"
504 }
505 ],
506 "_npmOperationalInternal": {
507 "host": "packages-16-east.internal.npmjs.com",
508 "tmp": "tmp/map-visit-0.1.5.tgz_1470434073338_0.894326905021444"
509 },
510 "directories": {}
511 },
512 "1.0.0": {
513 "name": "map-visit",
514 "description": "Map `visit` over an array of objects.",
515 "version": "1.0.0",
516 "homepage": "https://github.com/jonschlinkert/map-visit",
517 "author": {
518 "name": "Jon Schlinkert",
519 "url": "https://github.com/jonschlinkert"
520 },
521 "contributors": [
522 {
523 "name": "Brian Woodward",
524 "email": "[email protected]",
525 "url": "https://twitter.com/doowb"
526 },
527 {
528 "name": "Jon Schlinkert",
529 "email": "[email protected]",
530 "url": "http://twitter.com/jonschlinkert"
531 }
532 ],
533 "repository": {
534 "type": "git",
535 "url": "git+https://github.com/jonschlinkert/map-visit.git"
536 },
537 "bugs": {
538 "url": "https://github.com/jonschlinkert/map-visit/issues"
539 },
540 "license": "MIT",
541 "files": [
542 "index.js"
543 ],
544 "main": "index.js",
545 "engines": {
546 "node": ">=0.10.0"
547 },
548 "scripts": {
549 "test": "mocha"
550 },
551 "dependencies": {
552 "object-visit": "^1.0.0"
553 },
554 "devDependencies": {
555 "clone-deep": "^0.2.4",
556 "extend-shallow": "^2.0.1",
557 "gulp-format-md": "^0.1.12",
558 "lodash": "^4.17.4",
559 "mocha": "^3.2.0"
560 },
561 "keywords": [
562 "array",
563 "arrays",
564 "function",
565 "helper",
566 "invoke",
567 "key",
568 "map",
569 "method",
570 "object",
571 "objects",
572 "value",
573 "visit",
574 "visitor"
575 ],
576 "verb": {
577 "toc": false,
578 "layout": "default",
579 "tasks": [
580 "readme"
581 ],
582 "plugins": [
583 "gulp-format-md"
584 ],
585 "lint": {
586 "reflinks": true
587 },
588 "related": {
589 "list": [
590 "collection-visit",
591 "object-visit"
592 ]
593 },
594 "reflinks": [
595 "verb",
596 "verb-generate-readme"
597 ]
598 },
599 "gitHead": "73bcd8385c9520c595a825486f19623a5e0550f0",
600 "_id": "[email protected]",
601 "_shasum": "ecdca8f13144e660f1b5bd41f12f3479d98dfb8f",
602 "_from": ".",
603 "_npmVersion": "4.1.2",
604 "_nodeVersion": "7.7.3",
605 "_npmUser": {
606 "name": "jonschlinkert",
607 "email": "[email protected]"
608 },
609 "maintainers": [
610 {
611 "name": "doowb",
612 "email": "[email protected]"
613 },
614 {
615 "name": "jonschlinkert",
616 "email": "[email protected]"
617 }
618 ],
619 "dist": {
620 "shasum": "ecdca8f13144e660f1b5bd41f12f3479d98dfb8f",
621 "tarball": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz"
622 },
623 "_npmOperationalInternal": {
624 "host": "packages-12-west.internal.npmjs.com",
625 "tmp": "tmp/map-visit-1.0.0.tgz_1491774214052_0.825954457744956"
626 },
627 "directories": {}
628 }
629 },
630 "readme": "# map-visit [![NPM version](https://img.shields.io/npm/v/map-visit.svg?style=flat)](https://www.npmjs.com/package/map-visit) [![NPM monthly downloads](https://img.shields.io/npm/dm/map-visit.svg?style=flat)](https://npmjs.org/package/map-visit) [![NPM total downloads](https://img.shields.io/npm/dt/map-visit.svg?style=flat)](https://npmjs.org/package/map-visit) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/map-visit.svg?style=flat&label=Travis)](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._",
631 "maintainers": [
632 {
633 "name": "doowb",
634 "email": "[email protected]"
635 },
636 {
637 "name": "jonschlinkert",
638 "email": "[email protected]"
639 }
640 ],
641 "time": {
642 "modified": "2017-04-09T21:43:35.689Z",
643 "created": "2015-07-04T20:27:34.082Z",
644 "0.1.0": "2015-07-04T20:27:34.082Z",
645 "0.1.1": "2015-08-07T04:07:05.349Z",
646 "0.1.2": "2015-10-06T13:09:05.144Z",
647 "0.1.3": "2015-10-06T13:11:32.060Z",
648 "0.1.4": "2015-11-08T19:04:55.608Z",
649 "0.1.5": "2016-08-05T21:54:35.306Z",
650 "1.0.0": "2017-04-09T21:43:35.689Z"
651 },
652 "homepage": "https://github.com/jonschlinkert/map-visit",
653 "keywords": [
654 "array",
655 "arrays",
656 "function",
657 "helper",
658 "invoke",
659 "key",
660 "map",
661 "method",
662 "object",
663 "objects",
664 "value",
665 "visit",
666 "visitor"
667 ],
668 "repository": {
669 "type": "git",
670 "url": "git+https://github.com/jonschlinkert/map-visit.git"
671 },
672 "author": {
673 "name": "Jon Schlinkert",
674 "url": "https://github.com/jonschlinkert"
675 },
676 "bugs": {
677 "url": "https://github.com/jonschlinkert/map-visit/issues"
678 },
679 "license": "MIT",
680 "readmeFilename": "README.md",
681 "contributors": [
682 {
683 "name": "Brian Woodward",
684 "email": "[email protected]",
685 "url": "https://twitter.com/doowb"
686 },
687 {
688 "name": "Jon Schlinkert",
689 "email": "[email protected]",
690 "url": "http://twitter.com/jonschlinkert"
691 }
692 ],
693 "_attachments": {}
694 }