Comparing version 1.0.0 to 2.0.0
@@ -1,2 +0,2 @@ | ||
module.exports = function (obj) { | ||
module.exports = (Object.assign) ? Object.assign : function (obj) { | ||
Array.prototype.slice.call(arguments, 1).forEach(function (ext) { | ||
@@ -8,2 +8,2 @@ if (ext) Object.keys(ext).forEach(function (key) { | ||
return obj; | ||
}; | ||
}; |
{ | ||
"name": "xok", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "Extend an object with the \"has own property\"'s of other object(s)", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
# xok | ||
--- | ||
The name is short for extend-object-ownkeys; hat tip to @henrikjoreteg for ['extend-object'](https://www.npmjs.org/package/extend-object) which does pretty much the same thing as this, but uses `for … in` to match Underscore.js instead of `Object.keys` to match ???. See also ['extend'](https://www.npmjs.org/package/extend) if you want all the $.extend features. | ||
**NOTE**: as it turns out, this library very closely matched the behavior of the new `Object.assign` builtin! ([MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)) | ||
To celebrate, I've updated it to simply use the builtin implementation when available. So you can use this as a quasi-polyfill for `Object.assign` if you'd like, or just use `Object.assign` | ||
Main differences: | ||
- `xok` doesn't check or convert its `target` to an object like `Object.assign` does | ||
- `xok` has a slightly different check for the validity of subsequent arguments | ||
--- | ||
Simply extend an object with the keys from others. | ||
The name is short for extend-object-ownkeys; hat tip to [@henrikjoreteg](https://twitter.com/henrikjoreteg) for ['extend-object'](https://www.npmjs.org/package/extend-object) which does pretty much the same thing as this, but uses `for … in` to match Underscore.js instead of `Object.keys` to match ???. See also ['extend'](https://www.npmjs.org/package/extend) if you want all the $.extend features. | ||
## Example | ||
@@ -8,0 +22,0 @@ |
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
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
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
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
4598
32
57