functionalscript
Advanced tools
+32
-1
@@ -98,2 +98,31 @@ "use strict"; | ||
| /** | ||
| * @template I | ||
| * @typedef {{ | ||
| * readonly i: <O>(f: (input: I) => O) => Chain<O> | ||
| * readonly result: () => I | ||
| * }} Chain | ||
| */ | ||
| /** @type {<I>(value: I) => Chain<I>} */ | ||
| const chain = value => ({ | ||
| i: f => chain(f(value)), | ||
| result: () => value | ||
| }) | ||
| /** | ||
| * @template I | ||
| * @template T | ||
| * @typedef {{ | ||
| * readonly x: <O>(f: (v: T) => O) => Pipe<I, O> | ||
| * readonly f: (input: I) => T | ||
| * }} Pipe | ||
| */ | ||
| /** @type {<I, T>(f: (input: I) => T) => Pipe<I, T>} */ | ||
| const pipex = f => ({ | ||
| x: g => pipex(pipe(f)(g)), | ||
| f, | ||
| }) | ||
| module.exports = { | ||
@@ -128,6 +157,8 @@ | ||
| pipex, | ||
| /** @type {Reduce<number, number>} */ | ||
| sum: { merge: a => i => a + i, init: 0 }, | ||
| /** @type {<I, X>(_: (_: I) => X) => <O>(_: Reduce<X, O>) => Reduce<I, O>} */ | ||
| /** @type {<I, X>(f: (init: I) => X) => <O>(reduce: Reduce<X, O>) => Reduce<I, O>} */ | ||
| map: f => ({merge, init}) => ({ | ||
@@ -134,0 +165,0 @@ merge: pipe(merge)(pipe(f)), |
+1
-1
| { | ||
| "name": "functionalscript", | ||
| "version": "0.0.127", | ||
| "version": "0.0.128", | ||
| "description": "FunctionalScript is a functional subset of JavaScript", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
57571
0.95%746
3.61%