@ctx-core/function
Advanced tools
Comparing version 8.1.0 to 9.0.0
54
lib.js
@@ -270,2 +270,3 @@ /** | ||
* @typedef {function} fn__or | ||
* @param {*} val | ||
* @param {*} obj | ||
@@ -275,3 +276,3 @@ * @returns {*} | ||
/** | ||
* Returns `andand(obj, a1__name) || fn__or(obj)` | ||
* Returns `andand(obj, a1__name) || fn__or(obj, val)` | ||
* @param obj | ||
@@ -283,3 +284,4 @@ * @param {...arg__andand} a1__name | ||
export function andand__or(obj, a1__name, fn__or) { | ||
return andand(obj, ...a1__name) || fn__or(obj) | ||
const val = andand(obj, ...a1__name) | ||
return val || fn__or(val, obj) | ||
} | ||
@@ -528,50 +530,2 @@ /** | ||
/** | ||
* Returns `fn__or()` if `obj == val__eq` or returns `obj` | ||
* @param obj | ||
* @param {fn__or} fn__or | ||
* @param val__eq | ||
* @returns {*} | ||
*/ | ||
export function or__fn__if__eq(obj, fn__or, val__eq = null) { | ||
return ( | ||
obj == val__eq | ||
? fn__or(obj, val__eq) | ||
: obj | ||
) | ||
} | ||
/** | ||
* Returns function that returns `fn__or()` if `obj == val__eq` or returns `obj` | ||
* @param {fn__or} fn__or | ||
* @param val__eq | ||
* @returns {function(*=): *} | ||
*/ | ||
export function _or__fn__if__eq(fn__or, val__eq) { | ||
return obj => or__fn__if__eq(obj, fn__or, val__eq) | ||
} | ||
export const _fn__or__fn__if__eq = _or__fn__if__eq | ||
/** | ||
* Returns `fn__or()` if `obj === val__eq` or returns `obj` | ||
* @param obj | ||
* @param {fn__or} fn__or | ||
* @param val__eql | ||
* @returns {*} | ||
*/ | ||
export function or__fn__if__eql(obj, fn__or, val__eql = null) { | ||
return ( | ||
obj === val__eql | ||
? fn__or(obj, val__eql) | ||
: obj | ||
) | ||
} | ||
/** | ||
* Returns function that returns `fn__or()` if `obj === val__eq` or returns `obj` | ||
* @param {fn__or} fn__or | ||
* @param val__eql | ||
* @returns {function(*=): *} | ||
*/ | ||
export function _or__fn__if__eql(fn__or, val__eql) { | ||
return obj => or__fn__if__eql(obj, fn__or, val__eql) | ||
} | ||
export const _fn__or__fn__if__eql = _or__fn__if__eq | ||
/** | ||
* Returns `fn__if(conditional)` if `conditional` else `fn__else(conditional)` | ||
@@ -578,0 +532,0 @@ * @param conditional |
{ | ||
"name": "@ctx-core/function", | ||
"version": "8.1.0", | ||
"version": "9.0.0", | ||
"description": "ctx-core function", | ||
@@ -27,3 +27,3 @@ "main": "lib.js", | ||
}, | ||
"gitHead": "bdcb964274f1a3039e1e2cb19e4e959488cff2e0" | ||
"gitHead": "44e777d07ee38a01fe47429ecd4744c4221ff193" | ||
} |
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
15014
539