diff options
Diffstat (limited to 'node_modules/collection-visit')
-rw-r--r-- | node_modules/collection-visit/LICENSE | 2 | ||||
-rw-r--r-- | node_modules/collection-visit/README.md | 29 | ||||
-rw-r--r-- | node_modules/collection-visit/index.js | 25 | ||||
-rw-r--r-- | node_modules/collection-visit/package.json | 33 | ||||
-rw-r--r-- | node_modules/collection-visit/utils.js | 19 |
5 files changed, 46 insertions, 62 deletions
diff --git a/node_modules/collection-visit/LICENSE b/node_modules/collection-visit/LICENSE index 652517172..ec85897eb 100644 --- a/node_modules/collection-visit/LICENSE +++ b/node_modules/collection-visit/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015-2016, Jon Schlinkert +Copyright (c) 2015, 2017, Jon Schlinkert Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/node_modules/collection-visit/README.md b/node_modules/collection-visit/README.md index e2cb02d7a..c4da3f182 100644 --- a/node_modules/collection-visit/README.md +++ b/node_modules/collection-visit/README.md @@ -1,6 +1,6 @@ -# collection-visit [](https://www.npmjs.com/package/collection-visit) [](https://npmjs.org/package/collection-visit) [](https://travis-ci.org/jonschlinkert/collection-visit) +# collection-visit [](https://www.npmjs.com/package/collection-visit) [](https://npmjs.org/package/collection-visit) [](https://npmjs.org/package/collection-visit) [](https://travis-ci.org/jonschlinkert/collection-visit) -Visit a method over the items in an object, or map visit over the objects in an array. +> Visit a method over the items in an object, or map visit over the objects in an array. ## Install @@ -47,22 +47,29 @@ console.log(ctx.data); Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). +### Contributors + +| **Commits** | **Contributor** | +| --- | --- | +| 13 | [jonschlinkert](https://github.com/jonschlinkert) | +| 9 | [doowb](https://github.com/doowb) | + ### Building docs -_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ +_(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.)_ -To generate the readme and API documentation with [verb](https://github.com/verbose/verb): +To generate the readme, run the following command: ```sh -$ npm install -g verb verb-generate-readme && verb +$ npm install -g verbose/verb#dev verb-generate-readme && verb ``` ### Running tests -Install dev dependencies: +Running 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: ```sh -$ npm install -d && npm test +$ npm install && npm test ``` ### Author @@ -70,13 +77,13 @@ $ npm install -d && npm test **Jon Schlinkert** * [github/jonschlinkert](https://github.com/jonschlinkert) -* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) +* [twitter/jonschlinkert](https://twitter.com/jonschlinkert) ### License -Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). -Released under the [MIT license](https://github.com/jonschlinkert/collection-visit/blob/master/LICENSE). +Copyright © 2017, [Jon Schlinkert](https://github.com/jonschlinkert). +Released under the [MIT License](LICENSE). *** -_This file was generated by [verb](https://github.com/verbose/verb), v0.9.0, on August 05, 2016._
\ No newline at end of file +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.5.0, on April 09, 2017._
\ No newline at end of file diff --git a/node_modules/collection-visit/index.js b/node_modules/collection-visit/index.js index a431d5189..d1977ab22 100644 --- a/node_modules/collection-visit/index.js +++ b/node_modules/collection-visit/index.js @@ -1,33 +1,30 @@ /*! * collection-visit <https://github.com/jonschlinkert/collection-visit> * - * Copyright (c) 2015, Jon Schlinkert. - * Licensed under the MIT License. + * Copyright (c) 2015, 2017, Jon Schlinkert. + * Released under the MIT License. */ 'use strict'; -var utils = require('./utils'); +var visit = require('object-visit'); +var mapVisit = require('map-visit'); -function collectionVisit(collection, method, val) { +module.exports = function(collection, method, val) { var result; if (typeof val === 'string' && (method in collection)) { - result = collection[method](val); + var args = [].slice.call(arguments, 2); + result = collection[method].apply(collection, args); } else if (Array.isArray(val)) { - result = utils.mapVisit(collection, method, val); + result = mapVisit.apply(null, arguments); } else { - result = utils.visit(collection, method, val); + result = visit.apply(null, arguments); } if (typeof result !== 'undefined') { return result; } - return collection; -} - -/** - * Expose `collectionVisit` - */ -module.exports = collectionVisit; + return collection; +}; diff --git a/node_modules/collection-visit/package.json b/node_modules/collection-visit/package.json index b5936d43c..63697bc08 100644 --- a/node_modules/collection-visit/package.json +++ b/node_modules/collection-visit/package.json @@ -1,17 +1,20 @@ { "name": "collection-visit", "description": "Visit a method over the items in an object, or map visit over the objects in an array.", - "version": "0.2.3", + "version": "1.0.0", "homepage": "https://github.com/jonschlinkert/collection-visit", "author": "Jon Schlinkert (https://github.com/jonschlinkert)", + "contributors": [ + "Brian Woodward <brian.woodward@gmail.com> (https://twitter.com/doowb)", + "Jon Schlinkert <jon.schlinkert@sellside.com> (http://twitter.com/jonschlinkert)" + ], "repository": "jonschlinkert/collection-visit", "bugs": { "url": "https://github.com/jonschlinkert/collection-visit/issues" }, "license": "MIT", "files": [ - "index.js", - "utils.js" + "index.js" ], "main": "index.js", "engines": { @@ -21,22 +24,22 @@ "test": "mocha" }, "dependencies": { - "lazy-cache": "^2.0.1", - "map-visit": "^0.1.5", - "object-visit": "^0.3.4" + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" }, "devDependencies": { + "clone-deep": "^0.2.4", "gulp": "^3.9.1", "gulp-eslint": "^3.0.1", - "gulp-format-md": "^0.1.10", - "gulp-istanbul": "^1.0.0", + "gulp-format-md": "^0.1.12", + "gulp-istanbul": "^1.1.1", "gulp-mocha": "^3.0.0", - "mocha": "^3.0.1", - "should": "^10.0.0" + "mocha": "^3.2.0" }, "keywords": [ "array", "arrays", + "collection", "context", "function", "helper", @@ -54,8 +57,8 @@ "related": { "list": [ "base-methods", - "object-visit", - "map-visit" + "map-visit", + "object-visit" ] }, "toc": false, @@ -68,10 +71,6 @@ ], "lint": { "reflinks": true - }, - "reflinks": [ - "verb", - "verb-generate-readme" - ] + } } } diff --git a/node_modules/collection-visit/utils.js b/node_modules/collection-visit/utils.js deleted file mode 100644 index f619e898a..000000000 --- a/node_modules/collection-visit/utils.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -/** - * Lazily required module dependencies - */ - -var utils = require('lazy-cache')(require); -var fn = require; - -require = utils; // trick browserify so we can lazy-cache -require('map-visit'); -require('object-visit', 'visit'); -require = fn; - -/** - * Expose `utils` - */ - -module.exports = utils; |