pax_global_header00006660000000000000000000000064135106432500014511gustar00rootroot0000000000000052 comment=37816c0e2e25da2901d584442235946d5cd8c80d xtend-4.0.2/000077500000000000000000000000001351064325000126365ustar00rootroot00000000000000xtend-4.0.2/.gitignore000066400000000000000000000000151351064325000146220ustar00rootroot00000000000000node_modules xtend-4.0.2/.jshintrc000066400000000000000000000010411351064325000144570ustar00rootroot00000000000000{ "maxdepth": 4, "maxstatements": 200, "maxcomplexity": 12, "maxlen": 80, "maxparams": 5, "curly": true, "eqeqeq": true, "immed": true, "latedef": false, "noarg": true, "noempty": true, "nonew": true, "undef": true, "unused": "vars", "trailing": true, "quotmark": true, "expr": true, "asi": true, "browser": false, "esnext": true, "devel": false, "node": false, "nonstandard": false, "predef": ["require", "module", "__dirname", "__filename"] } xtend-4.0.2/LICENSE000066400000000000000000000020661351064325000136470ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) 2012-2014 Raynos. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. xtend-4.0.2/README.md000066400000000000000000000013261351064325000141170ustar00rootroot00000000000000# xtend [![browser support][3]][4] [![locked](http://badges.github.io/stability-badges/dist/locked.svg)](http://github.com/badges/stability-badges) Extend like a boss xtend is a basic utility library which allows you to extend an object by appending all of the properties from each object in a list. When there are identical properties, the right-most property takes precedence. ## Examples ```js var extend = require("xtend") // extend returns a new object. Does not mutate arguments var combination = extend({ a: "a", b: "c" }, { b: "b" }) // { a: "a", b: "b" } ``` ## Stability status: Locked ## MIT Licensed [3]: http://ci.testling.com/Raynos/xtend.png [4]: http://ci.testling.com/Raynos/xtend xtend-4.0.2/immutable.js000066400000000000000000000006001351064325000151470ustar00rootroot00000000000000module.exports = extend var hasOwnProperty = Object.prototype.hasOwnProperty; function extend() { var target = {} for (var i = 0; i < arguments.length; i++) { var source = arguments[i] for (var key in source) { if (hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target } xtend-4.0.2/mutable.js000066400000000000000000000005611351064325000146270ustar00rootroot00000000000000module.exports = extend var hasOwnProperty = Object.prototype.hasOwnProperty; function extend(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] for (var key in source) { if (hasOwnProperty.call(source, key)) { target[key] = source[key] } } } return target } xtend-4.0.2/package.json000066400000000000000000000020401351064325000151200ustar00rootroot00000000000000{ "name": "xtend", "version": "4.0.2", "description": "extend like a boss", "keywords": [ "extend", "merge", "options", "opts", "object", "array" ], "author": "Raynos ", "repository": "git://github.com/Raynos/xtend.git", "main": "immutable", "scripts": { "test": "node test" }, "dependencies": {}, "devDependencies": { "tape": "~1.1.0" }, "homepage": "https://github.com/Raynos/xtend", "contributors": [ { "name": "Jake Verbaten" }, { "name": "Matt Esch" } ], "bugs": { "url": "https://github.com/Raynos/xtend/issues", "email": "raynos2@gmail.com" }, "license": "MIT", "testling": { "files": "test.js", "browsers": [ "ie/7..latest", "firefox/16..latest", "firefox/nightly", "chrome/22..latest", "chrome/canary", "opera/12..latest", "opera/next", "safari/5.1..latest", "ipad/6.0..latest", "iphone/6.0..latest" ] }, "engines": { "node": ">=0.4" } } xtend-4.0.2/test.js000066400000000000000000000044031351064325000141540ustar00rootroot00000000000000var test = require("tape") var extend = require("./") var mutableExtend = require("./mutable") test("merge", function(assert) { var a = { a: "foo" } var b = { b: "bar" } assert.deepEqual(extend(a, b), { a: "foo", b: "bar" }) assert.end() }) test("replace", function(assert) { var a = { a: "foo" } var b = { a: "bar" } assert.deepEqual(extend(a, b), { a: "bar" }) assert.end() }) test("undefined", function(assert) { var a = { a: undefined } var b = { b: "foo" } assert.deepEqual(extend(a, b), { a: undefined, b: "foo" }) assert.deepEqual(extend(b, a), { a: undefined, b: "foo" }) assert.end() }) test("handle 0", function(assert) { var a = { a: "default" } var b = { a: 0 } assert.deepEqual(extend(a, b), { a: 0 }) assert.deepEqual(extend(b, a), { a: "default" }) assert.end() }) test("is immutable", function (assert) { var record = {} extend(record, { foo: "bar" }) assert.equal(record.foo, undefined) assert.end() }) test("null as argument", function (assert) { var a = { foo: "bar" } var b = null var c = void 0 assert.deepEqual(extend(b, a, c), { foo: "bar" }) assert.end() }) test("mutable", function (assert) { var a = { foo: "bar" } mutableExtend(a, { bar: "baz" }) assert.equal(a.bar, "baz") assert.end() }) test("null prototype", function(assert) { var a = { a: "foo" } var b = Object.create(null) b.b = "bar"; assert.deepEqual(extend(a, b), { a: "foo", b: "bar" }) assert.end() }) test("null prototype mutable", function (assert) { var a = { foo: "bar" } var b = Object.create(null) b.bar = "baz"; mutableExtend(a, b) assert.equal(a.bar, "baz") assert.end() }) test("prototype pollution", function (assert) { var a = {} var maliciousPayload = '{"__proto__":{"oops":"It works!"}}' assert.strictEqual(a.oops, undefined) extend({}, maliciousPayload) assert.strictEqual(a.oops, undefined) assert.end() }) test("prototype pollution mutable", function (assert) { var a = {} var maliciousPayload = '{"__proto__":{"oops":"It works!"}}' assert.strictEqual(a.oops, undefined) mutableExtend({}, maliciousPayload) assert.strictEqual(a.oops, undefined) assert.end() })