functionalscript
Advanced tools
Comparing version 0.0.155 to 0.0.156
@@ -31,15 +31,2 @@ "use strict"; | ||
/** @type {<A>(_: A) => <B>(_: B) => [A, B]} */ | ||
const tuple2 = a => b => [a, b] | ||
// /** @type {<T>(_: (_: string) => T) => (_: Dictionary<T>) => (_: string) => [T, Dictionary<T>]} */ | ||
// const cache = f => d => k => { | ||
// const set = () => { | ||
// const r = f(k) | ||
// return tuple2(r)(d.set(k)(r)) | ||
// } | ||
// const result = d.get(k) | ||
// return result !== undefined ? [result, d] : set() | ||
// } | ||
/** | ||
@@ -92,8 +79,2 @@ * @template T | ||
/** @type {<I, T>(f: (input: I) => T) => Pipe<I, T>} */ | ||
const pipex = f => ({ | ||
x: g => pipex(pipe(f)(g)), | ||
f, | ||
}) | ||
module.exports = { | ||
@@ -118,18 +99,4 @@ | ||
/** @type {(s: string) => Reduce<string, string>} */ | ||
join: s => ({ merge: a => i => a === '' ? i : a + s + i, init: ''}), | ||
pipe, | ||
pipex, | ||
/** @type {Reduce<number, number>} */ | ||
sum: { merge: a => i => a + i, init: 0 }, | ||
/** @type {<I, X>(f: (init: I) => X) => <O>(reduce: Reduce<X, O>) => Reduce<I, O>} */ | ||
map: f => ({merge, init}) => ({ | ||
merge: pipe(merge)(pipe(f)), | ||
init, | ||
}), | ||
last, | ||
@@ -136,0 +103,0 @@ |
const lib = require('./index') | ||
require('./iterable/test') | ||
require('./map/test') | ||
require('../iterable/test') | ||
require('../map/test') | ||
const lib = require('../lib') | ||
const iter = require('../lib/iterable') | ||
const iter = require('../iterable') | ||
const mr = require('../map-reduce') | ||
@@ -31,5 +32,5 @@ /** @typedef {(_: string) => string|undefined} ReadFile */ | ||
/** @type {lib.Reduce<string, undefined|string[]>} */ | ||
/** @type {mr.Operation<string, undefined|string[], undefined|string[]>} */ | ||
const pathNormReduce = { | ||
merge: path => item => | ||
reduce: path => item => | ||
path === undefined ? | ||
@@ -42,3 +43,4 @@ undefined : | ||
[...path, item], | ||
init: [] | ||
init: [], | ||
result: s => s, | ||
} | ||
@@ -49,3 +51,3 @@ | ||
const pathNorm = iter.reduce(pathNormReduce) | ||
const pathNorm = iter.apply(pathNormReduce) | ||
@@ -97,6 +99,10 @@ /** @type {(_: Package) => (_: string[]) => Module|undefined} */ | ||
module.exports = { | ||
/** @readonly */ | ||
isRelative, | ||
/** @readonly */ | ||
pathNorm, | ||
/** @readonly */ | ||
getModule, | ||
/** @readonly */ | ||
moduleId, | ||
} |
@@ -5,8 +5,2 @@ const i = require('.') | ||
{ | ||
if (require('./test0') !== 'test0.js') { throw './test0' } | ||
if (require('./test0.js') !== 'test0.js') { throw './test0.js'} | ||
if (require('./test0.js.js') !== 'test0.js.js') { throw './test0.js.js'} | ||
} | ||
require('./node/test') | ||
@@ -13,0 +7,0 @@ |
{ | ||
"name": "functionalscript", | ||
"version": "0.0.155", | ||
"version": "0.0.156", | ||
"description": "FunctionalScript is a functional subset of JavaScript", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
const lib = require('./lib') | ||
const i = require('./') | ||
require('./async/test') | ||
require('./module-manager/test') | ||
@@ -5,0 +6,0 @@ require('./lib/test') |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
76022
1307
2