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

xok

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xok - npm Package Compare versions

Comparing version 1.0.0 to 2.0.0

LICENSE

4

index.js

@@ -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 @@

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