smart-mixin
Advanced tools
Comparing version 1.0.0 to 1.0.2
@@ -42,3 +42,3 @@ var objToStr = function(x){ return Object.prototype.toString.call(x); }; | ||
: function(){ | ||
thing.call(this, arguments, thrower); | ||
return thing.call(this, arguments, thrower); | ||
}; | ||
@@ -45,0 +45,0 @@ }; |
{ | ||
"name": "smart-mixin", | ||
"version": "1.0.0", | ||
"version": "1.0.2", | ||
"description": "", | ||
@@ -18,2 +18,3 @@ "main": "index.js", | ||
"devDependencies": { | ||
"6to5ify": "^4.0.0", | ||
"expect.js": "^0.3.1", | ||
@@ -20,0 +21,0 @@ "mocha": "^2.1.0", |
@@ -1,2 +0,2 @@ | ||
# smart-mixin | ||
![travis](https://travis-ci.org/brigand/smart-mixin.svg) | ||
@@ -21,3 +21,3 @@ Mixins with smart merging strategies and errors over silent failure. | ||
// define a mixin behavior | ||
var mixIntoGameObject = ({ | ||
var mixIntoGameObject = mixins({ | ||
// this can only be defined once, will throw otherwise | ||
@@ -53,3 +53,3 @@ render: mixins.ONCE, | ||
countChickens: mixins.REDUCE_LEFT, | ||
countDucks: mixins.REDUCE_RIGHT | ||
countDucks: mixins.REDUCE_RIGHT, | ||
@@ -105,3 +105,3 @@ // define your own handler for it | ||
class Duck(){ | ||
class Duck { | ||
render(){ | ||
@@ -118,2 +118,5 @@ console.log(this.getState(5)); // {baz: 4, bar: 6} | ||
mixIntoGameObject(Duck.prototype, mixin); | ||
// use it | ||
new Duck().render(); | ||
``` | ||
@@ -124,3 +127,3 @@ | ||
Nothing too crazy, this was mostly built for use in react-class-mixins, but hopefully | ||
is useful to other people. It's fully tested and ready for production use in node and the browser. | ||
is useful to other people. I'll be adding more test coverage (the mixin.FN apis are fully tested, but not the actual mixin function). Any bug reports will be fixed ASAP. | ||
@@ -127,0 +130,0 @@ # License |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
23531
9
441
128
4
3
1