Comparing version 0.0.5 to 0.0.6
@@ -19,48 +19,48 @@ | ||
var Koalas = function() { | ||
this.args = slice.call(arguments); | ||
this.funcs = []; | ||
this.funcs.push(noop); | ||
this.args = slice.call(arguments); | ||
this.funcs = []; | ||
this.funcs.push(noop); | ||
}; | ||
var koalas = module.exports = function() { | ||
return create([ Koalas ].concat(slice.call(arguments))); | ||
return create([ Koalas ].concat(slice.call(arguments))); | ||
}; | ||
koalas.coalesce = function() { | ||
var args = slice.call(arguments); | ||
for (var i = 0; i < args.length; i++) { | ||
var arg = args[i]; | ||
if (typeof arg !== 'undefined' && arg !== null) { | ||
return arg; | ||
} | ||
} | ||
return null; | ||
var args = slice.call(arguments); | ||
for (var i = 0; i < args.length; i++) { | ||
var arg = args[i]; | ||
if (typeof arg !== 'undefined' && arg !== null) { | ||
return arg; | ||
} | ||
} | ||
return null; | ||
}; | ||
Koalas.prototype.use = function (func) { | ||
this.funcs.push(func); | ||
return this; | ||
this.funcs.push(func); | ||
return this; | ||
}; | ||
Koalas.prototype.process = function(value) { | ||
var ret = value; | ||
for (var i = 0; i < this.funcs.length; i++) { | ||
ret = this.funcs[i](ret); | ||
if (typeof ret === 'undefined' || ret === null) { | ||
break; | ||
} | ||
} | ||
return ret; | ||
var ret = value; | ||
for (var i = 0; i < this.funcs.length; i++) { | ||
ret = this.funcs[i](ret); | ||
if (typeof ret === 'undefined' || ret === null) { | ||
break; | ||
} | ||
} | ||
return ret; | ||
}; | ||
Koalas.prototype.value = function() { | ||
var ret = null; | ||
for (var i = 0; i < this.args.length; i++) { | ||
var arg = this.process(this.args[i]); | ||
if (typeof arg !== 'undefined' && arg !== null) { | ||
ret = arg; | ||
break; | ||
} | ||
} | ||
return ret; | ||
}; | ||
var ret = null; | ||
for (var i = 0; i < this.args.length; i++) { | ||
var arg = this.process(this.args[i]); | ||
if (typeof arg !== 'undefined' && arg !== null) { | ||
ret = arg; | ||
break; | ||
} | ||
} | ||
return ret; | ||
}; |
{ | ||
"name": "koalas", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "Koalas is a library for doing a coalesce in JavaScript", | ||
@@ -32,5 +32,4 @@ "main": "index.js", | ||
"grunt-contrib-jshint": "~0.7.0", | ||
"verb": "~0.1.22", | ||
"grunt-verb": "0.0.5" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16193
7
228