🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

functionalscript

Package Overview
Dependencies
Maintainers
1
Versions
466
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

functionalscript - npm Package Compare versions

Comparing version

to
0.0.128

33

lib/index.js

@@ -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)),

2

package.json
{
"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",