Comparing version 6.5.3 to 6.6.0
@@ -0,1 +1,12 @@ | ||
6.6.0 | ||
- Change `R.piped` typings to mimic that of `R.pipe`. Main difference is that `R.pipe` is focused on unary functions. | ||
- Fix wrong logic when `R.without` use `R.includes` while it should use array version of `R.includes`. | ||
- Use uglify plugin for UMD bundle. | ||
- Remove `dist` folder from `.gitignore` in order to fix `Deno` broken package. [Issue #570](https://github.com/selfrefactor/rambda/issues/570) | ||
- Improve `R.fromPairs` typings - [Issue #567](https://github.com/selfrefactor/rambda/issues/567) | ||
6.5.3 | ||
@@ -543,2 +554,2 @@ | ||
- 0.7.0 Close [issue #5](https://github.com/selfrefactor/rambda/issues/5) - change name of `curry` to `partialCurry`; add new method `curry`, which works just like Ramda's `curry` | ||
- 0.6.2 Add separate documentation site via `docsify` | ||
- 0.6.2 Add separate documentation site via `docsify` |
@@ -1,2348 +0,1 @@ | ||
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.R = {})); | ||
}(this, (function (exports) { 'use strict'; | ||
function F() { | ||
return false; | ||
} | ||
function T() { | ||
return true; | ||
} | ||
function add(a, b) { | ||
if (arguments.length === 1) return _b => add(a, _b); | ||
return Number(a) + Number(b); | ||
} | ||
function curry(fn, args = []) { | ||
return (..._args) => (rest => rest.length >= fn.length ? fn(...rest) : curry(fn, rest))([...args, ..._args]); | ||
} | ||
function adjustFn(index, replaceFn, list) { | ||
const actualIndex = index < 0 ? list.length + index : index; | ||
if (index >= list.length || actualIndex < 0) return list; | ||
const clone = list.slice(); | ||
clone[actualIndex] = replaceFn(clone[actualIndex]); | ||
return clone; | ||
} | ||
const adjust = curry(adjustFn); | ||
function all(predicate, list) { | ||
if (arguments.length === 1) return _list => all(predicate, _list); | ||
for (let i = 0; i < list.length; i++) { | ||
if (!predicate(list[i])) return false; | ||
} | ||
return true; | ||
} | ||
function allPass(predicates) { | ||
return input => { | ||
let counter = 0; | ||
while (counter < predicates.length) { | ||
if (!predicates[counter](input)) { | ||
return false; | ||
} | ||
counter++; | ||
} | ||
return true; | ||
}; | ||
} | ||
function always(x) { | ||
return () => x; | ||
} | ||
function and(a, b) { | ||
if (arguments.length === 1) return _b => and(a, _b); | ||
return a && b; | ||
} | ||
function any(predicate, list) { | ||
if (arguments.length === 1) return _list => any(predicate, _list); | ||
let counter = 0; | ||
while (counter < list.length) { | ||
if (predicate(list[counter], counter)) { | ||
return true; | ||
} | ||
counter++; | ||
} | ||
return false; | ||
} | ||
function anyPass(predicates) { | ||
return input => { | ||
let counter = 0; | ||
while (counter < predicates.length) { | ||
if (predicates[counter](input)) { | ||
return true; | ||
} | ||
counter++; | ||
} | ||
return false; | ||
}; | ||
} | ||
function append(x, input) { | ||
if (arguments.length === 1) return _input => append(x, _input); | ||
if (typeof input === 'string') return input.split('').concat(x); | ||
const clone = input.slice(); | ||
clone.push(x); | ||
return clone; | ||
} | ||
const _isArray = Array.isArray; | ||
function __findHighestArity(spec, max = 0) { | ||
for (const key in spec) { | ||
if (spec.hasOwnProperty(key) === false || key === 'constructor') continue; | ||
if (typeof spec[key] === 'object') { | ||
max = Math.max(max, __findHighestArity(spec[key])); | ||
} | ||
if (typeof spec[key] === 'function') { | ||
max = Math.max(max, spec[key].length); | ||
} | ||
} | ||
return max; | ||
} | ||
function __filterUndefined() { | ||
const defined = []; | ||
let i = 0; | ||
const l = arguments.length; | ||
while (i < l) { | ||
if (typeof arguments[i] === 'undefined') break; | ||
defined[i] = arguments[i]; | ||
i++; | ||
} | ||
return defined; | ||
} | ||
function __applySpecWithArity(spec, arity, cache) { | ||
const remaining = arity - cache.length; | ||
if (remaining === 1) return x => __applySpecWithArity(spec, arity, __filterUndefined(...cache, x)); | ||
if (remaining === 2) return (x, y) => __applySpecWithArity(spec, arity, __filterUndefined(...cache, x, y)); | ||
if (remaining === 3) return (x, y, z) => __applySpecWithArity(spec, arity, __filterUndefined(...cache, x, y, z)); | ||
if (remaining === 4) return (x, y, z, a) => __applySpecWithArity(spec, arity, __filterUndefined(...cache, x, y, z, a)); | ||
if (remaining > 4) return (...args) => __applySpecWithArity(spec, arity, __filterUndefined(...cache, ...args)); | ||
if (_isArray(spec)) { | ||
const ret = []; | ||
let i = 0; | ||
const l = spec.length; | ||
for (; i < l; i++) { | ||
if (typeof spec[i] === 'object' || _isArray(spec[i])) { | ||
ret[i] = __applySpecWithArity(spec[i], arity, cache); | ||
} | ||
if (typeof spec[i] === 'function') { | ||
ret[i] = spec[i](...cache); | ||
} | ||
} | ||
return ret; | ||
} | ||
const ret = {}; | ||
for (const key in spec) { | ||
if (spec.hasOwnProperty(key) === false || key === 'constructor') continue; | ||
if (typeof spec[key] === 'object') { | ||
ret[key] = __applySpecWithArity(spec[key], arity, cache); | ||
continue; | ||
} | ||
if (typeof spec[key] === 'function') { | ||
ret[key] = spec[key](...cache); | ||
} | ||
} | ||
return ret; | ||
} | ||
function applySpec(spec, ...args) { | ||
const arity = __findHighestArity(spec); | ||
if (arity === 0) { | ||
return () => ({}); | ||
} | ||
const toReturn = __applySpecWithArity(spec, arity, args); | ||
return toReturn; | ||
} | ||
function assocFn(prop, newValue, obj) { | ||
return Object.assign({}, obj, { | ||
[prop]: newValue | ||
}); | ||
} | ||
const assoc = curry(assocFn); | ||
function _isInteger(n) { | ||
return n << 0 === n; | ||
} | ||
var _isInteger$1 = Number.isInteger || _isInteger; | ||
function assocPathFn(path, newValue, input) { | ||
const pathArrValue = typeof path === 'string' ? path.split('.').map(x => _isInteger(Number(x)) ? Number(x) : x) : path; | ||
if (pathArrValue.length === 0) { | ||
return newValue; | ||
} | ||
const index = pathArrValue[0]; | ||
if (pathArrValue.length > 1) { | ||
const condition = typeof input !== 'object' || input === null || !input.hasOwnProperty(index); | ||
const nextinput = condition ? _isInteger(pathArrValue[1]) ? [] : {} : input[index]; | ||
newValue = assocPathFn(Array.prototype.slice.call(pathArrValue, 1), newValue, nextinput); | ||
} | ||
if (_isInteger(index) && _isArray(input)) { | ||
const arr = input.slice(); | ||
arr[index] = newValue; | ||
return arr; | ||
} | ||
return assoc(index, newValue, input); | ||
} | ||
const assocPath = curry(assocPathFn); | ||
function both(f, g) { | ||
if (arguments.length === 1) return _g => both(f, _g); | ||
return (...input) => f(...input) && g(...input); | ||
} | ||
function chain(fn, list) { | ||
if (arguments.length === 1) { | ||
return _list => chain(fn, _list); | ||
} | ||
return [].concat(...list.map(fn)); | ||
} | ||
function clampFn(min, max, input) { | ||
if (min > max) { | ||
throw new Error('min must not be greater than max in clamp(min, max, value)'); | ||
} | ||
if (input >= min && input <= max) return input; | ||
if (input > max) return max; | ||
if (input < min) return min; | ||
} | ||
const clamp = curry(clampFn); | ||
function clone(input) { | ||
const out = _isArray(input) ? Array(input.length) : {}; | ||
if (input && input.getTime) return new Date(input.getTime()); | ||
for (const key in input) { | ||
const v = input[key]; | ||
out[key] = typeof v === 'object' && v !== null ? v.getTime ? new Date(v.getTime()) : clone(v) : v; | ||
} | ||
return out; | ||
} | ||
function complement(fn) { | ||
return (...input) => !fn(...input); | ||
} | ||
function compose(...fns) { | ||
if (fns.length === 0) { | ||
throw new Error('compose requires at least one argument'); | ||
} | ||
return (...args) => { | ||
const list = fns.slice(); | ||
if (list.length > 0) { | ||
const fn = list.pop(); | ||
let result = fn(...args); | ||
while (list.length > 0) { | ||
result = list.pop()(result); | ||
} | ||
return result; | ||
} | ||
}; | ||
} | ||
function concat(x, y) { | ||
if (arguments.length === 1) return _y => concat(x, _y); | ||
return typeof x === 'string' ? `${x}${y}` : [...x, ...y]; | ||
} | ||
function cond(conditions) { | ||
return input => { | ||
let done = false; | ||
let toReturn; | ||
conditions.forEach(([predicate, resultClosure]) => { | ||
if (!done && predicate(input)) { | ||
done = true; | ||
toReturn = resultClosure(input); | ||
} | ||
}); | ||
return toReturn; | ||
}; | ||
} | ||
function _curryN(n, cache, fn) { | ||
return function () { | ||
let ci = 0; | ||
let ai = 0; | ||
const cl = cache.length; | ||
const al = arguments.length; | ||
const args = new Array(cl + al); | ||
while (ci < cl) { | ||
args[ci] = cache[ci]; | ||
ci++; | ||
} | ||
while (ai < al) { | ||
args[cl + ai] = arguments[ai]; | ||
ai++; | ||
} | ||
const remaining = n - args.length; | ||
return args.length >= n ? fn.apply(this, args) : _arity(remaining, _curryN(n, args, fn)); | ||
}; | ||
} | ||
function _arity(n, fn) { | ||
switch (n) { | ||
case 0: | ||
return function () { | ||
return fn.apply(this, arguments); | ||
}; | ||
case 1: | ||
return function (_1) { | ||
return fn.apply(this, arguments); | ||
}; | ||
case 2: | ||
return function (_1, _2) { | ||
return fn.apply(this, arguments); | ||
}; | ||
case 3: | ||
return function (_1, _2, _3) { | ||
return fn.apply(this, arguments); | ||
}; | ||
case 4: | ||
return function (_1, _2, _3, _4) { | ||
return fn.apply(this, arguments); | ||
}; | ||
case 5: | ||
return function (_1, _2, _3, _4, _5) { | ||
return fn.apply(this, arguments); | ||
}; | ||
case 6: | ||
return function (_1, _2, _3, _4, _5, _6) { | ||
return fn.apply(this, arguments); | ||
}; | ||
case 7: | ||
return function (_1, _2, _3, _4, _5, _6, _7) { | ||
return fn.apply(this, arguments); | ||
}; | ||
case 8: | ||
return function (_1, _2, _3, _4, _5, _6, _7, _8) { | ||
return fn.apply(this, arguments); | ||
}; | ||
case 9: | ||
return function (_1, _2, _3, _4, _5, _6, _7, _8, _9) { | ||
return fn.apply(this, arguments); | ||
}; | ||
default: | ||
return function (_1, _2, _3, _4, _5, _6, _7, _8, _9, _10) { | ||
return fn.apply(this, arguments); | ||
}; | ||
} | ||
} | ||
function curryN(n, fn) { | ||
if (arguments.length === 1) return _fn => curryN(n, _fn); | ||
if (n > 10) { | ||
throw new Error('First argument to _arity must be a non-negative integer no greater than ten'); | ||
} | ||
return _arity(n, _curryN(n, [], fn)); | ||
} | ||
const _keys = Object.keys; | ||
function mapArray(fn, list, isIndexed = false) { | ||
let index = 0; | ||
const willReturn = Array(list.length); | ||
while (index < list.length) { | ||
willReturn[index] = isIndexed ? fn(list[index], index) : fn(list[index]); | ||
index++; | ||
} | ||
return willReturn; | ||
} | ||
function mapObject(fn, obj) { | ||
let index = 0; | ||
const keys = _keys(obj); | ||
const len = keys.length; | ||
const willReturn = {}; | ||
while (index < len) { | ||
const key = keys[index]; | ||
willReturn[key] = fn(obj[key], key, obj); | ||
index++; | ||
} | ||
return willReturn; | ||
} | ||
function map(fn, list) { | ||
if (arguments.length === 1) return _list => map(fn, _list); | ||
if (list === undefined) return []; | ||
if (_isArray(list)) return mapArray(fn, list); | ||
return mapObject(fn, list); | ||
} | ||
function max(x, y) { | ||
if (arguments.length === 1) return _y => max(x, _y); | ||
return y > x ? y : x; | ||
} | ||
function reduceFn(reducer, acc, list) { | ||
if (!_isArray(list)) { | ||
throw new TypeError('reduce: list must be array or iterable'); | ||
} | ||
let index = 0; | ||
const len = list.length; | ||
while (index < len) { | ||
acc = reducer(acc, list[index], index, list); | ||
index++; | ||
} | ||
return acc; | ||
} | ||
const reduce = curry(reduceFn); | ||
function converge(fn, transformers) { | ||
if (arguments.length === 1) return _transformers => converge(fn, _transformers); | ||
const highestArity = reduce((a, b) => max(a, b.length), 0, transformers); | ||
return curryN(highestArity, function () { | ||
return fn.apply(this, map(g => g.apply(this, arguments), transformers)); | ||
}); | ||
} | ||
const dec = x => x - 1; | ||
function isFalsy(input) { | ||
return input === undefined || input === null || Number.isNaN(input) === true; | ||
} | ||
function defaultTo(defaultArgument, input) { | ||
if (arguments.length === 1) { | ||
return _input => defaultTo(defaultArgument, _input); | ||
} | ||
return isFalsy(input) ? defaultArgument : input; | ||
} | ||
function type(input) { | ||
const typeOf = typeof input; | ||
if (input === null) { | ||
return 'Null'; | ||
} else if (input === undefined) { | ||
return 'Undefined'; | ||
} else if (typeOf === 'boolean') { | ||
return 'Boolean'; | ||
} else if (typeOf === 'number') { | ||
return Number.isNaN(input) ? 'NaN' : 'Number'; | ||
} else if (typeOf === 'string') { | ||
return 'String'; | ||
} else if (_isArray(input)) { | ||
return 'Array'; | ||
} else if (typeOf === 'symbol') { | ||
return 'Symbol'; | ||
} else if (input instanceof RegExp) { | ||
return 'RegExp'; | ||
} | ||
const asStr = input && input.toString ? input.toString() : ''; | ||
if (['true', 'false'].includes(asStr)) return 'Boolean'; | ||
if (!Number.isNaN(Number(asStr))) return 'Number'; | ||
if (asStr.startsWith('async')) return 'Async'; | ||
if (asStr === '[object Promise]') return 'Promise'; | ||
if (typeOf === 'function') return 'Function'; | ||
if (input instanceof String) return 'String'; | ||
return 'Object'; | ||
} | ||
function parseError(maybeError) { | ||
const typeofError = maybeError.__proto__.toString(); | ||
if (!['Error', 'TypeError'].includes(typeofError)) return []; | ||
return [typeofError, maybeError.message]; | ||
} | ||
function parseDate(maybeDate) { | ||
if (!maybeDate.toDateString) return [false]; | ||
return [true, maybeDate.getTime()]; | ||
} | ||
function parseRegex(maybeRegex) { | ||
if (maybeRegex.constructor !== RegExp) return [false]; | ||
return [true, maybeRegex.toString()]; | ||
} | ||
function equals(a, b) { | ||
if (arguments.length === 1) return _b => equals(a, _b); | ||
const aType = type(a); | ||
if (aType !== type(b)) return false; | ||
if (aType === 'Function') { | ||
return a.name === undefined ? false : a.name === b.name; | ||
} | ||
if (['NaN', 'Undefined', 'Null'].includes(aType)) return true; | ||
if (aType === 'Number') { | ||
if (Object.is(-0, a) !== Object.is(-0, b)) return false; | ||
return a.toString() === b.toString(); | ||
} | ||
if (['String', 'Boolean'].includes(aType)) { | ||
return a.toString() === b.toString(); | ||
} | ||
if (aType === 'Array') { | ||
const aClone = Array.from(a); | ||
const bClone = Array.from(b); | ||
if (aClone.toString() !== bClone.toString()) { | ||
return false; | ||
} | ||
let loopArrayFlag = true; | ||
aClone.forEach((aCloneInstance, aCloneIndex) => { | ||
if (loopArrayFlag) { | ||
if (aCloneInstance !== bClone[aCloneIndex] && !equals(aCloneInstance, bClone[aCloneIndex])) { | ||
loopArrayFlag = false; | ||
} | ||
} | ||
}); | ||
return loopArrayFlag; | ||
} | ||
const aRegex = parseRegex(a); | ||
const bRegex = parseRegex(b); | ||
if (aRegex[0]) { | ||
return bRegex[0] ? aRegex[1] === bRegex[1] : false; | ||
} else if (bRegex[0]) return false; | ||
const aDate = parseDate(a); | ||
const bDate = parseDate(b); | ||
if (aDate[0]) { | ||
return bDate[0] ? aDate[1] === bDate[1] : false; | ||
} else if (bDate[0]) return false; | ||
const aError = parseError(a); | ||
const bError = parseError(b); | ||
if (aError[0]) { | ||
return bError[0] ? aError[0] === bError[0] && aError[1] === bError[1] : false; | ||
} | ||
if (aType === 'Object') { | ||
const aKeys = Object.keys(a); | ||
if (aKeys.length !== Object.keys(b).length) { | ||
return false; | ||
} | ||
let loopObjectFlag = true; | ||
aKeys.forEach(aKeyInstance => { | ||
if (loopObjectFlag) { | ||
const aValue = a[aKeyInstance]; | ||
const bValue = b[aKeyInstance]; | ||
if (aValue !== bValue && !equals(aValue, bValue)) { | ||
loopObjectFlag = false; | ||
} | ||
} | ||
}); | ||
return loopObjectFlag; | ||
} | ||
return false; | ||
} | ||
function includesArray(valueToFind, input) { | ||
let index = -1; | ||
while (++index < input.length) { | ||
if (equals(input[index], valueToFind)) { | ||
return true; | ||
} | ||
} | ||
return false; | ||
} | ||
function includes(valueToFind, input) { | ||
if (arguments.length === 1) return _input => includes(valueToFind, _input); | ||
if (typeof input === 'string') { | ||
return input.includes(valueToFind); | ||
} | ||
if (!input) { | ||
throw new TypeError(`Cannot read property \'indexOf\' of ${input}`); | ||
} | ||
if (!_isArray(input)) return false; | ||
return includesArray(valueToFind, input); | ||
} | ||
function uniq(list) { | ||
let index = -1; | ||
const willReturn = []; | ||
while (++index < list.length) { | ||
const value = list[index]; | ||
if (!includes(value, willReturn)) { | ||
willReturn.push(value); | ||
} | ||
} | ||
return willReturn; | ||
} | ||
function difference(a, b) { | ||
if (arguments.length === 1) return _b => difference(a, _b); | ||
return uniq(a).filter(aInstance => !includes(aInstance, b)); | ||
} | ||
function dissoc(prop, obj) { | ||
if (arguments.length === 1) return _obj => dissoc(prop, _obj); | ||
if (obj === null || obj === undefined) return {}; | ||
const willReturn = {}; | ||
for (const p in obj) { | ||
willReturn[p] = obj[p]; | ||
} | ||
delete willReturn[prop]; | ||
return willReturn; | ||
} | ||
function divide(a, b) { | ||
if (arguments.length === 1) return _b => divide(a, _b); | ||
return a / b; | ||
} | ||
function drop(howManyToDrop, listOrString) { | ||
if (arguments.length === 1) return _list => drop(howManyToDrop, _list); | ||
return listOrString.slice(howManyToDrop > 0 ? howManyToDrop : 0); | ||
} | ||
function dropLast(howManyToDrop, listOrString) { | ||
if (arguments.length === 1) { | ||
return _listOrString => dropLast(howManyToDrop, _listOrString); | ||
} | ||
return howManyToDrop > 0 ? listOrString.slice(0, -howManyToDrop) : listOrString.slice(); | ||
} | ||
function dropLastWhile(predicate, iterable) { | ||
if (arguments.length === 1) { | ||
return _iterable => dropLastWhile(predicate, _iterable); | ||
} | ||
if (iterable.length === 0) return iterable; | ||
const isArray = _isArray(iterable); | ||
if (typeof predicate !== 'function') { | ||
throw new Error(`'predicate' is from wrong type ${typeof predicate}`); | ||
} | ||
if (!isArray && typeof iterable !== 'string') { | ||
throw new Error(`'iterable' is from wrong type ${typeof iterable}`); | ||
} | ||
let found = false; | ||
const toReturn = []; | ||
let counter = iterable.length; | ||
while (counter > 0) { | ||
counter--; | ||
if (!found && predicate(iterable[counter]) === false) { | ||
found = true; | ||
toReturn.push(iterable[counter]); | ||
} else if (found) { | ||
toReturn.push(iterable[counter]); | ||
} | ||
} | ||
return isArray ? toReturn.reverse() : toReturn.reverse().join(''); | ||
} | ||
function dropRepeats(list) { | ||
if (!_isArray(list)) { | ||
throw new Error(`${list} is not a list`); | ||
} | ||
const toReturn = []; | ||
list.reduce((prev, current) => { | ||
if (!equals(prev, current)) { | ||
toReturn.push(current); | ||
} | ||
return current; | ||
}, undefined); | ||
return toReturn; | ||
} | ||
function dropRepeatsWith(predicate, list) { | ||
if (arguments.length === 1) { | ||
return _iterable => dropRepeatsWith(predicate, _iterable); | ||
} | ||
if (!_isArray(list)) { | ||
throw new Error(`${list} is not a list`); | ||
} | ||
const toReturn = []; | ||
list.reduce((prev, current) => { | ||
if (prev === undefined) { | ||
toReturn.push(current); | ||
return current; | ||
} | ||
if (!predicate(prev, current)) { | ||
toReturn.push(current); | ||
} | ||
return current; | ||
}, undefined); | ||
return toReturn; | ||
} | ||
function dropWhile(predicate, iterable) { | ||
if (arguments.length === 1) { | ||
return _iterable => dropWhile(predicate, _iterable); | ||
} | ||
const isArray = _isArray(iterable); | ||
if (!isArray && typeof iterable !== 'string') { | ||
throw new Error('`iterable` is neither list nor a string'); | ||
} | ||
let flag = false; | ||
const holder = []; | ||
let counter = -1; | ||
while (counter++ < iterable.length - 1) { | ||
if (flag) { | ||
holder.push(iterable[counter]); | ||
} else if (!predicate(iterable[counter])) { | ||
if (!flag) flag = true; | ||
holder.push(iterable[counter]); | ||
} | ||
} | ||
return isArray ? holder : holder.join(''); | ||
} | ||
function either(firstPredicate, secondPredicate) { | ||
if (arguments.length === 1) { | ||
return _secondPredicate => either(firstPredicate, _secondPredicate); | ||
} | ||
return (...input) => Boolean(firstPredicate(...input) || secondPredicate(...input)); | ||
} | ||
function endsWith(target, str) { | ||
if (arguments.length === 1) return _str => endsWith(target, _str); | ||
return str.endsWith(target); | ||
} | ||
function eqPropsFn(prop, obj1, obj2) { | ||
if (!obj1 || !obj2) { | ||
throw new Error('wrong object inputs are passed to R.eqProps'); | ||
} | ||
return equals(obj1[prop], obj2[prop]); | ||
} | ||
const eqProps = curry(eqPropsFn); | ||
function evolveArray(rules, list) { | ||
return mapArray((x, i) => { | ||
if (type(rules[i]) === 'Function') { | ||
return rules[i](x); | ||
} | ||
return x; | ||
}, list, true); | ||
} | ||
function evolveObject(rules, iterable) { | ||
return mapObject((x, prop) => { | ||
if (type(x) === 'Object') { | ||
const typeRule = type(rules[prop]); | ||
if (typeRule === 'Function') { | ||
return rules[prop](x); | ||
} | ||
if (typeRule === 'Object') { | ||
return evolve(rules[prop], x); | ||
} | ||
return x; | ||
} | ||
if (type(rules[prop]) === 'Function') { | ||
return rules[prop](x); | ||
} | ||
return x; | ||
}, iterable); | ||
} | ||
function evolve(rules, iterable) { | ||
if (arguments.length === 1) { | ||
return _iterable => evolve(rules, _iterable); | ||
} | ||
const rulesType = type(rules); | ||
const iterableType = type(iterable); | ||
if (iterableType !== rulesType) { | ||
throw new Error('iterableType !== rulesType'); | ||
} | ||
if (!['Object', 'Array'].includes(rulesType)) { | ||
throw new Error(`'iterable' and 'rules' are from wrong type ${rulesType}`); | ||
} | ||
if (iterableType === 'Object') { | ||
return evolveObject(rules, iterable); | ||
} | ||
return evolveArray(rules, iterable); | ||
} | ||
function filterObject(fn, obj) { | ||
const willReturn = {}; | ||
for (const prop in obj) { | ||
if (fn(obj[prop], prop, obj)) { | ||
willReturn[prop] = obj[prop]; | ||
} | ||
} | ||
return willReturn; | ||
} | ||
function filterArray(predicate, list, indexed = false) { | ||
let index = 0; | ||
const len = list.length; | ||
const willReturn = []; | ||
while (index < len) { | ||
const predicateResult = indexed ? predicate(list[index], index) : predicate(list[index]); | ||
if (predicateResult) { | ||
willReturn.push(list[index]); | ||
} | ||
index++; | ||
} | ||
return willReturn; | ||
} | ||
function filter(predicate, iterable) { | ||
if (arguments.length === 1) { | ||
return _iterable => filter(predicate, _iterable); | ||
} | ||
if (!iterable) return []; | ||
if (_isArray(iterable)) return filterArray(predicate, iterable); | ||
return filterObject(predicate, iterable); | ||
} | ||
function find(predicate, list) { | ||
if (arguments.length === 1) return _list => find(predicate, _list); | ||
let index = 0; | ||
const len = list.length; | ||
while (index < len) { | ||
const x = list[index]; | ||
if (predicate(x)) { | ||
return x; | ||
} | ||
index++; | ||
} | ||
} | ||
function findIndex(predicate, list) { | ||
if (arguments.length === 1) return _list => findIndex(predicate, _list); | ||
const len = list.length; | ||
let index = -1; | ||
while (++index < len) { | ||
if (predicate(list[index])) { | ||
return index; | ||
} | ||
} | ||
return -1; | ||
} | ||
function findLast(predicate, list) { | ||
if (arguments.length === 1) return _list => findLast(predicate, _list); | ||
let index = list.length; | ||
while (--index >= 0) { | ||
if (predicate(list[index])) { | ||
return list[index]; | ||
} | ||
} | ||
return undefined; | ||
} | ||
function findLastIndex(fn, list) { | ||
if (arguments.length === 1) return _list => findLastIndex(fn, _list); | ||
let index = list.length; | ||
while (--index >= 0) { | ||
if (fn(list[index])) { | ||
return index; | ||
} | ||
} | ||
return -1; | ||
} | ||
function flatten(list, input) { | ||
const willReturn = input === undefined ? [] : input; | ||
for (let i = 0; i < list.length; i++) { | ||
if (_isArray(list[i])) { | ||
flatten(list[i], willReturn); | ||
} else { | ||
willReturn.push(list[i]); | ||
} | ||
} | ||
return willReturn; | ||
} | ||
function flipFn(fn) { | ||
return (...input) => { | ||
if (input.length === 1) { | ||
return holder => fn(holder, input[0]); | ||
} else if (input.length === 2) { | ||
return fn(input[1], input[0]); | ||
} else if (input.length === 3) { | ||
return fn(input[1], input[0], input[2]); | ||
} else if (input.length === 4) { | ||
return fn(input[1], input[0], input[2], input[3]); | ||
} | ||
throw new Error('R.flip doesn\'t work with arity > 4'); | ||
}; | ||
} | ||
function flip(fn) { | ||
return flipFn(fn); | ||
} | ||
function forEach(fn, list) { | ||
if (arguments.length === 1) return _list => forEach(fn, _list); | ||
if (list === undefined) { | ||
return; | ||
} | ||
if (_isArray(list)) { | ||
let index = 0; | ||
const len = list.length; | ||
while (index < len) { | ||
fn(list[index]); | ||
index++; | ||
} | ||
} else { | ||
let index = 0; | ||
const keys = _keys(list); | ||
const len = keys.length; | ||
while (index < len) { | ||
const key = keys[index]; | ||
fn(list[key], key, list); | ||
index++; | ||
} | ||
} | ||
return list; | ||
} | ||
function fromPairs(listOfPairs) { | ||
const toReturn = {}; | ||
listOfPairs.forEach(([prop, value]) => toReturn[prop] = value); | ||
return toReturn; | ||
} | ||
function groupBy(groupFn, list) { | ||
if (arguments.length === 1) return _list => groupBy(groupFn, _list); | ||
const result = {}; | ||
for (let i = 0; i < list.length; i++) { | ||
const item = list[i]; | ||
const key = groupFn(item); | ||
if (!result[key]) { | ||
result[key] = []; | ||
} | ||
result[key].push(item); | ||
} | ||
return result; | ||
} | ||
function groupWith(compareFn, list) { | ||
if (!_isArray(list)) throw new TypeError('list.reduce is not a function'); | ||
const clone = list.slice(); | ||
if (list.length === 1) return [clone]; | ||
const toReturn = []; | ||
let holder = []; | ||
clone.reduce((prev, current, i) => { | ||
if (i === 0) return current; | ||
const okCompare = compareFn(prev, current); | ||
const holderIsEmpty = holder.length === 0; | ||
const lastCall = i === list.length - 1; | ||
if (okCompare) { | ||
if (holderIsEmpty) holder.push(prev); | ||
holder.push(current); | ||
if (lastCall) toReturn.push(holder); | ||
return current; | ||
} | ||
if (holderIsEmpty) { | ||
toReturn.push([prev]); | ||
if (lastCall) toReturn.push([current]); | ||
return current; | ||
} | ||
toReturn.push(holder); | ||
if (lastCall) toReturn.push([current]); | ||
holder = []; | ||
return current; | ||
}, undefined); | ||
return toReturn; | ||
} | ||
function has(prop, obj) { | ||
if (arguments.length === 1) return _obj => has(prop, _obj); | ||
if (!obj) return false; | ||
return obj[prop] !== undefined; | ||
} | ||
function path(pathInput, obj) { | ||
if (arguments.length === 1) return _obj => path(pathInput, _obj); | ||
if (obj === null || obj === undefined) { | ||
return undefined; | ||
} | ||
let willReturn = obj; | ||
let counter = 0; | ||
const pathArrValue = typeof pathInput === 'string' ? pathInput.split('.') : pathInput; | ||
while (counter < pathArrValue.length) { | ||
if (willReturn === null || willReturn === undefined) { | ||
return undefined; | ||
} | ||
willReturn = willReturn[pathArrValue[counter]]; | ||
counter++; | ||
} | ||
return willReturn; | ||
} | ||
function hasPath(maybePath, obj) { | ||
if (arguments.length === 1) { | ||
return objHolder => hasPath(maybePath, objHolder); | ||
} | ||
return path(maybePath, obj) !== undefined; | ||
} | ||
function head(listOrString) { | ||
if (typeof listOrString === 'string') return listOrString[0] || ''; | ||
return listOrString[0]; | ||
} | ||
function _objectIs(a, b) { | ||
if (a === b) { | ||
return a !== 0 || 1 / a === 1 / b; | ||
} | ||
return a !== a && b !== b; | ||
} | ||
var _objectIs$1 = Object.is || _objectIs; | ||
function identical(a, b) { | ||
if (arguments.length === 1) return _b => identical(a, _b); | ||
return _objectIs$1(a, b); | ||
} | ||
function identity(input) { | ||
return input; | ||
} | ||
function ifElseFn(condition, onTrue, onFalse) { | ||
return (...input) => { | ||
const conditionResult = typeof condition === 'boolean' ? condition : condition(...input); | ||
if (conditionResult === true) { | ||
return onTrue(...input); | ||
} | ||
return onFalse(...input); | ||
}; | ||
} | ||
const ifElse = curry(ifElseFn); | ||
const inc = x => x + 1; | ||
function indexByPath(pathInput, list) { | ||
const toReturn = {}; | ||
for (let i = 0; i < list.length; i++) { | ||
const item = list[i]; | ||
toReturn[path(pathInput, item)] = item; | ||
} | ||
return toReturn; | ||
} | ||
function indexBy(condition, list) { | ||
if (arguments.length === 1) { | ||
return _list => indexBy(condition, _list); | ||
} | ||
if (typeof condition === 'string') { | ||
return indexByPath(condition, list); | ||
} | ||
const toReturn = {}; | ||
for (let i = 0; i < list.length; i++) { | ||
const item = list[i]; | ||
toReturn[condition(item)] = item; | ||
} | ||
return toReturn; | ||
} | ||
function indexOf(valueToFind, list) { | ||
if (arguments.length === 1) { | ||
return _list => indexOf(valueToFind, _list); | ||
} | ||
let index = -1; | ||
const { | ||
length | ||
} = list; | ||
while (++index < length) { | ||
if (list[index] === valueToFind) { | ||
return index; | ||
} | ||
} | ||
return -1; | ||
} | ||
function baseSlice(array, start, end) { | ||
let index = -1; | ||
let { | ||
length | ||
} = array; | ||
end = end > length ? length : end; | ||
if (end < 0) { | ||
end += length; | ||
} | ||
length = start > end ? 0 : end - start >>> 0; | ||
start >>>= 0; | ||
const result = Array(length); | ||
while (++index < length) { | ||
result[index] = array[index + start]; | ||
} | ||
return result; | ||
} | ||
function init(listOrString) { | ||
if (typeof listOrString === 'string') return listOrString.slice(0, -1); | ||
return listOrString.length ? baseSlice(listOrString, 0, -1) : []; | ||
} | ||
function intersection(listA, listB) { | ||
if (arguments.length === 1) return _list => intersection(listA, _list); | ||
return filter(value => includes(value, listB), listA); | ||
} | ||
function intersperse(separator, list) { | ||
if (arguments.length === 1) return _list => intersperse(separator, _list); | ||
let index = -1; | ||
const len = list.length; | ||
const willReturn = []; | ||
while (++index < len) { | ||
if (index === len - 1) { | ||
willReturn.push(list[index]); | ||
} else { | ||
willReturn.push(list[index], separator); | ||
} | ||
} | ||
return willReturn; | ||
} | ||
function is(targetPrototype, x) { | ||
if (arguments.length === 1) return _x => is(targetPrototype, _x); | ||
return x != null && x.constructor === targetPrototype || x instanceof targetPrototype; | ||
} | ||
function isEmpty(input) { | ||
const inputType = type(input); | ||
if (['Undefined', 'NaN', 'Number', 'Null'].includes(inputType)) return false; | ||
if (!input) return true; | ||
if (inputType === 'Object') { | ||
return Object.keys(input).length === 0; | ||
} | ||
if (inputType === 'Array') { | ||
return input.length === 0; | ||
} | ||
return false; | ||
} | ||
function isNil(x) { | ||
return x === undefined || x === null; | ||
} | ||
function join(glue, list) { | ||
if (arguments.length === 1) return _list => join(glue, _list); | ||
return list.join(glue); | ||
} | ||
function keys(x) { | ||
return Object.keys(x); | ||
} | ||
function last(listOrString) { | ||
if (typeof listOrString === 'string') { | ||
return listOrString[listOrString.length - 1] || ''; | ||
} | ||
return listOrString[listOrString.length - 1]; | ||
} | ||
function lastIndexOf(target, list) { | ||
if (arguments.length === 1) return _list => lastIndexOf(target, _list); | ||
let index = list.length; | ||
while (--index > 0) { | ||
if (equals(list[index], target)) { | ||
return index; | ||
} | ||
} | ||
return -1; | ||
} | ||
function length(x) { | ||
if (!x && x !== '' || x.length === undefined) { | ||
return NaN; | ||
} | ||
return x.length; | ||
} | ||
function lens(getter, setter) { | ||
return function (functor) { | ||
return function (target) { | ||
return functor(getter(target)).map(focus => setter(focus, target)); | ||
}; | ||
}; | ||
} | ||
function nth(index, list) { | ||
if (arguments.length === 1) return _list => nth(index, _list); | ||
const idx = index < 0 ? list.length + index : index; | ||
return Object.prototype.toString.call(list) === '[object String]' ? list.charAt(idx) : list[idx]; | ||
} | ||
function updateFn(index, newValue, list) { | ||
const arrClone = list.slice(); | ||
return arrClone.fill(newValue, index, index + 1); | ||
} | ||
const update = curry(updateFn); | ||
function lensIndex(index) { | ||
return lens(nth(index), update(index)); | ||
} | ||
function lensPath(key) { | ||
return lens(path(key), assocPath(key)); | ||
} | ||
function prop(propToFind, obj) { | ||
if (arguments.length === 1) return _obj => prop(propToFind, _obj); | ||
if (!obj) return undefined; | ||
return obj[propToFind]; | ||
} | ||
function lensProp(key) { | ||
return lens(prop(key), assoc(key)); | ||
} | ||
function match(pattern, input) { | ||
if (arguments.length === 1) return _input => match(pattern, _input); | ||
const willReturn = input.match(pattern); | ||
return willReturn === null ? [] : willReturn; | ||
} | ||
function mathMod(x, y) { | ||
if (arguments.length === 1) return _y => mathMod(x, _y); | ||
if (!_isInteger$1(x) || !_isInteger$1(y) || y < 1) return NaN; | ||
return (x % y + y) % y; | ||
} | ||
function maxByFn(compareFn, x, y) { | ||
return compareFn(y) > compareFn(x) ? y : x; | ||
} | ||
const maxBy = curry(maxByFn); | ||
function sum(list) { | ||
return list.reduce((prev, current) => prev + current, 0); | ||
} | ||
function mean(list) { | ||
return sum(list) / list.length; | ||
} | ||
function median(list) { | ||
const len = list.length; | ||
if (len === 0) return NaN; | ||
const width = 2 - len % 2; | ||
const idx = (len - width) / 2; | ||
return mean(Array.prototype.slice.call(list, 0).sort((a, b) => { | ||
if (a === b) return 0; | ||
return a < b ? -1 : 1; | ||
}).slice(idx, idx + width)); | ||
} | ||
function merge(target, newProps) { | ||
if (arguments.length === 1) return _newProps => merge(target, _newProps); | ||
return Object.assign({}, target || {}, newProps || {}); | ||
} | ||
function mergeAll(arr) { | ||
let willReturn = {}; | ||
map(val => { | ||
willReturn = merge(willReturn, val); | ||
}, arr); | ||
return willReturn; | ||
} | ||
function mergeDeepRight(target, source) { | ||
if (arguments.length === 1) { | ||
return sourceHolder => mergeDeepRight(target, sourceHolder); | ||
} | ||
const willReturn = JSON.parse(JSON.stringify(target)); | ||
Object.keys(source).forEach(key => { | ||
if (type(source[key]) === 'Object') { | ||
if (type(target[key]) === 'Object') { | ||
willReturn[key] = mergeDeepRight(target[key], source[key]); | ||
} else { | ||
willReturn[key] = source[key]; | ||
} | ||
} else { | ||
willReturn[key] = source[key]; | ||
} | ||
}); | ||
return willReturn; | ||
} | ||
function mergeLeft(x, y) { | ||
if (arguments.length === 1) return _y => mergeLeft(x, _y); | ||
return merge(y, x); | ||
} | ||
function min(x, y) { | ||
if (arguments.length === 1) return _y => min(x, _y); | ||
return y < x ? y : x; | ||
} | ||
function minByFn(compareFn, x, y) { | ||
return compareFn(y) < compareFn(x) ? y : x; | ||
} | ||
const minBy = curry(minByFn); | ||
function modulo(x, y) { | ||
if (arguments.length === 1) return _y => modulo(x, _y); | ||
return x % y; | ||
} | ||
function moveFn(fromIndex, toIndex, list) { | ||
if (fromIndex < 0 || toIndex < 0) { | ||
throw new Error('Rambda.move does not support negative indexes'); | ||
} | ||
if (fromIndex > list.length - 1 || toIndex > list.length - 1) return list; | ||
const clone = list.slice(); | ||
clone[fromIndex] = list[toIndex]; | ||
clone[toIndex] = list[fromIndex]; | ||
return clone; | ||
} | ||
const move = curry(moveFn); | ||
function multiply(x, y) { | ||
if (arguments.length === 1) return _y => multiply(x, _y); | ||
return x * y; | ||
} | ||
function negate(x) { | ||
return -x; | ||
} | ||
function none(predicate, list) { | ||
if (arguments.length === 1) return _list => none(predicate, _list); | ||
for (let i = 0; i < list.length; i++) { | ||
if (!predicate(list[i])) return true; | ||
} | ||
return false; | ||
} | ||
function not(input) { | ||
return !input; | ||
} | ||
function of(value) { | ||
return [value]; | ||
} | ||
function omit(propsToOmit, obj) { | ||
if (arguments.length === 1) return _obj => omit(propsToOmit, _obj); | ||
if (obj === null || obj === undefined) { | ||
return undefined; | ||
} | ||
const propsToOmitValue = typeof propsToOmit === 'string' ? propsToOmit.split(',') : propsToOmit; | ||
const willReturn = {}; | ||
for (const key in obj) { | ||
if (!propsToOmitValue.includes(key)) { | ||
willReturn[key] = obj[key]; | ||
} | ||
} | ||
return willReturn; | ||
} | ||
function onceFn(fn, context) { | ||
let result; | ||
return function () { | ||
if (fn) { | ||
result = fn.apply(context || this, arguments); | ||
fn = null; | ||
} | ||
return result; | ||
}; | ||
} | ||
function once(fn, context) { | ||
if (arguments.length === 1) { | ||
const wrap = onceFn(fn, context); | ||
return curry(wrap); | ||
} | ||
return onceFn(fn, context); | ||
} | ||
function or(a, b) { | ||
if (arguments.length === 1) return _b => or(a, _b); | ||
return a || b; | ||
} | ||
const Identity = x => ({ | ||
x, | ||
map: fn => Identity(fn(x)) | ||
}); | ||
function overFn(lens, fn, object) { | ||
return lens(x => Identity(fn(x)))(object).x; | ||
} | ||
const over = curry(overFn); | ||
function partial(fn, ...args) { | ||
const len = fn.length; | ||
return (...rest) => { | ||
if (args.length + rest.length >= len) { | ||
return fn(...args, ...rest); | ||
} | ||
return partial(fn, ...[...args, ...rest]); | ||
}; | ||
} | ||
function partitionObject(predicate, iterable) { | ||
const yes = {}; | ||
const no = {}; | ||
Object.entries(iterable).forEach(([prop, value]) => { | ||
if (predicate(value, prop)) { | ||
yes[prop] = value; | ||
} else { | ||
no[prop] = value; | ||
} | ||
}); | ||
return [yes, no]; | ||
} | ||
function partitionArray(predicate, list) { | ||
const yes = []; | ||
const no = []; | ||
let counter = -1; | ||
while (counter++ < list.length - 1) { | ||
if (predicate(list[counter])) { | ||
yes.push(list[counter]); | ||
} else { | ||
no.push(list[counter]); | ||
} | ||
} | ||
return [yes, no]; | ||
} | ||
function partition(predicate, iterable) { | ||
if (arguments.length === 1) { | ||
return listHolder => partition(predicate, listHolder); | ||
} | ||
if (!_isArray(iterable)) return partitionObject(predicate, iterable); | ||
return partitionArray(predicate, iterable); | ||
} | ||
function pathEqFn(pathToSearch, target, input) { | ||
return equals(path(pathToSearch, input), target); | ||
} | ||
const pathEq = curry(pathEqFn); | ||
function pathOrFn(defaultValue, list, obj) { | ||
return defaultTo(defaultValue, path(list, obj)); | ||
} | ||
const pathOr = curry(pathOrFn); | ||
function paths(pathsToSearch, obj) { | ||
if (arguments.length === 1) { | ||
return _obj => paths(pathsToSearch, _obj); | ||
} | ||
return pathsToSearch.map(singlePath => path(singlePath, obj)); | ||
} | ||
function pick(propsToPick, input) { | ||
if (arguments.length === 1) return _input => pick(propsToPick, _input); | ||
if (input === null || input === undefined) { | ||
return undefined; | ||
} | ||
const keys = typeof propsToPick === 'string' ? propsToPick.split(',') : propsToPick; | ||
const willReturn = {}; | ||
let counter = 0; | ||
while (counter < keys.length) { | ||
if (keys[counter] in input) { | ||
willReturn[keys[counter]] = input[keys[counter]]; | ||
} | ||
counter++; | ||
} | ||
return willReturn; | ||
} | ||
function pickAll(propsToPick, obj) { | ||
if (arguments.length === 1) return _obj => pickAll(propsToPick, _obj); | ||
if (obj === null || obj === undefined) { | ||
return undefined; | ||
} | ||
const keysValue = typeof propsToPick === 'string' ? propsToPick.split(',') : propsToPick; | ||
const willReturn = {}; | ||
let counter = 0; | ||
while (counter < keysValue.length) { | ||
if (keysValue[counter] in obj) { | ||
willReturn[keysValue[counter]] = obj[keysValue[counter]]; | ||
} else { | ||
willReturn[keysValue[counter]] = undefined; | ||
} | ||
counter++; | ||
} | ||
return willReturn; | ||
} | ||
function pipe(...fns) { | ||
if (fns.length === 0) throw new Error('pipe requires at least one argument'); | ||
return (...args) => { | ||
const list = fns.slice(); | ||
if (list.length > 0) { | ||
const fn = list.shift(); | ||
let result = fn(...args); | ||
while (list.length > 0) { | ||
result = list.shift()(result); | ||
} | ||
return result; | ||
} | ||
}; | ||
} | ||
function pluck(property, list) { | ||
if (arguments.length === 1) return _list => pluck(property, _list); | ||
const willReturn = []; | ||
map(x => { | ||
if (x[property] !== undefined) { | ||
willReturn.push(x[property]); | ||
} | ||
}, list); | ||
return willReturn; | ||
} | ||
function prepend(x, input) { | ||
if (arguments.length === 1) return _input => prepend(x, _input); | ||
if (typeof input === 'string') return [x].concat(input.split('')); | ||
return [x].concat(input); | ||
} | ||
const product = reduce(multiply, 1); | ||
function propEqFn(propToFind, valueToMatch, obj) { | ||
if (!obj) return false; | ||
return obj[propToFind] === valueToMatch; | ||
} | ||
const propEq = curry(propEqFn); | ||
function propIsFn(targetPrototype, property, obj) { | ||
return is(targetPrototype, obj[property]); | ||
} | ||
const propIs = curry(propIsFn); | ||
function propOrFn(defaultValue, property, obj) { | ||
if (!obj) return defaultValue; | ||
return defaultTo(defaultValue, obj[property]); | ||
} | ||
const propOr = curry(propOrFn); | ||
function props(propsToPick, obj) { | ||
if (arguments.length === 1) { | ||
return _obj => props(propsToPick, _obj); | ||
} | ||
if (!_isArray(propsToPick)) { | ||
throw new Error('propsToPick is not a list'); | ||
} | ||
return mapArray(prop => obj[prop], propsToPick); | ||
} | ||
function range(start, end) { | ||
if (arguments.length === 1) return _end => range(start, _end); | ||
if (Number.isNaN(Number(start)) || Number.isNaN(Number(end))) { | ||
throw new TypeError('Both arguments to range must be numbers'); | ||
} | ||
if (end < start) return []; | ||
const len = end - start; | ||
const willReturn = Array(len); | ||
for (let i = 0; i < len; i++) { | ||
willReturn[i] = start + i; | ||
} | ||
return willReturn; | ||
} | ||
function reject(predicate, list) { | ||
if (arguments.length === 1) return _list => reject(predicate, _list); | ||
return filter(x => !predicate(x), list); | ||
} | ||
function repeat(x, timesToRepeat) { | ||
if (arguments.length === 1) { | ||
return _timesToRepeat => repeat(x, _timesToRepeat); | ||
} | ||
return Array(timesToRepeat).fill(x); | ||
} | ||
function replaceFn(pattern, replacer, str) { | ||
return str.replace(pattern, replacer); | ||
} | ||
const replace = curry(replaceFn); | ||
function reverse(listOrString) { | ||
if (typeof listOrString === 'string') { | ||
return listOrString.split('').reverse().join(''); | ||
} | ||
const clone = listOrString.slice(); | ||
return clone.reverse(); | ||
} | ||
function setFn(lens, replacer, x) { | ||
return over(lens, always(replacer), x); | ||
} | ||
const set = curry(setFn); | ||
function sliceFn(from, to, list) { | ||
return list.slice(from, to); | ||
} | ||
const slice = curry(sliceFn); | ||
function sort(sortFn, list) { | ||
if (arguments.length === 1) return _list => sort(sortFn, _list); | ||
const clone = list.slice(); | ||
return clone.sort(sortFn); | ||
} | ||
function sortBy(sortFn, list) { | ||
if (arguments.length === 1) return _list => sortBy(sortFn, _list); | ||
const clone = list.slice(); | ||
return clone.sort((a, b) => { | ||
const aSortResult = sortFn(a); | ||
const bSortResult = sortFn(b); | ||
if (aSortResult === bSortResult) return 0; | ||
return aSortResult < bSortResult ? -1 : 1; | ||
}); | ||
} | ||
function split(separator, str) { | ||
if (arguments.length === 1) return _str => split(separator, _str); | ||
return str.split(separator); | ||
} | ||
function maybe(ifRule, whenIf, whenElse) { | ||
const whenIfInput = ifRule && type(whenIf) === 'Function' ? whenIf() : whenIf; | ||
const whenElseInput = !ifRule && type(whenElse) === 'Function' ? whenElse() : whenElse; | ||
return ifRule ? whenIfInput : whenElseInput; | ||
} | ||
function take(howMany, listOrString) { | ||
if (arguments.length === 1) return _listOrString => take(howMany, _listOrString); | ||
if (howMany < 0) return listOrString.slice(); | ||
if (typeof listOrString === 'string') return listOrString.slice(0, howMany); | ||
return baseSlice(listOrString, 0, howMany); | ||
} | ||
function splitAt(index, input) { | ||
if (arguments.length === 1) { | ||
return _list => splitAt(index, _list); | ||
} | ||
if (!input) throw new TypeError(`Cannot read property 'slice' of ${input}`); | ||
if (!_isArray(input) && typeof input !== 'string') return [[], []]; | ||
const correctIndex = maybe(index < 0, input.length + index < 0 ? 0 : input.length + index, index); | ||
return [take(correctIndex, input), drop(correctIndex, input)]; | ||
} | ||
function splitEvery(sliceLength, listOrString) { | ||
if (arguments.length === 1) { | ||
return _listOrString => splitEvery(sliceLength, _listOrString); | ||
} | ||
if (sliceLength < 1) { | ||
throw new Error('First argument to splitEvery must be a positive integer'); | ||
} | ||
const willReturn = []; | ||
let counter = 0; | ||
while (counter < listOrString.length) { | ||
willReturn.push(listOrString.slice(counter, counter += sliceLength)); | ||
} | ||
return willReturn; | ||
} | ||
function splitWhen(predicate, input) { | ||
if (arguments.length === 1) { | ||
return _input => splitWhen(predicate, _input); | ||
} | ||
if (!input) throw new TypeError(`Cannot read property 'length' of ${input}`); | ||
const preFound = []; | ||
const postFound = []; | ||
let found = false; | ||
let counter = -1; | ||
while (counter++ < input.length - 1) { | ||
if (found) { | ||
postFound.push(input[counter]); | ||
} else if (predicate(input[counter])) { | ||
postFound.push(input[counter]); | ||
found = true; | ||
} else { | ||
preFound.push(input[counter]); | ||
} | ||
} | ||
return [preFound, postFound]; | ||
} | ||
function startsWith(target, str) { | ||
if (arguments.length === 1) return _str => startsWith(target, _str); | ||
return str.startsWith(target); | ||
} | ||
function subtract(a, b) { | ||
if (arguments.length === 1) return _b => subtract(a, _b); | ||
return a - b; | ||
} | ||
function symmetricDifference(x, y) { | ||
if (arguments.length === 1) { | ||
return _y => symmetricDifference(x, _y); | ||
} | ||
return concat(filter(value => !includes(value, y), x), filter(value => !includes(value, x), y)); | ||
} | ||
function tail(listOrString) { | ||
return drop(1, listOrString); | ||
} | ||
function takeLast(howMany, listOrString) { | ||
if (arguments.length === 1) return _listOrString => takeLast(howMany, _listOrString); | ||
const len = listOrString.length; | ||
if (howMany < 0) return listOrString.slice(); | ||
let numValue = howMany > len ? len : howMany; | ||
if (typeof listOrString === 'string') return listOrString.slice(len - numValue); | ||
numValue = len - numValue; | ||
return baseSlice(listOrString, numValue, len); | ||
} | ||
function takeLastWhile(predicate, input) { | ||
if (arguments.length === 1) { | ||
return _input => takeLastWhile(predicate, _input); | ||
} | ||
if (input.length === 0) return input; | ||
let found = false; | ||
const toReturn = []; | ||
let counter = input.length; | ||
while (!found || counter === 0) { | ||
counter--; | ||
if (predicate(input[counter]) === false) { | ||
found = true; | ||
} else if (!found) { | ||
toReturn.push(input[counter]); | ||
} | ||
} | ||
return _isArray(input) ? toReturn.reverse() : toReturn.reverse().join(''); | ||
} | ||
function takeWhile(predicate, iterable) { | ||
if (arguments.length === 1) { | ||
return _iterable => takeWhile(predicate, _iterable); | ||
} | ||
const isArray = _isArray(iterable); | ||
if (!isArray && typeof iterable !== 'string') { | ||
throw new Error('`iterable` is neither list nor a string'); | ||
} | ||
let flag = true; | ||
const holder = []; | ||
let counter = -1; | ||
while (counter++ < iterable.length - 1) { | ||
if (!predicate(iterable[counter])) { | ||
if (flag) flag = false; | ||
} else if (flag) { | ||
holder.push(iterable[counter]); | ||
} | ||
} | ||
return isArray ? holder : holder.join(''); | ||
} | ||
function tap(fn, x) { | ||
if (arguments.length === 1) return _x => tap(fn, _x); | ||
fn(x); | ||
return x; | ||
} | ||
function test(pattern, str) { | ||
if (arguments.length === 1) return _str => test(pattern, _str); | ||
if (typeof pattern === 'string') { | ||
throw new TypeError(`‘test’ requires a value of type RegExp as its first argument; received "${pattern}"`); | ||
} | ||
return str.search(pattern) !== -1; | ||
} | ||
function times(fn, howMany) { | ||
if (arguments.length === 1) return _howMany => times(fn, _howMany); | ||
if (!Number.isInteger(howMany) || howMany < 0) { | ||
throw new RangeError('n must be an integer'); | ||
} | ||
return map(fn, range(0, howMany)); | ||
} | ||
function toLower(str) { | ||
return str.toLowerCase(); | ||
} | ||
function toPairs(obj) { | ||
return Object.entries(obj); | ||
} | ||
function toString(x) { | ||
return x.toString(); | ||
} | ||
function toUpper(str) { | ||
return str.toUpperCase(); | ||
} | ||
function transpose(array) { | ||
return array.reduce((acc, el) => { | ||
el.forEach((nestedEl, i) => _isArray(acc[i]) ? acc[i].push(nestedEl) : acc.push([nestedEl])); | ||
return acc; | ||
}, []); | ||
} | ||
function trim(str) { | ||
return str.trim(); | ||
} | ||
function isFunction(fn) { | ||
return ['Async', 'Function'].includes(type(fn)); | ||
} | ||
function tryCatch(fn, fallback) { | ||
if (!isFunction(fn)) { | ||
throw new Error(`R.tryCatch | fn '${fn}'`); | ||
} | ||
const passFallback = isFunction(fallback); | ||
return (...inputs) => { | ||
try { | ||
return fn(...inputs); | ||
} catch (e) { | ||
return passFallback ? fallback(e, ...inputs) : fallback; | ||
} | ||
}; | ||
} | ||
function union(x, y) { | ||
if (arguments.length === 1) return _y => union(x, _y); | ||
const toReturn = x.slice(); | ||
y.forEach(yInstance => { | ||
if (!includes(yInstance, x)) toReturn.push(yInstance); | ||
}); | ||
return toReturn; | ||
} | ||
function uniqWith(predicate, list) { | ||
if (arguments.length === 1) return _list => uniqWith(predicate, _list); | ||
let index = -1; | ||
const len = list.length; | ||
const willReturn = []; | ||
while (++index < len) { | ||
const value = list[index]; | ||
const flag = any(willReturnInstance => predicate(value, willReturnInstance), willReturn); | ||
if (!flag) { | ||
willReturn.push(value); | ||
} | ||
} | ||
return willReturn; | ||
} | ||
function unless(predicate, whenFalse) { | ||
if (arguments.length === 1) { | ||
return _whenFalse => unless(predicate, _whenFalse); | ||
} | ||
return input => { | ||
if (predicate(input)) return input; | ||
return whenFalse(input); | ||
}; | ||
} | ||
function values(obj) { | ||
if (type(obj) !== 'Object') return []; | ||
return Object.values(obj); | ||
} | ||
const Const = x => ({ | ||
x, | ||
map: fn => Const(x) | ||
}); | ||
function view(lens, target) { | ||
if (arguments.length === 1) return _target => view(lens, _target); | ||
return lens(Const)(target).x; | ||
} | ||
function whenFn(predicate, whenTrueFn, input) { | ||
if (!predicate(input)) return input; | ||
return whenTrueFn(input); | ||
} | ||
const when = curry(whenFn); | ||
function where(conditions, input) { | ||
if (input === undefined) { | ||
return _input => where(conditions, _input); | ||
} | ||
let flag = true; | ||
for (const prop in conditions) { | ||
const result = conditions[prop](input[prop]); | ||
if (flag && result === false) { | ||
flag = false; | ||
} | ||
} | ||
return flag; | ||
} | ||
function whereEq(condition, input) { | ||
if (arguments.length === 1) { | ||
return _input => whereEq(condition, _input); | ||
} | ||
const result = filter((conditionValue, conditionProp) => equals(conditionValue, input[conditionProp]), condition); | ||
return Object.keys(result).length === Object.keys(condition).length; | ||
} | ||
function without(matchAgainst, source) { | ||
if (source === undefined) { | ||
return _source => without(matchAgainst, _source); | ||
} | ||
return reduce((prev, current) => includesArray(current, matchAgainst) ? prev : prev.concat(current), [], source); | ||
} | ||
function xor(a, b) { | ||
if (arguments.length === 1) return _b => xor(a, _b); | ||
return Boolean(a) && !b || Boolean(b) && !a; | ||
} | ||
function zip(left, right) { | ||
if (arguments.length === 1) return _right => zip(left, _right); | ||
const result = []; | ||
const length = Math.min(left.length, right.length); | ||
for (let i = 0; i < length; i++) { | ||
result[i] = [left[i], right[i]]; | ||
} | ||
return result; | ||
} | ||
function zipObj(keys, values) { | ||
if (arguments.length === 1) return yHolder => zipObj(keys, yHolder); | ||
return take(values.length, keys).reduce((prev, xInstance, i) => { | ||
prev[xInstance] = values[i]; | ||
return prev; | ||
}, {}); | ||
} | ||
function zipWithFn(fn, x, y) { | ||
return take(x.length > y.length ? y.length : x.length, x).map((xInstance, i) => fn(xInstance, y[i])); | ||
} | ||
const zipWith = curry(zipWithFn); | ||
exports.F = F; | ||
exports.T = T; | ||
exports.add = add; | ||
exports.adjust = adjust; | ||
exports.all = all; | ||
exports.allPass = allPass; | ||
exports.always = always; | ||
exports.and = and; | ||
exports.any = any; | ||
exports.anyPass = anyPass; | ||
exports.append = append; | ||
exports.applySpec = applySpec; | ||
exports.assoc = assoc; | ||
exports.assocPath = assocPath; | ||
exports.both = both; | ||
exports.chain = chain; | ||
exports.clamp = clamp; | ||
exports.clone = clone; | ||
exports.complement = complement; | ||
exports.compose = compose; | ||
exports.concat = concat; | ||
exports.cond = cond; | ||
exports.converge = converge; | ||
exports.curry = curry; | ||
exports.curryN = curryN; | ||
exports.dec = dec; | ||
exports.defaultTo = defaultTo; | ||
exports.difference = difference; | ||
exports.dissoc = dissoc; | ||
exports.divide = divide; | ||
exports.drop = drop; | ||
exports.dropLast = dropLast; | ||
exports.dropLastWhile = dropLastWhile; | ||
exports.dropRepeats = dropRepeats; | ||
exports.dropRepeatsWith = dropRepeatsWith; | ||
exports.dropWhile = dropWhile; | ||
exports.either = either; | ||
exports.endsWith = endsWith; | ||
exports.eqProps = eqProps; | ||
exports.equals = equals; | ||
exports.evolve = evolve; | ||
exports.evolveArray = evolveArray; | ||
exports.evolveObject = evolveObject; | ||
exports.filter = filter; | ||
exports.filterArray = filterArray; | ||
exports.filterObject = filterObject; | ||
exports.find = find; | ||
exports.findIndex = findIndex; | ||
exports.findLast = findLast; | ||
exports.findLastIndex = findLastIndex; | ||
exports.flatten = flatten; | ||
exports.flip = flip; | ||
exports.forEach = forEach; | ||
exports.fromPairs = fromPairs; | ||
exports.groupBy = groupBy; | ||
exports.groupWith = groupWith; | ||
exports.has = has; | ||
exports.hasPath = hasPath; | ||
exports.head = head; | ||
exports.identical = identical; | ||
exports.identity = identity; | ||
exports.ifElse = ifElse; | ||
exports.inc = inc; | ||
exports.includes = includes; | ||
exports.includesArray = includesArray; | ||
exports.indexBy = indexBy; | ||
exports.indexOf = indexOf; | ||
exports.init = init; | ||
exports.intersection = intersection; | ||
exports.intersperse = intersperse; | ||
exports.is = is; | ||
exports.isEmpty = isEmpty; | ||
exports.isNil = isNil; | ||
exports.join = join; | ||
exports.keys = keys; | ||
exports.last = last; | ||
exports.lastIndexOf = lastIndexOf; | ||
exports.length = length; | ||
exports.lens = lens; | ||
exports.lensIndex = lensIndex; | ||
exports.lensPath = lensPath; | ||
exports.lensProp = lensProp; | ||
exports.map = map; | ||
exports.mapArray = mapArray; | ||
exports.mapObject = mapObject; | ||
exports.match = match; | ||
exports.mathMod = mathMod; | ||
exports.max = max; | ||
exports.maxBy = maxBy; | ||
exports.maxByFn = maxByFn; | ||
exports.mean = mean; | ||
exports.median = median; | ||
exports.merge = merge; | ||
exports.mergeAll = mergeAll; | ||
exports.mergeDeepRight = mergeDeepRight; | ||
exports.mergeLeft = mergeLeft; | ||
exports.min = min; | ||
exports.minBy = minBy; | ||
exports.minByFn = minByFn; | ||
exports.modulo = modulo; | ||
exports.move = move; | ||
exports.multiply = multiply; | ||
exports.negate = negate; | ||
exports.none = none; | ||
exports.not = not; | ||
exports.nth = nth; | ||
exports.of = of; | ||
exports.omit = omit; | ||
exports.once = once; | ||
exports.or = or; | ||
exports.over = over; | ||
exports.partial = partial; | ||
exports.partition = partition; | ||
exports.partitionArray = partitionArray; | ||
exports.partitionObject = partitionObject; | ||
exports.path = path; | ||
exports.pathEq = pathEq; | ||
exports.pathOr = pathOr; | ||
exports.paths = paths; | ||
exports.pick = pick; | ||
exports.pickAll = pickAll; | ||
exports.pipe = pipe; | ||
exports.pluck = pluck; | ||
exports.prepend = prepend; | ||
exports.product = product; | ||
exports.prop = prop; | ||
exports.propEq = propEq; | ||
exports.propIs = propIs; | ||
exports.propOr = propOr; | ||
exports.props = props; | ||
exports.range = range; | ||
exports.reduce = reduce; | ||
exports.reject = reject; | ||
exports.repeat = repeat; | ||
exports.replace = replace; | ||
exports.reverse = reverse; | ||
exports.set = set; | ||
exports.slice = slice; | ||
exports.sort = sort; | ||
exports.sortBy = sortBy; | ||
exports.split = split; | ||
exports.splitAt = splitAt; | ||
exports.splitEvery = splitEvery; | ||
exports.splitWhen = splitWhen; | ||
exports.startsWith = startsWith; | ||
exports.subtract = subtract; | ||
exports.sum = sum; | ||
exports.symmetricDifference = symmetricDifference; | ||
exports.tail = tail; | ||
exports.take = take; | ||
exports.takeLast = takeLast; | ||
exports.takeLastWhile = takeLastWhile; | ||
exports.takeWhile = takeWhile; | ||
exports.tap = tap; | ||
exports.test = test; | ||
exports.times = times; | ||
exports.toLower = toLower; | ||
exports.toPairs = toPairs; | ||
exports.toString = toString; | ||
exports.toUpper = toUpper; | ||
exports.transpose = transpose; | ||
exports.trim = trim; | ||
exports.tryCatch = tryCatch; | ||
exports.type = type; | ||
exports.union = union; | ||
exports.uniq = uniq; | ||
exports.uniqWith = uniqWith; | ||
exports.unless = unless; | ||
exports.update = update; | ||
exports.values = values; | ||
exports.view = view; | ||
exports.when = when; | ||
exports.where = where; | ||
exports.whereEq = whereEq; | ||
exports.without = without; | ||
exports.xor = xor; | ||
exports.zip = zip; | ||
exports.zipObj = zipObj; | ||
exports.zipWith = zipWith; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
}))); | ||
!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((n="undefined"!=typeof globalThis?globalThis:n||self).R={})}(this,function(n){"use strict";function l(n){return(l="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(n)}function i(n,r){return function(n){if(Array.isArray(n))return n}(n)||function(n,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(n)))return;var t=[],e=!0,u=!1,i=void 0;try{for(var o,f=n[Symbol.iterator]();!(e=(o=f.next()).done)&&(t.push(o.value),!r||t.length!==r);e=!0);}catch(n){u=!0,i=n}finally{try{e||null==f.return||f.return()}finally{if(u)throw i}}return t}(n,r)||t(n,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(n){return function(n){if(Array.isArray(n))return e(n)}(n)||function(n){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(n))return Array.from(n)}(n)||t(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function t(n,r){if(n){if("string"==typeof n)return e(n,r);var t=Object.prototype.toString.call(n).slice(8,-1);return"Map"===(t="Object"===t&&n.constructor?n.constructor.name:t)||"Set"===t?Array.from(n):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?e(n,r):void 0}}function e(n,r){for(var t=0,e=Array(r=null==r||r>n.length?n.length:r);t<r;t++)e[t]=n[t];return e}function o(u){var i=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[];return function(){for(var n,r=arguments.length,t=Array(r),e=0;e<r;e++)t[e]=arguments[e];return(n=[].concat(h(i),t)).length<u.length?o(u,n):u.apply(void 0,h(n))}}var r=o(function(n,r,t){var e=n<0?t.length+n:n;return t.length<=n||e<0||((t=t.slice())[e]=r(t[e])),t});function u(n){return function(){return n}}function f(r,n){if(1===arguments.length)return function(n){return f(r,n)};for(var t=0;t<n.length;){if(r(n[t],t))return!0;t++}return!1}var s=Array.isArray;function p(){for(var n=[],r=0,t=arguments.length;r<t&&void 0!==arguments[r];)n[r]=arguments[r],r++;return n}var c=o(function(n,r,t){return Object.assign({},t,(t=r,(r=n)in(n={})?Object.defineProperty(n,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[r]=t,n))});function a(n){return n<<0===n}var g=Number.isInteger||a;var v=o(function n(r,t,e){var u="string"==typeof r?r.split(".").map(function(n){return a(+(""+n))?+(""+n):n}):r;if(0===u.length)return t;r=u[0];if(1<u.length&&(i="object"===l(e)&&null!==e&&e.hasOwnProperty(r)?e[r]:a(u[1])?[]:{},t=n(Array.prototype.slice.call(u,1),t,i)),a(r)&&s(e)){var i=e.slice();return i[r]=t,i}return c(r,t,e)});var y=o(function(n,r,t){if(r<n)throw Error("min must not be greater than max in clamp(min, max, value)");return t<n||r<t?r<t?r:t<n?n:void 0:t});function d(r,n){return 1===arguments.length?function(n){return d(r,n)}:"string"==typeof r?"".concat(r).concat(n):[].concat(h(r),h(n))}function m(n,l){switch(n){case 0:return function(){return l.apply(this,arguments)};case 1:return function(n){return l.apply(this,arguments)};case 2:return function(n,r){return l.apply(this,arguments)};case 3:return function(n,r,t){return l.apply(this,arguments)};case 4:return function(n,r,t,e){return l.apply(this,arguments)};case 5:return function(n,r,t,e,u){return l.apply(this,arguments)};case 6:return function(n,r,t,e,u,i){return l.apply(this,arguments)};case 7:return function(n,r,t,e,u,i,o){return l.apply(this,arguments)};case 8:return function(n,r,t,e,u,i,o,f){return l.apply(this,arguments)};case 9:return function(n,r,t,e,u,i,o,f,c){return l.apply(this,arguments)};default:return function(n,r,t,e,u,i,o,f,c,a){return l.apply(this,arguments)}}}function b(r,n){if(1===arguments.length)return function(n){return b(r,n)};if(10<r)throw Error("First argument to _arity must be a non-negative integer no greater than ten");return m(r,function i(o,f,c){return function(){for(var n=0,r=0,t=f.length,e=arguments.length,u=Array(t+e);n<t;)u[n]=f[n],n++;for(;r<e;)u[t+r]=arguments[r],r++;return u.length<o?m(o-u.length,i(o,u,c)):c.apply(this,u)}}(r,[],n))}var w=Object.keys;function j(n,r){for(var t=2<arguments.length&&void 0!==arguments[2]&&arguments[2],e=0,u=Array(r.length);e<r.length;)u[e]=t?n(r[e],e):n(r[e]),e++;return u}function E(n,r){for(var t=0,e=w(r),u=e.length,i={};t<u;){var o=e[t];i[o]=n(r[o],o,r),t++}return i}function O(r,n){return 1===arguments.length?function(n){return O(r,n)}:void 0===n?[]:(s(n)?j:E)(r,n)}function A(r,n){return 1===arguments.length?function(n){return A(r,n)}:r<n?n:r}var N=o(function(n,r,t){if(!s(t))throw new TypeError("reduce: list must be array or iterable");for(var e=0,u=t.length;e<u;)r=n(r,t[e],e,t),e++;return r});function x(r,n){return 1===arguments.length?function(n){return x(r,n)}:null==(t=n)||!0===Number.isNaN(t)?r:n;var t}function S(n){var r=l(n);if(null===n)return"Null";if(void 0===n)return"Undefined";if("boolean"===r)return"Boolean";if("number"===r)return Number.isNaN(n)?"NaN":"Number";if("string"===r)return"String";if(s(n))return"Array";if("symbol"===r)return"Symbol";if(n instanceof RegExp)return"RegExp";var t=n&&n.toString?""+n:"";return["true","false"].includes(t)?"Boolean":Number.isNaN(+(""+t))?t.startsWith("async")?"Async":"[object Promise]"===t?"Promise":"function"===r?"Function":n instanceof String?"String":"Object":"Number"}function T(n){var r=""+n.__proto__;return["Error","TypeError"].includes(r)?[r,n.message]:[]}function k(n){return n.toDateString?[!0,n.getTime()]:[!1]}function P(n){return n.constructor!==RegExp?[!1]:[!0,""+n]}function W(t,e){if(1===arguments.length)return function(n){return W(t,n)};var n=S(t);if(n!==S(e))return!1;if("Function"===n)return void 0!==t.name&&t.name===e.name;if(["NaN","Undefined","Null"].includes(n))return!0;if("Number"===n)return Object.is(-0,t)===Object.is(-0,e)&&""+t==""+e;if(["String","Boolean"].includes(n))return""+t==""+e;if("Array"===n){var r=Array.from(t),u=Array.from(e);if(""+r!=""+u)return!1;var i=!0;return r.forEach(function(n,r){i&&(n===u[r]||W(n,u[r])||(i=!1))}),i}var o=P(t),r=P(e);if(o[0])return!!r[0]&&o[1]===r[1];if(r[0])return!1;o=k(t),r=k(e);if(o[0])return!!r[0]&&o[1]===r[1];if(r[0])return!1;o=T(t),r=T(e);if(o[0])return!!r[0]&&(o[0]===r[0]&&o[1]===r[1]);if("Object"!==n)return!1;n=Object.keys(t);if(n.length!==Object.keys(e).length)return!1;var f=!0;return n.forEach(function(n){var r;f&&((r=t[n])===(n=e[n])||W(r,n)||(f=!1))}),f}function F(n,r){for(var t=-1;++t<r.length;)if(W(r[t],n))return!0;return!1}function R(r,n){if(1===arguments.length)return function(n){return R(r,n)};if("string"==typeof n)return n.includes(r);if(!n)throw new TypeError("Cannot read property 'indexOf' of ".concat(n));return!!s(n)&&F(r,n)}function I(n){for(var r=-1,t=[];++r<n.length;){var e=n[r];R(e,t)||t.push(e)}return t}function q(r,n){return 1===arguments.length?function(n){return q(r,n)}:n.slice(0<r?r:0)}var B=o(function(n,r,t){if(!r||!t)throw Error("wrong object inputs are passed to R.eqProps");return W(r[n],t[n])});function L(t,n){return j(function(n,r){return"Function"===S(t[r])?t[r](n):n},n,!0)}function C(e,n){return E(function(n,r){if("Object"!==S(n))return"Function"===S(e[r])?e[r](n):n;var t=S(e[r]);return"Function"===t?e[r](n):"Object"===t?_(e[r],n):n},n)}function _(r,n){if(1===arguments.length)return function(n){return _(r,n)};var t=S(r),e=S(n);if(e!==t)throw Error("iterableType !== rulesType");if(!["Object","Array"].includes(t))throw Error("'iterable' and 'rules' are from wrong type ".concat(t));return("Object"===e?C:L)(r,n)}function M(n,r){var t,e={};for(t in r)n(r[t],t,r)&&(e[t]=r[t]);return e}function U(n,r){for(var t=2<arguments.length&&void 0!==arguments[2]&&arguments[2],e=0,u=r.length,i=[];e<u;)(t?n(r[e],e):n(r[e]))&&i.push(r[e]),e++;return i}function D(r,n){return 1===arguments.length?function(n){return D(r,n)}:n?(s(n)?U:M)(r,n):[]}function z(r,n){if(1===arguments.length)return function(n){return z(r,n)};if(null!=n){for(var t=n,e=0,u="string"==typeof r?r.split("."):r;e<u.length;){if(null==t)return;t=t[u[e]],e++}return t}}var J=Object.is||function(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r};var $=o(function(n,r,t){return function(){return(!0===("boolean"==typeof n?n:n.apply(void 0,arguments))?r:t).apply(void 0,arguments)}});function G(n,r,t){var e=-1,u=n.length;(t=u<t?u:t)<0&&(t+=u),u=t<r?0:t-r>>>0,r>>>=0;for(var i=Array(u);++e<u;)i[e]=n[e+r];return i}function H(r,n){return 1===arguments.length?function(n){return H(r,n)}:null!=n&&n.constructor===r||n instanceof r}function K(t,e){return function(n){return function(r){return n(t(r)).map(function(n){return e(n,r)})}}}function Q(r,n){if(1===arguments.length)return function(n){return Q(r,n)};var t=r<0?n.length+r:r;return"[object String]"===Object.prototype.toString.call(n)?n[0|t]:n[t]}var V=o(function(n,r,t){return t.slice().fill(r,n,n+1)});function X(r,n){return 1===arguments.length?function(n){return X(r,n)}:n?n[r]:void 0}function Y(n,r,t){return n(t)>n(r)?t:r}var Z=o(Y);function nn(n){return n.reduce(function(n,r){return n+r},0)}function rn(n){return nn(n)/n.length}function tn(r,n){return 1===arguments.length?function(n){return tn(r,n)}:Object.assign({},r||{},n||{})}function en(n,r,t){return n(t)<n(r)?t:r}var un=o(en);var on=o(function(n,r,t){if(n<0||r<0)throw Error("Rambda.move does not support negative indexes");if(t.length-1<n||t.length-1<r)return t;var e=t.slice();return e[n]=t[r],e[r]=t[n],e});function fn(r,n){return 1===arguments.length?function(n){return fn(r,n)}:r*n}function cn(n,r){var t;return function(){return n&&(t=n.apply(r||this,arguments),n=null),t}}function an(r){return{x:r,map:function(n){return an(n(r))}}}var ln=o(function(n,r,t){return n(function(n){return an(r(n))})(t).x});function hn(e){for(var n=arguments.length,u=Array(1<n?n-1:0),r=1;r<n;r++)u[r-1]=arguments[r];var i=e.length;return function(){for(var n=arguments.length,r=Array(n),t=0;t<n;t++)r[t]=arguments[t];return u.length+r.length<i?hn.apply(void 0,[e].concat([].concat(u,r))):e.apply(void 0,u.concat(r))}}function sn(t,n){var e={},u={};return Object.entries(n).forEach(function(n){var r=i(n,2),n=r[0],r=r[1];t(r,n)?e[n]=r:u[n]=r}),[e,u]}function pn(n,r){for(var t=[],e=[],u=-1;u++<r.length-1;)(n(r[u])?t:e).push(r[u]);return[t,e]}var gn=o(function(n,r,t){return W(z(n,t),r)});var vn=o(function(n,r,t){return x(n,z(r,t))});var yn=N(fn,1);var dn=o(function(n,r,t){return!!t&&t[n]===r});var mn=o(function(n,r,t){return H(n,t[r])});var bn=o(function(n,r,t){return t?x(n,t[r]):n});function wn(r,n){if(1===arguments.length)return function(n){return wn(r,n)};if(Number.isNaN(+(""+r))||Number.isNaN(+(""+n)))throw new TypeError("Both arguments to range must be numbers");if(n<r)return[];for(var t=n-r,e=Array(t),u=0;u<t;u++)e[u]=r+u;return e}var jn=o(function(n,r,t){return t.replace(n,r)});var En=o(function(n,r,t){return ln(n,u(r),t)});var On=o(function(n,r,t){return t.slice(n,r)});function An(r,n){return 1===arguments.length?function(n){return An(r,n)}:r<0?n.slice():"string"==typeof n?n.slice(0,r):G(n,0,r)}function Nn(n){return["Async","Function"].includes(S(n))}var xn=function r(t){return{x:t,map:function(n){return r(t)}}};var Sn=o(function(n,r,t){return n(t)?r(t):t});var Tn=o(function(t,n,e){return An((e.length<n.length?e:n).length,n).map(function(n,r){return t(n,e[r])})});n.F=function(){return!1},n.T=function(){return!0},n.add=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:+(""+t)+ +(""+n)},n.adjust=r,n.all=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=0;e<n.length;e++)if(!t(n[e]))return!1;return!0},n.allPass=function(t){return function(n){for(var r=0;r<t.length;){if(!t[r](n))return!1;r++}return!0}},n.always=u,n.and=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:t&&n},n.any=f,n.anyPass=function(t){return function(n){for(var r=0;r<t.length;){if(t[r](n))return!0;r++}return!1}},n.append=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if("string"==typeof n)return n.split("").concat(t);n=n.slice();return n.push(t),n},n.applySpec=function(n){var r=function n(r,t){var e,u=1<arguments.length&&void 0!==t?t:0;for(e in r)0!=r.hasOwnProperty(e)&&"constructor"!==e&&("object"===l(r[e])&&(u=Math.max(u,n(r[e]))),"function"==typeof r[e]&&(u=Math.max(u,r[e].length)));return u}(n);if(0===r)return function(){return{}};for(var t=arguments.length,e=Array(1<t?t-1:0),u=1;u<t;u++)e[u-1]=arguments[u];return function u(i,o,f){var n=o-f.length;if(1==n)return function(n){return u(i,o,p.apply(void 0,h(f).concat([n])))};if(2==n)return function(n,r){return u(i,o,p.apply(void 0,h(f).concat([n,r])))};if(3==n)return function(n,r,t){return u(i,o,p.apply(void 0,h(f).concat([n,r,t])))};if(4==n)return function(n,r,t,e){return u(i,o,p.apply(void 0,h(f).concat([n,r,t,e])))};if(4<n)return function(){for(var n=arguments.length,r=Array(n),t=0;t<n;t++)r[t]=arguments[t];return u(i,o,p.apply(void 0,h(f).concat(r)))};if(s(i)){for(var r=[],t=0,e=i.length;t<e;t++)"object"!==l(i[t])&&!s(i[t])||(r[t]=u(i[t],o,f)),"function"==typeof i[t]&&(r[t]=i[t].apply(i,h(f)));return r}var c,a={};for(c in i)0!=i.hasOwnProperty(c)&&"constructor"!==c&&("object"!==l(i[c])?"function"==typeof i[c]&&(a[c]=i[c].apply(i,h(f))):a[c]=u(i[c],o,f));return a}(n,r,e)},n.assoc=c,n.assocPath=v,n.both=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:function(){return t.apply(void 0,arguments)&&n.apply(void 0,arguments)}},n.chain=function r(t,n){var e;return 1===arguments.length?function(n){return r(t,n)}:(e=[]).concat.apply(e,h(n.map(t)))},n.clamp=y,n.clone=function n(r){var t,e=s(r)?Array(r.length):{};if(r&&r.getTime)return new Date(r.getTime());for(t in r){var u=r[t];e[t]="object"===l(u)&&null!==u?u.getTime?new Date(u.getTime()):n(u):u}return e},n.complement=function(n){return function(){return!n.apply(void 0,arguments)}},n.compose=function(){for(var n=arguments.length,t=Array(n),r=0;r<n;r++)t[r]=arguments[r];if(0===t.length)throw Error("compose requires at least one argument");return function(){var n=t.slice();if(0<n.length){for(var r=n.pop().apply(void 0,arguments);0<n.length;)r=n.pop()(r);return r}}},n.concat=d,n.cond=function(n){return function(t){var e,u=!1;return n.forEach(function(n){var r=i(n,2),n=r[1];!u&&(0,r[0])(t)&&(u=!0,e=n(t))}),e}},n.converge=function r(e,n){return 1===arguments.length?function(n){return r(e,n)}:b(N(function(n,r){return A(n,r.length)},0,n),function(){var r=arguments,t=this;return e.apply(this,O(function(n){return n.apply(t,r)},n))})},n.curry=o,n.curryN=b,n.dec=function(n){return n-1},n.defaultTo=x,n.difference=function r(t,e){return 1===arguments.length?function(n){return r(t,n)}:I(t).filter(function(n){return!R(n,e)})},n.dissoc=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(null==n)return{};var e,u={};for(e in n)u[e]=n[e];return delete u[t],u},n.divide=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:t/n},n.drop=q,n.dropLast=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:0<t?n.slice(0,-t):n.slice()},n.dropLastWhile=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(0===n.length)return n;var e=s(n);if("function"!=typeof t)throw Error("'predicate' is from wrong type ".concat(l(t)));if(!e&&"string"!=typeof n)throw Error("'iterable' is from wrong type ".concat(l(n)));for(var u=!1,i=[],o=n.length;0<o;)o--,u||!1!==t(n[o])?u&&i.push(n[o]):(u=!0,i.push(n[o]));return e?i.reverse():i.reverse().join("")},n.dropRepeats=function(n){if(!s(n))throw Error("".concat(n," is not a list"));var t=[];return n.reduce(function(n,r){return W(n,r)||t.push(r),r},void 0),t},n.dropRepeatsWith=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(!s(n))throw Error("".concat(n," is not a list"));var e=[];return n.reduce(function(n,r){return void 0!==n&&t(n,r)||e.push(r),r},void 0),e},n.dropWhile=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};var e=s(n);if(!e&&"string"!=typeof n)throw Error("`iterable` is neither list nor a string");for(var u=!1,i=[],o=-1;o++<n.length-1;)u?i.push(n[o]):t(n[o])||(u=u||!0,i.push(n[o]));return e?i:i.join("")},n.either=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:function(){return!(!t.apply(void 0,arguments)&&!n.apply(void 0,arguments))}},n.endsWith=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:n.endsWith(t)},n.eqProps=B,n.equals=W,n.evolve=_,n.evolveArray=L,n.evolveObject=C,n.filter=D,n.filterArray=U,n.filterObject=M,n.find=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=0,u=n.length;e<u;){var i=n[e];if(t(i))return i;e++}},n.findIndex=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=n.length,u=-1;++u<e;)if(t(n[u]))return u;return-1},n.findLast=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=n.length;0<=--e;)if(t(n[e]))return n[e]},n.findLastIndex=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=n.length;0<=--e;)if(t(n[e]))return e;return-1},n.flatten=function n(r,t){for(var e=void 0===t?[]:t,u=0;u<r.length;u++)s(r[u])?n(r[u],e):e.push(r[u]);return e},n.flip=function(n){return e=n,function(){for(var n=arguments.length,r=Array(n),t=0;t<n;t++)r[t]=arguments[t];if(1===r.length)return function(n){return e(n,r[0])};if(2===r.length)return e(r[1],r[0]);if(3===r.length)return e(r[1],r[0],r[2]);if(4===r.length)return e(r[1],r[0],r[2],r[3]);throw Error("R.flip doesn't work with arity > 4")};var e},n.forEach=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(void 0!==n){if(s(n))for(var e=0,u=n.length;e<u;)t(n[e]),e++;else for(var i=0,o=w(n),f=o.length;i<f;){var c=o[i];t(n[c],c,n),i++}return n}},n.fromPairs=function(n){var r={};return n.forEach(function(n){n=i(n,2);return r[n[0]]=n[1]}),r},n.groupBy=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e={},u=0;u<n.length;u++){var i=n[u],o=t(i);e[o]||(e[o]=[]),e[o].push(i)}return e},n.groupWith=function(i,o){if(!s(o))throw new TypeError("list.reduce is not a function");var n=o.slice();if(1===o.length)return[n];var f=[],c=[];return n.reduce(function(n,r,t){if(0===t)return r;var e=i(n,r),u=0===c.length,t=t===o.length-1;return e?(u&&c.push(n),c.push(r),t&&f.push(c)):u?(f.push([n]),t&&f.push([r])):(f.push(c),t&&f.push([r]),c=[]),r},void 0),f},n.has=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:!!n&&void 0!==n[t]},n.hasPath=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:void 0!==z(t,n)},n.head=function(n){return"string"==typeof n?n[0]||"":n[0]},n.identical=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:J(t,n)},n.identity=function(n){return n},n.ifElse=$,n.inc=function(n){return n+1},n.includes=R,n.includesArray=F,n.indexBy=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if("string"==typeof t)return function(n,r){for(var t={},e=0;e<r.length;e++){var u=r[e];t[z(n,u)]=u}return t}(t,n);for(var e={},u=0;u<n.length;u++){var i=n[u];e[t(i)]=i}return e},n.indexOf=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=-1,u=n.length;++e<u;)if(n[e]===t)return e;return-1},n.init=function(n){return"string"==typeof n?n.slice(0,-1):n.length?G(n,0,-1):[]},n.intersection=function r(t,e){return 1===arguments.length?function(n){return r(t,n)}:D(function(n){return R(n,e)},t)},n.intersperse=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=-1,u=n.length,i=[];++e<u;)e===u-1?i.push(n[e]):i.push(n[e],t);return i},n.is=H,n.isEmpty=function(n){var r=S(n);return!["Undefined","NaN","Number","Null"].includes(r)&&(!n||("Object"===r?0===Object.keys(n).length:"Array"===r&&0===n.length))},n.isNil=function(n){return null==n},n.join=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:n.join(t)},n.keys=function(n){return Object.keys(n)},n.last=function(n){return"string"==typeof n?n[n.length-1]||"":n[n.length-1]},n.lastIndexOf=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=n.length;0<--e;)if(W(n[e],t))return e;return-1},n.length=function(n){return!n&&""!==n||void 0===n.length?NaN:n.length},n.lens=K,n.lensIndex=function(n){return K(Q(n),V(n))},n.lensPath=function(n){return K(z(n),v(n))},n.lensProp=function(n){return K(X(n),c(n))},n.map=O,n.mapArray=j,n.mapObject=E,n.match=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};n=n.match(t);return null===n?[]:n},n.mathMod=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:g(t)&&g(n)&&1<=n?(t%n+n)%n:NaN},n.max=A,n.maxBy=Z,n.maxByFn=Y,n.mean=rn,n.median=function(n){if(0===(t=n.length))return NaN;var r=2-t%2,t=(t-r)/2;return rn(Array.prototype.slice.call(n,0).sort(function(n,r){return n===r?0:n<r?-1:1}).slice(t,t+r))},n.merge=tn,n.mergeAll=function(n){var r={};return O(function(n){r=tn(r,n)},n),r},n.mergeDeepRight=function r(t,e){if(1===arguments.length)return function(n){return r(t,n)};var u=JSON.parse(JSON.stringify(t));return Object.keys(e).forEach(function(n){"Object"===S(e[n])&&"Object"===S(t[n])?u[n]=r(t[n],e[n]):u[n]=e[n]}),u},n.mergeLeft=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:tn(n,t)},n.min=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:n<t?n:t},n.minBy=un,n.minByFn=en,n.modulo=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:t%n},n.move=on,n.multiply=fn,n.negate=function(n){return-n},n.none=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=0;e<n.length;e++)if(!t(n[e]))return!0;return!1},n.not=function(n){return!n},n.nth=Q,n.of=function(n){return[n]},n.omit=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(null!=n){var e,u="string"==typeof t?t.split(","):t,i={};for(e in n)u.includes(e)||(i[e]=n[e]);return i}},n.once=function(n,r){return 1!==arguments.length?cn(n,r):o(cn(n,r))},n.or=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:t||n},n.over=ln,n.partial=hn,n.partition=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:(s(n)?pn:sn)(t,n)},n.partitionArray=pn,n.partitionObject=sn,n.path=z,n.pathEq=gn,n.pathOr=vn,n.paths=function r(t,e){return 1===arguments.length?function(n){return r(t,n)}:t.map(function(n){return z(n,e)})},n.pick=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(null!=n){for(var e="string"==typeof t?t.split(","):t,u={},i=0;i<e.length;)e[i]in n&&(u[e[i]]=n[e[i]]),i++;return u}},n.pickAll=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(null!=n){for(var e="string"==typeof t?t.split(","):t,u={},i=0;i<e.length;)e[i]in n?u[e[i]]=n[e[i]]:u[e[i]]=void 0,i++;return u}},n.pipe=function(){for(var n=arguments.length,t=Array(n),r=0;r<n;r++)t[r]=arguments[r];if(0===t.length)throw Error("pipe requires at least one argument");return function(){var n=t.slice();if(0<n.length){for(var r=n.shift().apply(void 0,arguments);0<n.length;)r=n.shift()(r);return r}}},n.pluck=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};var e=[];return O(function(n){void 0!==n[t]&&e.push(n[t])},n),e},n.prepend=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:[t].concat("string"==typeof n?n.split(""):n)},n.product=yn,n.prop=X,n.propEq=dn,n.propIs=mn,n.propOr=bn,n.props=function r(t,e){if(1===arguments.length)return function(n){return r(t,n)};if(!s(t))throw Error("propsToPick is not a list");return j(function(n){return e[n]},t)},n.range=wn,n.reduce=N,n.reject=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:D(function(n){return!t(n)},n)},n.repeat=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:Array(n).fill(t)},n.replace=jn,n.reverse=function(n){return"string"==typeof n?n.split("").reverse().join(""):n.slice().reverse()},n.set=En,n.slice=On,n.sort=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:n.slice().sort(t)},n.sortBy=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:n.slice().sort(function(n,r){return n=t(n),r=t(r),n===r?0:n<r?-1:1})},n.split=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:n.split(t)},n.splitAt=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(!n)throw new TypeError("Cannot read property 'slice' of ".concat(n));if(!s(n)&&"string"!=typeof n)return[[],[]];var e,u,i=(u=n.length+t<0?0:n.length+t,u=(e=(i=t)<0)&&"Function"===S(u)?u():u,i=e||"Function"!==S(i)?i:i(),e?u:i);return[An(i,n),q(i,n)]},n.splitEvery=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(t<1)throw Error("First argument to splitEvery must be a positive integer");for(var e=[],u=0;u<n.length;)e.push(n.slice(u,u+=t));return e},n.splitWhen=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(!n)throw new TypeError("Cannot read property 'length' of ".concat(n));for(var e=[],u=[],i=!1,o=-1;o++<n.length-1;)i?u.push(n[o]):t(n[o])?(u.push(n[o]),i=!0):e.push(n[o]);return[e,u]},n.startsWith=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:n.startsWith(t)},n.subtract=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:t-n},n.sum=nn,n.symmetricDifference=function r(t,e){return 1===arguments.length?function(n){return r(t,n)}:d(D(function(n){return!R(n,e)},t),D(function(n){return!R(n,t)},e))},n.tail=function(n){return q(1,n)},n.take=An,n.takeLast=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};var e=n.length;if(t<0)return n.slice();var u=e<t?e:t;return"string"==typeof n?n.slice(e-u):G(n,u=e-u,e)},n.takeLastWhile=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(0===n.length)return n;for(var e=!1,u=[],i=n.length;!e||0===i;)!1===t(n[--i])?e=!0:e||u.push(n[i]);return s(n)?u.reverse():u.reverse().join("")},n.takeWhile=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};var e=s(n);if(!e&&"string"!=typeof n)throw Error("`iterable` is neither list nor a string");for(var u=!0,i=[],o=-1;o++<n.length-1;)t(n[o])?u&&i.push(n[o]):u=u&&!1;return e?i:i.join("")},n.tap=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:(t(n),n)},n.test=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if("string"==typeof t)throw new TypeError('‘test’ requires a value of type RegExp as its first argument; received "'.concat(t,'"'));return-1!=n.search(t)},n.times=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};if(!Number.isInteger(n)||n<0)throw new RangeError("n must be an integer");return O(t,wn(0,n))},n.toLower=function(n){return n.toLowerCase()},n.toPairs=function(n){return Object.entries(n)},n.toString=function(n){return""+n},n.toUpper=function(n){return n.toUpperCase()},n.transpose=function(n){return n.reduce(function(t,n){return n.forEach(function(n,r){return s(t[r])?t[r].push(n):t.push([n])}),t},[])},n.trim=function(n){return n.trim()},n.tryCatch=function(e,u){if(!Nn(e))throw Error("R.tryCatch | fn '".concat(e,"'"));var i=Nn(u);return function(){for(var n=arguments.length,r=Array(n),t=0;t<n;t++)r[t]=arguments[t];try{return e.apply(void 0,r)}catch(n){return i?u.apply(void 0,[n].concat(r)):u}}},n.type=S,n.union=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};var e=t.slice();return n.forEach(function(n){R(n,t)||e.push(n)}),e},n.uniq=I,n.uniqWith=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=-1,u=n.length,i=[];++e<u;)!function(){var r=n[e];f(function(n){return t(r,n)},i)||i.push(r)}();return i},n.unless=function r(t,e){return 1===arguments.length?function(n){return r(t,n)}:function(n){return t(n)?n:e(n)}},n.update=V,n.values=function(n){return"Object"!==S(n)?[]:Object.values(n)},n.view=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:t(xn)(n).x},n.when=Sn,n.where=function r(t,n){if(void 0===n)return function(n){return r(t,n)};var e,u=!0;for(e in t){var i=t[e](n[e]);u&&!1===i&&(u=!1)}return u},n.whereEq=function r(t,e){if(1===arguments.length)return function(n){return r(t,n)};var n=D(function(n,r){return W(n,e[r])},t);return Object.keys(n).length===Object.keys(t).length},n.without=function r(t,n){return void 0===n?function(n){return r(t,n)}:N(function(n,r){return F(r,t)?n:n.concat(r)},[],n)},n.xor=function r(t,n){return 1===arguments.length?function(n){return r(t,n)}:!!t&&!n||!!n&&!t},n.zip=function r(t,n){if(1===arguments.length)return function(n){return r(t,n)};for(var e=[],u=Math.min(t.length,n.length),i=0;i<u;i++)e[i]=[t[i],n[i]];return e},n.zipObj=function r(t,e){return 1===arguments.length?function(n){return r(t,n)}:An(e.length,t).reduce(function(n,r,t){return n[r]=e[t],n},{})},n.zipWith=Tn,Object.defineProperty(n,"__esModule",{value:!0})}); |
186
package.json
{ | ||
"name": "rambda", | ||
"version": "6.5.3", | ||
"scripts": { | ||
"out": "cd ../rambda-scripts&&yarn populate:docs&&cd ../rambda-scripts&&yarn populate:readme", | ||
"x": "cd ../rambda-scripts&&yarn populate:docs:rambdax&&cd ../rambda-scripts&&yarn populate:readme:rambdax", | ||
"github": "cd ../rambda-scripts&&yarn github", | ||
"docs": "cd ../rambda-scripts&&yarn highlighter", | ||
"toolbelt": "cd ../rambda-scripts&&yarn toolbelt", | ||
"immutable": "cd ../rambda-scripts&&yarn immutable", | ||
"usedby": "cd ../rambda-scripts&&yarn usedby", | ||
"lint": "cd ../rambda-scripts&&yarn lint", | ||
"build": "yarn build:main&&yarn build:web&&yarn deps", | ||
"build:web": "cross-env NODE_ENV=build rollup -c files/rollup.web.config.js", | ||
"build:main": "cross-env NODE_ENV=build rollup -c files/rollup.config.js", | ||
"parse": "cd ../rambda-scripts&&yarn hjson:parse", | ||
"deps": "cd ../rambda-scripts&&yarn hjson:fix", | ||
"docsify": "docsify init ./docs", | ||
"new": "cd ../rambda-scripts&&yarn new", | ||
"test": "jest source -u --bail=false", | ||
"cover:spec": "jest source --coverage --no-cache -w 1", | ||
"cover": "yarn typings&&yarn cover:spec", | ||
"benchmark": "cd ../rambda-scripts&&yarn benchmarks", | ||
"benchmarkx": "cd ../rambda-scripts&&yarn benchmarksx", | ||
"typings": "dtslint --localTs ./node_modules/typescript/lib --expectOnly ./source", | ||
"fix": "mkdir $HOME/.dts/perf -p" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@babel/core": "7.12.10", | ||
"@babel/plugin-proposal-object-rest-spread": "7.12.1", | ||
"@babel/preset-env": "7.12.11", | ||
"@rollup/plugin-babel": "5.2.2", | ||
"@rollup/plugin-commonjs": "17.0.0", | ||
"@rollup/plugin-json": "4.1.0", | ||
"@rollup/plugin-node-resolve": "11.1.0", | ||
"@rollup/plugin-replace": "2.3.4", | ||
"@types/jest": "26.0.20", | ||
"@types/ramda": "0.27.34", | ||
"combinate": "1.1.2", | ||
"cross-env": "7.0.3", | ||
"dtslint": "4.0.6", | ||
"helpers-fn": "1.3.2", | ||
"is-ci": "2.0.0", | ||
"jest": "26.6.3", | ||
"jest-extended": "0.11.5", | ||
"lodash": "4.17.20", | ||
"rambdax": "7.1.0", | ||
"ramda": "0.27.1", | ||
"rollup": "2.36.2", | ||
"rollup-plugin-cleanup": "3.2.1", | ||
"rollup-plugin-sourcemaps": "0.6.3", | ||
"typescript": "4.1.3" | ||
}, | ||
"jest": { | ||
"testEnvironment": "node", | ||
"testRegex": ".*\\.spec\\.js$", | ||
"setupFilesAfterEnv": [ | ||
"jest-extended" | ||
], | ||
"collectCoverageFrom": [ | ||
"source/*.js", | ||
"!_internals", | ||
"!benchmarks" | ||
] | ||
}, | ||
"files": [ | ||
"dist", | ||
"src", | ||
"_ts-toolbelt", | ||
"CHANGELOG.md", | ||
"index.d.ts" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/selfrefactor/rambda.git" | ||
}, | ||
"license": "MIT", | ||
"author": "self_refactor", | ||
"description": "Lightweight and faster alternative to Ramda", | ||
"module": "./dist/rambda.esm.js", | ||
"main": "./dist/rambda", | ||
"umd": "./dist/rambda.umd.js", | ||
"sideEffects": false, | ||
"keywords": [ | ||
"ramda", | ||
"fp", | ||
"functional", | ||
"utility", | ||
"lodash" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/selfrefactor/rambda/issues" | ||
}, | ||
"homepage": "https://github.com/selfrefactor/rambda#readme" | ||
"name": "rambda", | ||
"version": "6.6.0", | ||
"scripts": { | ||
"out": "cd ../rambda-scripts&&yarn populate:docs&&cd ../rambda-scripts&&yarn populate:readme", | ||
"x": "cd ../rambda-scripts&&yarn populate:docs:rambdax&&cd ../rambda-scripts&&yarn populate:readme:rambdax", | ||
"github": "cd ../rambda-scripts&&yarn github", | ||
"toolbelt": "cd ../rambda-scripts&&yarn toolbelt", | ||
"immutable": "cd ../rambda-scripts&&yarn immutable", | ||
"usedby": "cd ../rambda-scripts&&yarn usedby", | ||
"lint": "cd ../rambda-scripts&&yarn lint", | ||
"build": "yarn build:main&&yarn build:web", | ||
"build:web": "cross-env NODE_ENV=build rollup -c files/rollup.web.config.js", | ||
"build:main": "cross-env NODE_ENV=build rollup -c files/rollup.config.js", | ||
"docs": "docsify init ./docs", | ||
"new": "cd ../rambda-scripts&&yarn new", | ||
"test": "jest source -u --bail=false", | ||
"cover:spec": "jest source --coverage --no-cache -w 1", | ||
"cover": "yarn typings&&yarn cover:spec", | ||
"benchmark": "cd ../rambda-scripts&&yarn benchmarks", | ||
"benchmarkx": "cd ../rambda-scripts&&yarn benchmarksx", | ||
"typings": "dtslint --localTs ./node_modules/typescript/lib --expectOnly ./source", | ||
"fix": "mkdir $HOME/.dts/perf -p" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@babel/core": "7.12.13", | ||
"@babel/plugin-proposal-object-rest-spread": "7.12.13", | ||
"@babel/preset-env": "7.12.13", | ||
"@rollup/plugin-babel": "5.2.3", | ||
"@rollup/plugin-commonjs": "17.1.0", | ||
"@rollup/plugin-json": "4.1.0", | ||
"@rollup/plugin-node-resolve": "11.1.1", | ||
"@rollup/plugin-replace": "2.3.4", | ||
"@types/jest": "26.0.20", | ||
"@types/ramda": "0.27.38", | ||
"combinate": "1.1.2", | ||
"cross-env": "7.0.3", | ||
"dtslint": "4.0.7", | ||
"helpers-fn": "1.6.0", | ||
"is-ci": "2.0.0", | ||
"jest": "26.6.3", | ||
"jest-extended": "0.11.5", | ||
"lodash": "4.17.20", | ||
"rambdax": "7.2.0", | ||
"ramda": "0.27.1", | ||
"rollup": "2.38.5", | ||
"rollup-plugin-cleanup": "3.2.1", | ||
"rollup-plugin-sourcemaps": "0.6.3", | ||
"rollup-plugin-uglify": "6.0.4", | ||
"typescript": "4.1.5" | ||
}, | ||
"jest": { | ||
"testEnvironment": "node", | ||
"testRegex": ".*\\.spec\\.js$", | ||
"setupFilesAfterEnv": [ | ||
"jest-extended" | ||
], | ||
"collectCoverageFrom": [ | ||
"source/*.js", | ||
"!_internals", | ||
"!benchmarks" | ||
] | ||
}, | ||
"files": [ | ||
"dist", | ||
"src", | ||
"_ts-toolbelt", | ||
"CHANGELOG.md", | ||
"index.d.ts" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/selfrefactor/rambda.git" | ||
}, | ||
"license": "MIT", | ||
"author": "self_refactor", | ||
"description": "Lightweight and faster alternative to Ramda", | ||
"module": "./dist/rambda.esm.js", | ||
"main": "./dist/rambda", | ||
"umd": "./dist/rambda.umd.js", | ||
"sideEffects": false, | ||
"keywords": [ | ||
"ramda", | ||
"fp", | ||
"functional", | ||
"utility", | ||
"lodash" | ||
], | ||
"bugs": { | ||
"url": "https://github.com/selfrefactor/rambda/issues" | ||
}, | ||
"homepage": "https://github.com/selfrefactor/rambda#readme" | ||
} |
@@ -1,7 +0,7 @@ | ||
import { assocPath } from './assocPath' | ||
import { lens } from './lens' | ||
import { path } from './path' | ||
import {assocPath} from './assocPath' | ||
import {lens} from './lens' | ||
import {path} from './path' | ||
export function lensPath(key){ | ||
export function lensPath(key) { | ||
return lens(path(key), assocPath(key)) | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
445
21428
1071670
25
17024