Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

map-visit

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

map-visit - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

14

index.js

@@ -8,11 +8,15 @@ 'use strict';

*
* @param {Object} `thisArg` The context in which to invoke `method`
* @param {String} `method` Name of the method to call on `thisArg`
* @param {Object} `collection` The context in which to invoke `method`
* @param {String} `method` Name of the method to call on `collection`
* @param {Object} `arr` Array of objects.
*/
module.exports = function mapVisit(thisArg, method, arr) {
arr.forEach(function (obj) {
visit(thisArg, method, obj);
module.exports = function mapVisit(collection, method, arr) {
arr.forEach(function (val) {
if (typeof val === 'string') {
collection[method](val);
} else {
visit(collection, method, val);
}
});
};
{
"name": "map-visit",
"description": "Map `visit` over an array of objects.",
"version": "0.1.0",
"version": "0.1.1",
"homepage": "https://github.com/jonschlinkert/map-visit",

@@ -44,3 +44,11 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",

"visitor"
]
],
"verbiage": {
"related": {
"list": [
"collection-visit",
"object-visit"
]
}
}
}

@@ -55,3 +55,3 @@ # map-visit [![NPM version](https://badge.fury.io/js/map-visit.svg)](http://badge.fury.io/js/map-visit)

The above approach works fine, let's say you also want to emit an event each time a property is added to the `data` object. A better approach would be to use `visit`.
The above approach works fine for most use cases. But **if you also want to emit an event** each time a property is added to the `data` object. A better approach would be to use `visit`.

@@ -101,8 +101,4 @@ **Example using `visit`**

* [assign-deep](https://github.com/jonschlinkert/assign-deep): Deeply assign the enumerable properties of source objects to a destination object.
* [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util.
* [get-value](https://github.com/jonschlinkert/get-value): Use property paths (` a.b.c`) to get a nested value from an object.
* [has-value](https://github.com/jonschlinkert/has-value): Returns true if a value exists, false if empty. Works with deeply nested values using… [more](https://github.com/jonschlinkert/has-value)
* [collection-visit](https://github.com/jonschlinkert/collection-visit): Visit a method over the items in an object, or map visit over the objects… [more](https://github.com/jonschlinkert/collection-visit)
* [object-visit](https://github.com/jonschlinkert/object-visit): Call the given method on each value in the given object.
* [set-value](https://github.com/jonschlinkert/set-value): Create nested values and any intermediaries using dot notation (`'a.b.c'`) paths.

@@ -135,2 +131,2 @@ ## Running tests

_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on July 04, 2015._
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on August 07, 2015._
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc