esfunctional
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -74,3 +74,3 @@ 'use strict'; | ||
.apply(object, args.concat(global.oknok(ok, nok))) | ||
)) | ||
)); | ||
}); | ||
@@ -149,3 +149,3 @@ | ||
let call = function(callback) { | ||
let call = function(callback, undef) { | ||
@@ -163,3 +163,3 @@ // jshint maxcomplexity: 8 | ||
v === undefined ? this : | ||
v === undefined ? (undef ? global.undefineda : this) : | ||
v === null ? global.nulla : | ||
@@ -188,5 +188,5 @@ v | ||
Object.prototype[global.then] = function(callback) { | ||
Object.prototype[global.then] = function(callback, undef) { | ||
if (this[global.syncFail]) return this; | ||
return call.call(this, callback); | ||
return call.call(this, callback, undef); | ||
}; | ||
@@ -213,5 +213,5 @@ | ||
Object.prototype[global.thens] = global.unbind((value, callback) => ( | ||
Object.prototype[global.thens] = global.unbind((value, callback, undef) => ( | ||
value[global.syncFail] ? value : | ||
(value) [global.then] (callback) [global.fail] ( | ||
(value) [global.then] (callback, undef) [global.fail] ( | ||
(err) => global.nok(err) [global.then] ((promise) => ( | ||
@@ -231,5 +231,5 @@ promise[global.syncFail] = true, | ||
Object.prototype[global.thena] = global.unbind((value, callback) => ( | ||
Object.prototype[global.thena] = global.unbind((value, callback, undef) => ( | ||
(value instanceof Promise) ? value.then(callback) : | ||
value [global.thens] (callback) | ||
value [global.thens] (callback, undef) | ||
)); | ||
@@ -245,3 +245,3 @@ | ||
Object.prototype[global.catcha] = global.unbind((value, callback) => ( | ||
(value instanceof Promise) ? value.catch(callback) : | ||
(value instanceof Promise) ? value.catch(callback || (err => err)) : | ||
value [global.fail] (callback) | ||
@@ -429,3 +429,4 @@ )); | ||
global.promiseware = (func) => (req, res, next) => ( | ||
global.vala(func(req)) | ||
global.vala(req) | ||
[global.thena](func, true) | ||
[global.thena](next) | ||
@@ -432,0 +433,0 @@ [global.catcha]((err) => { |
{ | ||
"name": "esfunctional", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Next Generation EcmaScript Functional Helpers", | ||
@@ -5,0 +5,0 @@ "main": "lib/v1/index.js", |
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
15566
380