custom-ability
Advanced tools
Comparing version
@@ -14,7 +14,8 @@ (function() { | ||
module.exports = function(AbilityClass, aCoreMethod, isGetClassFunc) { | ||
module.exports = function(abilityClass, aCoreMethod, isGetClassFunc) { | ||
return function(aClass, aOptions) { | ||
var filter, vExcludes, vIncludes; | ||
var AbilityClass, filter, vExcludes, vIncludes; | ||
AbilityClass = abilityClass; | ||
if (isGetClassFunc === true) { | ||
AbilityClass = AbilityClass(aClass, aOptions); | ||
AbilityClass = abilityClass(aClass, aOptions); | ||
} | ||
@@ -21,0 +22,0 @@ if (aClass == null) { |
{ | ||
"name": "custom-ability", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "make custom ability more easy. generate the ability which can be added to any class directly.", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/snowyu/custom-ability.js", |
@@ -15,9 +15,11 @@ ### custom-ability [](http://travis-ci.org/snowyu/custom-ability.js) [](https://npmjs.org/package/custom-ability) [](https://npmjs.org/package/custom-ability) [](https://npmjs.org/package/custom-ability) | ||
* customAbility(AbilityClass, coreMethod) | ||
* customAbility(abilityClass, coreMethod[, isGetClassFunction]) | ||
__arguments__ | ||
* AbilityClass *(function)*: make the class become to ability. | ||
* abilityClass *(function)*: the class will become to ability able. | ||
* coreMethod *(string)*: the core instance method name to identify this ability. | ||
* it's the key to avoid duplication injection. | ||
* isGetClassFunction *(boolean)*: the `AbilityClass` is a `function(aClass, aOptions)` | ||
to return the real `Ability Class` if true. defaults to false. | ||
@@ -24,0 +26,0 @@ __return__ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
17588
5.16%74
1.37%116
1.75%