@ctx-core/function
Advanced tools
Comparing version 10.1.3 to 10.1.4
@@ -95,2 +95,3 @@ export declare type falsy = false | 0 | '' | null | undefined; | ||
* @returns {*|(function(...[*]): *)} | ||
* @see {@link https://gist.github.com/JamieMason/172460a36a0eaef24233e6edb2706f83} | ||
*/ | ||
@@ -97,0 +98,0 @@ export declare const compose: (...a1__fn: any[]) => any; |
@@ -145,4 +145,5 @@ 'use strict'; | ||
* @returns {*|(function(...[*]): *)} | ||
* @see {@link https://gist.github.com/JamieMason/172460a36a0eaef24233e6edb2706f83} | ||
*/ | ||
const compose = (...a1__fn) => a1__fn.reduce((f, g) => (...args) => f(g(...args))); | ||
const compose = (...a1__fn) => a1__fn.reduceRight((fn__prev, fn__next) => (...a1__arg) => fn__next(fn__prev(...a1__arg)), value => value); | ||
/** | ||
@@ -149,0 +150,0 @@ * Invokes interceptor with the obj, and then returns object. |
{ | ||
"name": "@ctx-core/function", | ||
"version": "10.1.3", | ||
"version": "10.1.4", | ||
"description": "ctx-core function", | ||
@@ -37,3 +37,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "9a3033715b2a30c039278159f16ca1dc439545be" | ||
"gitHead": "fbe1a570660d97b76da79903e8e8d7284c15f9b0" | ||
} |
@@ -1,2 +0,2 @@ | ||
export type falsy = false | 0 | '' | null | undefined | ||
export type falsy = false|0|''|null|undefined | ||
/** | ||
@@ -10,3 +10,3 @@ * @typedef {boolean} false | ||
export function _val(val) { | ||
return () => val | ||
return ()=>val | ||
} | ||
@@ -27,3 +27,3 @@ /** | ||
*/ | ||
export function _a1__wrap(value:any | any[]):any[] { | ||
export function _a1__wrap(value:any|any[]):any[] { | ||
return ( | ||
@@ -60,3 +60,3 @@ isArray(value) | ||
export function _call(fn, ...a1__arg) { | ||
return (...args__) => fn(...concat(a1__arg, args__)) | ||
return (...args__)=>fn(...concat(a1__arg, args__)) | ||
} | ||
@@ -71,3 +71,3 @@ /** | ||
export function _call__bind(fn, self, ...a1__arg) { | ||
return (...args__) => fn.call(self, ...concat(a1__arg, args__)) | ||
return (...args__)=>fn.call(self, ...concat(a1__arg, args__)) | ||
} | ||
@@ -81,3 +81,3 @@ /** | ||
export function _apply(fn, a1__arg = []) { | ||
return (...args__) => fn(...concat(a1__arg, args__)) | ||
return (...args__)=>fn(...concat(a1__arg, args__)) | ||
} | ||
@@ -92,3 +92,3 @@ /** | ||
export function _apply__bind(fn, self, args = []) { | ||
return (...args__) => fn.apply(self, concat(args, args__)) | ||
return (...args__)=>fn.apply(self, concat(args, args__)) | ||
} | ||
@@ -115,3 +115,3 @@ /** | ||
export function slice__a1__arg(fn, ...a1__arg__slice) { | ||
return (...a1__arg) => fn(a1__arg.slice.apply(a1__arg, a1__arg__slice)) | ||
return (...a1__arg)=>fn(a1__arg.slice.apply(a1__arg, a1__arg__slice)) | ||
} | ||
@@ -133,4 +133,4 @@ /** | ||
export function tick(fn, timeout = 0) { | ||
return new Promise((resolve, reject) => { | ||
setTimeout(() => { | ||
return new Promise((resolve, reject)=>{ | ||
setTimeout(()=>{ | ||
let rv | ||
@@ -150,7 +150,10 @@ try { | ||
* @returns {*|(function(...[*]): *)} | ||
* @see {@link https://gist.github.com/JamieMason/172460a36a0eaef24233e6edb2706f83} | ||
*/ | ||
export const compose = | ||
(...a1__fn) => | ||
a1__fn.reduce( | ||
(f, g) => (...args) => f(g(...args))) | ||
export const compose = (...a1__fn)=> | ||
a1__fn.reduceRight( | ||
(fn__prev, fn__next)=> | ||
(...a1__arg)=>fn__next(fn__prev(...a1__arg)), | ||
value=>value | ||
) | ||
/** | ||
@@ -175,3 +178,3 @@ * Invokes interceptor with the obj, and then returns object. | ||
export function _tap(obj) { | ||
return interceptor => tap(obj, interceptor) | ||
return interceptor=>tap(obj, interceptor) | ||
} | ||
@@ -246,3 +249,3 @@ /** | ||
export function _andand(...a1__name) { | ||
return obj => andand(obj, ...a1__name) | ||
return obj=>andand(obj, ...a1__name) | ||
} | ||
@@ -277,3 +280,3 @@ export const _fn__andand = _andand | ||
export function _andand_(...a1__name) { | ||
return obj => andand_(obj, ...a1__name) | ||
return obj=>andand_(obj, ...a1__name) | ||
} | ||
@@ -305,3 +308,3 @@ export const _fn__andand__fn = _andand_ | ||
export function _andand__or(a1__name, fn__or) { | ||
return obj => andand__or(obj, a1__name, fn__or) | ||
return obj=>andand__or(obj, a1__name, fn__or) | ||
} | ||
@@ -328,3 +331,3 @@ export const _fn__andand__or = _andand__or | ||
export function _not(__a1__value__) { | ||
return __a1__value => not(concat__wrap(__a1__value__, __a1__value)) | ||
return __a1__value=>not(concat__wrap(__a1__value__, __a1__value)) | ||
} | ||
@@ -350,3 +353,3 @@ /** | ||
export function _notnot(__a1__value) { | ||
return value => notnot(concat__wrap(__a1__value, value)) | ||
return value=>notnot(concat__wrap(__a1__value, value)) | ||
} | ||
@@ -372,4 +375,4 @@ /** | ||
*/ | ||
export function _eq(__a1__value:any[]):(value:any|any[]) => boolean { | ||
return value => eq(concat__wrap(__a1__value, value)) | ||
export function _eq(__a1__value:any[]):(value:any|any[])=>boolean { | ||
return value=>eq(concat__wrap(__a1__value, value)) | ||
} | ||
@@ -397,3 +400,3 @@ export const _fn__eq = _eq | ||
export function _neq(__a1__value__) { | ||
return __a1__value => neq(concat__wrap(__a1__value__, __a1__value)) | ||
return __a1__value=>neq(concat__wrap(__a1__value__, __a1__value)) | ||
} | ||
@@ -420,3 +423,3 @@ /** | ||
export function _eql(__a1__value) { | ||
return value => eql(concat__wrap(__a1__value, value)) | ||
return value=>eql(concat__wrap(__a1__value, value)) | ||
} | ||
@@ -429,3 +432,3 @@ /** | ||
export function _fn__eql(compare) { | ||
return value => value === compare | ||
return value=>value === compare | ||
} | ||
@@ -452,3 +455,3 @@ /** | ||
export function _neql(__a1__value) { | ||
return value => neql(concat__wrap(__a1__value, value)) | ||
return value=>neql(concat__wrap(__a1__value, value)) | ||
} | ||
@@ -474,3 +477,3 @@ /** | ||
export function _and(__a1__value) { | ||
return value => and(concat__wrap(__a1__value, value)) | ||
return value=>and(concat__wrap(__a1__value, value)) | ||
} | ||
@@ -499,3 +502,3 @@ /** | ||
export function _and__fn(__a1__value__) { | ||
return __a1__value => and__fn(concat__wrap(__a1__value__, __a1__value)) | ||
return __a1__value=>and__fn(concat__wrap(__a1__value__, __a1__value)) | ||
} | ||
@@ -520,3 +523,3 @@ /** | ||
export function _or(__a1__value) { | ||
return value => or(concat__wrap(__a1__value, value)) | ||
return value=>or(concat__wrap(__a1__value, value)) | ||
} | ||
@@ -546,3 +549,3 @@ /** | ||
export function _or__fn(__a1__value) { | ||
return value => or__fn(concat__wrap(__a1__value, value)) | ||
return value=>or__fn(concat__wrap(__a1__value, value)) | ||
} | ||
@@ -549,0 +552,0 @@ export const _fn__or__fn = _or__fn |
Sorry, the diff of this file is not supported yet
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
58704
2051