pax_global_header00006660000000000000000000000064131603317270014515gustar00rootroot0000000000000052 comment=680a65305312a990751fd32b83bd2c12d67809d4 utils-merge-1.0.1/000077500000000000000000000000001316033172700137515ustar00rootroot00000000000000utils-merge-1.0.1/.gitignore000066400000000000000000000001131316033172700157340ustar00rootroot00000000000000docs/ reports/ # Mac OS X .DS_Store # Node.js node_modules npm-debug.log utils-merge-1.0.1/.jshintrc000066400000000000000000000004531316033172700156000ustar00rootroot00000000000000{ "node": true, "bitwise": true, "camelcase": true, "curly": true, "forin": true, "immed": true, "latedef": true, "newcap": true, "noarg": true, "noempty": true, "nonew": true, "quotmark": "single", "undef": true, "unused": true, "trailing": true, "laxcomma": true } utils-merge-1.0.1/.npmignore000066400000000000000000000001171316033172700157470ustar00rootroot00000000000000CONTRIBUTING.md Makefile docs/ examples/ reports/ test/ .jshintrc .travis.yml utils-merge-1.0.1/.travis.yml000066400000000000000000000004641316033172700160660ustar00rootroot00000000000000language: "node_js" node_js: - "8" - "7" - "6" - "5" - "4" - "3" # io.js - "2" # io.js - "1" # io.js - "0.12" - "0.10" - "0.8" before_install: - "npm install make-node@0.3.x -g" - "preinstall-compat" script: - "make test-cov" after_success: - "make report-cov" sudo: false utils-merge-1.0.1/CONTRIBUTING.md000066400000000000000000000006141316033172700162030ustar00rootroot00000000000000## Contributing ### Tests The test suite is located in the `test/` directory. All new features are expected to have corresponding test cases with complete code coverage. Patches that increse test coverage are happily accepted. Ensure that the test suite passes by executing: ```bash $ make test ``` Coverage reports can be viewed by executing: ```bash $ make test-cov $ make view-cov ``` utils-merge-1.0.1/LICENSE000066400000000000000000000020741316033172700147610ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) 2013-2017 Jared Hanson 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. utils-merge-1.0.1/Makefile000066400000000000000000000006301316033172700154100ustar00rootroot00000000000000include node_modules/make-node/main.mk SOURCES = lib/*.js lib/**/*.js TESTS = test/*.test.js test/**/*.test.js LCOVFILE = ./reports/coverage/lcov.info MOCHAFLAGS = --require ./test/bootstrap/node view-docs: open ./docs/index.html view-cov: open ./reports/coverage/lcov-report/index.html clean: clean-docs clean-cov -rm -r $(REPORTSDIR) clobber: clean -rm -r node_modules .PHONY: clean clobber utils-merge-1.0.1/README.md000066400000000000000000000024471316033172700152370ustar00rootroot00000000000000# utils-merge [![Version](https://img.shields.io/npm/v/utils-merge.svg?label=version)](https://www.npmjs.com/package/utils-merge) [![Build](https://img.shields.io/travis/jaredhanson/utils-merge.svg)](https://travis-ci.org/jaredhanson/utils-merge) [![Quality](https://img.shields.io/codeclimate/github/jaredhanson/utils-merge.svg?label=quality)](https://codeclimate.com/github/jaredhanson/utils-merge) [![Coverage](https://img.shields.io/coveralls/jaredhanson/utils-merge.svg)](https://coveralls.io/r/jaredhanson/utils-merge) [![Dependencies](https://img.shields.io/david/jaredhanson/utils-merge.svg)](https://david-dm.org/jaredhanson/utils-merge) Merges the properties from a source object into a destination object. ## Install ```bash $ npm install utils-merge ``` ## Usage ```javascript var a = { foo: 'bar' } , b = { bar: 'baz' }; merge(a, b); // => { foo: 'bar', bar: 'baz' } ``` ## License [The MIT License](http://opensource.org/licenses/MIT) Copyright (c) 2013-2017 Jared Hanson <[http://jaredhanson.net/](http://jaredhanson.net/)> Sponsor utils-merge-1.0.1/index.js000066400000000000000000000005751316033172700154250ustar00rootroot00000000000000/** * Merge object b with object a. * * var a = { foo: 'bar' } * , b = { bar: 'baz' }; * * merge(a, b); * // => { foo: 'bar', bar: 'baz' } * * @param {Object} a * @param {Object} b * @return {Object} * @api public */ exports = module.exports = function(a, b){ if (a && b) { for (var key in b) { a[key] = b[key]; } } return a; }; utils-merge-1.0.1/package.json000066400000000000000000000015311316033172700162370ustar00rootroot00000000000000{ "name": "utils-merge", "version": "1.0.1", "description": "merge() utility function", "keywords": [ "util" ], "author": { "name": "Jared Hanson", "email": "jaredhanson@gmail.com", "url": "http://www.jaredhanson.net/" }, "repository": { "type": "git", "url": "git://github.com/jaredhanson/utils-merge.git" }, "bugs": { "url": "http://github.com/jaredhanson/utils-merge/issues" }, "license": "MIT", "licenses": [ { "type": "MIT", "url": "http://opensource.org/licenses/MIT" } ], "main": "./index", "dependencies": {}, "devDependencies": { "make-node": "0.3.x", "mocha": "1.x.x", "chai": "1.x.x" }, "engines": { "node": ">= 0.4.0" }, "scripts": { "test": "node_modules/.bin/mocha --reporter spec --require test/bootstrap/node test/*.test.js" } } utils-merge-1.0.1/test/000077500000000000000000000000001316033172700147305ustar00rootroot00000000000000utils-merge-1.0.1/test/bootstrap/000077500000000000000000000000001316033172700167455ustar00rootroot00000000000000utils-merge-1.0.1/test/bootstrap/node.js000066400000000000000000000000721316033172700202270ustar00rootroot00000000000000var chai = require('chai'); global.expect = chai.expect; utils-merge-1.0.1/test/bootstrap/testling.js000066400000000000000000000000721316033172700211330ustar00rootroot00000000000000var chai = require('chai'); window.expect = chai.expect; utils-merge-1.0.1/test/index.test.js000066400000000000000000000024651316033172700173620ustar00rootroot00000000000000var merge = require('../index'); describe('merge', function() { describe('an object', function() { var a = { foo: 'bar' } , b = { bar: 'baz' }; var o = merge(a, b); it('should merge properties into first object', function() { expect(Object.keys(a)).to.have.length(2); expect(a.foo).to.be.equal('bar'); expect(a.bar).to.be.equal('baz'); }); it('should return first argument', function() { expect(o).to.be.equal(a); }); }); describe('an object with duplicate key', function() { var a = { foo: 'bar', qux: 'corge' } , b = { foo: 'baz' }; var o = merge(a, b); it('should merge properties into first object', function() { expect(Object.keys(a)).to.have.length(2); expect(a.foo).to.be.equal('baz'); expect(a.qux).to.be.equal('corge'); }); it('should return first argument', function() { expect(o).to.be.equal(a); }); }); describe('without a source object', function() { var a = { foo: 'bar' }; var o = merge(a); it('should leave first object unmodified', function() { expect(Object.keys(a)).to.have.length(1); expect(a.foo).to.be.equal('bar'); }); it('should return first argument', function() { expect(o).to.be.equal(a); }); }); }); utils-merge-1.0.1/test/module.test.js000066400000000000000000000002541316033172700175320ustar00rootroot00000000000000var merge = require('../index'); describe('utils-merge', function() { it('should export function', function() { expect(merge).to.be.a('function'); }); });