class-utils
Advanced tools
Comparing version 0.2.0 to 0.2.1
19
index.js
'use strict'; | ||
var util = require('util'); | ||
var define = require('define-property'); | ||
var isObj = require('isobject'); | ||
var utils = require('./utils'); | ||
/** | ||
* Expose class utils | ||
*/ | ||
var cu = module.exports; | ||
/** | ||
* Expose class utils: `cu` | ||
*/ | ||
var cu = exports = module.exports; | ||
cu.isObject = function isObject(val) { | ||
return isObj(val) || typeof val === 'function'; | ||
return utils.isObj(val) || typeof val === 'function'; | ||
}; | ||
@@ -112,3 +115,3 @@ | ||
cu.arrayify = function arrayify(val) { | ||
return val ? (Array.isArray(val) ? val : [val]) : [] | ||
return val ? (Array.isArray(val) ? val : [val]) : []; | ||
}; | ||
@@ -242,3 +245,3 @@ | ||
var val = cu.getDescriptor(provider, name); | ||
if (val) define(receiver, name, val); | ||
if (val) utils.define(receiver, name, val); | ||
}; | ||
@@ -274,3 +277,3 @@ | ||
if (cu.has(keys, key)) { | ||
define(receiver, key, provider[key]); | ||
utils.define(receiver, key, provider[key]); | ||
} else if (!(key in receiver) && !cu.has(omit, key)) { | ||
@@ -277,0 +280,0 @@ cu.copyDescriptor(receiver, provider, key); |
{ | ||
"name": "class-utils", | ||
"description": "Utils for working with JavaScript classes and prototype methods.", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"homepage": "https://github.com/jonschlinkert/class-utils", | ||
@@ -13,3 +13,4 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"files": [ | ||
"index.js" | ||
"index.js", | ||
"utils.js" | ||
], | ||
@@ -25,3 +26,4 @@ "main": "index.js", | ||
"define-property": "^0.2.5", | ||
"isobject": "^2.0.0" | ||
"isobject": "^2.0.0", | ||
"lazy-cache": "^0.2.3" | ||
}, | ||
@@ -28,0 +30,0 @@ "devDependencies": { |
@@ -36,3 +36,3 @@ # class-utils [![NPM version](https://badge.fury.io/js/class-utils.svg)](http://badge.fury.io/js/class-utils) | ||
### [.has](index.js#L37) | ||
### [.has](index.js#L40) | ||
@@ -60,3 +60,3 @@ Returns true if an array has any of the given elements, or an object has any of the give keys. | ||
### [.hasAll](index.js#L84) | ||
### [.hasAll](index.js#L87) | ||
@@ -84,3 +84,3 @@ Returns true if an array or object has all of the given values. | ||
### [.arrayify](index.js#L111) | ||
### [.arrayify](index.js#L114) | ||
@@ -104,3 +104,3 @@ Cast the given value to an array. | ||
### [.hasConstructor](index.js#L146) | ||
### [.hasConstructor](index.js#L149) | ||
@@ -124,3 +124,3 @@ Returns true if a value has a `contructor` | ||
### [.nativeKeys](index.js#L168) | ||
### [.nativeKeys](index.js#L171) | ||
@@ -144,3 +144,3 @@ Get the native `ownPropertyNames` from the constructor of the given `object`. An empty array is returned if the object does not have a constructor. | ||
### [.getDescriptor](index.js#L200) | ||
### [.getDescriptor](index.js#L203) | ||
@@ -174,3 +174,3 @@ Returns property descriptor `key` if it's an "own" property of the given object. | ||
### [.copyDescriptor](index.js#L230) | ||
### [.copyDescriptor](index.js#L233) | ||
@@ -199,3 +199,3 @@ Copy a descriptor from one object to another. | ||
### [.copy](index.js#L255) | ||
### [.copy](index.js#L258) | ||
@@ -212,3 +212,3 @@ Copy static properties, prototype properties, and descriptors | ||
### [.inherit](index.js#L290) | ||
### [.inherit](index.js#L293) | ||
@@ -225,3 +225,3 @@ Inherit the static properties, prototype properties, and descriptors | ||
### [.extend](index.js#L333) | ||
### [.extend](index.js#L336) | ||
@@ -282,2 +282,2 @@ Returns a function for extending the static properties, prototype properties, and descriptors from the `Parent` constructor onto `Child` constructors. | ||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 01, 2015._ | ||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 04, 2015._ |
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
16210
5
339
3
272
1
+ Addedlazy-cache@^0.2.3
+ Addedlazy-cache@0.2.7(transitive)