to-function
Advanced tools
Comparing version 0.0.1 to 1.0.0
@@ -5,3 +5,3 @@ { | ||
"description": "Convert property access strings into functions", | ||
"version": "0.0.1", | ||
"version": "1.0.0", | ||
"keywords": ["utility"], | ||
@@ -8,0 +8,0 @@ "dependencies": {}, |
@@ -11,2 +11,4 @@ | ||
* | ||
* TODO: consider compiling to functions. | ||
* | ||
* @param {Mixed} obj | ||
@@ -41,3 +43,8 @@ * @return {Function} | ||
if (null == obj) return; | ||
obj = obj[props[i]]; | ||
var name = props[i]; | ||
if ('function' == typeof obj[name]) { | ||
obj = obj[name](); | ||
} else { | ||
obj = obj[name]; | ||
} | ||
} | ||
@@ -44,0 +51,0 @@ return obj; |
@@ -5,6 +5,9 @@ { | ||
"description": "Convert property access strings into functions", | ||
"version": "0.0.1", | ||
"version": "1.0.0", | ||
"keywords": ["utility"], | ||
"dependencies": {}, | ||
"development": {}, | ||
"devDependencies": { | ||
"mocha": "*", | ||
"should": "*" | ||
}, | ||
"component": { | ||
@@ -11,0 +14,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
3056
8
82
1
2