Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

koalas

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koalas - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

64

lib/koalas.js

@@ -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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc