Comparing version 0.1.1 to 0.1.2
@@ -13,3 +13,3 @@ 'use strict'; | ||
or = or || or === undefined; | ||
or = or || arguments.length === 2; | ||
@@ -16,0 +16,0 @@ if (cl && (len = cl.length)) { |
{ | ||
"name": "mix2", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "The YUI mix", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -14,8 +14,25 @@ # mix2 [](http://badge.fury.io/js/mix2) [](https://travis-ci.org/kaelzhang/node-mix2) [](https://gemnasium.com/kaelzhang/node-mix2) | ||
```js | ||
var mix2 = require('mix2'); | ||
var mix = require('mix2'); | ||
var a = {a: 1}; | ||
var b = {b: 2}; | ||
var c = {a: 10, b: 20, c: 30} | ||
mix(a, b); | ||
a; // {a: 1, b: 2} | ||
mix({a: 1}, c, false); // {a: 1, b: 20, c: 30} | ||
mix({a: 1}, c, true, ['a', 'c']); // {a: 10, c: 30} | ||
``` | ||
## Licence | ||
### mix(receiver, supplier, override, copylist) | ||
- receiver `Object` | ||
- supplier `Object` | ||
- override `Boolean=true` Whether should override the existing property of `receiver`. Default to overriding | ||
- copylist `(Array.<String>)=` If specified, only mix the specific keys in the array. | ||
Extend the object `receiver` with `supplier`, and returns `receiver`. | ||
## License | ||
MIT | ||
<!-- do not want to make nodeinit to complicated, you can edit this whenever you want. --> |
3850
37