租房小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.9 KiB

3 months ago
  1. # extend-shallow [![NPM version](https://badge.fury.io/js/extend-shallow.svg)](http://badge.fury.io/js/extend-shallow) [![Build Status](https://travis-ci.org/jonschlinkert/extend-shallow.svg)](https://travis-ci.org/jonschlinkert/extend-shallow)
  2. > Extend an object with the properties of additional objects. node.js/javascript util.
  3. ## Install
  4. Install with [npm](https://www.npmjs.com/)
  5. ```sh
  6. $ npm i extend-shallow --save
  7. ```
  8. ## Usage
  9. ```js
  10. var extend = require('extend-shallow');
  11. extend({a: 'b'}, {c: 'd'})
  12. //=> {a: 'b', c: 'd'}
  13. ```
  14. Pass an empty object to shallow clone:
  15. ```js
  16. var obj = {};
  17. extend(obj, {a: 'b'}, {c: 'd'})
  18. //=> {a: 'b', c: 'd'}
  19. ```
  20. ## Related
  21. * [extend-shallow](https://github.com/jonschlinkert/extend-shallow): Extend an object with the properties of additional objects. node.js/javascript util.
  22. * [for-own](https://github.com/jonschlinkert/for-own): Iterate over the own enumerable properties of an object, and return an object with properties… [more](https://github.com/jonschlinkert/for-own)
  23. * [for-in](https://github.com/jonschlinkert/for-in): Iterate over the own and inherited enumerable properties of an objecte, and return an object… [more](https://github.com/jonschlinkert/for-in)
  24. * [is-plain-object](https://github.com/jonschlinkert/is-plain-object): Returns true if an object was created by the `Object` constructor.
  25. * [isobject](https://github.com/jonschlinkert/isobject): Returns true if the value is an object and not an array or null.
  26. * [kind-of](https://github.com/jonschlinkert/kind-of): Get the native type of a value.
  27. ## Running tests
  28. Install dev dependencies:
  29. ```sh
  30. $ npm i -d && npm test
  31. ```
  32. ## Author
  33. **Jon Schlinkert**
  34. + [github/jonschlinkert](https://github.com/jonschlinkert)
  35. + [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
  36. ## License
  37. Copyright © 2015 Jon Schlinkert
  38. Released under the MIT license.
  39. ***
  40. _This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on June 29, 2015._