Socket
Socket
Sign inDemoInstall

object-visit

Package Overview
Dependencies
2
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.1 to 0.3.0

15

index.js

@@ -11,10 +11,15 @@ /*!

var isObject = require('isobject');
var expected - require('expected');
module.exports = function visit(thisArg, method, target) {
if (!isObject(thisArg) && typeof thisArg !== 'function') {
throw new Error('object-visit expects `thisArg` to be an object.');
expected(thisArg).to.be.an('object');
}
if (!isObject(target) && typeof target !== 'function') {
expected(target).to.be.an('object');
}
if (typeof method !== 'string') {
throw new Error('object-visit expects `method` name to be a string');
expected(method).to.be.a('string');
}

@@ -24,5 +29,9 @@

for (var key in target) {
thisArg[method](key, target[key]);
var fn = thisArg[method];
if (typeof fn !== 'function') {
expected(fn).to.be.a('function');
}
fn(key, target[key]);
}
return thisArg;
};

4

package.json
{
"name": "object-visit",
"description": "Call the given method on each value in the given object.",
"version": "0.2.1",
"version": "0.3.0",
"homepage": "https://github.com/jonschlinkert/object-visit",

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

"dependencies": {
"expected": "^0.1.0",
"isobject": "^1.0.0"

@@ -44,2 +45,3 @@ },

"list": [
"base-methods",
"collection-visit",

@@ -46,0 +48,0 @@ "map-visit"

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

* [base-methods](https://www.npmjs.com/package/base-methods): Starter for creating a node.js application with a handful of common methods, like `set`, `get`,… [more](https://www.npmjs.com/package/base-methods) | [homepage](https://github.com/jonschlinkert/base-methods)
* [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://www.npmjs.com/package/collection-visit) | [homepage](https://github.com/jonschlinkert/collection-visit)

@@ -70,2 +71,2 @@ * [map-visit](https://www.npmjs.com/package/map-visit): Map `visit` over an array of objects. | [homepage](https://github.com/jonschlinkert/map-visit)

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

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc