@brandingbrand/standard-compose
Advanced tools
Comparing version 11.62.0 to 11.63.0
@@ -5,2 +5,11 @@ # Changelog | ||
# [11.63.0](https://github.com/brandingbrand/shipyard/compare/v11.62.0...v11.63.0) (2022-05-24) | ||
### Features | ||
* **shared-util-std-compose:** validatic pipe definition ([aff179a](https://github.com/brandingbrand/shipyard/commit/aff179ad3a99fd05af81d1ba77a9d5e4239630e2)) | ||
# [11.62.0](https://github.com/brandingbrand/shipyard/compare/v11.61.0...v11.62.0) (2022-05-18) | ||
@@ -7,0 +16,0 @@ |
const applyParam = (...params)=>(fnToApply)=>fnToApply(...params) | ||
; | ||
function branch(...fns) { | ||
/** | ||
* | ||
* @param fns | ||
*/ function branch(...fns) { | ||
return (input)=>fns.map((fn)=>fn(input) | ||
@@ -17,10 +20,17 @@ ) | ||
function flow(firstFunction, ...functions) { | ||
return (...params)=>{ | ||
return functions.reduce((val, fn)=>fn(val) | ||
, firstFunction(...params)); | ||
}; | ||
/** | ||
* | ||
* @param firstFunction | ||
* @param functions | ||
*/ function flow(firstFunction, ...functions) { | ||
return (...params)=>functions.reduce((val, fn)=>fn(val) | ||
, firstFunction(...params)) | ||
; | ||
} | ||
function pipe(value, ...functions) { | ||
/** | ||
* | ||
* @param value | ||
* @param functions | ||
*/ function pipe(value, ...functions) { | ||
return functions.reduce((val, fn)=>fn(val) | ||
@@ -27,0 +37,0 @@ , value); |
24
index.js
@@ -8,3 +8,6 @@ 'use strict'; | ||
function branch(...fns) { | ||
/** | ||
* | ||
* @param fns | ||
*/ function branch(...fns) { | ||
return (input)=>fns.map((fn)=>fn(input) | ||
@@ -22,10 +25,17 @@ ) | ||
function flow(firstFunction, ...functions) { | ||
return (...params)=>{ | ||
return functions.reduce((val, fn)=>fn(val) | ||
, firstFunction(...params)); | ||
}; | ||
/** | ||
* | ||
* @param firstFunction | ||
* @param functions | ||
*/ function flow(firstFunction, ...functions) { | ||
return (...params)=>functions.reduce((val, fn)=>fn(val) | ||
, firstFunction(...params)) | ||
; | ||
} | ||
function pipe(value, ...functions) { | ||
/** | ||
* | ||
* @param value | ||
* @param functions | ||
*/ function pipe(value, ...functions) { | ||
return functions.reduce((val, fn)=>fn(val) | ||
@@ -32,0 +42,0 @@ , value); |
{ | ||
"name": "@brandingbrand/standard-compose", | ||
"version": "11.62.0", | ||
"version": "11.63.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "typings": "./src/index.d.ts", |
@@ -21,1 +21,2 @@ export declare function pipe<A>(a: A): A; | ||
export declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T>(a: A, ab: (a: A) => B, bc: (b: B) => C, cd: (c: C) => D, de: (d: D) => E, ef: (e: E) => F, fg: (f: F) => G, gh: (g: G) => H, hi: (h: H) => I, ij: (i: I) => J, jk: (j: J) => K, kl: (k: K) => L, lm: (l: L) => M, mn: (m: M) => N, no: (n: N) => O, op: (o: O) => P, pq: (p: P) => Q, qr: (q: Q) => R, rs: (r: R) => S, st: (s: S) => T): T; | ||
export declare function pipe<InputType>(value: InputType, ...functions: Array<(input: InputType) => InputType>): InputType; |
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
15386
123