class-utils
Advanced tools
Comparing version 0.2.3 to 0.3.0
14
index.js
@@ -331,2 +331,3 @@ 'use strict'; | ||
* @param {Function} `Parent` Parent ctor | ||
* @param {Function} `extend` Optional extend function to handle custom extensions. Useful when updating methods that require a specific prototype. | ||
* @param {Function} `Child` Child ctor | ||
@@ -338,3 +339,3 @@ * @param {Object} `proto` Optionally pass additional prototype properties to inherit. | ||
cu.extend = function extend(Parent) { | ||
cu.extend = function extend(Parent, extend) { | ||
if (typeof Parent !== 'function') { | ||
@@ -363,11 +364,8 @@ throw new TypeError('expected Parent to be a function.'); | ||
Ctor.prototype.mixin = function(key, value) { | ||
Ctor.prototype[key] = value; | ||
}; | ||
if (typeof extend === 'function') { | ||
extend(Ctor, Parent); | ||
} | ||
Ctor.extend = cu.extend(Ctor); | ||
if (Parent.inherit) { | ||
Ctor.inherit = Parent.inherit; | ||
} | ||
Ctor.extend = cu.extend(Ctor, extend); | ||
}; | ||
}; |
{ | ||
"name": "class-utils", | ||
"description": "Utils for working with JavaScript classes and prototype methods.", | ||
"version": "0.2.3", | ||
"version": "0.3.0", | ||
"homepage": "https://github.com/jonschlinkert/class-utils", | ||
@@ -6,0 +6,0 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16370
340
1