diff --git a/README.md b/README.md index bd269a29..cfaca53b 100644 --- a/README.md +++ b/README.md @@ -240,6 +240,8 @@ BSD 3 Clause - Included in sources. - Added `native` which includes all the static methods that live on `Object` though flipped and curried. +- Added 'fjl-mutable' as part of source. All methods of 'fjl-mutable' now +live directly on 'fjl' and are defined in 'fjl/objects/defineProp' (or more directly in src at './src/objects/defineProp'). #### Development changes. - Updated 'dev-deps' to use latest babel. diff --git a/dist/amd/object/defineProp.js b/dist/amd/object/defineProp.js new file mode 100644 index 00000000..ef0fa915 --- /dev/null +++ b/dist/amd/object/defineProp.js @@ -0,0 +1,202 @@ +define(["exports", "../function/curry", "../jsPlatform/function", "../errorThrowing", "./is"], function (_exports, _curry, _function, _errorThrowing, _is) { + "use strict"; + + Object.defineProperty(_exports, "__esModule", { + value: true + }); + _exports.defineProps = _exports.defineEnumProps = _exports.defineEnumProp = _exports.defineProp = _exports.toTargetDescriptorTuple = _exports.toEnumerableDescriptor = _exports.createTypedDescriptor = void 0; + + function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } + + function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } + + function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + + function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + /** + * Creates `defineProps` and `defineEnumProps` methods based on `{enumerable}` param. + * @param {{enumerable: Boolean}} + * @returns {function(*, *)|PropsDefinerCall} + * @private + */ + function createDefinePropsMethod(_ref) { + var enumerable = _ref.enumerable; + var operation = enumerable ? defineEnumProp : defineProp; + return function (argTuples, target) { + argTuples.forEach(function (argTuple) { + var _argTuple = _slicedToArray(argTuple, 3), + TypeRef = _argTuple[0], + propName = _argTuple[1], + defaultValue = _argTuple[2]; + + (0, _function.apply)(operation, [TypeRef, target, propName, defaultValue]); + }); + return target; + }; + } + + var + /** + * Creates a descriptor for a property which is settable but throws + * errors when the `Type` is disobeyed. + * @function module:object.createTypedDescriptor + * @param Type {TypeRef} - {String|Function} + * @param target {*} + * @param propName {String} + * @returns {Descriptor} - Property descriptor with just getter and setter. + */ + createTypedDescriptor = function createTypedDescriptor(Type, target, propName) { + var _value; + + return { + get: function get() { + return _value; + }, + set: function set(value) { + _value = (0, _errorThrowing.errorIfNotType)(Type, propName, target, value); + } + }; + }, + + /** + * Returns a target-descriptor tuple whose 'descriptor' will be set to + * enumerable (`enumerable: true`). + * @function module:object.toEnumerableDescriptor + * @param {TargetDescriptorTuple} - [target, descriptor] tuple. + * @returns {TargetDescriptorTuple} - Array of target and descriptor. + */ + toEnumerableDescriptor = function toEnumerableDescriptor(_ref2) { + var _ref3 = _slicedToArray(_ref2, 2), + target = _ref3[0], + descriptor = _ref3[1]; + + descriptor.enumerable = true; + return [target, descriptor]; + }, + + /** + * Returns an target and descriptor tuple from given. + * @function module:object.toTargetDescriptorTuple + * @param targetOrTargetDescriptorTuple {(*|Array<*, *>)} - Target object or tuple of target and descriptor. + * @returns {(Array<*>|Array<*,*>)} + */ + toTargetDescriptorTuple = function toTargetDescriptorTuple(targetOrTargetDescriptorTuple) { + return (0, _is.isType)('Array', targetOrTargetDescriptorTuple) ? // Strict type check for array + targetOrTargetDescriptorTuple : [targetOrTargetDescriptorTuple]; + }, + + /** + * Allows you to define a "typed" property on given `target`. + * @function module:object.defineProp + * @param Type {TypeRef} - {String|Function} + * @param target {TargetDescriptorTuple} - Target or array of target and descriptor ([target, descriptor]). + * @param propName {String} + * @param [defaultValue=undefined] {*} + * @returns {TargetDescriptorTuple} + */ + defineProp = function defineProp(Type, target, propName) { + var defaultValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined; + + var _toTargetDescriptorTu = toTargetDescriptorTuple(target), + _toTargetDescriptorTu2 = _slicedToArray(_toTargetDescriptorTu, 2), + _target = _toTargetDescriptorTu2[0], + _descriptor = _toTargetDescriptorTu2[1], + descriptor = _descriptor || createTypedDescriptor(Type, _target, propName); + + Object.defineProperty(_target, propName, descriptor); + + if (!(0, _is.isUndefined)(defaultValue)) { + _target[propName] = defaultValue; + } + + return [_target, descriptor]; + }, + + /** + * Allows you to define a "typed", enumerated property on `target`. + * @function module:object.defineEnumProp + * @param Type {TypeRef} - {String|Function} + * @param target {TargetDescriptorTuple} - Target or array of target and descriptor ([target, descriptor]). + * @param propName {String} + * @param [defaultValue=undefined] {*} + * @returns {TargetDescriptorTuple} + */ + defineEnumProp = function defineEnumProp(Type, target, propName) { + var defaultValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined; + + var _toTargetDescriptorTu3 = toTargetDescriptorTuple(target), + _toTargetDescriptorTu4 = _slicedToArray(_toTargetDescriptorTu3, 2), + _target = _toTargetDescriptorTu4[0], + _descriptor = _toTargetDescriptorTu4[1], + descriptor = _descriptor || createTypedDescriptor(Type, _target, propName); + + return defineProp(Type, toEnumerableDescriptor([_target, descriptor]), propName, defaultValue); + }, + + /** + * Allows you to define multiple enum props at once on target. + * @function module:object.defineEnumProps + * @param argsTuple {Array.} - Array of argArrays for `defineEnumProp`. + * @param [target = undefined] {Target} - Target to use in internal calls if one is not provided but encountered 'argArray'. + * @returns {Array.} - Results of each call to `defineEnumProp`. + */ + defineEnumProps = (0, _curry.curry)(createDefinePropsMethod({ + enumerable: true + })), + + /** + * Allows you to define multiple props at once on target. + * @function module:object.defineProps + * @param argsTuple {Array.} - Array of argArrays for `defineProp`. + * @param [target = undefined] {Target} - Target to use in internal calls if one is not provided but encountered 'argArray'. + * @returns {Array.} - Results of each call to `defineProp`. + * @curried + */ + defineProps = (0, _curry.curry)(createDefinePropsMethod({ + enumerable: false + })); + /** ============================================================= */ + + /** Type definitions: */ + + /** ============================================================= */ + + /** + * @typedef {*} Target + */ + + /** + * @typedef {Object} Descriptor + */ + + /** + * @typedef {Array} TargetDescriptorTuple + */ + + /** + * @typedef {Array.} DefinePropArgsTuple + * @description Arguments list for `defineProp` and/or `defineEnumProp` (note: some + * parts of array/tuple are options (namely the last two args)); E.g., + * ``` + * [String, [someTarget], 'somePropName', 'someDefaultValue] // ... + * ``` + */ + + /** + * @typedef {Function} PropsDefinerCall + * @description Same type as `defineProp` and `defineEnumProp` + * @param argsTuple {DefinePropArgsTuple} + * @param target {Target} + * @returns {Array.} + */ + + + _exports.defineProps = defineProps; + _exports.defineEnumProps = defineEnumProps; + _exports.defineEnumProp = defineEnumProp; + _exports.defineProp = defineProp; + _exports.toTargetDescriptorTuple = toTargetDescriptorTuple; + _exports.toEnumerableDescriptor = toEnumerableDescriptor; + _exports.createTypedDescriptor = createTypedDescriptor; +}); \ No newline at end of file diff --git a/dist/cjs/object/defineProp.js b/dist/cjs/object/defineProp.js new file mode 100644 index 00000000..df3a9410 --- /dev/null +++ b/dist/cjs/object/defineProp.js @@ -0,0 +1,208 @@ +"use strict"; + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.defineProps = exports.defineEnumProps = exports.defineEnumProp = exports.defineProp = exports.toTargetDescriptorTuple = exports.toEnumerableDescriptor = exports.createTypedDescriptor = void 0; + +var _curry = require("../function/curry"); + +var _function = require("../jsPlatform/function"); + +var _errorThrowing = require("../errorThrowing"); + +var _is = require("./is"); + +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } + +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } + +function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + +/** + * Creates `defineProps` and `defineEnumProps` methods based on `{enumerable}` param. + * @param {{enumerable: Boolean}} + * @returns {function(*, *)|PropsDefinerCall} + * @private + */ +function createDefinePropsMethod(_ref) { + var enumerable = _ref.enumerable; + var operation = enumerable ? defineEnumProp : defineProp; + return function (argTuples, target) { + argTuples.forEach(function (argTuple) { + var _argTuple = _slicedToArray(argTuple, 3), + TypeRef = _argTuple[0], + propName = _argTuple[1], + defaultValue = _argTuple[2]; + + (0, _function.apply)(operation, [TypeRef, target, propName, defaultValue]); + }); + return target; + }; +} + +var +/** + * Creates a descriptor for a property which is settable but throws + * errors when the `Type` is disobeyed. + * @function module:object.createTypedDescriptor + * @param Type {TypeRef} - {String|Function} + * @param target {*} + * @param propName {String} + * @returns {Descriptor} - Property descriptor with just getter and setter. + */ +createTypedDescriptor = function createTypedDescriptor(Type, target, propName) { + var _value; + + return { + get: function get() { + return _value; + }, + set: function set(value) { + _value = (0, _errorThrowing.errorIfNotType)(Type, propName, target, value); + } + }; +}, + +/** + * Returns a target-descriptor tuple whose 'descriptor' will be set to + * enumerable (`enumerable: true`). + * @function module:object.toEnumerableDescriptor + * @param {TargetDescriptorTuple} - [target, descriptor] tuple. + * @returns {TargetDescriptorTuple} - Array of target and descriptor. + */ +toEnumerableDescriptor = function toEnumerableDescriptor(_ref2) { + var _ref3 = _slicedToArray(_ref2, 2), + target = _ref3[0], + descriptor = _ref3[1]; + + descriptor.enumerable = true; + return [target, descriptor]; +}, + +/** + * Returns an target and descriptor tuple from given. + * @function module:object.toTargetDescriptorTuple + * @param targetOrTargetDescriptorTuple {(*|Array<*, *>)} - Target object or tuple of target and descriptor. + * @returns {(Array<*>|Array<*,*>)} + */ +toTargetDescriptorTuple = function toTargetDescriptorTuple(targetOrTargetDescriptorTuple) { + return (0, _is.isType)('Array', targetOrTargetDescriptorTuple) ? // Strict type check for array + targetOrTargetDescriptorTuple : [targetOrTargetDescriptorTuple]; +}, + +/** + * Allows you to define a "typed" property on given `target`. + * @function module:object.defineProp + * @param Type {TypeRef} - {String|Function} + * @param target {TargetDescriptorTuple} - Target or array of target and descriptor ([target, descriptor]). + * @param propName {String} + * @param [defaultValue=undefined] {*} + * @returns {TargetDescriptorTuple} + */ +defineProp = function defineProp(Type, target, propName) { + var defaultValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined; + + var _toTargetDescriptorTu = toTargetDescriptorTuple(target), + _toTargetDescriptorTu2 = _slicedToArray(_toTargetDescriptorTu, 2), + _target = _toTargetDescriptorTu2[0], + _descriptor = _toTargetDescriptorTu2[1], + descriptor = _descriptor || createTypedDescriptor(Type, _target, propName); + + Object.defineProperty(_target, propName, descriptor); + + if (!(0, _is.isUndefined)(defaultValue)) { + _target[propName] = defaultValue; + } + + return [_target, descriptor]; +}, + +/** + * Allows you to define a "typed", enumerated property on `target`. + * @function module:object.defineEnumProp + * @param Type {TypeRef} - {String|Function} + * @param target {TargetDescriptorTuple} - Target or array of target and descriptor ([target, descriptor]). + * @param propName {String} + * @param [defaultValue=undefined] {*} + * @returns {TargetDescriptorTuple} + */ +defineEnumProp = function defineEnumProp(Type, target, propName) { + var defaultValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined; + + var _toTargetDescriptorTu3 = toTargetDescriptorTuple(target), + _toTargetDescriptorTu4 = _slicedToArray(_toTargetDescriptorTu3, 2), + _target = _toTargetDescriptorTu4[0], + _descriptor = _toTargetDescriptorTu4[1], + descriptor = _descriptor || createTypedDescriptor(Type, _target, propName); + + return defineProp(Type, toEnumerableDescriptor([_target, descriptor]), propName, defaultValue); +}, + +/** + * Allows you to define multiple enum props at once on target. + * @function module:object.defineEnumProps + * @param argsTuple {Array.} - Array of argArrays for `defineEnumProp`. + * @param [target = undefined] {Target} - Target to use in internal calls if one is not provided but encountered 'argArray'. + * @returns {Array.} - Results of each call to `defineEnumProp`. + */ +defineEnumProps = (0, _curry.curry)(createDefinePropsMethod({ + enumerable: true +})), + +/** + * Allows you to define multiple props at once on target. + * @function module:object.defineProps + * @param argsTuple {Array.} - Array of argArrays for `defineProp`. + * @param [target = undefined] {Target} - Target to use in internal calls if one is not provided but encountered 'argArray'. + * @returns {Array.} - Results of each call to `defineProp`. + * @curried + */ +defineProps = (0, _curry.curry)(createDefinePropsMethod({ + enumerable: false +})); +/** ============================================================= */ + +/** Type definitions: */ + +/** ============================================================= */ + +/** + * @typedef {*} Target + */ + +/** + * @typedef {Object} Descriptor + */ + +/** + * @typedef {Array} TargetDescriptorTuple + */ + +/** + * @typedef {Array.} DefinePropArgsTuple + * @description Arguments list for `defineProp` and/or `defineEnumProp` (note: some + * parts of array/tuple are options (namely the last two args)); E.g., + * ``` + * [String, [someTarget], 'somePropName', 'someDefaultValue] // ... + * ``` + */ + +/** + * @typedef {Function} PropsDefinerCall + * @description Same type as `defineProp` and `defineEnumProp` + * @param argsTuple {DefinePropArgsTuple} + * @param target {Target} + * @returns {Array.} + */ + + +exports.defineProps = defineProps; +exports.defineEnumProps = defineEnumProps; +exports.defineEnumProp = defineEnumProp; +exports.defineProp = defineProp; +exports.toTargetDescriptorTuple = toTargetDescriptorTuple; +exports.toEnumerableDescriptor = toEnumerableDescriptor; +exports.createTypedDescriptor = createTypedDescriptor; \ No newline at end of file diff --git a/dist/es6-module/fjl.js b/dist/es6-module/fjl.js index ca6a47e8..9152c4cf 100644 --- a/dist/es6-module/fjl.js +++ b/dist/es6-module/fjl.js @@ -1676,5 +1676,11 @@ const classCase = compose(ucaseFirst, camelCase); * @see http://hackage.haskell.org/package/base-4.10.0.0/docs/Data-List.html */ +/** + * @typedef {String|Function|ArrayBufferConstructor|ArrayConstructor|BooleanConstructor|MapConstructor|NumberConstructor|SetConstructor|WeakMapConstructor|WeakSetConstructor} TypeRef + * @description Type reference. Either actual type or type's name; E.g., `Type.name` + * Also note: Class cased names are use for values that do not have `name` properties; Namely: 'Null', 'NaN' and 'Undefined' (for their respective values respectively). + */ + export { instanceOf, hasOwnProperty, length, native, keys, assign, lookup, typeOf, copy, toTypeRef, toTypeRefs, toTypeRefName, toTypeRefNames, isFunction, isType, isOfType, isClass, isCallable, isArray, isObject, isBoolean, isNumber, isString, isMap, isSet, isWeakMap, isWeakSet, isUndefined, isNull, isSymbol, isUsableImmutablePrimitive, isEmptyList, isEmptyObject, isEmptyCollection, isEmpty, isset, isOneOf, isFunctor, of, searchObj, assignDeep, objUnion, objIntersect, objDifference, objComplement, log, error, peek, jsonClone, toArray, toAssocList, toAssocListDeep, fromAssocList, fromAssocListDeep, isTruthy, isFalsy, alwaysTrue, alwaysFalse, equal, equalAll, apply, call, compose, curryN, curry, curry2, curry3, curry4, curry5, flipN, flip, flip3, flip4, flip5, id, negateF, negateF2, negateF3, negateFN, until, fnOrError, noop, map$1 as map, append, head, last, tail, init, uncons, unconsr, concat$1 as concat, concatMap, reverse$1 as reverse, intersperse, intercalate, transpose, subsequences, swapped, permutations, foldl, foldr, foldl1, foldr1, mapAccumL, mapAccumR, iterate, repeat, replicate, cycle, unfoldr, findIndex, findIndices, elemIndex, elemIndices, take, drop, splitAt, takeWhile, dropWhile, dropWhileEnd, span, breakOnList, at, find, forEach$1 as forEach, filter$1 as filter, partition, elem, notElem, isPrefixOf, isSuffixOf, isInfixOf, isSubsequenceOf, group, groupBy, inits, tails, stripPrefix, zip, zipN, zip3, zip4, zip5, zipWith, zipWithN, zipWith3, zipWith4, zipWith5, unzip, unzipN, any, all, and, or, not, sum, product, maximum, minimum, scanl, scanl1, scanr, scanr1, nub, remove, sort, sortOn, sortBy, insert, insertBy, nubBy, removeBy, removeFirstsBy, unionBy, union, intersect, intersectBy, difference, complement, slice, includes, indexOf, lastIndexOf, push, range, sliceFrom, sliceTo, sliceCopy, genericAscOrdering, lengths, toShortest, reduceUntil, reduceUntilRight, reduce$1 as reduce, reduceRight$1 as reduceRight, lastIndex, findIndexWhere, findIndexWhereRight, findIndicesWhere, findWhere, aggregateArray, split, lines, words, unwords, unlines, lcaseFirst, ucaseFirst, camelCase, classCase, fPureTakesOne, fPureTakes2, fPureTakes3, fPureTakes4, fPureTakes5, fPureTakesOneOrMore, typeRefsToStringOrError, defaultErrorMessageCall, _getErrorIfNotTypeThrower, _getErrorIfNotTypesThrower, _errorIfNotType, _errorIfNotTypes, getErrorIfNotTypeThrower, getErrorIfNotTypesThrower, errorIfNotType, errorIfNotTypes }; //# sourceMappingURL=fjl.js.map diff --git a/dist/es6-module/fjl.js.map b/dist/es6-module/fjl.js.map index 7fa774cb..e691b536 100644 --- a/dist/es6-module/fjl.js.map +++ b/dist/es6-module/fjl.js.map @@ -1 +1 @@ -{"version":3,"file":"fjl.js","sources":["../../src/function/curry.js","../../src/utils.js","../../src/jsPlatform/array.js","../../src/jsPlatform/function.js","../../src/function/flip.js","../../src/jsPlatform/object.js","../../src/object/typeOf.js","../../src/object/is.js","../../src/object/lookup.js","../../src/object/of.js","../../src/object/copy.js","../../src/object/searchObj.js","../../src/object/assignDeep.js","../../src/jsPlatform/list.js","../../src/boolean.js","../../src/list/map.js","../../src/list/aggregation.js","../../src/list/utils.js","../../src/object/setTheory.js","../../src/object/console.js","../../src/object/jsonClone.js","../../src/object/assocList.js","../../src/object/toArray.js","../../src/object.js","../../src/function/compose.js","../../src/function/id.js","../../src/function/negate.js","../../src/function/until.js","../../src/function/fnOrError.js","../../src/function/noop.js","../../src/function.js","../../src/list/range.js","../../src/jsPlatform/string.js","../../src/jsPlatform.js","../../src/list.js","../../src/errorThrowing.js","../../src/string.js","../../src/fjl.js"],"sourcesContent":["/**\r\n * @author elydelacruz\r\n * @created 12/6/2016.\r\n * @memberOf function\r\n * @description \"Curry strict\" and \"curry arbitrarily\" functions (`curry`, `curryN`).\r\n */\r\n\r\n/**\r\n * @private\r\n * @type {string}\r\n */\r\nconst\r\n\r\n /**\r\n * Returns curried function.\r\n * @private\r\n * @param executeArity {Number}\r\n * @param unmetArityNum {Number}\r\n * @param fn {Function}\r\n * @param argsToCurry {...*}\r\n * @returns {Function} - Curried function.\r\n */\r\n returnCurried = (executeArity, unmetArityNum, fn, argsToCurry) => {\r\n switch (unmetArityNum) {\r\n case 1:\r\n /* eslint-disable */\r\n return function func(x) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n case 2:\r\n /* eslint-disable */\r\n return function func(a, b) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n case 3:\r\n /* eslint-disable */\r\n return function func(a, b, c) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n case 4:\r\n /* eslint-disable */\r\n return function func(a, b, c, d) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n case 5:\r\n /* eslint-disable */\r\n return function func(a, b, c, d, e) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n default:\r\n return (...args) => executeAsCurriedFunc(fn, executeArity, unmetArityNum, args, argsToCurry);\r\n }\r\n },\r\n\r\n /**\r\n * Returns curried function if unmetArity is not met else returns result of executing\r\n * final function.\r\n * @private\r\n * @param fn {Function}\r\n * @param executeArity {Number}\r\n * @param unmetArity {Number}\r\n * @param args {Array<*>}\r\n * @param argsToCurry {Array<*>}\r\n * @returns {Function|*} - Curried function or result of 'finally' executed function.\r\n */\r\n executeAsCurriedFunc = (fn, executeArity, unmetArity, args, argsToCurry) => {\r\n let concatedArgs = argsToCurry.concat(args),\r\n canBeCalled = (concatedArgs.length >= executeArity) || !executeArity,\r\n newExpectedArity = executeArity - concatedArgs.length;\r\n return !canBeCalled ?\r\n returnCurried(executeArity, newExpectedArity, fn, concatedArgs) :\r\n fn(...concatedArgs);\r\n }\r\n;\r\n\r\nexport const\r\n\r\n /**\r\n * Curries a function up to a given arity.\r\n * @function module:function.curryN\r\n * @param executeArity {Number}\r\n * @param fn {Function}\r\n * @param argsToCurry {...*}\r\n * @returns {Function}\r\n * @throws {Error} - When `fn` is not a function.\r\n */\r\n curryN = (executeArity, fn, ...argsToCurry) => {\r\n if (!fn || !(fn instanceof Function)) {\r\n throw new Error(`\\`curry*\\` functions expect first parameter to be of type \\`Function\\` though received ${fn}?`);\r\n }\r\n return returnCurried(executeArity, executeArity - argsToCurry.length, fn, argsToCurry);\r\n },\r\n\r\n /**\r\n * Curries a function based on it's defined arity (note: rest args param (`...rest`) are not counted in arity).\r\n * @function module:function.curry\r\n * @param fn {Function}\r\n * @param argsToCurry {...*}\r\n * @returns {Function}\r\n */\r\n curry = (fn, ...argsToCurry) => curryN((fn || {}).length, fn, ...argsToCurry),\r\n\r\n /**\r\n * Curries a function up to an arity of 2 (won't call function until 2 or more args).\r\n * @function module:function.curry2\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n curry2 = fn => curryN(2, fn),\r\n\r\n /**\r\n * Curries a function up to an arity of 3 (won't call function until 3 or more args).\r\n * @function module:function.curry3\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n curry3 = fn => curryN(3, fn),\r\n\r\n /**\r\n * Curries a function up to an arity of 4 (won't call function until 4 or more args).\r\n * @function module:function.curry4\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n curry4 = fn => curryN(4, fn),\r\n\r\n /**\r\n * Curries a function up to an arity of 5 (won't call function until 5 or more args).\r\n * @function module:function.curry5\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n curry5 = fn => curryN(5, fn);\r\n","/**\r\n * @module utils\r\n */\r\nimport {curry, curry2} from './function/curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns a function that takes an argument and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakesOne\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakesOne = name => curry((arg, f) => f[name](arg)),\r\n\r\n /**\r\n * Returns a function that takes 2 arguments and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakes2\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakes2 = name => curry((arg1, arg2, f) => f[name](arg1, arg2)),\r\n\r\n /**\r\n * Returns a function that takes 3 arguments and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakes3\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakes3 = name => curry((arg1, arg2, arg3, f) => f[name](arg1, arg2, arg3)),\r\n\r\n /**\r\n * Returns a function that takes 4 arguments and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakes4\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakes4 = name => curry((arg1, arg2, arg3, arg4, f) => f[name](arg1, arg2, arg3, arg4)),\r\n\r\n /**\r\n * Returns a function that takes 5 arguments and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakes5\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakes5 = name => curry((arg1, arg2, arg3, arg4, arg5, f) => f[name](arg1, arg2, arg3, arg4, arg5)),\r\n\r\n /**\r\n * Returns a function that takes an object and one or more arguments on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakesOneOrMore\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakesOneOrMore = name => curry2((f, ...args) => f[name](...args))\r\n\r\n;\r\n","/**\r\n * Created by elyde on 7/20/2017.\r\n * Functional versions of common array methods (`map`, `filter`, etc.) (un-curried);\r\n * @module _jsPlatform_arrayOps\r\n * @private\r\n */\r\n\r\nimport {fPureTakesOne, fPureTakes2, fPureTakesOneOrMore} from '../utils';\r\n\r\nexport const\r\n\r\n /**\r\n * Array.prototype.reverse generator (generates a function that calls the prototype version or a\r\n * shimmed version if it doesn't exist).\r\n * @returns {Function}\r\n */\r\n defineReverse = () =>\r\n Array.prototype.reverse ? x => x.reverse() :\r\n x => x.reduceRight((agg, item) => {\r\n agg.push(item);\r\n return agg;\r\n }, []),\r\n\r\n /**\r\n * Maps a function to functor (list etc.).\r\n * @function module:_jsPlatform_array.map\r\n * @param fn {Function}\r\n * @param functor {Array|{map: {Function}}}\r\n * @returns {Array|{map: {Function}}}\r\n */\r\n map = fPureTakesOne('map'),\r\n\r\n /**\r\n * Filters a functor (list etc.) with passed in function.\r\n * @function module:_jsPlatform_array.filter\r\n * @param fn {Function}\r\n * @param functor {Array|{filter: {Function}}}\r\n * @returns {Array|{filter: {Function}}}\r\n */\r\n filter = fPureTakesOne('filter'),\r\n\r\n /**\r\n * Reduces a foldable (list etc.) with passed in function.\r\n * @function module:_jsPlatform_array.reduce\r\n * @param fn {Function}\r\n * @param functor {Array|{reduce: {Function}}}\r\n * @returns {Array|{reduce: {Function}}}\r\n */\r\n reduce = fPureTakes2('reduce'),\r\n\r\n /**\r\n * Reduces a foldable (list etc.) from the right with passed in function.\r\n * @function module:_jsPlatform_array.reduceRight\r\n * @param fn {Function}\r\n * @param functor {Array|{reduceRight: {Function}}}\r\n * @returns {Array|{reduceRight: {Function}}}\r\n */\r\n reduceRight = fPureTakes2('reduceRight'),\r\n\r\n /**\r\n * For each on functor (Array|Object|etc.).\r\n * @param fn {Function}\r\n * @param functor {Array|Object|*}\r\n * @return {*|Array|Object} - The type of object you pass in unless it doesn't have a `forEach` method.\r\n * @throws {Error} - When passed in functor doesn't have a `forEach` method.\r\n */\r\n forEach = fPureTakesOne('forEach'),\r\n\r\n /**\r\n * Returns `true` if `fn` (predicate) returns true for at least one item\r\n * in functor else returns `false`.\r\n * @param fn {Function} - Predicate.\r\n * @param functor {Array|Object|*}\r\n * @return {*|Array|Object} - The type passed.\r\n * @throws {Error} - When passed in object doesn't have a `some` method.\r\n */\r\n some = fPureTakesOne('some'),\r\n\r\n /**\r\n * Returns `true` if `fn` (predicate) returns true for all items in functor else returns `false`.\r\n * @param fn {Function} - Predicate.\r\n * @param functor {Array|Object|*}\r\n * @return {*|Array|Object} - The type passed.\r\n * @throws {Error} - When passed in object doesn't have an `every` method.\r\n */\r\n every = fPureTakesOne('every'),\r\n\r\n /**\r\n * Array.prototype.join\r\n * @function module:listPrelude.join\r\n * @param separator {String|RegExp}\r\n * @param arr {Array}\r\n * @returns {String}\r\n */\r\n join = fPureTakesOne('join'),\r\n\r\n /**\r\n * Same as Array.prototype.push\r\n * @param item {*}\r\n * @param arr {Array}\r\n * @returns {Number}\r\n */\r\n push = fPureTakesOneOrMore('push'),\r\n\r\n /**\r\n * Reverses an list (shimmed if not exists).\r\n * @function module:listPrelude.reverse\r\n * @return {Array}\r\n */\r\n reverse = defineReverse();\r\n","import {curry, curry2} from '../function/curry';\r\n\r\n/**\r\n * Created by elydelacruz on 9/7/2017.\r\n * @memberOf function\r\n */\r\nexport const\r\n\r\n /**\r\n * Functional `apply` function (takes no context).\r\n * @function module:function.apply\r\n * @param fn {Function}\r\n * @param args {Array|*}\r\n * @returns {*}\r\n */\r\n apply = curry((fn, args) => fn.apply(null, args)),\r\n\r\n /**\r\n * Functional `call` function (takes no context).\r\n * @function module:function.call\r\n * @param fn {Function}\r\n * @param args {...*}\r\n * @returns {*}\r\n */\r\n call = curry2((fn, ...args) => fn.call(null, ...args));\r\n","import {reverse} from '../jsPlatform/array';\r\nimport {apply, call} from '../jsPlatform/function';\r\nimport {curry, curry2} from './curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns a curried function requiring given functions arguments in reverse\r\n * (returned function expects 2 or more variables (curried at 2 or more args)).\r\n * @function module:function.flipN\r\n * @param fn {Function}\r\n * @returns {Function}\r\n * @curried\r\n */\r\n flipN = fn => curry2((...args) => apply(fn, reverse(args))),\r\n\r\n /**\r\n * Flips a function's first and second arguments and and returns a new function requiring said arguments in reverse.\r\n * @function module:function.flip\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n flip = fn => curry((b, a) => call(fn, a, b)),\r\n\r\n /**\r\n * Same as `flip` except returns a flipped function of arity 3.\r\n * @function module:function.flip3\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n flip3 = fn => curry((c, b, a) => call(fn, a, b, c)),\r\n\r\n /**\r\n * Same as `flip` except returns a flipped function of arity 4.\r\n * @function module:function.flip4\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n flip4 = fn => curry((d, c, b, a) => call(fn, a, b, c, d)),\r\n\r\n /**\r\n * Same as `flip` except returns a flipped function of arity 5.\r\n * @function module:function.flip5\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n flip5 = fn => curry((e, d, c, b, a) => call(fn, a, b, c, d, e));\r\n","/**\r\n * @memberOf object\r\n * @description Defines some of the platform methods for objects (the ones used within `fjl`).\r\n */\r\n\r\nimport {fPureTakesOne} from '../utils';\r\nimport {curry, curry2} from '../function/curry';\r\nimport {flip, flip3, flip4, flip5} from '../function/flip';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns whether constructor has derived object.\r\n * @function module:object.instanceOf\r\n * @param instanceConstructor {Function} - Constructor.\r\n * @param instance {*}\r\n * @instance {*}\r\n * @returns {Boolean}\r\n */\r\n instanceOf = curry((instanceConstructor, instance) =>\r\n instance instanceof instanceConstructor),\r\n\r\n /**\r\n * @function module:object.hasOwnProperty\r\n * @param propName {*}\r\n * @param typeInstance {*}\r\n * @returns {Boolean}\r\n * @deprecated - Use property directly instead.\r\n */\r\n hasOwnProperty = fPureTakesOne('hasOwnProperty'),\r\n\r\n /**\r\n * @function module:object.length\r\n * @param x {*}\r\n * @returns {Number}\r\n * @throws {Error} - Throws an error if value doesn't have a `length` property (\r\n * `null`, `undefined`, {Boolean}, Symbol, et. al.).\r\n */\r\n length = x => x.length,\r\n\r\n /**\r\n * Contains all the static functions from `Object` but curried and flipped;\r\n * @example\r\n * // E.g., `Object.defineProperties(obj, descriptor)` can now be used like\r\n * import {defineProperties} from 'fjl'\r\n * defineProperties(descriptor, someObj),\r\n * // Et. al.\r\n * @memberOf module:object\r\n * @type {{...Object}}\r\n */\r\n native = Object.getOwnPropertyNames(Object).reduce((agg, key) => {\r\n if (typeof Object[key] !== 'function') {\r\n return agg;\r\n }\r\n const operation = Object[key];\r\n switch (operation.length) {\r\n case 2:\r\n agg[key] = flip(operation);\r\n break;\r\n case 3:\r\n agg[key] = flip3(operation);\r\n break;\r\n case 4:\r\n agg[key] = flip4(operation);\r\n break;\r\n case 5:\r\n agg[key] = flip5(operation);\r\n break;\r\n default:\r\n agg[key] = Object[key];\r\n break;\r\n }\r\n return agg;\r\n }, {}),\r\n\r\n /**\r\n * Gets passed in object's own enumerable keys (same as `Object.keys`).\r\n * @function module:object.keys\r\n * @param obj {*}\r\n * @returns {Array}\r\n */\r\n {keys} = native,\r\n\r\n /**\r\n * Defined as `Object.assign` else is the same thing but shimmed.\r\n * @function module:object.assign\r\n * @param obj0 {Object}\r\n * @param objs {...{Object}}\r\n * @returns {Object}\r\n */\r\n assign = (() => Object.assign ?\r\n (obj0, ...objs) => Object.assign(obj0, ...objs) :\r\n curry2((obj0, ...objs) => objs.reduce((topAgg, obj) => {\r\n return Object.keys(obj).reduce((agg, key) => {\r\n agg[key] = obj[key];\r\n return agg;\r\n }, topAgg);\r\n }, obj0))\r\n )();\r\n","/**\r\n * Created by elyde on 12/18/2016.\r\n * @memberOf object\r\n */\r\nconst _Number = Number.name,\r\n _NaN = 'NaN',\r\n _Null = 'Null',\r\n _Undefined = 'Undefined';\r\n\r\n/**\r\n * Returns the constructor/class/type name of a value.\r\n * @note Returns 'NaN' if value is of type `Number` and value is `isNaN`.\r\n * @note Returns 'Undefined' if value is `undefined`\r\n * @note Returns 'Null' if value is `null`\r\n * For values that have no concrete constructors and/or casters\r\n * (null, NaN, and undefined) we returned normalized names for them ('Null', 'NaN', 'Number')\r\n * @function module:object.typeOf\r\n * @param value {*}\r\n * @returns {string} - Constructor's name or derived name (in the case of `null`, `undefined`, or `NaN` (whose\r\n * normalized names are 'Null', 'Undefined', 'NaN' respectively).\r\n */\r\nexport function typeOf (value) {\r\n let retVal;\r\n if (value === undefined) {\r\n retVal = _Undefined;\r\n }\r\n else if (value === null) {\r\n retVal = _Null;\r\n }\r\n else {\r\n let constructorName = (value).constructor.name;\r\n retVal = constructorName === _Number && isNaN(value) ?\r\n _NaN : constructorName;\r\n }\r\n return retVal;\r\n}\r\n","/**\r\n * Created by elyde on 12/18/2016.\r\n * @memberOf object\r\n */\r\n\r\nimport {typeOf} from './typeOf';\r\nimport {instanceOf, length, keys} from '../jsPlatform/object';\r\nimport {curry} from '../function/curry';\r\n\r\nlet _String = String.name,\r\n _Number = Number.name,\r\n _Object = Object.name,\r\n _Boolean = Boolean.name,\r\n _Function = Function.name,\r\n _Array = Array.name,\r\n _Symbol = 'Symbol',\r\n _Map = 'Map',\r\n _Set = 'Set',\r\n _WeakMap = 'WeakMap',\r\n _WeakSet = 'WeakSet',\r\n _Null = 'Null',\r\n _Undefined = 'Undefined',\r\n _NaN = 'NaN';\r\n\r\nexport const\r\n\r\n /**\r\n * Resolves/normalizes a type name from either a string or a constructor.\r\n * @function module:object.toTypeRef\r\n * @param type {Function|String} - String or function representing a type.\r\n * @returns {String}\r\n * @todo write tests for this function.\r\n */\r\n toTypeRef = type => {\r\n if (!type) {\r\n return typeOf(type);\r\n }\r\n else if (type.constructor === String || (type instanceof Function)) {\r\n return type;\r\n }\r\n return typeOf(type);\r\n },\r\n\r\n /**\r\n * Returns an array of type refs from possible type refs (converts null, undefined, NaN, and other values into\r\n * type refs (either constructor name or constructor name based on whether value(s) is a string, a constructor, or not).\r\n * @function module:object.toTypeRefs\r\n * @param types {...(TypeRef|*)}\r\n * @returns {Array}\r\n * @todo Ensure tests are written for this function.\r\n */\r\n toTypeRefs = (...types) => types.map(toTypeRef),\r\n\r\n /**\r\n * Returns possible Type's TypeRef name.\r\n * @function module:object.toTypeRefName\r\n * @param Type {(TypeRef|*)}\r\n * @returns {String}\r\n * @todo Ensure tests are written for this function.\r\n */\r\n toTypeRefName = Type => {\r\n const ref = toTypeRef(Type);\r\n return ref instanceof Function ? ref.name : ref;\r\n },\r\n\r\n /**\r\n * Returns possible Types' TypeRef names.\r\n * @function module:object.toTypeRefNames\r\n * @param types {...(TypeRef|*)}\r\n * @returns {String[]}\r\n * @todo Ensure tests are written for this function.\r\n */\r\n toTypeRefNames = (...types) => types.map(toTypeRefName),\r\n\r\n /**\r\n * Returns whether a value is a function or not.\r\n * @function module:object.isFunction\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isFunction = instanceOf(Function),\r\n\r\n /**\r\n * Strict type checker. Checks if given value is a direct instance of given type; E.g.,\r\n * @example\r\n * isType(String, 'abcdefg') === true // true\r\n * isType(String.name, 'abcdefg') === true\r\n * isType(Number, NaN) === false\r\n * isType(Number, 99) === true\r\n * isType('Null', 99) === false // though, for `null` and `undefined` checks\r\n * // @see `isset`, in this module, instead\r\n * isType('Undefined', undefined) === true // true\r\n *\r\n * @note Useful where absolute types, or some semblance thereof, are required.\r\n * @function module:object.isType\r\n * @param type {Function|ObjectConstructor|String} - Constructor or constructor name\r\n * @param obj {*}\r\n * @return {Boolean}\r\n */\r\n isType = curry((type, obj) => typeOf(obj) === toTypeRefName(type)),\r\n\r\n /**\r\n * Loose type checker; E.g., If `type` is not a constructor, but a constructor name, does a type check on\r\n * constructor names, else if first check fails and `type` is a constructor, performs an `instanceof` check\r\n * on value with constructor.\r\n * @note Use care when checking for `Array` and/or `Object` since the both are considered objects by `instanceof` checker.\r\n * @note For `null` and `undefined` their class cased names can be used for type checks\r\n * `isOfType('Null', null) === true (passes strict type check)` (or better yet `isset` can be used).\r\n * @throwsafe - Doesn't throw on `null` or `undefined` `obj` values.\r\n * @example\r\n * isOfType(Number, 99) === true // true (passes strict type check (numbers are not instances of `Number`\r\n * // constructor)\r\n * isOfType('Number', 99) === true // true (passes strict type check)\r\n * isOfType(Number, NaN) === true // true. (passes instance of check)\r\n * // If you want \"true\" strict type checking use `isType`\r\n * isOfType(Object, []) === true // true (passes instance of check)\r\n * isOfType(Array, []) === true // true (passes instance of check)\r\n * isOfType(Object, {}) === true // true (passes instance of check)\r\n * isOfType(Object.name, {}) === true // true (Passes strict type check)\r\n * class Abc extends String {}\r\n * isOfType(String, new Abc('abcd')) // true (passes instanceof check)\r\n *\r\n * @function module:object.isOfType\r\n * @param type {Function|String} - Type reference (constructor or `constructor.name`).\r\n * @param x {*} - Value to check.\r\n * @returns {Boolean}\r\n */\r\n isOfType = curry((type, x) => isType(type, x) || instanceOf(type, x)),\r\n\r\n /**\r\n * Checks if `value` is an es2015 `class`.\r\n * @function module:object.isClass\r\n * @param x {*}\r\n * @returns {boolean}\r\n */\r\n isClass = x => x && /^\\s{0,3}class\\s{1,3}/.test((x + '').substr(0, 10)),\r\n\r\n /**\r\n * Returns a boolean depicting whether a value is callable or not.\r\n * @function module:object.isCallable\r\n * @tentative\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isCallable = x => isFunction(x) && !isClass(x),\r\n\r\n /**\r\n * Checks if value is an array (same as `Array.isArray`).\r\n * @function module:object.isArray\r\n * @param value {*}\r\n * @returns {boolean}\r\n */\r\n {isArray} = Array,\r\n\r\n /**\r\n * Checks whether value is an object or not.\r\n * @function module:object.isObject\r\n * @param value\r\n * @returns {Boolean}\r\n */\r\n isObject = isType(_Object),\r\n\r\n /**\r\n * Checks if value is a boolean.\r\n * @function module:object.isBoolean\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isBoolean = isType(_Boolean),\r\n\r\n /**\r\n * Checks if value is a valid number (also checks if isNaN so that you don't have to).\r\n * @function module:object.isNumber\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isNumber = isType(_Number),\r\n\r\n /**\r\n * Checks whether value is a string or not.\r\n * @function module:object.isString\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isString = isType(_String),\r\n\r\n /**\r\n * Checks whether value is of `Map` or not.\r\n * @function module:object.isMap\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isMap = isType(_Map),\r\n\r\n /**\r\n * Checks whether value is of `Set` or not.\r\n * @function module:object.isSet\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isSet = isType(_Set),\r\n\r\n /**\r\n * Checks whether value is of `WeakMap` or not.\r\n * @function module:object.isWeakMap\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isWeakMap =isType(_WeakMap),\r\n\r\n /**\r\n * Checks whether value is of `WeakSet` or not.\r\n * @function module:object.isWeakSet\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isWeakSet = isType(_WeakSet),\r\n\r\n /**\r\n * Checks if value is undefined.\r\n * @function module:object.isUndefined\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isUndefined = isType(_Undefined),\r\n\r\n /**\r\n * Checks if value is null.\r\n * @function module:object.isNull\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isNull = isType(_Null),\r\n\r\n /**\r\n * Checks if value is a `Symbol`.\r\n * @function module:object.isSymbol\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isSymbol = isType(_Symbol),\r\n\r\n /**\r\n * Checks if given `x` is set and of one of\r\n * [String, Boolean, Number, Symbol] (null and undefined are immutable\r\n * but are not \"usable\" (usually not what we want to operate on).\r\n * @function module:object.isUsableImmutablePrimitive\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isUsableImmutablePrimitive = x => {\r\n const typeOfX = typeOf(x);\r\n return isset(x) &&\r\n [_String, _Number, _Boolean, _Symbol]\r\n .some(Type => Type === typeOfX);\r\n },\r\n\r\n /**\r\n * Checks if !length.\r\n * @function module:object.isEmptyList\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isEmptyList = x => !length(x),\r\n\r\n /**\r\n * Checks if object has own properties/enumerable-props or not.\r\n * @function module:object.isEmptyObject\r\n * @param obj {*}\r\n * @returns {Boolean}\r\n */\r\n isEmptyObject = obj => isEmptyList(keys(obj)),\r\n\r\n /**\r\n * Checks if collection is empty or not (Map, WeakMap, WeakSet, Set etc.).\r\n * @function module:object.isEmptyCollection\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isEmptyCollection = x => x.size === 0,\r\n\r\n /**\r\n * Checks to see if passed in value is empty; I.e.,\r\n * check for one of '', 0, `null`, `undefined`, `false`, empty array, empty object, empty function (zero arity),\r\n * or empty collection (es6 Map, Set, WeakMap, or WeakSet etc. (`!value.size`);\r\n * @function module:object.isEmpty\r\n * @param value {*} - Value to check.\r\n * @returns {Boolean}\r\n */\r\n isEmpty = value => {\r\n if (!value) { // if '', 0, `null`, `undefined`, or `false` then is empty\r\n return true;\r\n }\r\n switch (typeOf(value)) {\r\n case _Array:\r\n case _Function:\r\n return !value.length;\r\n case _Number: // zero and NaN checks happened above so `if number` then it's 'not-an-empty-number' (lol)\r\n return false;\r\n case _Object:\r\n return !keys(value).length;\r\n case _Map:\r\n case _Set:\r\n case _WeakSet:\r\n case _WeakMap:\r\n return !value.size;\r\n case _NaN:\r\n return true;\r\n default:\r\n return !value;\r\n }\r\n },\r\n\r\n /**\r\n * Returns whether passed in values is defined and not null or not.\r\n * @function module:object.isset\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isset = x => x !== null && x !== undefined,\r\n\r\n /**\r\n * Checks to see if `x` is of one of the given type refs.\r\n * @function object.isOneOf\r\n * @param x {*}\r\n * @param types {...(TypeRef|*)}\r\n * @returns {boolean}\r\n * @todo write tests for this function.\r\n */\r\n isOneOf = (x, ...types) => {\r\n const typeName = typeOf(x);\r\n return toTypeRefNames(types).some(name => typeName === name);\r\n },\r\n\r\n isFunctor = x => x && x.map && instanceOf(Function, x.map)\r\n\r\n;\r\n","/**\r\n * @memberOf object\r\n */\r\n\r\nimport {isset} from './is';\r\nimport {curry} from '../function/curry';\r\n\r\n/**\r\n * Looks up property and returns it's value; Else `undefined`.\r\n * Method is null safe (will not throw on `null` or `undefined`).\r\n * @function module:object.lookup\r\n * @param key {String} - Key to search on `obj`\r\n * @param obj {Object} - Object to search `name` on.\r\n * @returns {*}\r\n */\r\nexport const lookup = curry((key, obj) => isset(obj) ? obj[key] : undefined);\r\n","import {isFunction, isset, isUsableImmutablePrimitive} from './is';\r\nimport {apply} from '../jsPlatform/function';\r\n\r\n/**\r\n * Creates a value `of` given type; Checks for one of the following construction strategies (in order listed):\r\n * @example\r\n * // - If exists `(value).constructor.of` uses this.\r\n * // - If value is of one String, Boolean, Symbol, or Number types calls it's\r\n * // constructor as a function (in cast form; E.g., `constructor(...args)` )\r\n * // - Else if constructor is a function, thus far, then calls constructor using\r\n * // the `new` keyword (with any passed in args).\r\n\r\n * @function module:object.of\r\n * @param x {*} - Value to derive returned value's type from.\r\n * @param [args] {...*} - Any args to pass in to matched construction strategy.\r\n * @returns {*|undefined} - New value of given value's type else `undefined`.\r\n */\r\nexport const of = (x, ...args) => {\r\n if (!isset(x)) { return undefined; }\r\n const constructor = x.constructor;\r\n if (constructor.hasOwnProperty('of')) {\r\n return apply(constructor.of, args);\r\n }\r\n else if (isUsableImmutablePrimitive(x)) {\r\n return apply(constructor, args);\r\n }\r\n else if (isFunction(constructor)) {\r\n return new constructor(...args);\r\n }\r\n return undefined;\r\n};\r\n","import {typeOf} from './typeOf';\r\nimport {of} from './of';\r\n\r\nexport const\r\n\r\n /**\r\n * Make a copy of a value or optionally copy incoming value onto an outgoing value (second parameter).\r\n * @note If incoming thing is an immmutable primitive (string, number, symbol, null, undefined, boolean)\r\n * it is returned as is.\r\n * @function module:object.copy\r\n * @param x {*} - Thing to copy.\r\n * @param [out = undefined] {*} - Optional value to copy on to. Not required.\r\n * @returns {*} - Copied thing or optionally outgoing value copied onto.\r\n */\r\n copy = (x, out) => {\r\n // if `null`, `undefined`, `''`, `0`, `false` return\r\n if (!x) { return x; }\r\n switch (typeOf(x)) {\r\n case Array.name:\r\n return !out ? x.slice(0) : Object.assign(out, x);\r\n\r\n // If immutable primitive, return it\r\n case Symbol.name:\r\n case Boolean.name:\r\n case String.name:\r\n case Number.name:\r\n case Promise.name:\r\n case Function.name:\r\n case 'NaN':\r\n case 'Null':\r\n case 'Undefined':\r\n return x;\r\n\r\n case 'Map':\r\n case 'Set':\r\n case 'WeakMap':\r\n case 'WeakSet':\r\n return new x.constructor(Array.from(x));\r\n\r\n // Else make copy\r\n default:\r\n return Object.assign(!out ? of(x) : out, x);\r\n }\r\n }\r\n;\r\n\r\nexport default copy;\r\n","import {isset} from './is';\r\nimport {curry} from '../function/curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Gives you value at key/namespace-key within `obj`; E.g.,\r\n * searchObj('all.your.base', {all: {your: {base: 99}}}) === 99 // `true`\r\n * @note If key is unreachable (undefined) returns `undefined`.\r\n * Useful in cases where we do not want to check each key along the way before getting/checking value; E.g.,\r\n * @example\r\n * ```\r\n * if (obj && obj.all && obj.all.your && obj.all.your.base) {\r\n * // Thing we want to do\r\n * }\r\n *\r\n * // So with our function becomes\r\n * if (searchObj('all.your.base', obj)) {\r\n * // Thing we want to do\r\n * }\r\n * ```\r\n * @function module:object.searchObj\r\n * @param nsString {String}\r\n * @param obj {*}\r\n * @returns {*}\r\n */\r\n searchObj = curry((nsString, obj) => {\r\n if (!obj) { return obj; }\r\n if (nsString.indexOf('.') === -1) {\r\n return obj[nsString];\r\n }\r\n const parts = nsString.split('.'),\r\n limit = parts.length;\r\n let ind = 0,\r\n parent = obj;\r\n for (; ind < limit; ind += 1) {\r\n const node = parent[parts[ind]];\r\n if (!isset(node)) {\r\n return node;\r\n }\r\n parent = node;\r\n }\r\n return parent;\r\n })\r\n;\r\n","\r\nimport {isObject} from './is';\r\nimport {keys} from '../jsPlatform/object';\r\nimport {curry2} from '../function/curry';\r\n\r\nexport const\r\n /**\r\n * Merges all objects down into one (takes two or more args).\r\n * @function module:object.assignDeep\r\n * @param obj0 {Object}\r\n * @param [objs] {...{Object}} - One or more objects to merge onto `obj0`.\r\n * @returns {Object}\r\n */\r\n assignDeep = curry2((obj0, ...objs) =>\r\n !obj0 ? obj0 : objs.reduce((topAgg, obj) =>\r\n !obj ? topAgg : keys(obj).reduce((agg, key) => {\r\n let propDescription = Object.getOwnPropertyDescriptor(agg, key);\r\n // If property is not writable move to next item in collection\r\n if (agg.hasOwnProperty(key) && propDescription &&\r\n !(propDescription.get && propDescription.set) &&\r\n !propDescription.writable) {\r\n return agg;\r\n }\r\n if (isObject(agg[key]) && isObject(obj[key])) {\r\n assignDeep(agg[key], obj[key]);\r\n }\r\n else { agg[key] = obj[key]; }\r\n return agg;\r\n }, topAgg)\r\n , obj0));\r\n","/**\r\n * List operations that overlap (apart from globally overlapping props and functions like `length`)\r\n * on both strings and arrays.\r\n * @memberOf list\r\n */\r\n\r\nimport {fPureTakesOne, fPureTakes2, fPureTakesOneOrMore} from '../utils';\r\n\r\nexport const\r\n\r\n /**\r\n * Concats/appends all functors onto the end of first functor.\r\n * Note: functors passed in after the first one must be of the same type.\r\n * @function module:list.concat\r\n * @param functor {Array|Object|*}\r\n * @param ...functor {Array|Object|*}\r\n * @return {*|Array|Object} - The type passed.\r\n * @throws {Error} - When passed in object doesn't have an `every` method.\r\n */\r\n concat = fPureTakesOneOrMore('concat'),\r\n\r\n /**\r\n * Same as Array.prototype.slice\r\n * @function module:list.slice\r\n * @param separator {String|RegExp}\r\n * @param arr{Array}\r\n * @returns {Array}\r\n */\r\n slice = fPureTakes2('slice'),\r\n\r\n /**\r\n * `Array.prototype.includes` or shim.\r\n * @function module:list.includes\r\n * @param value {*}\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n includes = (() => 'includes' in Array.prototype ?\r\n fPureTakesOne('includes') :\r\n (value, xs) => xs.indexOf(value) > -1)(),\r\n\r\n /**\r\n * Searches list/list-like for given element `x`.\r\n * @function module:list.indexOf\r\n * @param x {*} - Element to search for.\r\n * @param xs {Array|String|*} - list or list like to look in.\r\n * @returns {Number} - `-1` if element not found else index at which it is found.\r\n */\r\n indexOf = fPureTakesOne('indexOf'),\r\n\r\n /**\r\n * Last index of (`Array.prototype.lastIndexOf`).\r\n * @function module:list.lastIndexOf\r\n * @param x {*} - Element to search for.\r\n * @param xs {Array|String|*} - list or list like to look in.\r\n * @returns {Number} - `-1` if element not found else index at which it is found.\r\n */\r\n lastIndexOf = fPureTakesOne('lastIndexOf')\r\n\r\n;\r\n","/**\r\n * @module boolean\r\n * @description Contains functional version of 'always-true', 'always-false', 'is-truthy', and 'is-falsy'.\r\n */\r\nimport {curry, curry2} from './function/curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns whether `value` is 'truthy' or not\r\n * @function module:boolean.isTruthy\r\n * @param value\r\n * @returns {Boolean}\r\n */\r\n isTruthy = value => !!value,\r\n\r\n /**\r\n * Returns whether `value` is 'falsy' or not\r\n * @function module:boolean.isFalsy\r\n * @param value\r\n * @returns {Boolean}\r\n */\r\n isFalsy = value => !value,\r\n\r\n /**\r\n * Returns `true`.\r\n * @function module:boolean.alwaysTrue\r\n * @returns {Boolean}\r\n */\r\n alwaysTrue = () => true,\r\n\r\n /**\r\n * Returns `false`.\r\n * @function module:boolean.alwaysFalse\r\n * @returns {Boolean}\r\n */\r\n alwaysFalse = () => false,\r\n\r\n /**\r\n * Equality operator.\r\n * @function module:boolean.equal\r\n * @param a {*}\r\n * @param b {*}\r\n * @returns {boolean}\r\n */\r\n equal = curry((a, b) => a === b),\r\n\r\n /**\r\n * Equality operator for all.\r\n * @function module:boolean.equalAll\r\n * @param a {*} - Item `0`.\r\n * @param args {...*} - Others\r\n * @returns {boolean}\r\n */\r\n equalAll = curry2((a, ...args) => args.every(b => equal(a, b)))\r\n\r\n;\r\n","import {length} from '../jsPlatform/object';\r\nimport {curry} from '../function/curry';\r\nimport {typeOf} from '../object/typeOf';\r\nimport {of} from '../object/of';\r\nimport {isFunctor, isset} from '../object/is';\r\n\r\n/**\r\n * Maps a function onto a List (string or array) or a functor (value containing a map method).\r\n * @function module:list.map\r\n * @param fn {Function} - Function to map on given value.\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\nconst map = curry((fn, xs) => {\r\n if (!isset(xs)) { return xs; }\r\n let out = of(xs),\r\n limit,\r\n i = 0;\r\n switch (typeOf(xs)) {\r\n case 'Array':\r\n limit = length(xs);\r\n if (!limit) { return out; }\r\n for (; i < limit; i += 1) {\r\n out.push(fn(xs[i], i, xs));\r\n }\r\n return out;\r\n case 'String':\r\n limit = length(xs);\r\n if (!xs) { return out; }\r\n for (; i < limit; i += 1) {\r\n out += fn(xs[i], i, xs);\r\n }\r\n return out;\r\n default:\r\n if (isFunctor(xs)) { return xs.map(fn); }\r\n\r\n // Other objects\r\n return Object.keys(xs).reduce((agg, key) => {\r\n out[key] = fn(xs[key], key, xs);\r\n return out;\r\n }, out);\r\n }\r\n});\r\n\r\nexport default map;\r\n","\r\nexport const\r\n\r\n /**\r\n * Pushes incoming `item` onto given array and returns said array.\r\n * @private\r\n * @param agg {Array}\r\n * @param item {*}\r\n * @returns {Array}\r\n */\r\n aggregateArray = (agg, item) => {\r\n agg.push(item);\r\n return agg;\r\n }\r\n\r\n;\r\n","/**\r\n * List operator utils module.\r\n * @module listUtils\r\n */\r\nimport {apply} from '../jsPlatform/function'; // un-curried version\r\nimport {slice} from '../jsPlatform/list'; // un-curried version good for both strings and arrays\r\nimport {length} from '../jsPlatform/object';\r\nimport {alwaysFalse} from '../boolean';\r\nimport map from './map';\r\nimport {curry, curry2} from '../function/curry';\r\n\r\nexport * from './aggregation';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns a slice of the given list from `startInd` to the end of the list.\r\n * @function module:listUtils.sliceFrom\r\n * @param startInd {Number}\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n sliceFrom = curry((startInd, xs) => slice(startInd, undefined, xs)),\r\n\r\n /**\r\n * Slices from index `0` to given index.\r\n * @function module:listUtils.sliceTo\r\n * @param toInd {Number}\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n sliceTo = curry((toInd, xs) => slice(0, toInd, xs)),\r\n\r\n /**\r\n * Slices a copy of list.\r\n * @function listUtils.sliceCopy\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n sliceCopy = sliceFrom(0),\r\n\r\n /**\r\n * Generic 'ascending order' ordering function (use by the likes of `list.sort` etc.)\r\n * @function module:listUtils.genericAscOrdering\r\n * @param a {*}\r\n * @param b {*}\r\n * @returns {number}\r\n */\r\n genericAscOrdering = curry((a, b) => {\r\n if (a > b) { return 1; }\r\n else if (a < b) { return -1; }\r\n return 0;\r\n }),\r\n\r\n /**\r\n * Returns length of all passed lists in list.\r\n * @function module:listUtils.lengths\r\n * @param lists ...{Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n lengths = curry2((...lists) => map(length, lists)),\r\n\r\n /**\r\n * Returns a list of lists trimmed to the shortest length in given list of lists. @background This method is used by the `zip*` functions to achieve their\r\n * 'slice to smallest' functionality.\r\n * @function module:listUtils.toShortest\r\n * @param lists {...(Array|String|*)}\r\n * @returns {Array|String|*}\r\n */\r\n toShortest = curry2((...lists) => {\r\n const listLengths = apply(lengths, lists),\r\n smallLen = Math.min.apply(Math, listLengths);\r\n return map((list, ind) => listLengths[ind] > smallLen ?\r\n sliceTo(smallLen, list) : sliceCopy(list), lists);\r\n }),\r\n\r\n /**\r\n * Reduces until predicate.\r\n * @function module:listUtils.reduceUntil\r\n * @param pred {Function} - `(item, index, list) => Boolean(...)`\r\n * @param op {Function} - Operation - `(agg, item, index, list) => agg`\r\n * @param agg {*} - Zero value.\r\n * @param xs {Array|String|*} - List.\r\n * @returns {*}\r\n */\r\n reduceUntil = curry((pred, op, agg, xs) => {\r\n const limit = length(xs);\r\n if (!limit) { return agg; }\r\n let ind = 0,\r\n result = agg;\r\n for (; ind < limit; ind++) {\r\n if (pred(xs[ind], ind, xs)) { break; }\r\n result = op(result, xs[ind], ind, xs);\r\n }\r\n return result;\r\n }),\r\n\r\n /**\r\n * Reduces until predicate (from right to left).\r\n * @function module:listUtils.reduceUntilRight\r\n * @param pred {Function} - `(item, index, list) => Boolean(...)`\r\n * @param op {Function} - Operation - `(agg, item, index, list) => agg`\r\n * @param agg {*} - Zero value.\r\n * @param xs {Array|String|*} - List.\r\n * @returns {*}\r\n */\r\n reduceUntilRight = curry((pred, op, agg, arr) => {\r\n const limit = length(arr);\r\n if (!limit) { return agg; }\r\n let ind = limit - 1,\r\n result = agg;\r\n for (; ind >= 0; ind--) {\r\n if (pred(arr[ind], ind, arr)) { break; }\r\n result = op(result, arr[ind], ind, arr);\r\n }\r\n return result;\r\n }),\r\n\r\n /**\r\n * Reduces a list with given operation (`op`) function.\r\n * @function module:listUtils.reduce\r\n * @param op {Function} - Operation - `(agg, item, index, list) => agg`\r\n * @param agg {*} - Zero value.\r\n * @param xs {Array|String|*} - List.\r\n * @returns {*}\r\n */\r\n reduce = reduceUntil(alwaysFalse),\r\n\r\n /**\r\n * Reduces a list with given operation (`op`) function (from right-to-left).\r\n * @function module:listUtils.reduceRight\r\n * @param op {Function} - Operation - `(agg, item, index, list) => agg`\r\n * @param agg {*} - Zero value.\r\n * @param xs {Array|String|*} - List.\r\n * @returns {*}\r\n */\r\n reduceRight = reduceUntilRight(alwaysFalse),\r\n\r\n /**\r\n * Gets last index of a list/list-like (Array|String|Function etc.).\r\n * @function module:listUtils.lastIndex\r\n * @param x {Array|String|*} - list like or list.\r\n * @returns {Number} - `-1` if no element found.\r\n */\r\n lastIndex = x => { const len = length(x); return len ? len - 1 : 0; },\r\n\r\n /**\r\n * Finds index in string or list.\r\n * @function module:listUtils.findIndexWhere\r\n * @param pred {Function} - Predicate.\r\n * @param arr {Array|String}\r\n * @returns {Number} - `-1` if predicate not matched else `index` found\r\n */\r\n findIndexWhere = curry((pred, arr) => {\r\n let ind = 0;\r\n const limit = length(arr);\r\n for (; ind < limit; ind += 1) {\r\n const predicateFulfilled = !!pred(arr[ind], ind, arr);\r\n if (predicateFulfilled) {\r\n return ind;\r\n }\r\n }\r\n return -1;\r\n }),\r\n\r\n /**\r\n * Finds index in list from right to left.\r\n * @function module:listUtils.findIndexWhereRight\r\n * @param pred {Function} - Predicate.\r\n * @param arr {Array|String}\r\n * @returns {Number} - `-1` if predicate not matched else `index` found\r\n */\r\n findIndexWhereRight = curry((pred, arr) => {\r\n let ind = length(arr) - 1;\r\n for (; ind >= 0; ind -= 1) {\r\n const predicateFulfilled = !!pred(arr[ind], ind, arr);\r\n if (predicateFulfilled) {\r\n return ind;\r\n }\r\n }\r\n return -1;\r\n }),\r\n\r\n /**\r\n * @function module:listUtils.findIndicesWhere\r\n * @param pred {Function}\r\n * @param xs {Array|String|*} - list or list like.\r\n * @returns {Array|undefined}\r\n */\r\n findIndicesWhere = curry((pred, xs) => {\r\n const limit = length(xs);\r\n let ind = 0,\r\n out = [];\r\n for (; ind < limit; ind++) {\r\n if (pred(xs[ind], ind, xs)) { out.push(ind); }\r\n }\r\n return out.length ? out : undefined;\r\n }),\r\n\r\n /**\r\n * @function module:listUtils.findWhere\r\n * @param pred {Function}\r\n * @param xs {Array|String|*} - list or list like.\r\n * @returns {*}\r\n */\r\n findWhere = curry((pred, xs) => {\r\n let ind = 0,\r\n limit = length(xs);\r\n if (!limit) { return; }\r\n for (; ind < limit; ind++) {\r\n let elm = xs[ind];\r\n if (pred(elm, ind, xs)) { return elm; }\r\n }\r\n })\r\n\r\n;\r\n","import {assignDeep} from './assignDeep';\r\nimport {keys} from '../jsPlatform/object';\r\nimport {reduce} from '../list/utils';\r\nimport {curry, curry2} from '../function/curry';\r\n\r\nexport const\r\n\r\n objUnion = curry((obj1, obj2) => assignDeep(obj1, obj2)),\r\n\r\n objIntersect = curry((obj1, obj2) => reduce((agg, key) => {\r\n if (obj2.hasOwnProperty(key)) {\r\n agg[key] = obj2[key];\r\n }\r\n return agg;\r\n }, {}, keys(obj1))),\r\n\r\n objDifference = curry((obj1, obj2) => reduce((agg, key) => {\r\n if (!obj2.hasOwnProperty(key)) {\r\n agg[key] = obj1[key];\r\n }\r\n return agg;\r\n }, {}, keys(obj1))),\r\n\r\n objComplement = curry2((obj0, ...objs) => reduce((agg, obj) =>\r\n assignDeep(agg, objDifference(obj, obj0)), {}, objs));\r\n","/**\r\n * @module console\r\n * @description Console exports.\r\n */\r\nexport const\r\n\r\n /**\r\n * `Console.log` method.\r\n * @function module:console.log\r\n * @params args {...*}\r\n * @returns {void}\r\n */\r\n log = console.log.bind(console),\r\n\r\n /**\r\n * `Console.error` method.\r\n * @function module:console.error\r\n * @params args {...*}\r\n * @returns {void}\r\n */\r\n error = console.error.bind(console),\r\n\r\n /**\r\n * Peeks (console.log) at incoming value(s) and returns the last value.\r\n * @function module:console.peek\r\n * @param args {...*}\r\n * @returns {*} Last given value (if one or more values) else first value.\r\n */\r\n peek = (...args) => (log(...args), args.pop())\r\n\r\n;\r\n","export const\r\n\r\n /**\r\n * Clones and object or array using `JSON.parse(JSON.stringify(...))` pattern.\r\n * @function module:object.jsonClone\r\n * @param x {*}\r\n * @returns {*}\r\n */\r\n jsonClone = x => JSON.parse(JSON.stringify(x))\r\n\r\n;\r\n","import {isArray, isType} from './is';\r\nimport {keys} from '../jsPlatform/object';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns an associated list from given object.\r\n * @note Useful for working with plain javascript objects.\r\n * @function module:object.toAssocList\r\n * @param obj {(Object|Array|*)}\r\n * @returns {Array.<*, *>}\r\n */\r\n toAssocList = obj => keys(obj).map(key => [key, obj[key]]),\r\n\r\n /**\r\n * Returns an associated list from given object (deeply (on incoming object's type)).\r\n * @note Does deep conversion on all values of passed in type's type.\r\n * @function module:object.toAssocListDeep\r\n * @param obj {*}\r\n * @param [TypeConstraint = Object] {(Constructor|Function)} - Type constraint to convert on.\r\n * @returns {*}\r\n */\r\n toAssocListDeep = (obj, TypeConstraint = Object) => keys(obj).map(key =>\r\n TypeConstraint && isType(TypeConstraint, obj[key]) ?\r\n [key, toAssocListDeep(obj[key], TypeConstraint)] :\r\n [key, obj[key]]\r\n ),\r\n\r\n /**\r\n * From associated list to object.\r\n * @function module:object.fromAssocList\r\n * @param xs {Array.} - Associated list.\r\n * @param [OutType = Object] {Constructor|Function} - Output type. Default `Object`.\r\n * @returns {*} - Default is `Object`\r\n */\r\n fromAssocList = (xs, OutType = Object) => xs.reduce((agg, [key, value]) => {\r\n agg[key] = value;\r\n return agg;\r\n }, new OutType()),\r\n\r\n /**\r\n * From associated list to object (deep conversion on associative lists (array of 2 value arrays)).\r\n * @note Considers array of arrays associated lists.\r\n * @function module:object.fromAssocListDeep\r\n * @param xs {Array.} - Associated list.\r\n * @param [OutType = Object] {Constructor|Function} - Output type. Default `Object`.\r\n * @returns {*} - Default is `Object`\r\n */\r\n fromAssocListDeep = (xs, OutType = Object) => xs.reduce((agg, [key, value]) => {\r\n if (isArray(value) && isArray(value[0]) && value[0].length === 2) {\r\n agg[key] = fromAssocListDeep(value, OutType);\r\n return agg;\r\n }\r\n agg[key] = value;\r\n return agg;\r\n }, new OutType())\r\n;\r\n","import {typeOf} from './typeOf';\r\nimport {toAssocList} from './assocList';\r\n\r\nexport const\r\n\r\n /**\r\n * Converts incoming value to an array.\r\n * @note For `WeakMap`, `WeakSet`, `Map` and `Set` result is the same as calling `Array.from` on such.\r\n * @note For `null`, `undefined`, `NaN`, `Number{}`, `Symbol{}`, `Boolean{}` returns an empty array.\r\n * @note Method does a shallow conversion;\r\n * @function module:object.toArray\r\n * @param x {*} - Thing to convert from.\r\n * @returns {Array}\r\n */\r\n toArray = x => {\r\n switch (typeOf(x)) {\r\n case 'Null':\r\n case 'Undefined':\r\n return [];\r\n case String.name:\r\n case Array.name:\r\n case 'WeakMap':\r\n case 'WeakSet':\r\n case 'Map':\r\n case 'Set':\r\n return Array.from(x);\r\n case Object.name:\r\n default:\r\n return toAssocList(x);\r\n }\r\n }\r\n\r\n;\r\n","/**\r\n * @module object\r\n * @description Object operations/combinators.\r\n */\r\n\r\nexport * from './jsPlatform/object';\r\nexport * from './object/lookup';\r\nexport * from './object/typeOf';\r\nexport * from './object/copy';\r\nexport * from './object/is';\r\nexport * from './object/of';\r\nexport * from './object/searchObj';\r\nexport * from './object/assignDeep';\r\nexport * from './object/setTheory';\r\nexport * from './object/console';\r\nexport * from './object/jsonClone';\r\nexport * from './object/toArray';\r\nexport * from './object/assocList';\r\n","import {reduceRight} from '../jsPlatform/array';\r\n\r\n/**\r\n * Composes all functions passed in from right to left passing each functions return value to\r\n * the function on the left of itself.\r\n * @function module:function.compose\r\n * @type {Function}\r\n * @param args {...{Function}}\r\n * @returns {Function}\r\n */\r\nexport const compose = (...args) =>\r\n arg0 => reduceRight((value, fn) => fn(value), arg0, args);\r\n","/**\r\n * @memberOf function\r\n */\r\n\r\n/**\r\n * Returns passed in parameter.\r\n * @haskellType `id :: a -> a`\r\n * @function module:function.id\r\n * @param x {*}\r\n * @returns {*}\r\n */\r\nexport const id = x => x;\r\n","/**\r\n * @memberOf function\r\n */\r\n\r\nimport {apply} from '../jsPlatform/function';\r\nimport {curry, curry2} from './curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Negates a function that takes one/no argument.\r\n * @function module:function.negateF\r\n * @param fn {Function}\r\n * @returns {function(*=): boolean}\r\n */\r\n negateF = fn => x => !fn(x),\r\n\r\n /**\r\n * Takes a function that takes two parameters and returns a negated version of given\r\n * function.\r\n * @function module:_negate.negateF2\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n negateF2 = fn => curry((a, b) => !fn(a, b)),\r\n\r\n /**\r\n * Takes a function that takes three parameters and returns a\r\n * negated version of given function.\r\n * @function module:_negate.negateF3\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n negateF3 = fn => curry((a, b, c) => !fn(a, b, c)),\r\n\r\n /**\r\n * Returns a negated version of given function.\r\n * Returned function is variadiac (takes one or more arguments).\r\n * @note function returned is uncurried.\r\n * @uncurried\r\n * @function module:function.negateFN\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n negateFN = fn => curry2((...args) => !apply(fn, args));\r\n","import {curry} from './curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Run `operation` until predicate returns `true` (like a functional\r\n * version of a while loop).\r\n * @function module:function.until\r\n * @param predicate {Function} :: a -> Boolean\r\n * @param operation {Function} :: a -> a\r\n * @param typeInstance {*} :: * - A monoidal zero or some starting point.\r\n * @returns {*} - What ever type `typeInstance` is\r\n */\r\n until = curry((predicate, operation, typeInstance) => {\r\n let result = typeInstance;\r\n while (!predicate(result)) {\r\n result = operation(result);\r\n }\r\n return result;\r\n });\r\n","import {typeOf} from '../object/typeOf';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns a function or throws an error if given `f` is not a function.\r\n * @function module:function.fnOrError\r\n * @param symbolName {String} - Error message prefix.\r\n * @param f {Function|*} - Expected function.\r\n * @returns {Function}\r\n * @throws {Error} - Error if `f` is not of `function`\r\n */\r\n fnOrError = (symbolName, f) => {\r\n if (!f || !(f instanceof Function)) {\r\n throw new Error(`${symbolName} should be a function. ` +\r\n `Type received: ${typeOf(f)}; Value received: ${f}.`);\r\n }\r\n return f;\r\n }\r\n\r\n;\r\n","/**\r\n * No-op ('op' as in 'operation') - Performs no operation 'always' (good for places where\r\n * a value should always be a function etc.).\r\n * @function module:function.noop\r\n * @returns {undefined}\r\n */\r\nexport const noop = () => undefined;\r\n","/**\r\n * @module function\r\n */\r\nexport * from './jsPlatform/function';\r\nexport * from './function/compose';\r\nexport * from './function/curry';\r\nexport * from './function/flip';\r\nexport * from './function/id';\r\nexport * from './function/negate';\r\nexport * from './function/until';\r\nexport * from './function/fnOrError';\r\nexport * from './function/noop';\r\n","/**\r\n * @module object\r\n */\r\nimport {curry} from '../function/curry';\r\n\r\n/**\r\n * Normalizes step for `from` and `to` combination.\r\n * @function module:list.normalizeStep\r\n * @param from {Number}\r\n * @param to {Number}\r\n * @param [step = 1] {Number}\r\n * @returns {Number}\r\n * @private\r\n */\r\nconst normalizeStep = (from, to, step) => {\r\n if (from > to) {\r\n return step > 0 ? -step : step; // make step negative\r\n }\r\n return step < 0 ? -1 * step : step; // make step positive\r\n};\r\n\r\nexport const\r\n\r\n /**\r\n * Range function - gives you an array contain numbers in given range.\r\n * @note normalizes `step` to be valid if range numbers given are invalid\r\n * (forces `step` to be negative if range required is in the negative direction\r\n * and forces `step` to be positive if range required is in the other direction).\r\n * @function module:list.range\r\n * @param from {Number}\r\n * @param to {Number}\r\n * @param [step = 1] {Number}\r\n * @returns {Array.}\r\n */\r\n range = curry((from, to, step = 1) => {\r\n let i = from;\r\n const out = [];\r\n step = normalizeStep(from, to, step);\r\n if (step === 0 || from === to) { return [from]; }\r\n for (; (to - i) * step >= 0; i += step) { out.push(i); }\r\n return out;\r\n })\r\n;\r\n","/**\r\n * Created by elydelacruz on 9/6/2017.\r\n */\r\n\r\nimport {fPureTakesOne} from '../utils';\r\n\r\n/**\r\n * Functional version of `String.prototype.split`.\r\n * @function module:_string.split\r\n * @param separator {String|RegExp}\r\n * @param str {String}\r\n * @returns {Array}\r\n */\r\nexport const split = fPureTakesOne('split');\r\n","/**\r\n * @module jsPlatform_\r\n * @private\r\n */\r\nexport * from './jsPlatform/object';\r\nexport * from './jsPlatform/array';\r\nexport * from './jsPlatform/list';\r\nexport * from './jsPlatform/string';\r\nexport * from './jsPlatform/function';\r\n","/**\r\n * List operations module.\r\n * @module list\r\n */\r\nimport {concat as listAppend, indexOf, slice, includes} from './jsPlatform/list';\r\nimport {apply} from './jsPlatform/function';\r\nimport {length} from './jsPlatform/object';\r\nimport {negateF3, negateF2} from './function/negate';\r\nimport {curry, curry2, curry3} from './function/curry';\r\nimport {isTruthy, isFalsy} from './boolean';\r\nimport {lookup} from './object/lookup';\r\nimport {of} from './object/of';\r\nimport {isset, isString} from './object/is';\r\nimport {typeOf} from './object/typeOf';\r\nimport map from './list/map';\r\n\r\nimport {\r\n sliceFrom, sliceTo, lengths,\r\n toShortest, aggregateArray,\r\n reduceUntil, reduce, reduceRight, lastIndex,\r\n findIndexWhere, findIndexWhereRight, findIndicesWhere,\r\n findWhere, sliceCopy, genericAscOrdering\r\n}\r\n from './list/utils';\r\n\r\nexport * from './list/range';\r\n\r\nexport * from './list/utils';\r\n\r\nexport {map};\r\n\r\nexport {slice, includes, indexOf, lastIndexOf, push} from './jsPlatform';\r\n\r\nexport const\r\n\r\n /**\r\n * Append two, or more, lists, i.e.,\r\n * @example\r\n * expectEqual(append(take(13, alphabetString), drop(13, alphabetString)), alphabetString); // true\r\n *\r\n * // Another example\r\n * const result = append(\r\n * alphabetStr.split(''),\r\n * alphabetStr.split('')\r\n * ),\r\n * expected = repeat(2, alphabetStr).split('');\r\n *\r\n * shallowEquals(result, expected) === true // `true`\r\n *\r\n * @function module:list.append\r\n * @param [args] {...(Array|String|*)} - One or more lists or list likes (strings etc.).\r\n * @returns {(Array|String|*)} - Same type as list like passed in.\r\n */\r\n append = curry2((...args) => apply(listAppend, args)),\r\n\r\n /**\r\n * Returns head of list (first item of list).\r\n * @haskellType `head :: [a] -> a`\r\n * @function module:list.head\r\n * @param x {Array|String}\r\n * @returns {*} - First item from list\r\n */\r\n head = x => x[0],\r\n\r\n /**\r\n * Returns last item of list.\r\n * @haskellType `last :: [a] -> a`\r\n * @function module:list.last\r\n * @param xs {Array|String}\r\n * @returns {*}\r\n */\r\n last = xs => xs[lastIndex(xs)],\r\n\r\n /**\r\n * Returns tail part of list (everything after the first item as new list).\r\n * @haskelType `tail :: [a] -> [a]`\r\n * @function module:list.tail\r\n * @param xs {Array|String}\r\n * @returns {Array|String}\r\n */\r\n tail = xs => sliceFrom(1, xs),\r\n\r\n /**\r\n * Returns everything except last item of list as new list.\r\n * @haskellType `init :: [a] -> [a]`\r\n * @function module:list.init\r\n * @param xs {Array|String}\r\n * @returns {Array|String}\r\n */\r\n init = xs => sliceTo(lastIndex(xs), xs),\r\n\r\n /**\r\n * Returns `head` and `tail` of passed in list/string in a tuple.\r\n * @haskellType `uncons :: [a] -> Maybe (a, [a])`\r\n * @function module:list.uncons\r\n * @param xs {Array|String}\r\n * @returns {Array|undefined}\r\n */\r\n uncons = xs => !xs || length(xs) === 0 ? undefined : [head(xs), tail(xs)],\r\n\r\n /**\r\n * Returns `tail` and `head` of passed in list/string in a tuple.\r\n * @haskellType `unconsr :: [a] -> Maybe ([a], a)`\r\n * @function module:list.unconsr\r\n * @param xs {Array|String}\r\n * @returns {Array|String|*|undefined}\r\n */\r\n unconsr = xs => !xs || length(xs) === 0 ? undefined : [init(xs), last(xs)],\r\n\r\n /**\r\n * Concatenates all the elements of a container of lists.\r\n * @haskellType `concat :: Foldable t => t [a] -> [a]`\r\n * @function module:list.concat\r\n * @param xs {Array}\r\n * @returns {Array}\r\n */\r\n concat = xs => {\r\n switch (length(xs)) {\r\n case undefined:\r\n case 0:\r\n return [];\r\n case 1:\r\n const item0 = xs[0];\r\n return item0 && item0.slice ? sliceCopy(item0) : item0;\r\n case 2:\r\n default:\r\n return apply(append, xs);\r\n }\r\n },\r\n\r\n /**\r\n * Map a function over all the elements of a container and concatenate the resulting lists.\r\n * @haskellType `concatMap :: Foldable t => (a -> [b]) -> t a -> [b]`\r\n * @function module:list.concatMap\r\n * @param fn {Function}\r\n * @param foldableOfA {Array}\r\n * @returns {Array}\r\n */\r\n concatMap = curry((fn, foldableOfA) => concat(map(fn, foldableOfA))),\r\n\r\n /**\r\n * Returns a copy of the passed in list reverses.\r\n * @haskellType `reverse :: [a] -> [a]`\r\n * @function module:list.reverse\r\n * @param xs {Array|String}\r\n * @returns {Array|String}\r\n */\r\n reverse = xs => {\r\n if (!isset(xs) || !xs.length) {\r\n return xs;\r\n }\r\n let out = of(xs),\r\n i = xs.length - 1;\r\n switch (typeOf(xs)) {\r\n case 'String':\r\n for (; i >= 0; i -= 1) {\r\n out += xs[i];\r\n }\r\n return out;\r\n default:\r\n for (; i >= 0; i -= 1) {\r\n out.push(xs[i]);\r\n }\r\n return out;\r\n }\r\n },\r\n\r\n /**\r\n * Takes an element and a list and `intersperses' that element between the\r\n * elements of the list.\r\n * @function module:list.intersperse\r\n * @note In our version of the function javascript is loosely typed so,\r\n * so is our function (to much overhead to make it typed) so `between` can be any value.\r\n * @param between {*} - Should be of the same type of elements contained in list.\r\n * @param arr {Array|String} - List.\r\n * @returns {Array|String}\r\n */\r\n intersperse = curry((between, xs) => {\r\n if (!xs || !xs.length) {\r\n return xs;\r\n }\r\n const limit = xs.length,\r\n lastInd = limit - 1;\r\n let out = of(xs),\r\n i = 0;\r\n if (isString(xs)) {\r\n for (; i < limit; i += 1) {\r\n out += i === lastInd ?\r\n xs[i] : xs[i] + between;\r\n }\r\n return out;\r\n }\r\n for (; i < limit; i += 1) {\r\n if (i === lastInd) {\r\n out.push(xs[i]);\r\n } else {\r\n out.push(xs[i], between);\r\n }\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * `intercalate xs xss` is equivalent to (concat (intersperse xs xss)). It inserts the list xs in between the lists in xss and concatenates the result.\r\n * @haskellType `intercalate :: [a] -> [[a]] -> [a]`\r\n * @function module:list.intercalate\r\n * @param xs {Array|String}\r\n * @param xss {Array|String}\r\n * @returns {Array|String}\r\n */\r\n intercalate = curry((xs, xss) => {\r\n if (isString(xss)) {\r\n return intersperse(xs, xss);\r\n }\r\n return concat(intersperse(xs, xss));\r\n }),\r\n\r\n /**\r\n * Transposes rows and columns into lists by index; E.g.,\r\n * Haskell example:\r\n * ```\r\n * transpose [[1,2,3],[4,5,6]] == [[1,4],[2,5],[3,6]]\r\n *\r\n * -- Notice the shorter arrays are ignored after their last index is copied over:\r\n * transpose [[10,11],[20],[],[30,31,32]] == [[10,20,30],[11,31],[32]]\r\n * ```\r\n * @note from columns to rows.\r\n * @note Empty lists are ignored.\r\n * @haskellType `transpose :: [[a]] -> [[a]]`\r\n * @function module:list.transpose\r\n * @param xss {Array}\r\n * @returns {Array}\r\n */\r\n transpose = xss => {\r\n let numLists = length(xss),\r\n ind = 0, ind2;\r\n if (!numLists) {\r\n return [];\r\n }\r\n const listLengths = apply(lengths, xss),\r\n longestListLen = maximum(listLengths),\r\n outLists = [];\r\n for (; ind < longestListLen; ind += 1) {\r\n const outList = [];\r\n for (ind2 = 0; ind2 < numLists; ind2 += 1) {\r\n if (listLengths[ind2] < ind + 1) {\r\n continue;\r\n }\r\n outList.push(xss[ind2][ind]);\r\n }\r\n outLists.push(outList);\r\n }\r\n return filter(x => length(x) > 0, outLists);\r\n },\r\n\r\n /**\r\n * Generates 2^n sub-sequences for passed in sequence (string/list) (`n` is\r\n * the length of the passed in sequence so: 2^length(xs)).\r\n * Note: The return value doubles per index/character passed in so use with caution!\r\n * Also note that for 2^16 (or for a sequence of 16 characters) this algorithm\r\n * will generate 65536 sub-sequences! So caution should be taken to not\r\n * use this with sequences above a certain length on certain platform (the browser thread in specific).\r\n * @function module:list.subsequences\r\n * @jsperftest https://jsperf.com/subsequences\r\n * @param xs {Array|String}\r\n * @returns {Array.}\r\n */\r\n subsequences = xs => {\r\n const listLen = length(xs),\r\n len = Math.pow(2, listLen),\r\n out = [];\r\n for (let i = 0; i < len; i += 1) {\r\n let entry = [];\r\n for (let j = 0; j < listLen; j += 1) {\r\n if (i & (1 << j)) {\r\n entry.push(xs[j]);\r\n }\r\n }\r\n out.push(entry);\r\n }\r\n return out;\r\n },\r\n\r\n /**\r\n * Returns an array with the given indices swapped.\r\n * @function module:list.swapped\r\n * @param ind1 {Number}\r\n * @param ind2 {Number}\r\n * @param list {Array}\r\n * @returns {Array} - Copy of incoming with swapped values at indices.\r\n */\r\n swapped = curry((ind1, ind2, list) => {\r\n const out = sliceCopy(list),\r\n tmp = out[ind1];\r\n out[ind1] = out[ind2];\r\n out[ind2] = tmp;\r\n return out;\r\n }),\r\n\r\n /**\r\n * Returns a list of permutations for passed in list.\r\n * Use caution with lists above a length of 15 (will take long due to nature of\r\n * algorithm).\r\n * @function module:list.permutations\r\n * @param xs {Array} - List.\r\n * @returns {Array} - Array of permutations.\r\n */\r\n permutations = xs => {\r\n const limit = length(xs);\r\n\r\n if (!limit || limit === 1) {\r\n return [xs];\r\n }\r\n\r\n let list = sliceCopy(xs),\r\n c = repeat(limit, 0),\r\n i = 0;\r\n\r\n const out = [list];\r\n\r\n for (; i < limit; i++) {\r\n if (c[i] < i) {\r\n list = swapped(i % 2 === 0 ? 0 : c[i], i, list);\r\n out.push(list);\r\n c[i] += 1;\r\n i = 0;\r\n continue;\r\n }\r\n c[i] = 0;\r\n }\r\n\r\n return out;\r\n },\r\n\r\n /**\r\n * Left associative fold. Reduces a container of elements down by the given operation (same as [].reduce).\r\n * @function module:list.foldl\r\n * @param fn {Function}\r\n * @param zero {*} - Aggregator.\r\n * @param functor {Array}\r\n * @returns {*} - Whatever type is lastly returned from `fn`.\r\n */\r\n foldl = reduce,\r\n\r\n /**\r\n * Right associative fold. Reduces a container of elements down by the given operation (same as [].reduceRight).\r\n * @function module:list.foldr\r\n * @param fn {Function}\r\n * @param zero {*} - Aggregator.\r\n * @param functor {Array}\r\n * @returns {*} - Whatever type is lastly returned from `fn`.\r\n */\r\n foldr = reduceRight,\r\n\r\n /**\r\n * A variant of `foldl` except that this one doesn't require the starting point. The starting point/value will be pulled\r\n * out from a copy of the container.\r\n * @function module:list.foldl1\r\n * @param op {Function}\r\n * @param xs {Array}\r\n * @returns {*} - Whatever type is lastly returned from `op`.\r\n */\r\n foldl1 = curry((op, xs) => {\r\n const parts = uncons(xs);\r\n return !parts ? [] : reduce(op, parts[0], parts[1]);\r\n }),\r\n\r\n /**\r\n * A variant of `foldr` except that this one doesn't require the starting point/value. The starting point/value will be pulled\r\n * out from a copy of the container.\r\n * @function module:list.foldr1\r\n * @param op {Function}\r\n * @param xs {Array}\r\n * @returns {*} - Whatever type is lastly returned from `op`.\r\n */\r\n foldr1 = curry((op, xs) => {\r\n const parts = unconsr(xs);\r\n return !parts ? [] : reduceRight(op, parts[1], parts[0]);\r\n }),\r\n\r\n /**\r\n * Performs a map then a reduce all in one (from left-to-right). Returns a tuple\r\n * containing the aggregated value and the result of mapping the passed in function on passed in list.\r\n * @function module:list.mapAccumL\r\n * @param op {Function} - Function : [aggregated, mapResult]\r\n * @param zero {*} - An instance of the passed in list type used to aggregateArray on.\r\n * @param xs {Array} - list type.\r\n * @return {Array} - [aggregated, list]\r\n */\r\n mapAccumL = curry((op, zero, xs) => {\r\n const list = sliceCopy(xs),\r\n limit = length(xs);\r\n if (!limit) {\r\n return [zero, list];\r\n }\r\n let ind = 0,\r\n agg = zero,\r\n mapped = [],\r\n tuple;\r\n for (; ind < limit; ind++) {\r\n tuple = op(agg, list[ind], ind);\r\n agg = tuple[0];\r\n mapped = tuple[1];\r\n }\r\n return [agg, mapped];\r\n }),\r\n\r\n /**\r\n * Performs a map and a reduce all in one (from right-to-left). Returns a tuple\r\n * containing the aggregated value and the result of mapping the passed in function on passed in list.\r\n * @function module:list.mapAccumR\r\n * @param op {Function} - Function : [aggregated, mapResult]\r\n * @param zero {*} - An instance of the passed in list type used to aggregateArray on.\r\n * @param xs {Array} - list type.\r\n * @return {Array} - [aggregated, list]\r\n */\r\n mapAccumR = curry((op, zero, xs) => {\r\n const list = sliceCopy(xs),\r\n limit = length(xs);\r\n if (!limit) {\r\n return [zero, list];\r\n }\r\n let ind = limit - 1,\r\n agg = zero,\r\n mapped = [],\r\n tuple;\r\n for (; ind >= 0; ind--) {\r\n tuple = op(agg, list[ind], ind);\r\n agg = tuple[0];\r\n mapped = tuple[1];\r\n }\r\n return [agg, mapped];\r\n }),\r\n\r\n /**\r\n * iterate f x returns an infinite list of repeated applications of f to x.\r\n * @function module:list.iterate\r\n * @example `iterate(5, f, x) == [x, f(x), f(f(x)), ...]`\r\n * @param limit {Number}\r\n * @param op {Function} - Operation.\r\n * @param x {*} - Starting point.\r\n * @returns {*}\r\n */\r\n iterate = curry((limit, op, x) => {\r\n let ind = 0,\r\n out = [],\r\n lastX = x;\r\n for (; ind < limit; ind += 1) {\r\n out.push(lastX);\r\n lastX = op(lastX, ind);\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Repeats `x` `limit` number of times.\r\n * @function module:list.repeat\r\n * @param limit {Number}\r\n * @param x {*}\r\n * @return {Array}\r\n */\r\n repeat = curry((limit, x) => iterate(limit, a => a, x)),\r\n\r\n /**\r\n * Same as `repeat` due to the nature of javascript (see haskell version for usage).\r\n * @function module:list.replicate\r\n * @param limit {Number}\r\n * @param x {*}\r\n * @return {Array}\r\n */\r\n replicate = repeat,\r\n\r\n /**\r\n * Replicates a list `limit` number of times and appends the results (concat)\r\n * @function module:list.cycle\r\n * @param limit {Number}\r\n * @param xs {Array}\r\n * @returns {Array}\r\n */\r\n cycle = curry((limit, xs) => concat(replicate(limit, xs))),\r\n\r\n /**\r\n * Unfolds a value into a list of somethings.\r\n * @haskellType `unfoldr :: (b -> Maybe (a, b)) -> b -> [a]`\r\n * @function module:list.unfoldr\r\n * @param op {Function} - Operation to perform (should return a two component tuple (item to aggregateArray and item to unfold in next iteration).\r\n * @param x {*} - Starting parameter to unfold from.\r\n * @returns {Array} - An array of whatever you return from `op` yielded.\r\n */\r\n unfoldr = curry((op, x) => {\r\n let ind = 0,\r\n out = [],\r\n resultTuple = op(x, ind, out);\r\n while (resultTuple) {\r\n out.push(resultTuple[0]);\r\n resultTuple = op(resultTuple[1], ++ind, out);\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Finds index in string or list (alias for `findIndex`).\r\n * @function module:list.findIndex\r\n * @param pred {Function} - Predicate.\r\n * @param arr {Array|String}\r\n * @returns {Number} - `-1` if predicate not matched else `index` found\r\n */\r\n findIndex = findIndexWhere,\r\n\r\n /**\r\n * @function module:list.findIndices\r\n * @param pred {Function}\r\n * @param xs {Array} - list or list like.\r\n * @returns {Array|undefined}\r\n */\r\n findIndices = findIndicesWhere,\r\n\r\n /**\r\n * @function module:list.elemIndex\r\n * @param x {*} - Element to search for.\r\n * @param xs {Array} - list or list like.\r\n * @returns {*}\r\n */\r\n elemIndex = curry((x, xs) => {\r\n const foundInd = indexOf(x, xs);\r\n return foundInd !== -1 ? foundInd : undefined;\r\n }),\r\n\r\n /**\r\n * @function module:list.elemIndices\r\n * @param value {*} - Element to search for.\r\n * @param xs {Array} - list or list like.\r\n * @returns {*}\r\n */\r\n elemIndices = curry((value, xs) => findIndices(x => x === value, xs)),\r\n\r\n /**\r\n * Takes `n` items from start of list to `limit` (exclusive).\r\n * @function module:list.take\r\n * @param list {Array|String}\r\n * @param limit {Number}\r\n * @returns {String|Array} - Passed in type's type\r\n */\r\n take = sliceTo,\r\n\r\n /**\r\n * Drops `n` items from start of list to `count` (exclusive).\r\n * @function module:list.drop\r\n * @param list {Array|String}\r\n * @param count {Number}\r\n * @returns {String|Array} - Passed in type's type\r\n */\r\n drop = sliceFrom,\r\n\r\n /**\r\n * Splits `x` in two at given `index` (exclusive (includes element/character at\r\n * given index in second part of returned list)).\r\n * @function module:list.splitAt\r\n * @param ind {Number} - Index to split at.\r\n * @param list {Array|String} - functor (list or string) to split.\r\n * @returns {Array|String} - List like type passed\r\n */\r\n splitAt = (ind, list) => [sliceTo(ind, list), sliceFrom(ind, list)],\r\n\r\n /**\r\n * Gives an list with passed elements while predicate was true.\r\n * @function module:list.takeWhile\r\n * @param pred {Function} - Predicate<*, index, list|string>\r\n * @param list {Array|String}\r\n * @returns {Array}\r\n */\r\n takeWhile = curry((pred, list) =>\r\n reduceUntil(\r\n negateF3(pred), // predicate\r\n isString(list) ?\r\n (agg, x) => agg + x :\r\n aggregateArray, // operation\r\n of(list), // aggregate\r\n list\r\n )),\r\n\r\n /**\r\n * Returns an list without elements that match predicate.\r\n * @function module:list.dropWhile\r\n * @param pred {Function} - Predicate<*, index, list|string>\r\n * @param list {Array|String}\r\n * @refactor\r\n * @returns {Array|String}\r\n */\r\n dropWhile = curry((pred, list) => {\r\n const limit = length(list),\r\n splitPoint =\r\n findIndexWhere(\r\n (x, i, xs) => !pred(x, i, xs),\r\n list\r\n );\r\n\r\n return splitPoint === -1 ?\r\n sliceFrom(limit, list) :\r\n slice(splitPoint, limit, list);\r\n }),\r\n\r\n /**\r\n * @function module:list.dropWhileEnd\r\n * @param pred {Function} - Predicate<*, index, list|string>\r\n * @param list {Array|String}\r\n * @refactor\r\n * @returns {Array|String}\r\n */\r\n dropWhileEnd = curry((pred, list) => {\r\n const splitPoint =\r\n findIndexWhereRight(\r\n (x, i, xs) => !pred(x, i, xs),\r\n list\r\n );\r\n if (splitPoint === -1) {\r\n return of(list);\r\n }\r\n return sliceTo(splitPoint + 1, list);\r\n }),\r\n\r\n /**\r\n * Gives you the `span` of items matching predicate\r\n * and items not matching predicate; E.g., Gives an\r\n * array of arrays; E.g., [[matching-items], [non-matching-items]]\r\n * @function list.span\r\n * @param pred {Function} - List predicate (`(x, i, list) => bool`)\r\n * @param list {Array|String}\r\n * @returns {(Array>|Array)}\r\n * @type {Function}\r\n */\r\n span = curry((pred, list) => {\r\n const splitPoint = findIndexWhere(negateF3(pred), list);\r\n return splitPoint === -1 ?\r\n [sliceFrom(0, list), of(list)] :\r\n splitAt(splitPoint, list);\r\n }),\r\n\r\n /**\r\n * breakOnList, applied to a predicate p and a list xs, returns a tuple\r\n * where first element is longest prefix (possibly empty) of xs of elements\r\n * that do not satisfy p and second element is the remainder of the list:\r\n * @haskellExample\r\n * Replace `break` with `breakOnList` for our version.\r\n * ```\r\n * breakOnList (> 3) [1,2,3,4,1,2,3,4] == ([1,2,3],[4,1,2,3,4])\r\n * breakOnList (< 9) [1,2,3] == ([],[1,2,3])\r\n * breakOnList (> 9) [1,2,3] == ([1,2,3],[])\r\n * ```\r\n * @function module:list.breakOnList\r\n * @param pred {Function}\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n breakOnList = curry((pred, list) => {\r\n const splitPoint = findIndexWhere(negateF3(pred), list);\r\n return splitPoint === -1 ?\r\n [of(list), sliceFrom(0, list)] : reverse(splitAt(splitPoint, list));\r\n }),\r\n\r\n /**\r\n * Gets item at index.\r\n * @function module:list.at\r\n * @param ind {Number} - Index.\r\n * @param xs {Array} - list or list like.\r\n * @returns {*|undefined} - Item or `undefined`.\r\n */\r\n at = lookup,\r\n\r\n /**\r\n * Find an item in structure of elements based on given predicate (`pred`).\r\n * @function module:list.find\r\n * @param pred {Function}\r\n * @param xs {Array} - list or list like.\r\n * @returns {*} - Found item.\r\n */\r\n find = findWhere,\r\n\r\n /**\r\n * For each function (same as `[].forEach` except in functional format).\r\n * @function module:list.forEach\r\n * @param fn {Function} - Operation (`(element, index, list) => {...}`, etc.)\r\n * @param xs {(Array|String)}\r\n * @returns {void}\r\n */\r\n forEach = curry((fn, list) => {\r\n const limit = length(list);\r\n if (!limit) {\r\n return;\r\n }\r\n let ind = 0;\r\n for (; ind < limit; ind += 1) {\r\n fn(list[ind], ind, list);\r\n }\r\n }),\r\n\r\n /**\r\n * Filters a structure of elements using given predicate (`pred`) (same as `[].filter`).\r\n * @function module:list.filter\r\n * @param pred {Function}\r\n * @param xs {Array} - list or list like.\r\n * @returns {Array} - Structure of filtered elements.\r\n */\r\n filter = curry((pred, xs) => {\r\n let ind = 0,\r\n limit = length(xs),\r\n out = [];\r\n if (!limit) {\r\n return out;\r\n }\r\n for (; ind < limit; ind++) {\r\n if (pred(xs[ind], ind, xs)) {\r\n out.push(xs[ind]);\r\n }\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Partitions a list on a predicate; Items that match predicate are in first list in tuple; Items that\r\n * do not match the tuple are in second list in the returned tuple.\r\n * Essentially `[filter(p, xs), filter(negateF3(p), xs)]`.\r\n * @function module:list.partition\r\n * @param pred {Function} - Predicate\r\n * @param list {Array}\r\n * @returns {Array|String} - Tuple of arrays or strings (depends on incoming list (of type list or string)).\r\n */\r\n partition = curry((pred, list) =>\r\n !length(list) ?\r\n [[], []] :\r\n [filter(pred, list), filter(negateF3(pred), list)]),\r\n\r\n /**\r\n * Returns a boolean indicating whether an element exists in given structure of elements.\r\n * @function module:list.elem\r\n * @param element {*}\r\n * @param xs {Array}\r\n * @returns {Boolean}\r\n */\r\n elem = includes,\r\n\r\n /**\r\n * The opposite of `elem` - Returns a boolean indicating whether an element exists in given list.\r\n * @function module:list.notElem\r\n * @param element {*}\r\n * @param xs {Array}\r\n * @returns {Boolean}\r\n */\r\n notElem = negateF2(includes),\r\n\r\n /**\r\n * Checks if list `xs1` is a prefix of list `xs2`\r\n * @function module:list.isPrefixOf\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {boolean}\r\n */\r\n isPrefixOf = curry((xs1, xs2) => {\r\n const limit1 = length(xs1),\r\n limit2 = length(xs2);\r\n if (limit2 < limit1 || !limit1 || !limit2 || indexOf(xs1[0], xs2) === -1) {\r\n return false;\r\n }\r\n let ind = 0;\r\n for (; ind < limit1; ind++) {\r\n if (xs1[ind] !== xs2[ind]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }),\r\n\r\n /**\r\n * Checks if list `xs1` is a suffix of list `xs2`\r\n * @function module:list.isSuffixOf\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {boolean}\r\n */\r\n isSuffixOf = curry((xs1, xs2) => {\r\n const limit1 = length(xs1),\r\n limit2 = length(xs2);\r\n if (limit2 < limit1 || !limit1 || !limit2 || indexOf(xs1[0], xs2) === -1) {\r\n return false;\r\n }\r\n let ind1 = limit1 - 1,\r\n ind2 = limit2 - 1;\r\n for (; ind1 >= 0; ind1--) {\r\n if (xs1[ind1] !== xs2[ind2]) {\r\n return false;\r\n }\r\n ind2 -= 1;\r\n }\r\n return true;\r\n }),\r\n\r\n /**\r\n * Checks if list `xs1` is an infix of list `xs2`\r\n * @function module:list.isInfixOf\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {boolean}\r\n */\r\n isInfixOf = curry((xs1, xs2) => {\r\n const limit1 = length(xs1),\r\n limit2 = length(xs2);\r\n if (limit2 < limit1 || !limit1 || !limit2) {\r\n return false;\r\n }\r\n let ind1,\r\n foundLen,\r\n ind = 0;\r\n for (; ind < limit2; ind += 1) {\r\n foundLen = 0;\r\n for (ind1 = 0; ind1 < limit1; ind1 += 1) {\r\n if (xs2[ind1 + ind] === xs1[ind1]) {\r\n foundLen += 1;\r\n }\r\n if (foundLen === limit1) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }),\r\n\r\n /**\r\n * Checks if list `xs1` is a sub-sequence of list `xs2`\r\n * @function module:list.isSubsequenceOf\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {boolean}\r\n */\r\n isSubsequenceOf = curry((xs1, xs2) => {\r\n const len = Math.pow(2, length(xs2)),\r\n lenXs1 = length(xs1);\r\n let foundLen,\r\n i;\r\n for (i = 0; i < len; i += 1) {\r\n foundLen = 0;\r\n for (let j = 0; j < len; j += 1) {\r\n if (i & (1 << j) && indexOf(xs2[j], xs1) > -1) {\r\n foundLen += 1;\r\n }\r\n if (foundLen === lenXs1) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }),\r\n\r\n /**\r\n * The group function takes a list and returns a list of lists such that\r\n * the concatenation of the result is equal to the argument. Moreover, each\r\n * sublist in the result contains only equal elements. For example,\r\n * `group \"Mississippi\" = [\"M\",\"i\",\"ss\",\"i\",\"ss\",\"i\",\"pp\",\"i\"]`\r\n * It is a special case of groupBy, which allows the programmer to supply\r\n * their own equality test.\r\n * @haskellType `group :: Eq a => [a] -> [[a]]`\r\n * @function module:list.group\r\n * @param xs {Array|String}\r\n * @returns {Array|*}\r\n */\r\n group = xs => groupBy((a, b) => a === b, xs),\r\n\r\n /**\r\n * Allows you to group items in a list based on your supplied equality check.\r\n * @note Sames `group` but allows you to specify equality operation.\r\n * @haskellType `groupBy :: (a -> a -> Bool) -> [a] -> [[a]]`\r\n * @function module:list.groupBy\r\n * @param equalityOp {Function}\r\n * @param xs {Array}\r\n * @returns {*}\r\n */\r\n groupBy = curry((equalityOp, xs) => {\r\n const limit = length(xs);\r\n if (!limit) {\r\n return sliceCopy(xs);\r\n }\r\n let ind = 0,\r\n prevItem,\r\n item,\r\n predOp = x => {\r\n if (equalityOp(x, prevItem)) {\r\n ind++;\r\n }\r\n if (equalityOp(x, item)) {\r\n prevItem = x;\r\n return true;\r\n }\r\n return false;\r\n },\r\n agg = [];\r\n for (; ind < limit; ind += 1) {\r\n item = xs[ind];\r\n agg.push(takeWhile(predOp, slice(ind, limit, xs)));\r\n }\r\n return agg;\r\n }),\r\n\r\n /**\r\n * The inits function returns all initial segments of the argument, shortest first. For example,\r\n * ```\r\n * shallowEquals(inits('abc'), ['','a','ab','abc'])\r\n * ```\r\n * @function module:list.inits\r\n * @haskellType `inits :: [a] -> [[a]]`\r\n * @param xs {Array}\r\n * @returns {Array}\r\n */\r\n inits = xs => {\r\n let limit = length(xs),\r\n ind = 0,\r\n agg = [];\r\n if (!limit) {\r\n return [];\r\n }\r\n for (; ind <= limit; ind += 1) {\r\n agg.push(sliceTo(ind, xs));\r\n }\r\n return agg;\r\n }, //map(list => init(list), xs),\r\n\r\n /**\r\n * The inits function returns all initial segments of the argument, shortest first. For example,\r\n * ```\r\n * shallowEquals(tails('abc'), ['abc', 'bc', 'c',''])\r\n * ```\r\n * @function module:list.tails\r\n * @haskellType `tails :: [a] -> [[a]]`\r\n * @param xs {Array}\r\n * @returns {Array}\r\n */\r\n tails = xs => {\r\n let limit = length(xs),\r\n ind = 0,\r\n agg = [];\r\n if (!limit) {\r\n return [];\r\n }\r\n for (; ind <= limit; ind += 1) {\r\n agg.push(slice(ind, limit, xs));\r\n }\r\n return agg;\r\n }, //map(list => tail(list), xs),\r\n\r\n /**\r\n * Strips prefix list from given list\r\n * @function module:list.stripPrefix\r\n * @param prefix {Array|String|*}\r\n * @param list {Array|string|*}\r\n * @returns {Array|*}\r\n */\r\n stripPrefix = curry((prefix, list) =>\r\n isPrefixOf(prefix, list) ?\r\n splitAt(length(prefix), list)[1] :\r\n sliceCopy(list)),\r\n\r\n /**\r\n * zip takes two lists and returns a list of corresponding pairs.\r\n * If one input list is short, excess elements of the longer list are discarded.\r\n * @haskellType `zip :: [a] -> [b] -> [(a, b)]`\r\n * @function module:list.zip\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @returns {Array>}\r\n */\r\n zip = curry((arr1, arr2) => {\r\n if (!length(arr1) || !length(arr2)) {\r\n return [];\r\n }\r\n const [a1, a2] = toShortest(arr1, arr2);\r\n return reduce((agg, item, ind) =>\r\n aggregateArray(agg, [item, a2[ind]]),\r\n [], a1);\r\n }),\r\n\r\n /**\r\n * zipN takes one or more lists and returns a list containing lists of all indices\r\n * at a given index, index by index.\r\n * If one input list is short, excess elements of the longer list are discarded.\r\n * @function module:list.zipN\r\n * @param lists {Array|String} - One ore more lists of the same type.\r\n * @returns {Array}\r\n */\r\n zipN = curry2((...lists) => {\r\n const trimmedLists = apply(toShortest, lists);\r\n return reduce((agg, item, ind) =>\r\n aggregateArray(agg, map(xs => xs[ind], trimmedLists)),\r\n [], trimmedLists[0]);\r\n }),\r\n\r\n /**\r\n * @haskellType `zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]`\r\n * @function module:list.zip3\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @param arr3 {Array}\r\n * @returns {Array>}\r\n */\r\n zip3 = curry((arr1, arr2, arr3) => zipN(arr1, arr2, arr3)),\r\n\r\n /**\r\n * @haskellType `zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]`\r\n * @function module:list.zip4\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @param arr3 {Array}\r\n * @param arr4 {Array}\r\n * @returns {Array>}\r\n */\r\n zip4 = curry((arr1, arr2, arr3, arr4) => zipN(arr1, arr2, arr3, arr4)),\r\n\r\n /**\r\n * @haskellType `zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]`\r\n * @function module:list.zip5\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @param arr3 {Array}\r\n * @param arr4 {Array}\r\n * @param arr5 {Array}\r\n * @returns {Array>}\r\n */\r\n zip5 = curry((arr1, arr2, arr3, arr4, arr5) => zipN(arr1, arr2, arr3, arr4, arr5)),\r\n\r\n /**\r\n * zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]\r\n * zipWith generalises zip by zipping with the function given as the\r\n * first argument, instead of a function tupling function (function that returns a tuple). For example,\r\n * zipWith (+) is applied to two lists to produce the list of corresponding sums.\r\n * @note `_|_` means bottom or perpetual (@see\r\n * - https://wiki.haskell.org/Bottom\r\n * - https://stackoverflow.com/questions/19794681/what-does-this-syntax-mean-in-haskell-or\r\n * )\r\n * @example\r\n * ```\r\n * zipWith f [] _|_ = []\r\n * ```\r\n * @haskellType `zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]`\r\n * @function module:list.zipWith\r\n * @param op {Function} - Takes two parts of a tuple and returns a tuple.\r\n * E.g., ` op :: a -> b -> (a, b)`\r\n * @param xs1 {Array}\r\n * @param xs2 {Array}\r\n * @returns {Array>}\r\n */\r\n zipWith = curry((op, xs1, xs2) => {\r\n if (!length(xs1) || !length(xs2)) {\r\n return [];\r\n }\r\n const [a1, a2] = toShortest(xs1, xs2);\r\n return reduce((agg, item, ind) =>\r\n aggregateArray(agg, op(item, a2[ind])),\r\n [], a1);\r\n }),\r\n\r\n /**\r\n * Zips all given lists with tupling function. Note: Haskell types do not have\r\n * a way (that I know of) to show one or more for params in a function so `@haskellType` below\r\n * is left there for general purpose not for exactness as is told by aforementioned.\r\n * @haskellType `zipWithN :: (a -> b -> c) -> [a] -> [b] -> [c]` - Where `N` is the number\r\n * of lists to zip.\r\n * @function module:list.zipWithN\r\n * @param op {Function} - Takes expected number of parts for tuple and returns a tuple\r\n * of said parts:\r\n * E.g., ` op :: a -> b -> c -> (a, b, c)`\r\n * @param lists ...{Array}\r\n * @returns {Array>}\r\n */\r\n zipWithN = curry3((op, ...lists) => {\r\n const trimmedLists = apply(toShortest, lists),\r\n lenOfTrimmed = length(trimmedLists);\r\n if (!lenOfTrimmed) {\r\n return [];\r\n }\r\n else if (lenOfTrimmed === 1) {\r\n return sliceTo(length(trimmedLists[0]), trimmedLists[0]);\r\n }\r\n return reduce((agg, item, ind) =>\r\n aggregateArray(agg, apply(op, map(xs => xs[ind], trimmedLists))),\r\n [], trimmedLists[0]);\r\n }),\r\n\r\n /**\r\n * Zips 3 lists with tupling function.\r\n * @haskellType `zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]`\r\n * @function module:list.zipWith3\r\n * @param op {Function} - Takes expected number of parts for tuple and returns a tuple\r\n * of said parts:\r\n * E.g., ` op :: a -> b -> c -> (a, b, c)`\r\n * @param xs1 {Array}\r\n * @param xs2 {Array}\r\n * @param xs3 {Array}\r\n * @returns {Array>}\r\n */\r\n zipWith3 = curry((op, xs1, xs2, xs3) => zipWithN(op, xs1, xs2, xs3)),\r\n\r\n /**\r\n * Zips 4 lists with tupling function.\r\n * @haskellType `zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]`\r\n * @function module:list.zipWith4\r\n * @param op {Function} - Takes expected number of parts for tuple and returns a tuple\r\n * of said parts:\r\n * E.g., ` op :: a -> b -> c -> d -> (a, b, c, d)`\r\n * @param xs1 {Array}\r\n * @param xs2 {Array}\r\n * @param xs3 {Array}\r\n * @param xs4 {Array}\r\n * @returns {Array>}\r\n */\r\n zipWith4 = curry((op, xs1, xs2, xs3, xs4) => zipWithN(op, xs1, xs2, xs3, xs4)),\r\n\r\n /**\r\n * Zips 5 lists.\r\n * @haskellType `zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]`\r\n * @function module:list.zipWith5\r\n * @param op {Function} - Takes expected number of parts for tuple and returns a tuple\r\n * of said parts:\r\n * E.g., ` op :: a -> b -> c -> d -> e -> (a, b, c, d, e)`\r\n * @param xs1 {Array}\r\n * @param xs2 {Array}\r\n * @param xs3 {Array}\r\n * @param xs4 {Array}\r\n * @param xs5 {Array}\r\n * @returns {Array>}\r\n */\r\n zipWith5 = curry((op, xs1, xs2, xs3, xs4, xs5) => zipWithN(op, xs1, xs2, xs3, xs4, xs5)),\r\n\r\n /**\r\n * unzip transforms a list of pairs into a list of first components and a list of second components.\r\n * @haskellType `unzip :: [(a, b)] -> ([a], [b])`\r\n * @function module:list.unzip\r\n * @param arr {Array|*}\r\n * @returns {Array|*}\r\n */\r\n unzip = foldl((agg, item) => {\r\n agg[0].push(item[0]);\r\n agg[1].push(item[1]);\r\n return agg;\r\n }, [[], []]),\r\n\r\n /**\r\n * unzip transforms a list of pairs into a list of first components and a list of second components.\r\n * @sudoHaskellType `unzipN :: [(a, b, ...x)] -> ([a], [b], ...[x])`\r\n * @function module:list.unzipN\r\n * @param list {Array|*} - List of tuples (lists).\r\n * @returns {Array|*}\r\n */\r\n unzipN = list => {\r\n if (!length(list)) {\r\n return [];\r\n }\r\n const lenItem0 = length(list[0]);\r\n let zero = lenItem0 ?\r\n unfoldr(numLists => numLists-- ? [[], numLists] : undefined, lenItem0) :\r\n [];\r\n return foldl((agg, item) => {\r\n agg.forEach((outList, ind) => outList.push(item[ind]));\r\n return agg;\r\n }, zero, list);\r\n },\r\n\r\n /**\r\n * Returns true if any item in container passes predicate `p`.\r\n * @function module:list.any\r\n * @param p {Function} - Predicate.\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n any = curry((p, xs) => {\r\n let ind = 0,\r\n limit = length(xs);\r\n if (!limit) {\r\n return false;\r\n }\r\n for (; ind < limit; ind += 1) {\r\n if (p(xs[ind])) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }),\r\n\r\n /**\r\n * Returns true if all items in container pass predicate `p`.\r\n * @function module:list.all\r\n * @param p {Function} - Predicate.\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n all = curry((p, xs) => {\r\n const limit = length(xs);\r\n let ind = 0;\r\n if (!limit) {\r\n return false;\r\n }\r\n for (; ind < limit; ind++) {\r\n if (!p(xs[ind], ind, xs)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }),\r\n\r\n /**\r\n * Conjuction of container of bools (or truthy and/or falsy values); Returns\r\n * `true` if all in container are 'truthy' else returns `false`\r\n * @function module:list.and\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n and = xs => all(isTruthy, xs),\r\n\r\n /**\r\n * Returns a boolean indicating whether any item in container is 'truthy' or not.\r\n * **Note** The haskell type for this function only takes two items, but here\r\n * we allow the passing of more than one item (may change later to adhere to the haskell type).\r\n * @function module:list.or\r\n * @haskellType `or :: Bool -> Bool -> Bool`\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n or = xs => any(isTruthy, xs),\r\n\r\n /**\r\n * Returns a boolean indicating whether all items in container are 'falsy' or not.\r\n * **Note** The haskell type for this function only takes two items, but here\r\n * we allow the passing of more than one item (may change later to adhere to the haskell type).\r\n * @function module:list.not\r\n * @haskellType `not :: Bool -> Bool`\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n not = xs => all(isFalsy, xs),\r\n\r\n /**\r\n * Computes the sum of the numbers of a structure.\r\n * @function module:list.sum\r\n * @haskellType `sum :: (List t, Num a) => t a -> a`\r\n * @param list {Array|String}\r\n * @returns {Number}\r\n */\r\n sum = list => foldl((agg, x) => agg + x, 0, list),\r\n\r\n /**\r\n * Computes the product of the numbers of a structure.\r\n * @function module:list.product\r\n * @haskellType `product :: (List t, Num a) => t a -> a`\r\n * @param list {Array|String}\r\n * @returns {Number}\r\n */\r\n product = list => foldl((agg, x) => agg * x, 1, list),\r\n\r\n /**\r\n * Returns the largest element in a non-empty structure of elements.\r\n * @function module:list.maximum\r\n * @haskellType `maximum :: forall a . Ord a => t a -> a`\r\n * @param list {Array|String}\r\n * @returns {*} - Whatever type the array is made of (if any).\r\n */\r\n maximum = list => last(sortBy(genericAscOrdering, list)),\r\n\r\n /**\r\n * Returns the smallest element in a non-empty structure of elements.\r\n * @function module:list.minimum\r\n * @haskellType `minimum :: forall a . Ord a => t a -> a`\r\n * @param list {Array|String}\r\n * @returns {*} - Whatever type the array is made of (if any).\r\n */\r\n minimum = list => head(sortBy(genericAscOrdering, list)),\r\n\r\n /**\r\n * scanl is similar to foldl, but returns a list of successive reduced values from the left:\r\n * ```\r\n * scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]\r\n * ```\r\n * Also note that:\r\n * ```\r\n * last (scanl f z xs) == foldl f z xs.\r\n * ```\r\n * @function module:list.scanl\r\n * @param fn {Function}\r\n * @param zero {*}\r\n * @param xs {Array}\r\n * @returns {Array|*}\r\n */\r\n scanl = curry((fn, zero, xs) => {\r\n if (!xs || !length(xs)) {\r\n return [];\r\n }\r\n const limit = length(xs);\r\n let ind = 0,\r\n result = zero,\r\n out = [];\r\n while (ind < limit) {\r\n result = fn(result, xs[ind], ind, xs);\r\n out.push(result);\r\n ind++;\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * `scanl1` is a variant of `scanl` that has no starting value argument:\r\n * `shallowCompare(scanl1(fn, [x1, x2, ...]), [x1, fn(x1, x2), ...]) // true`\r\n * @function module:list.scanl1\r\n * @param fn {Function}\r\n * @param xs {Array}\r\n * @returns {Array|*}\r\n */\r\n scanl1 = curry((fn, xs) => {\r\n if (!xs || !xs.length) {\r\n return [];\r\n }\r\n return scanl(fn, head(xs), tail(xs));\r\n }),\r\n\r\n /**\r\n * Same as `scanl` but from the right (similiar to `foldr`'s relationship to 'foldl').\r\n * Note also `scanr`'s relationship ot `foldr`:\r\n * `head (scanr(fn, z, xs)) === foldr(fn, z, xs).\r\n * @function module:list.scanr\r\n * @param fn {Function}\r\n * @param zero {*}\r\n * @param xs {Array}\r\n * @returns {Array|*}\r\n */\r\n scanr = curry((fn, zero, xs) => {\r\n if (!xs || !length(xs)) {\r\n return [];\r\n }\r\n const limit = length(xs);\r\n let ind = limit - 1,\r\n result = xs[0],\r\n out = [];\r\n while (ind > -1) {\r\n result = fn(result, xs[ind], ind, xs);\r\n out.push(result);\r\n ind--;\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Same as `scanr` but takes no zero/accumulator value.\r\n * @function module:list.scanr1\r\n * @param fn {Function}\r\n * @param xs {Array}\r\n * @returns {Array|*}\r\n */\r\n scanr1 = curry((fn, xs) => {\r\n if (!xs || !xs.length) {\r\n return [];\r\n }\r\n return scanr(fn, last(xs), init(xs));\r\n }),\r\n\r\n /**\r\n * The nub function removes duplicate elements from a list.\r\n * In particular, it keeps only the first occurrence of each element.\r\n * (The name nub means `essence'.) It is a special case of nubBy, which\r\n * allows the programmer to supply their own equality test.\r\n * ```shallowCompare( nub ([1,2,3,4,3,2,1,2,4,3,5]), [1,2,3,4,5] )```\r\n * @function module:list.nub\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n nub = list => nubBy((a, b) => a === b, list),\r\n\r\n /**\r\n * `remove(x, xs)` removes the first occurrence of `x` from `xs`.\r\n * For example, `remove('a', 'banana') === 'bnana';`\r\n * @function module:list.remove\r\n * @param x {*}\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n remove = curry((x, list) => removeBy((a, b) => a === b, x, list)),\r\n\r\n /**\r\n * The sort function implements a stable sorting algorithm.\r\n * It is a special case of sortBy, which allows the programmer\r\n * to supply their own comparison function.\r\n * ```shallowCompare(sort ([1,6,4,3,2,5]), [1,2,3,4,5,6]) // true```\r\n * @function module:list.sort\r\n * @param xs {Array|String|*}\r\n * @returns {Array}\r\n */\r\n sort = xs => sortBy(genericAscOrdering, xs),\r\n\r\n /**\r\n * Sort a list by comparing the results of a key function applied to each\r\n * element. sortOn f is equivalent to sortBy (comparing f), but has the\r\n * performance advantage of only evaluating f once for each element in the\r\n * input list. This is called the decorate-sort-undecorate paradigm, or\r\n * Schwartzian transform.\r\n *\r\n * Elements are arranged from from lowest to highest, keeping duplicates\r\n * in the order they appeared in the input.\r\n *\r\n * Ex:\r\n * ```\r\n * shallowEquals(\r\n * sortOn (head, [[2, \"world\"], [4, \"!\"], [1, \"Hello\"]]),\r\n * [[1,\"Hello\"],[2,\"world\"],[4,\"!\"]]\r\n * ) // true\r\n * ```\r\n * @function module:list.sortOn\r\n * @param valueFn {Function}\r\n * @param xs {Array|String|*}\r\n * @returns {Array}\r\n */\r\n sortOn = curry((valueFn, xs) =>\r\n\r\n // Un-decorate\r\n map(decorated => decorated[1],\r\n\r\n // Decorate and sort\r\n sortBy(\r\n // Ordering\r\n ([a0], [b0]) => genericAscOrdering(a0, b0),\r\n\r\n // Decorate\r\n map(item => [valueFn(item), item], xs)\r\n )\r\n )\r\n ),\r\n\r\n /**\r\n * The sortBy function is the non-overloaded (in haskell terms) version of sort.\r\n * @haskellExample ```\r\n * >>> sortBy (\\(a,_) (b,_) -> compare a b) [(2, \"world\"), (4, \"!\"), (1, \"Hello\")]\r\n * [(1,\"Hello\"),(2,\"world\"),(4,\"!\")]\r\n * ```\r\n * @function module:list.sortBy\r\n * @param orderingFn {Function}\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n sortBy = curry((orderingFn, xs) => sliceCopy(xs).sort(orderingFn || genericAscOrdering)),\r\n\r\n /**\r\n * The insert function takes an element and a list and inserts the element\r\n * into the list at the first position where it is less than or equal to the\r\n * next element. In particular, if the list is sorted before the call, the\r\n * result will also be sorted. It is a special case of insertBy, which allows\r\n * the programmer to supply their own comparison function.\r\n * @function module:list.insert\r\n * @param x {*}\r\n * @param xs {Array|*}\r\n * @returns {Array}\r\n */\r\n insert = curry((x, xs) => {\r\n if (!xs.length) {\r\n return of(xs, x);\r\n }\r\n const foundIndex = findIndex(item => x <= item, xs);\r\n return foundIndex === -1 ? concat([xs, of(xs, x)]) :\r\n concat(intersperse(of(xs, x), splitAt(foundIndex, xs)));\r\n }),\r\n\r\n /**\r\n * A version of `insert` that allows you to specify the ordering of the inserted\r\n * item; Before/at, or after\r\n * @function module:list.insertBy\r\n * @haskellType `insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]`\r\n * @note `Ordering` means 'something that is order-able'\r\n * operated on by this functions logic.\r\n * @param orderingFn {Function} - A function that returns `-1`, `0`, or 1`.\r\n * @param x {*} - Value to insert.\r\n * @param xs {Array} - List to insert into (note new list is returned)\r\n * @returns {Array} - New list.\r\n */\r\n insertBy = curry((orderingFn, x, xs) => {\r\n const limit = length(xs);\r\n if (!limit) {\r\n return [x];\r\n }\r\n let ind = 0;\r\n for (; ind < limit; ind += 1) {\r\n if (orderingFn(x, xs[ind]) <= 0) {\r\n const parts = splitAt(ind, xs);\r\n return concat([parts[0], [x], parts[1]]);\r\n }\r\n }\r\n return aggregateArray(sliceCopy(xs), x);\r\n }),\r\n\r\n /**\r\n * The nubBy function behaves just like nub, except it uses a user-supplied equality predicate.\r\n * @function module:list.nubBy\r\n * @param pred {Function}\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n nubBy = curry((pred, list) => {\r\n if (!length(list)) {\r\n return [];\r\n }\r\n const limit = length(list);\r\n let ind = 0,\r\n currItem,\r\n out = [],\r\n anyOp = storedItem => pred(currItem, storedItem);\r\n for (; ind < limit; ind += 1) {\r\n currItem = list[ind];\r\n if (any(anyOp, out)) {\r\n continue;\r\n }\r\n out.push(currItem);\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Behaves the same as `remove`, but takes a user-supplied equality predicate.\r\n * @function module:list.removeBy\r\n * @param pred {Function} - Equality predicate `(a, b) => bool`\r\n * @param x {*}\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n removeBy = curry((pred, x, list) => {\r\n const foundIndex = findIndex(item => pred(x, item), list);\r\n if (foundIndex > -1) {\r\n const parts = splitAt(foundIndex, list);\r\n return append(parts[0], tail(parts[1]));\r\n }\r\n return sliceCopy(list);\r\n }),\r\n\r\n /**\r\n * The `removeFirstsBy` function takes a predicate and two lists and returns the first list with the first\r\n * occurrence of each element of the second list removed.\r\n * @function module:list.removeFirstBy\r\n * @param pred {Function}\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {Array}\r\n */\r\n removeFirstsBy = curry((pred, xs1, xs2) =>\r\n foldl((agg, x) => removeBy(pred, x, agg), xs1, xs2)),\r\n\r\n /**\r\n * Returns the union on elements matching boolean check passed in.\r\n * @function module:list.unionBy\r\n * @param pred {Function} - `pred :: a -> a -> Bool`\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @returns {Array}\r\n */\r\n unionBy = curry((pred, arr1, arr2) =>\r\n foldl((agg, b) => {\r\n const alreadyAdded = any(a => pred(a, b), agg);\r\n return !alreadyAdded ? (agg.push(b), agg) : agg;\r\n }, sliceCopy(arr1), arr2\r\n )),\r\n\r\n /**\r\n * Creates a union on matching elements from array1.\r\n * @function module:list.union\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @returns {Array}\r\n */\r\n union = curry((arr1, arr2) =>\r\n append(arr1,\r\n filter(elm => !includes(elm, arr1), arr2))),\r\n\r\n /**\r\n * Performs an intersection on list 1 with elements from list 2.\r\n * @function module:list.intersect\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @returns {Array}\r\n */\r\n intersect = curry((arr1, arr2) =>\r\n !arr1 || !arr2 || (!arr1 && !arr2) ? [] :\r\n filter(elm => includes(elm, arr2), arr1)),\r\n\r\n /**\r\n * Returns an intersection by predicate.\r\n * @function module:list.intersectBy\r\n * @param pred {Function} - `pred :: a -> b -> Bool`\r\n * @param list1 {Array}\r\n * @param list2 {Array}\r\n * @return {Array}\r\n */\r\n intersectBy = curry((pred, list1, list2) =>\r\n foldl((agg, a) =>\r\n any(b => pred(a, b), list2) ? (agg.push(a), agg) : agg\r\n , [], list1)),\r\n\r\n /**\r\n * Returns the difference of list 1 from list 2.\r\n * @note The `difference` operation here is non-associative; E.g., `a - b` is not equal to `b - a`;\r\n * @function module:list.difference\r\n * @param array1 {Array}\r\n * @param array2 {Array}\r\n * @returns {Array}\r\n */\r\n difference = curry((array1, array2) => { // augment this with max length and min length ordering on op\r\n if (array1 && !array2) {\r\n return sliceCopy(array1);\r\n }\r\n else if (!array1 && array2 || (!array1 && !array2)) {\r\n return [];\r\n }\r\n return reduce((agg, elm) =>\r\n !includes(elm, array2) ? (agg.push(elm), agg) : agg\r\n , [], array1);\r\n }),\r\n\r\n /**\r\n * Returns the complement of list 0 and the reset of the passed in arrays.\r\n * @function module:list.complement\r\n * @param arr0 {Array}\r\n * @param arrays {...Array}\r\n * @returns {Array}\r\n */\r\n complement = curry2((arr0, ...arrays) =>\r\n reduce((agg, arr) => append(agg, difference(arr, arr0)), [], arrays));\r\n","/**\r\n * @module errorThrowing\r\n * @description Contains error throwing facilities for when a value doesn't match a type.\r\n */\r\nimport {typeOf} from './object/typeOf';\r\nimport {isArray, toTypeRef, toTypeRefName, isOfType} from './object/is';\r\nimport {curry} from './function/curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Pretty prints an array of types/type-strings for use by error messages;\r\n * Outputs \"`SomeTypeName`, ...\" from [SomeType, 'SomeTypeName', etc...]\r\n * @function module:errorThrowing.typeRefsToStringOrError\r\n * @param types {Array|TypesArray}\r\n * @return {String}\r\n * @private\r\n */\r\n typeRefsToStringOrError = types => types.length ?\r\n types.map(type => `\\`${toTypeRefName(type)}\\``).join(', ') : '',\r\n\r\n /**\r\n * Prints a message from an object. Object signature:\r\n * {contextName, valueName, value, expectedTypeName, foundTypeName, messageSuffix}\r\n * @function module:errorThrowing.defaultErrorMessageCall\r\n * @param tmplContext {Object|TemplateContext} - Object to use in error template.\r\n * @returns {string}\r\n * @private\r\n */\r\n defaultErrorMessageCall = tmplContext => {\r\n const {\r\n contextName, valueName, value, expectedTypeName,\r\n foundTypeName, messageSuffix\r\n } = tmplContext,\r\n isMultiTypeNames = isArray(expectedTypeName),\r\n typesCopy = isMultiTypeNames ? 'of type' : 'of one of the types',\r\n typesToMatchCopy = isMultiTypeNames ? typeRefsToStringOrError(expectedTypeName) : expectedTypeName;\r\n return (contextName ? `\\`${contextName}.` : '`') +\r\n `${valueName}\\` is not ${typesCopy}: ${typesToMatchCopy}. ` +\r\n `Type received: ${foundTypeName}. Value: ${value};` +\r\n `${messageSuffix ? ' ' + messageSuffix + ';' : ''}`;\r\n },\r\n\r\n /**\r\n * Gets the error message thrower seeded with passed in errorMessage template call.\r\n * @function module:errorThrowing.getErrorIfNotTypeThrower$\r\n * @param errorMessageCall {Function|ErrorMessageCall}\r\n * @param typeChecker {Function|TypeChecker} - Function:Boolean\r\n * @returns {Function|ErrorIfNotType}\r\n * @private\r\n */\r\n _getErrorIfNotTypeThrower = (errorMessageCall, typeChecker = isOfType) =>\r\n (ValueType, contextName, valueName, value, messageSuffix = null) => {\r\n const expectedTypeName = toTypeRef(ValueType),\r\n foundTypeName = typeOf(value);\r\n if (typeChecker(ValueType, value)) { return value; } // Value matches type\r\n throw new Error(errorMessageCall(\r\n {contextName, valueName, value, expectedTypeName, foundTypeName, messageSuffix}\r\n ));\r\n },\r\n\r\n /**\r\n * Gets the error message thrower seeded with passed in errorMessage template call.\r\n * @function module:errorThrowing.getErrorIfNotTypesThrower$\r\n * @param errorMessageCall {Function|ErrorMessageCall}\r\n * @param typeChecker {Function|TypeChecker} - Function:Boolean\r\n * @returns {Function|ErrorIfNotTypes}\r\n * @private\r\n */\r\n _getErrorIfNotTypesThrower = (errorMessageCall, typeChecker = isOfType) =>\r\n (valueTypes, contextName, valueName, value, messageSuffix = null) => {\r\n const expectedTypeNames = valueTypes.map(toTypeRef),\r\n matchFound = valueTypes.some(ValueType => typeChecker(ValueType, value)),\r\n foundTypeName = typeOf(value);\r\n if (matchFound) { return value; }\r\n throw new Error(\r\n errorMessageCall({\r\n contextName, valueName, value,\r\n expectedTypeName: expectedTypeNames, foundTypeName,\r\n messageSuffix\r\n })\r\n );\r\n },\r\n\r\n /**\r\n * Checks that passed in `value` is of given `type`. Throws an error if value\r\n * is not of given `type`. This is the un-curried version. For the curried version\r\n * see `module:errorThrowing.errorIfNotType`.\r\n * @function module:errorThrowing.errorIfNotType$\r\n * @param type {String|Function} - Type's name or type itself.\r\n * @param contextName {String} - Name of context to attribute errors if thrown.\r\n * @param valueName {String} - String rep of value.\r\n * @param value {*}\r\n * @param [messageSuffix=null] {String} - Optional.\r\n * @returns {*} - Given `value` if `value` matches passed in type.\r\n * @private\r\n */\r\n _errorIfNotType = _getErrorIfNotTypeThrower(defaultErrorMessageCall),\r\n\r\n /**\r\n * Checks that passed in `value` is of one of the given `types`. Throws an error if value\r\n * is not of one of the given `types`. This is the un-curried version. For the curried version\r\n * see `module:errorThrowing.errorIfNotTypes`.\r\n * @type {Function|module:errorThrowing.errorIfNotTypes}\r\n * @function module:errorThrowing.errorIfNotTypes$\r\n * @param types {Array} - Array of one or more types or type names themselves.\r\n * @param contextName {String} - Name of context to attribute errors if thrown.\r\n * @param valueName {String} - String rep of value.\r\n * @param value {*}\r\n * @returns {*} - Given `value` if `value` matches passed in type.\r\n * @private\r\n */\r\n _errorIfNotTypes = _getErrorIfNotTypesThrower(defaultErrorMessageCall),\r\n\r\n /**\r\n * Returns a function that can be used to ensure that values are of a given type.\r\n * Also throws informative error messages containing the value types, names, expected type names,\r\n * etc.\r\n * @function module:errorThrowing.getErrorIfNotTypeThrower\r\n * @param errorMessageCall {Function|ErrorMessageCall} - Template function (takes an info-object and returns a printed string).\r\n * @returns {Function|ErrorIfNotType} - Returns a function with the same signature as `errorIfNotType` though curried.\r\n */\r\n getErrorIfNotTypeThrower = errorMessageCall => curry(_getErrorIfNotTypeThrower(errorMessageCall)),\r\n\r\n /**\r\n * Returns a function that can be used to ensure that a value is of one or more given types.\r\n * The returned function is used in cases where informative error messages\r\n * containing the value types, names, expected type names, are-required/should-be-used etc.\r\n * @function module:errorThrowing.getErrorIfNotTypesThrower\r\n * @param errorMessageCall {Function|ErrorMessageCall} - Template function (takes an info-object and returns a printed string).\r\n * @returns {Function|ErrorIfNotTypes} - Returns a function with the same signature as `errorIfNotTypes` though curried.\r\n */\r\n getErrorIfNotTypesThrower = errorMessageCall => curry(_getErrorIfNotTypesThrower(errorMessageCall)),\r\n\r\n /**\r\n * Checks that passed in `value` is of given `type`. Throws an error if value\r\n * is not of given `type`. Curried.\r\n * @function module:errorThrowing.errorIfNotType\r\n * @param type {String|Function} - Type's name or type itself.\r\n * @param contextName {String} - Name of context to attribute errors if thrown.\r\n * @param valueName {String} - String rep of value.\r\n * @param value {*}\r\n * @param [messageSuffix=null] {String} - Optional.\r\n * @returns {*} - Given `value` if `value` matches passed in type.\r\n * @curried\r\n */\r\n errorIfNotType = curry(_errorIfNotType),\r\n\r\n /**\r\n * Checks that passed in `value` is of one of the given `types`. Throws an error if value\r\n * is not of one of the given `types`. Curried.\r\n * @function module:errorThrowing.errorIfNotTypes\r\n * @param types {Array} - Array of one or more types or type names themselves.\r\n * @param contextName {String} - Name of context to attribute errors if thrown.\r\n * @param valueName {String} - String rep of value.\r\n * @param value {*}\r\n * @returns {*} - Given `value` if `value` matches passed in type.\r\n * @curried\r\n */\r\n errorIfNotTypes = curry(_errorIfNotTypes)\r\n;\r\n\r\n/**\r\n * @typedef {*} Any - Synonym for 'any value'.\r\n */\r\n\r\n/**\r\n * @typedef {String|Function} TypeRef\r\n * @description Type reference. Type itself or Type's name; E.g., `Type.name`;\r\n */\r\n\r\n/**\r\n * @typedef {Object} TemplateContext\r\n * @description Template context used for error message renderers (functions that take a context obj and return a string).\r\n * @property value {*}\r\n * @property valueName {String}\r\n * @property expectedTypeName {String} - Expected name of constructor of `value`; E.g., usually `SomeConstructor.name`;\r\n * @property foundTypeName {String} - Found types name; E.g., `FoundConstructor.name`;\r\n * @property [messageSuffix=null] {*} - Message suffix (sometimes an extra hint or instructions for\r\n * directing user to fix where his/her error has occurred). Optional.\r\n */\r\n\r\n/**\r\n * @typedef {Array<(String|Function)>} TypesArray\r\n */\r\n\r\n/**\r\n * @typedef {Function} TypeChecker\r\n * @description Checks whether a value is of given type.\r\n * @param Type {TypeRef} - a Type or it's name; E.g., `Type.name`.\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n\r\n/**\r\n * @typedef {Function} ErrorMessageCall\r\n * @description Error message template function.\r\n * @param tmplContext {TemplateContext}\r\n * @returns {String}\r\n */\r\n\r\n/**\r\n * @typedef {Function} ErrorIfNotType\r\n * @description Used to ensure value matches passed in type.\r\n * @param type {TypeRef} - Constructor name or constructor.\r\n * @param contextName {String}\r\n * @param valueName {String}\r\n * @param value {*}\r\n * @throws {Error} - If value doesn't match type.\r\n * @returns {*} - What ever value is.\r\n */\r\n\r\n/**\r\n * @typedef {Function} ErrorIfNotTypes\r\n * @description Used to ensure a value matches one of one or more types passed in.\r\n * @param valueTypes {TypesArray} - Array of constructor names or constructors.\r\n * @param contextName {String}\r\n * @param valueName {String}\r\n * @param value {*}\r\n * @throws {Error} - If value doesn't match type.\r\n * @returns {*} - Whatever value is.\r\n */\r\n","/**\r\n * @module string\r\n * @description Contains functions for strings.\r\n */\r\nimport {intercalate, map, filter} from './list';\r\nimport {split} from './jsPlatform/string';\r\nimport {compose} from './function/compose';\r\nimport {join} from './jsPlatform/array';\r\nimport {_errorIfNotType} from './errorThrowing';\r\n\r\nexport {split};\r\n\r\nexport const\r\n\r\n /**\r\n * Splits a string on all '\\n', '\\r', '\\n\\r', or '\\r\\n' characters.\r\n * @function module:string.lines\r\n * @param str {String}\r\n * @returns {Array}\r\n */\r\n lines = split(/[\\n\\r]/gm),\r\n\r\n /**\r\n * Splits a string on all '\\s' and/or all '\\t' characters.\r\n * @function module:string.words\r\n * @param str{String}\r\n * @returns {Array}\r\n */\r\n words = split(/[\\s\\t]/gm),\r\n\r\n /**\r\n * Intersperse an array of strings with '\\s' and then concats them.\r\n * @function module:string.unwords\r\n * @param arr {String}\r\n * @returns {Array}\r\n */\r\n unwords = intercalate(' '),\r\n\r\n /**\r\n * Intersperses a '\\n' character into a list of strings and then concats it.\r\n * @function module:string.unlines\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n unlines = intercalate('\\n'),\r\n\r\n /**\r\n * Lower cases first character of a non-empty string.\r\n * @function module:string.lcaseFirst\r\n * @param xs {String}\r\n * @returns {string}\r\n * @throws {Error} - Throws error if receiving anything that is not a string.\r\n */\r\n lcaseFirst = xs => {\r\n _errorIfNotType(String, 'lcaseFirst', 'xs', xs);\r\n return xs[0].toLowerCase() + xs.substring(1);\r\n },\r\n\r\n /**\r\n * Upper cases first character of a non-empty string.\r\n * @function module:string.ucaseFirst\r\n * @param xs {String}\r\n * @returns {string}\r\n * @throws {Error} - Throws error if receiving anything that is not a string.\r\n */\r\n ucaseFirst = xs => {\r\n _errorIfNotType(String, 'ucaseFirst', 'xs', xs);\r\n return xs[0].toUpperCase() + xs.substring(1);\r\n },\r\n\r\n /**\r\n * Camel cases (class case) a string.\r\n * @function module:string.camelCase\r\n * @param xs {String}\r\n * @param [pattern=/[^a-z\\d/i]/] {RegExp} - Pattern to split on. Optional.\r\n * @throws {Error} - Throws error if param `xs` is not a string.\r\n * @returns {string}\r\n * @curried\r\n */\r\n camelCase = (xs, pattern = /[^a-z\\d]/i) => compose(\r\n join(''),\r\n map(str => ucaseFirst(str.toLowerCase())),\r\n filter(x => !!x),\r\n split(pattern)\r\n )(_errorIfNotType(String, 'camelCase', 'xs', xs)),\r\n\r\n /**\r\n * Class cases a string. Uses pattern /[^a-z\\d/i]/ to split on.\r\n * If you require a different pattern use `string.camelCase(str, pattern)`\r\n * and then upper case first character (`ucaseFirst`).\r\n * @function module:string.classCase\r\n * @param xs {String}\r\n * @returns {string}\r\n * @throws {Error} - Throws error if `xs` is not a string (via `camelCase` call).\r\n */\r\n classCase = compose(ucaseFirst, camelCase)\r\n\r\n;\r\n\r\n/**\r\n * Functional version of `String.prototype.split`.\r\n * @function module:string.split\r\n * @param separator {String|RegExp}\r\n * @param str {String}\r\n * @returns {Array}\r\n */\r\n","/**\r\n * @module fjl\r\n * @description Exports all module methods (object, list, string modules etc.).\r\n * @goal to include everything from haskell's Prelude where it makes sense in order to create\r\n * a subset of functions which can make the javascript developer more efficient and make his/her\r\n * code more concise (and functional).\r\n * @motivation preludejs, lodash/fp, RamdaJs, Haskell.\r\n * @see http://hackage.haskell.org/package/base-4.10.0.0/docs/Prelude.html\r\n * @see http://hackage.haskell.org/package/base-4.10.0.0/docs/Data-List.html\r\n */\r\nexport * from './object';\r\nexport * from './boolean';\r\nexport * from './function';\r\nexport * from './list';\r\nexport * from './string';\r\nexport * from './utils';\r\nexport * from './errorThrowing';\r\n"],"names":["returnCurried","executeArity","unmetArityNum","fn","argsToCurry","func","x","executeAsCurriedFunc","Array","from","arguments","a","b","c","d","e","args","unmetArity","concatedArgs","concat","canBeCalled","length","newExpectedArity","curryN","Function","Error","curry","curry2","curry3","curry4","curry5","fPureTakesOne","name","arg","f","fPureTakes2","arg1","arg2","fPureTakes3","arg3","fPureTakes4","arg4","fPureTakes5","arg5","fPureTakesOneOrMore","defineReverse","prototype","reverse","reduceRight","agg","item","push","map","filter","reduce","forEach","some","every","join","apply","call","flipN","flip","flip3","flip4","flip5","instanceOf","instanceConstructor","instance","hasOwnProperty","native","Object","getOwnPropertyNames","key","operation","keys","assign","obj0","objs","topAgg","obj","_Number","Number","_NaN","_Null","_Undefined","typeOf","value","retVal","undefined","constructorName","constructor","isNaN","_String","String","_Object","_Boolean","Boolean","_Function","_Array","_Symbol","_Map","_Set","_WeakMap","_WeakSet","toTypeRef","type","toTypeRefs","types","toTypeRefName","Type","ref","toTypeRefNames","isFunction","isType","isOfType","isClass","test","substr","isCallable","isArray","isObject","isBoolean","isNumber","isString","isMap","isSet","isWeakMap","isWeakSet","isUndefined","isNull","isSymbol","isUsableImmutablePrimitive","typeOfX","isset","isEmptyList","isEmptyObject","isEmptyCollection","size","isEmpty","isOneOf","typeName","isFunctor","lookup","of","copy","out","slice","Symbol","Promise","searchObj","nsString","indexOf","parts","split","limit","ind","parent","node","assignDeep","propDescription","getOwnPropertyDescriptor","get","set","writable","includes","xs","lastIndexOf","isTruthy","isFalsy","alwaysTrue","alwaysFalse","equal","equalAll","i","aggregateArray","sliceFrom","startInd","sliceTo","toInd","sliceCopy","genericAscOrdering","lengths","lists","toShortest","listLengths","smallLen","Math","min","list","reduceUntil","pred","op","result","reduceUntilRight","arr","lastIndex","len","findIndexWhere","predicateFulfilled","findIndexWhereRight","findIndicesWhere","findWhere","elm","objUnion","obj1","obj2","objIntersect","objDifference","objComplement","log","console","bind","error","peek","pop","jsonClone","JSON","parse","stringify","toAssocList","toAssocListDeep","TypeConstraint","fromAssocList","OutType","fromAssocListDeep","toArray","compose","arg0","id","negateF","negateF2","negateF3","negateFN","until","predicate","typeInstance","fnOrError","symbolName","noop","normalizeStep","to","step","range","append","listAppend","head","last","tail","init","uncons","unconsr","item0","concatMap","foldableOfA","intersperse","between","lastInd","intercalate","xss","transpose","numLists","ind2","longestListLen","maximum","outLists","outList","subsequences","listLen","pow","entry","j","swapped","ind1","tmp","permutations","repeat","foldl","foldr","foldl1","foldr1","mapAccumL","zero","mapped","tuple","mapAccumR","iterate","lastX","replicate","cycle","unfoldr","resultTuple","findIndex","findIndices","elemIndex","foundInd","elemIndices","take","drop","splitAt","takeWhile","dropWhile","splitPoint","dropWhileEnd","span","breakOnList","at","find","partition","elem","notElem","isPrefixOf","xs1","xs2","limit1","limit2","isSuffixOf","isInfixOf","foundLen","isSubsequenceOf","lenXs1","group","groupBy","equalityOp","prevItem","predOp","inits","tails","stripPrefix","prefix","zip","arr1","arr2","a1","a2","zipN","trimmedLists","zip3","arr3","zip4","arr4","zip5","arr5","zipWith","zipWithN","lenOfTrimmed","zipWith3","xs3","zipWith4","xs4","zipWith5","xs5","unzip","unzipN","lenItem0","any","p","all","and","or","not","sum","product","sortBy","minimum","scanl","scanl1","scanr","scanr1","nub","nubBy","remove","removeBy","sort","sortOn","valueFn","decorated","a0","b0","orderingFn","insert","foundIndex","insertBy","currItem","anyOp","storedItem","removeFirstsBy","unionBy","alreadyAdded","union","intersect","intersectBy","list1","list2","difference","array1","array2","complement","arr0","arrays","typeRefsToStringOrError","defaultErrorMessageCall","tmplContext","contextName","valueName","expectedTypeName","foundTypeName","messageSuffix","isMultiTypeNames","typesCopy","typesToMatchCopy","_getErrorIfNotTypeThrower","errorMessageCall","typeChecker","ValueType","_getErrorIfNotTypesThrower","valueTypes","expectedTypeNames","matchFound","_errorIfNotType","_errorIfNotTypes","getErrorIfNotTypeThrower","getErrorIfNotTypesThrower","errorIfNotType","errorIfNotTypes","lines","words","unwords","unlines","lcaseFirst","toLowerCase","substring","ucaseFirst","toUpperCase","camelCase","pattern","str","classCase"],"mappings":"AAAA;;;;;;;;;;;AAWA,MAWIA,aAAa,GAAG,CAACC,YAAD,EAAeC,aAAf,EAA8BC,EAA9B,EAAkCC,WAAlC,KAAkD;UACtDF,aAAR;SACS,CAAL;;aAEW,SAASG,IAAT,CAAcC,CAAd,EAAiB;;eAEbC,oBAAoB,CAACJ,EAAD,EAAKF,YAAL,EAAmBC,aAAnB,EAAkCM,KAAK,CAACC,IAAN,CAAWC,SAAX,CAAlC,EAAyDN,WAAzD,CAA3B;OAFJ;;SAIC,CAAL;;aAEW,SAASC,IAAT,CAAcM,CAAd,EAAiBC,CAAjB,EAAoB;;eAEhBL,oBAAoB,CAACJ,EAAD,EAAKF,YAAL,EAAmBC,aAAnB,EAAkCM,KAAK,CAACC,IAAN,CAAWC,SAAX,CAAlC,EAAyDN,WAAzD,CAA3B;OAFJ;;SAIC,CAAL;;aAEW,SAASC,IAAT,CAAcM,CAAd,EAAiBC,CAAjB,EAAoBC,CAApB,EAAuB;;eAEnBN,oBAAoB,CAACJ,EAAD,EAAKF,YAAL,EAAmBC,aAAnB,EAAkCM,KAAK,CAACC,IAAN,CAAWC,SAAX,CAAlC,EAAyDN,WAAzD,CAA3B;OAFJ;;SAIC,CAAL;;aAEW,SAASC,IAAT,CAAcM,CAAd,EAAiBC,CAAjB,EAAoBC,CAApB,EAAuBC,CAAvB,EAA0B;;eAEtBP,oBAAoB,CAACJ,EAAD,EAAKF,YAAL,EAAmBC,aAAnB,EAAkCM,KAAK,CAACC,IAAN,CAAWC,SAAX,CAAlC,EAAyDN,WAAzD,CAA3B;OAFJ;;SAIC,CAAL;;aAEW,SAASC,IAAT,CAA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AAC5Q,EAAD,EAAK6Q,OAAO,GAAG,WAAf,KAA+BhN,OAAO,CAC1CzK,IAAI,CAAC,EAAD,CADsC,EAE1CN,KAAG,CAACgY,GAAG,IAAIJ,UAAU,CAACI,GAAG,CAACN,WAAJ,EAAD,CAAlB,CAFuC,EAG1CzX,QAAM,CAAC/C,CAAC,IAAI,CAAC,CAACA,CAAR,CAHoC,EAI1CoJ,KAAK,CAACyR,OAAD,CAJqC,CAAP,CAKrChB,eAAe,CAACrU,MAAD,EAAS,WAAT,EAAsB,IAAtB,EAA4BwE,EAA5B,CALsB,CAnExC;MAmFH+Q,SAAS,GAAGlN,OAAO,CAAC6M,UAAD,EAAaE,SAAb,CAnFhB;;;;;;;;;ACZP;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"fjl.js","sources":["../../src/function/curry.js","../../src/utils.js","../../src/jsPlatform/array.js","../../src/jsPlatform/function.js","../../src/function/flip.js","../../src/jsPlatform/object.js","../../src/object/typeOf.js","../../src/object/is.js","../../src/object/lookup.js","../../src/object/of.js","../../src/object/copy.js","../../src/object/searchObj.js","../../src/object/assignDeep.js","../../src/jsPlatform/list.js","../../src/boolean.js","../../src/list/map.js","../../src/list/aggregation.js","../../src/list/utils.js","../../src/object/setTheory.js","../../src/object/console.js","../../src/object/jsonClone.js","../../src/object/assocList.js","../../src/object/toArray.js","../../src/object.js","../../src/function/compose.js","../../src/function/id.js","../../src/function/negate.js","../../src/function/until.js","../../src/function/fnOrError.js","../../src/function/noop.js","../../src/function.js","../../src/list/range.js","../../src/jsPlatform/string.js","../../src/jsPlatform.js","../../src/list.js","../../src/errorThrowing.js","../../src/string.js","../../src/fjl.js"],"sourcesContent":["/**\r\n * @author elydelacruz\r\n * @created 12/6/2016.\r\n * @memberOf function\r\n * @description \"Curry strict\" and \"curry arbitrarily\" functions (`curry`, `curryN`).\r\n */\r\n\r\n/**\r\n * @private\r\n * @type {string}\r\n */\r\nconst\r\n\r\n /**\r\n * Returns curried function.\r\n * @private\r\n * @param executeArity {Number}\r\n * @param unmetArityNum {Number}\r\n * @param fn {Function}\r\n * @param argsToCurry {...*}\r\n * @returns {Function} - Curried function.\r\n */\r\n returnCurried = (executeArity, unmetArityNum, fn, argsToCurry) => {\r\n switch (unmetArityNum) {\r\n case 1:\r\n /* eslint-disable */\r\n return function func(x) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n case 2:\r\n /* eslint-disable */\r\n return function func(a, b) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n case 3:\r\n /* eslint-disable */\r\n return function func(a, b, c) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n case 4:\r\n /* eslint-disable */\r\n return function func(a, b, c, d) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n case 5:\r\n /* eslint-disable */\r\n return function func(a, b, c, d, e) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n default:\r\n return (...args) => executeAsCurriedFunc(fn, executeArity, unmetArityNum, args, argsToCurry);\r\n }\r\n },\r\n\r\n /**\r\n * Returns curried function if unmetArity is not met else returns result of executing\r\n * final function.\r\n * @private\r\n * @param fn {Function}\r\n * @param executeArity {Number}\r\n * @param unmetArity {Number}\r\n * @param args {Array<*>}\r\n * @param argsToCurry {Array<*>}\r\n * @returns {Function|*} - Curried function or result of 'finally' executed function.\r\n */\r\n executeAsCurriedFunc = (fn, executeArity, unmetArity, args, argsToCurry) => {\r\n let concatedArgs = argsToCurry.concat(args),\r\n canBeCalled = (concatedArgs.length >= executeArity) || !executeArity,\r\n newExpectedArity = executeArity - concatedArgs.length;\r\n return !canBeCalled ?\r\n returnCurried(executeArity, newExpectedArity, fn, concatedArgs) :\r\n fn(...concatedArgs);\r\n }\r\n;\r\n\r\nexport const\r\n\r\n /**\r\n * Curries a function up to a given arity.\r\n * @function module:function.curryN\r\n * @param executeArity {Number}\r\n * @param fn {Function}\r\n * @param argsToCurry {...*}\r\n * @returns {Function}\r\n * @throws {Error} - When `fn` is not a function.\r\n */\r\n curryN = (executeArity, fn, ...argsToCurry) => {\r\n if (!fn || !(fn instanceof Function)) {\r\n throw new Error(`\\`curry*\\` functions expect first parameter to be of type \\`Function\\` though received ${fn}?`);\r\n }\r\n return returnCurried(executeArity, executeArity - argsToCurry.length, fn, argsToCurry);\r\n },\r\n\r\n /**\r\n * Curries a function based on it's defined arity (note: rest args param (`...rest`) are not counted in arity).\r\n * @function module:function.curry\r\n * @param fn {Function}\r\n * @param argsToCurry {...*}\r\n * @returns {Function}\r\n */\r\n curry = (fn, ...argsToCurry) => curryN((fn || {}).length, fn, ...argsToCurry),\r\n\r\n /**\r\n * Curries a function up to an arity of 2 (won't call function until 2 or more args).\r\n * @function module:function.curry2\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n curry2 = fn => curryN(2, fn),\r\n\r\n /**\r\n * Curries a function up to an arity of 3 (won't call function until 3 or more args).\r\n * @function module:function.curry3\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n curry3 = fn => curryN(3, fn),\r\n\r\n /**\r\n * Curries a function up to an arity of 4 (won't call function until 4 or more args).\r\n * @function module:function.curry4\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n curry4 = fn => curryN(4, fn),\r\n\r\n /**\r\n * Curries a function up to an arity of 5 (won't call function until 5 or more args).\r\n * @function module:function.curry5\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n curry5 = fn => curryN(5, fn);\r\n","/**\r\n * @module utils\r\n */\r\nimport {curry, curry2} from './function/curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns a function that takes an argument and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakesOne\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakesOne = name => curry((arg, f) => f[name](arg)),\r\n\r\n /**\r\n * Returns a function that takes 2 arguments and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakes2\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakes2 = name => curry((arg1, arg2, f) => f[name](arg1, arg2)),\r\n\r\n /**\r\n * Returns a function that takes 3 arguments and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakes3\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakes3 = name => curry((arg1, arg2, arg3, f) => f[name](arg1, arg2, arg3)),\r\n\r\n /**\r\n * Returns a function that takes 4 arguments and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakes4\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakes4 = name => curry((arg1, arg2, arg3, arg4, f) => f[name](arg1, arg2, arg3, arg4)),\r\n\r\n /**\r\n * Returns a function that takes 5 arguments and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakes5\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakes5 = name => curry((arg1, arg2, arg3, arg4, arg5, f) => f[name](arg1, arg2, arg3, arg4, arg5)),\r\n\r\n /**\r\n * Returns a function that takes an object and one or more arguments on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakesOneOrMore\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakesOneOrMore = name => curry2((f, ...args) => f[name](...args))\r\n\r\n;\r\n","/**\r\n * Created by elyde on 7/20/2017.\r\n * Functional versions of common array methods (`map`, `filter`, etc.) (un-curried);\r\n * @module _jsPlatform_arrayOps\r\n * @private\r\n */\r\n\r\nimport {fPureTakesOne, fPureTakes2, fPureTakesOneOrMore} from '../utils';\r\n\r\nexport const\r\n\r\n /**\r\n * Array.prototype.reverse generator (generates a function that calls the prototype version or a\r\n * shimmed version if it doesn't exist).\r\n * @returns {Function}\r\n */\r\n defineReverse = () =>\r\n Array.prototype.reverse ? x => x.reverse() :\r\n x => x.reduceRight((agg, item) => {\r\n agg.push(item);\r\n return agg;\r\n }, []),\r\n\r\n /**\r\n * Maps a function to functor (list etc.).\r\n * @function module:_jsPlatform_array.map\r\n * @param fn {Function}\r\n * @param functor {Array|{map: {Function}}}\r\n * @returns {Array|{map: {Function}}}\r\n */\r\n map = fPureTakesOne('map'),\r\n\r\n /**\r\n * Filters a functor (list etc.) with passed in function.\r\n * @function module:_jsPlatform_array.filter\r\n * @param fn {Function}\r\n * @param functor {Array|{filter: {Function}}}\r\n * @returns {Array|{filter: {Function}}}\r\n */\r\n filter = fPureTakesOne('filter'),\r\n\r\n /**\r\n * Reduces a foldable (list etc.) with passed in function.\r\n * @function module:_jsPlatform_array.reduce\r\n * @param fn {Function}\r\n * @param functor {Array|{reduce: {Function}}}\r\n * @returns {Array|{reduce: {Function}}}\r\n */\r\n reduce = fPureTakes2('reduce'),\r\n\r\n /**\r\n * Reduces a foldable (list etc.) from the right with passed in function.\r\n * @function module:_jsPlatform_array.reduceRight\r\n * @param fn {Function}\r\n * @param functor {Array|{reduceRight: {Function}}}\r\n * @returns {Array|{reduceRight: {Function}}}\r\n */\r\n reduceRight = fPureTakes2('reduceRight'),\r\n\r\n /**\r\n * For each on functor (Array|Object|etc.).\r\n * @param fn {Function}\r\n * @param functor {Array|Object|*}\r\n * @return {*|Array|Object} - The type of object you pass in unless it doesn't have a `forEach` method.\r\n * @throws {Error} - When passed in functor doesn't have a `forEach` method.\r\n */\r\n forEach = fPureTakesOne('forEach'),\r\n\r\n /**\r\n * Returns `true` if `fn` (predicate) returns true for at least one item\r\n * in functor else returns `false`.\r\n * @param fn {Function} - Predicate.\r\n * @param functor {Array|Object|*}\r\n * @return {*|Array|Object} - The type passed.\r\n * @throws {Error} - When passed in object doesn't have a `some` method.\r\n */\r\n some = fPureTakesOne('some'),\r\n\r\n /**\r\n * Returns `true` if `fn` (predicate) returns true for all items in functor else returns `false`.\r\n * @param fn {Function} - Predicate.\r\n * @param functor {Array|Object|*}\r\n * @return {*|Array|Object} - The type passed.\r\n * @throws {Error} - When passed in object doesn't have an `every` method.\r\n */\r\n every = fPureTakesOne('every'),\r\n\r\n /**\r\n * Array.prototype.join\r\n * @function module:listPrelude.join\r\n * @param separator {String|RegExp}\r\n * @param arr {Array}\r\n * @returns {String}\r\n */\r\n join = fPureTakesOne('join'),\r\n\r\n /**\r\n * Same as Array.prototype.push\r\n * @param item {*}\r\n * @param arr {Array}\r\n * @returns {Number}\r\n */\r\n push = fPureTakesOneOrMore('push'),\r\n\r\n /**\r\n * Reverses an list (shimmed if not exists).\r\n * @function module:listPrelude.reverse\r\n * @return {Array}\r\n */\r\n reverse = defineReverse();\r\n","import {curry, curry2} from '../function/curry';\r\n\r\n/**\r\n * Created by elydelacruz on 9/7/2017.\r\n * @memberOf function\r\n */\r\nexport const\r\n\r\n /**\r\n * Functional `apply` function (takes no context).\r\n * @function module:function.apply\r\n * @param fn {Function}\r\n * @param args {Array|*}\r\n * @returns {*}\r\n */\r\n apply = curry((fn, args) => fn.apply(null, args)),\r\n\r\n /**\r\n * Functional `call` function (takes no context).\r\n * @function module:function.call\r\n * @param fn {Function}\r\n * @param args {...*}\r\n * @returns {*}\r\n */\r\n call = curry2((fn, ...args) => fn.call(null, ...args));\r\n","import {reverse} from '../jsPlatform/array';\r\nimport {apply, call} from '../jsPlatform/function';\r\nimport {curry, curry2} from './curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns a curried function requiring given functions arguments in reverse\r\n * (returned function expects 2 or more variables (curried at 2 or more args)).\r\n * @function module:function.flipN\r\n * @param fn {Function}\r\n * @returns {Function}\r\n * @curried\r\n */\r\n flipN = fn => curry2((...args) => apply(fn, reverse(args))),\r\n\r\n /**\r\n * Flips a function's first and second arguments and and returns a new function requiring said arguments in reverse.\r\n * @function module:function.flip\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n flip = fn => curry((b, a) => call(fn, a, b)),\r\n\r\n /**\r\n * Same as `flip` except returns a flipped function of arity 3.\r\n * @function module:function.flip3\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n flip3 = fn => curry((c, b, a) => call(fn, a, b, c)),\r\n\r\n /**\r\n * Same as `flip` except returns a flipped function of arity 4.\r\n * @function module:function.flip4\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n flip4 = fn => curry((d, c, b, a) => call(fn, a, b, c, d)),\r\n\r\n /**\r\n * Same as `flip` except returns a flipped function of arity 5.\r\n * @function module:function.flip5\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n flip5 = fn => curry((e, d, c, b, a) => call(fn, a, b, c, d, e));\r\n","/**\r\n * @memberOf object\r\n * @description Defines some of the platform methods for objects (the ones used within `fjl`).\r\n */\r\n\r\nimport {fPureTakesOne} from '../utils';\r\nimport {curry, curry2} from '../function/curry';\r\nimport {flip, flip3, flip4, flip5} from '../function/flip';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns whether constructor has derived object.\r\n * @function module:object.instanceOf\r\n * @param instanceConstructor {Function} - Constructor.\r\n * @param instance {*}\r\n * @instance {*}\r\n * @returns {Boolean}\r\n */\r\n instanceOf = curry((instanceConstructor, instance) =>\r\n instance instanceof instanceConstructor),\r\n\r\n /**\r\n * @function module:object.hasOwnProperty\r\n * @param propName {*}\r\n * @param typeInstance {*}\r\n * @returns {Boolean}\r\n * @deprecated - Use property directly instead.\r\n */\r\n hasOwnProperty = fPureTakesOne('hasOwnProperty'),\r\n\r\n /**\r\n * @function module:object.length\r\n * @param x {*}\r\n * @returns {Number}\r\n * @throws {Error} - Throws an error if value doesn't have a `length` property (\r\n * `null`, `undefined`, {Boolean}, Symbol, et. al.).\r\n */\r\n length = x => x.length,\r\n\r\n /**\r\n * Contains all the static functions from `Object` but curried and flipped;\r\n * @example\r\n * // E.g., `Object.defineProperties(obj, descriptor)` can now be used like\r\n * import {defineProperties} from 'fjl'\r\n * defineProperties(descriptor, someObj),\r\n * // Et. al.\r\n * @memberOf module:object\r\n * @type {{...Object}}\r\n */\r\n native = Object.getOwnPropertyNames(Object).reduce((agg, key) => {\r\n if (typeof Object[key] !== 'function') {\r\n return agg;\r\n }\r\n const operation = Object[key];\r\n switch (operation.length) {\r\n case 2:\r\n agg[key] = flip(operation);\r\n break;\r\n case 3:\r\n agg[key] = flip3(operation);\r\n break;\r\n case 4:\r\n agg[key] = flip4(operation);\r\n break;\r\n case 5:\r\n agg[key] = flip5(operation);\r\n break;\r\n default:\r\n agg[key] = Object[key];\r\n break;\r\n }\r\n return agg;\r\n }, {}),\r\n\r\n /**\r\n * Gets passed in object's own enumerable keys (same as `Object.keys`).\r\n * @function module:object.keys\r\n * @param obj {*}\r\n * @returns {Array}\r\n */\r\n {keys} = native,\r\n\r\n /**\r\n * Defined as `Object.assign` else is the same thing but shimmed.\r\n * @function module:object.assign\r\n * @param obj0 {Object}\r\n * @param objs {...{Object}}\r\n * @returns {Object}\r\n */\r\n assign = (() => Object.assign ?\r\n (obj0, ...objs) => Object.assign(obj0, ...objs) :\r\n curry2((obj0, ...objs) => objs.reduce((topAgg, obj) => {\r\n return Object.keys(obj).reduce((agg, key) => {\r\n agg[key] = obj[key];\r\n return agg;\r\n }, topAgg);\r\n }, obj0))\r\n )();\r\n","/**\r\n * Created by elyde on 12/18/2016.\r\n * @memberOf object\r\n */\r\nconst _Number = Number.name,\r\n _NaN = 'NaN',\r\n _Null = 'Null',\r\n _Undefined = 'Undefined';\r\n\r\n/**\r\n * Returns the constructor/class/type name of a value.\r\n * @note Returns 'NaN' if value is of type `Number` and value is `isNaN`.\r\n * @note Returns 'Undefined' if value is `undefined`\r\n * @note Returns 'Null' if value is `null`\r\n * For values that have no concrete constructors and/or casters\r\n * (null, NaN, and undefined) we returned normalized names for them ('Null', 'NaN', 'Number')\r\n * @function module:object.typeOf\r\n * @param value {*}\r\n * @returns {string} - Constructor's name or derived name (in the case of `null`, `undefined`, or `NaN` (whose\r\n * normalized names are 'Null', 'Undefined', 'NaN' respectively).\r\n */\r\nexport function typeOf (value) {\r\n let retVal;\r\n if (value === undefined) {\r\n retVal = _Undefined;\r\n }\r\n else if (value === null) {\r\n retVal = _Null;\r\n }\r\n else {\r\n let constructorName = (value).constructor.name;\r\n retVal = constructorName === _Number && isNaN(value) ?\r\n _NaN : constructorName;\r\n }\r\n return retVal;\r\n}\r\n","/**\r\n * Created by elyde on 12/18/2016.\r\n * @memberOf object\r\n */\r\n\r\nimport {typeOf} from './typeOf';\r\nimport {instanceOf, length, keys} from '../jsPlatform/object';\r\nimport {curry} from '../function/curry';\r\n\r\nlet _String = String.name,\r\n _Number = Number.name,\r\n _Object = Object.name,\r\n _Boolean = Boolean.name,\r\n _Function = Function.name,\r\n _Array = Array.name,\r\n _Symbol = 'Symbol',\r\n _Map = 'Map',\r\n _Set = 'Set',\r\n _WeakMap = 'WeakMap',\r\n _WeakSet = 'WeakSet',\r\n _Null = 'Null',\r\n _Undefined = 'Undefined',\r\n _NaN = 'NaN';\r\n\r\nexport const\r\n\r\n /**\r\n * Resolves/normalizes a type name from either a string or a constructor.\r\n * @function module:object.toTypeRef\r\n * @param type {Function|String} - String or function representing a type.\r\n * @returns {String}\r\n * @todo write tests for this function.\r\n */\r\n toTypeRef = type => {\r\n if (!type) {\r\n return typeOf(type);\r\n }\r\n else if (type.constructor === String || (type instanceof Function)) {\r\n return type;\r\n }\r\n return typeOf(type);\r\n },\r\n\r\n /**\r\n * Returns an array of type refs from possible type refs (converts null, undefined, NaN, and other values into\r\n * type refs (either constructor name or constructor name based on whether value(s) is a string, a constructor, or not).\r\n * @function module:object.toTypeRefs\r\n * @param types {...(TypeRef|*)}\r\n * @returns {Array}\r\n * @todo Ensure tests are written for this function.\r\n */\r\n toTypeRefs = (...types) => types.map(toTypeRef),\r\n\r\n /**\r\n * Returns possible Type's TypeRef name.\r\n * @function module:object.toTypeRefName\r\n * @param Type {(TypeRef|*)}\r\n * @returns {String}\r\n * @todo Ensure tests are written for this function.\r\n */\r\n toTypeRefName = Type => {\r\n const ref = toTypeRef(Type);\r\n return ref instanceof Function ? ref.name : ref;\r\n },\r\n\r\n /**\r\n * Returns possible Types' TypeRef names.\r\n * @function module:object.toTypeRefNames\r\n * @param types {...(TypeRef|*)}\r\n * @returns {String[]}\r\n * @todo Ensure tests are written for this function.\r\n */\r\n toTypeRefNames = (...types) => types.map(toTypeRefName),\r\n\r\n /**\r\n * Returns whether a value is a function or not.\r\n * @function module:object.isFunction\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isFunction = instanceOf(Function),\r\n\r\n /**\r\n * Strict type checker. Checks if given value is a direct instance of given type; E.g.,\r\n * @example\r\n * isType(String, 'abcdefg') === true // true\r\n * isType(String.name, 'abcdefg') === true\r\n * isType(Number, NaN) === false\r\n * isType(Number, 99) === true\r\n * isType('Null', 99) === false // though, for `null` and `undefined` checks\r\n * // @see `isset`, in this module, instead\r\n * isType('Undefined', undefined) === true // true\r\n *\r\n * @note Useful where absolute types, or some semblance thereof, are required.\r\n * @function module:object.isType\r\n * @param type {Function|ObjectConstructor|String} - Constructor or constructor name\r\n * @param obj {*}\r\n * @return {Boolean}\r\n */\r\n isType = curry((type, obj) => typeOf(obj) === toTypeRefName(type)),\r\n\r\n /**\r\n * Loose type checker; E.g., If `type` is not a constructor, but a constructor name, does a type check on\r\n * constructor names, else if first check fails and `type` is a constructor, performs an `instanceof` check\r\n * on value with constructor.\r\n * @note Use care when checking for `Array` and/or `Object` since the both are considered objects by `instanceof` checker.\r\n * @note For `null` and `undefined` their class cased names can be used for type checks\r\n * `isOfType('Null', null) === true (passes strict type check)` (or better yet `isset` can be used).\r\n * @throwsafe - Doesn't throw on `null` or `undefined` `obj` values.\r\n * @example\r\n * isOfType(Number, 99) === true // true (passes strict type check (numbers are not instances of `Number`\r\n * // constructor)\r\n * isOfType('Number', 99) === true // true (passes strict type check)\r\n * isOfType(Number, NaN) === true // true. (passes instance of check)\r\n * // If you want \"true\" strict type checking use `isType`\r\n * isOfType(Object, []) === true // true (passes instance of check)\r\n * isOfType(Array, []) === true // true (passes instance of check)\r\n * isOfType(Object, {}) === true // true (passes instance of check)\r\n * isOfType(Object.name, {}) === true // true (Passes strict type check)\r\n * class Abc extends String {}\r\n * isOfType(String, new Abc('abcd')) // true (passes instanceof check)\r\n *\r\n * @function module:object.isOfType\r\n * @param type {Function|String} - Type reference (constructor or `constructor.name`).\r\n * @param x {*} - Value to check.\r\n * @returns {Boolean}\r\n */\r\n isOfType = curry((type, x) => isType(type, x) || instanceOf(type, x)),\r\n\r\n /**\r\n * Checks if `value` is an es2015 `class`.\r\n * @function module:object.isClass\r\n * @param x {*}\r\n * @returns {boolean}\r\n */\r\n isClass = x => x && /^\\s{0,3}class\\s{1,3}/.test((x + '').substr(0, 10)),\r\n\r\n /**\r\n * Returns a boolean depicting whether a value is callable or not.\r\n * @function module:object.isCallable\r\n * @tentative\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isCallable = x => isFunction(x) && !isClass(x),\r\n\r\n /**\r\n * Checks if value is an array (same as `Array.isArray`).\r\n * @function module:object.isArray\r\n * @param value {*}\r\n * @returns {boolean}\r\n */\r\n {isArray} = Array,\r\n\r\n /**\r\n * Checks whether value is an object or not.\r\n * @function module:object.isObject\r\n * @param value\r\n * @returns {Boolean}\r\n */\r\n isObject = isType(_Object),\r\n\r\n /**\r\n * Checks if value is a boolean.\r\n * @function module:object.isBoolean\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isBoolean = isType(_Boolean),\r\n\r\n /**\r\n * Checks if value is a valid number (also checks if isNaN so that you don't have to).\r\n * @function module:object.isNumber\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isNumber = isType(_Number),\r\n\r\n /**\r\n * Checks whether value is a string or not.\r\n * @function module:object.isString\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isString = isType(_String),\r\n\r\n /**\r\n * Checks whether value is of `Map` or not.\r\n * @function module:object.isMap\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isMap = isType(_Map),\r\n\r\n /**\r\n * Checks whether value is of `Set` or not.\r\n * @function module:object.isSet\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isSet = isType(_Set),\r\n\r\n /**\r\n * Checks whether value is of `WeakMap` or not.\r\n * @function module:object.isWeakMap\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isWeakMap =isType(_WeakMap),\r\n\r\n /**\r\n * Checks whether value is of `WeakSet` or not.\r\n * @function module:object.isWeakSet\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isWeakSet = isType(_WeakSet),\r\n\r\n /**\r\n * Checks if value is undefined.\r\n * @function module:object.isUndefined\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isUndefined = isType(_Undefined),\r\n\r\n /**\r\n * Checks if value is null.\r\n * @function module:object.isNull\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isNull = isType(_Null),\r\n\r\n /**\r\n * Checks if value is a `Symbol`.\r\n * @function module:object.isSymbol\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isSymbol = isType(_Symbol),\r\n\r\n /**\r\n * Checks if given `x` is set and of one of\r\n * [String, Boolean, Number, Symbol] (null and undefined are immutable\r\n * but are not \"usable\" (usually not what we want to operate on).\r\n * @function module:object.isUsableImmutablePrimitive\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isUsableImmutablePrimitive = x => {\r\n const typeOfX = typeOf(x);\r\n return isset(x) &&\r\n [_String, _Number, _Boolean, _Symbol]\r\n .some(Type => Type === typeOfX);\r\n },\r\n\r\n /**\r\n * Checks if !length.\r\n * @function module:object.isEmptyList\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isEmptyList = x => !length(x),\r\n\r\n /**\r\n * Checks if object has own properties/enumerable-props or not.\r\n * @function module:object.isEmptyObject\r\n * @param obj {*}\r\n * @returns {Boolean}\r\n */\r\n isEmptyObject = obj => isEmptyList(keys(obj)),\r\n\r\n /**\r\n * Checks if collection is empty or not (Map, WeakMap, WeakSet, Set etc.).\r\n * @function module:object.isEmptyCollection\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isEmptyCollection = x => x.size === 0,\r\n\r\n /**\r\n * Checks to see if passed in value is empty; I.e.,\r\n * check for one of '', 0, `null`, `undefined`, `false`, empty array, empty object, empty function (zero arity),\r\n * or empty collection (es6 Map, Set, WeakMap, or WeakSet etc. (`!value.size`);\r\n * @function module:object.isEmpty\r\n * @param value {*} - Value to check.\r\n * @returns {Boolean}\r\n */\r\n isEmpty = value => {\r\n if (!value) { // if '', 0, `null`, `undefined`, or `false` then is empty\r\n return true;\r\n }\r\n switch (typeOf(value)) {\r\n case _Array:\r\n case _Function:\r\n return !value.length;\r\n case _Number: // zero and NaN checks happened above so `if number` then it's 'not-an-empty-number' (lol)\r\n return false;\r\n case _Object:\r\n return !keys(value).length;\r\n case _Map:\r\n case _Set:\r\n case _WeakSet:\r\n case _WeakMap:\r\n return !value.size;\r\n case _NaN:\r\n return true;\r\n default:\r\n return !value;\r\n }\r\n },\r\n\r\n /**\r\n * Returns whether passed in values is defined and not null or not.\r\n * @function module:object.isset\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isset = x => x !== null && x !== undefined,\r\n\r\n /**\r\n * Checks to see if `x` is of one of the given type refs.\r\n * @function object.isOneOf\r\n * @param x {*}\r\n * @param types {...(TypeRef|*)}\r\n * @returns {boolean}\r\n * @todo write tests for this function.\r\n */\r\n isOneOf = (x, ...types) => {\r\n const typeName = typeOf(x);\r\n return toTypeRefNames(types).some(name => typeName === name);\r\n },\r\n\r\n isFunctor = x => x && x.map && instanceOf(Function, x.map)\r\n\r\n;\r\n","/**\r\n * @memberOf object\r\n */\r\n\r\nimport {isset} from './is';\r\nimport {curry} from '../function/curry';\r\n\r\n/**\r\n * Looks up property and returns it's value; Else `undefined`.\r\n * Method is null safe (will not throw on `null` or `undefined`).\r\n * @function module:object.lookup\r\n * @param key {String} - Key to search on `obj`\r\n * @param obj {Object} - Object to search `name` on.\r\n * @returns {*}\r\n */\r\nexport const lookup = curry((key, obj) => isset(obj) ? obj[key] : undefined);\r\n","import {isFunction, isset, isUsableImmutablePrimitive} from './is';\r\nimport {apply} from '../jsPlatform/function';\r\n\r\n/**\r\n * Creates a value `of` given type; Checks for one of the following construction strategies (in order listed):\r\n * @example\r\n * // - If exists `(value).constructor.of` uses this.\r\n * // - If value is of one String, Boolean, Symbol, or Number types calls it's\r\n * // constructor as a function (in cast form; E.g., `constructor(...args)` )\r\n * // - Else if constructor is a function, thus far, then calls constructor using\r\n * // the `new` keyword (with any passed in args).\r\n\r\n * @function module:object.of\r\n * @param x {*} - Value to derive returned value's type from.\r\n * @param [args] {...*} - Any args to pass in to matched construction strategy.\r\n * @returns {*|undefined} - New value of given value's type else `undefined`.\r\n */\r\nexport const of = (x, ...args) => {\r\n if (!isset(x)) { return undefined; }\r\n const constructor = x.constructor;\r\n if (constructor.hasOwnProperty('of')) {\r\n return apply(constructor.of, args);\r\n }\r\n else if (isUsableImmutablePrimitive(x)) {\r\n return apply(constructor, args);\r\n }\r\n else if (isFunction(constructor)) {\r\n return new constructor(...args);\r\n }\r\n return undefined;\r\n};\r\n","import {typeOf} from './typeOf';\r\nimport {of} from './of';\r\n\r\nexport const\r\n\r\n /**\r\n * Make a copy of a value or optionally copy incoming value onto an outgoing value (second parameter).\r\n * @note If incoming thing is an immmutable primitive (string, number, symbol, null, undefined, boolean)\r\n * it is returned as is.\r\n * @function module:object.copy\r\n * @param x {*} - Thing to copy.\r\n * @param [out = undefined] {*} - Optional value to copy on to. Not required.\r\n * @returns {*} - Copied thing or optionally outgoing value copied onto.\r\n */\r\n copy = (x, out) => {\r\n // if `null`, `undefined`, `''`, `0`, `false` return\r\n if (!x) { return x; }\r\n switch (typeOf(x)) {\r\n case Array.name:\r\n return !out ? x.slice(0) : Object.assign(out, x);\r\n\r\n // If immutable primitive, return it\r\n case Symbol.name:\r\n case Boolean.name:\r\n case String.name:\r\n case Number.name:\r\n case Promise.name:\r\n case Function.name:\r\n case 'NaN':\r\n case 'Null':\r\n case 'Undefined':\r\n return x;\r\n\r\n case 'Map':\r\n case 'Set':\r\n case 'WeakMap':\r\n case 'WeakSet':\r\n return new x.constructor(Array.from(x));\r\n\r\n // Else make copy\r\n default:\r\n return Object.assign(!out ? of(x) : out, x);\r\n }\r\n }\r\n;\r\n\r\nexport default copy;\r\n","import {isset} from './is';\r\nimport {curry} from '../function/curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Gives you value at key/namespace-key within `obj`; E.g.,\r\n * searchObj('all.your.base', {all: {your: {base: 99}}}) === 99 // `true`\r\n * @note If key is unreachable (undefined) returns `undefined`.\r\n * Useful in cases where we do not want to check each key along the way before getting/checking value; E.g.,\r\n * @example\r\n * ```\r\n * if (obj && obj.all && obj.all.your && obj.all.your.base) {\r\n * // Thing we want to do\r\n * }\r\n *\r\n * // So with our function becomes\r\n * if (searchObj('all.your.base', obj)) {\r\n * // Thing we want to do\r\n * }\r\n * ```\r\n * @function module:object.searchObj\r\n * @param nsString {String}\r\n * @param obj {*}\r\n * @returns {*}\r\n */\r\n searchObj = curry((nsString, obj) => {\r\n if (!obj) { return obj; }\r\n if (nsString.indexOf('.') === -1) {\r\n return obj[nsString];\r\n }\r\n const parts = nsString.split('.'),\r\n limit = parts.length;\r\n let ind = 0,\r\n parent = obj;\r\n for (; ind < limit; ind += 1) {\r\n const node = parent[parts[ind]];\r\n if (!isset(node)) {\r\n return node;\r\n }\r\n parent = node;\r\n }\r\n return parent;\r\n })\r\n;\r\n","\r\nimport {isObject} from './is';\r\nimport {keys} from '../jsPlatform/object';\r\nimport {curry2} from '../function/curry';\r\n\r\nexport const\r\n /**\r\n * Merges all objects down into one (takes two or more args).\r\n * @function module:object.assignDeep\r\n * @param obj0 {Object}\r\n * @param [objs] {...{Object}} - One or more objects to merge onto `obj0`.\r\n * @returns {Object}\r\n */\r\n assignDeep = curry2((obj0, ...objs) =>\r\n !obj0 ? obj0 : objs.reduce((topAgg, obj) =>\r\n !obj ? topAgg : keys(obj).reduce((agg, key) => {\r\n let propDescription = Object.getOwnPropertyDescriptor(agg, key);\r\n // If property is not writable move to next item in collection\r\n if (agg.hasOwnProperty(key) && propDescription &&\r\n !(propDescription.get && propDescription.set) &&\r\n !propDescription.writable) {\r\n return agg;\r\n }\r\n if (isObject(agg[key]) && isObject(obj[key])) {\r\n assignDeep(agg[key], obj[key]);\r\n }\r\n else { agg[key] = obj[key]; }\r\n return agg;\r\n }, topAgg)\r\n , obj0));\r\n","/**\r\n * List operations that overlap (apart from globally overlapping props and functions like `length`)\r\n * on both strings and arrays.\r\n * @memberOf list\r\n */\r\n\r\nimport {fPureTakesOne, fPureTakes2, fPureTakesOneOrMore} from '../utils';\r\n\r\nexport const\r\n\r\n /**\r\n * Concats/appends all functors onto the end of first functor.\r\n * Note: functors passed in after the first one must be of the same type.\r\n * @function module:list.concat\r\n * @param functor {Array|Object|*}\r\n * @param ...functor {Array|Object|*}\r\n * @return {*|Array|Object} - The type passed.\r\n * @throws {Error} - When passed in object doesn't have an `every` method.\r\n */\r\n concat = fPureTakesOneOrMore('concat'),\r\n\r\n /**\r\n * Same as Array.prototype.slice\r\n * @function module:list.slice\r\n * @param separator {String|RegExp}\r\n * @param arr{Array}\r\n * @returns {Array}\r\n */\r\n slice = fPureTakes2('slice'),\r\n\r\n /**\r\n * `Array.prototype.includes` or shim.\r\n * @function module:list.includes\r\n * @param value {*}\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n includes = (() => 'includes' in Array.prototype ?\r\n fPureTakesOne('includes') :\r\n (value, xs) => xs.indexOf(value) > -1)(),\r\n\r\n /**\r\n * Searches list/list-like for given element `x`.\r\n * @function module:list.indexOf\r\n * @param x {*} - Element to search for.\r\n * @param xs {Array|String|*} - list or list like to look in.\r\n * @returns {Number} - `-1` if element not found else index at which it is found.\r\n */\r\n indexOf = fPureTakesOne('indexOf'),\r\n\r\n /**\r\n * Last index of (`Array.prototype.lastIndexOf`).\r\n * @function module:list.lastIndexOf\r\n * @param x {*} - Element to search for.\r\n * @param xs {Array|String|*} - list or list like to look in.\r\n * @returns {Number} - `-1` if element not found else index at which it is found.\r\n */\r\n lastIndexOf = fPureTakesOne('lastIndexOf')\r\n\r\n;\r\n","/**\r\n * @module boolean\r\n * @description Contains functional version of 'always-true', 'always-false', 'is-truthy', and 'is-falsy'.\r\n */\r\nimport {curry, curry2} from './function/curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns whether `value` is 'truthy' or not\r\n * @function module:boolean.isTruthy\r\n * @param value\r\n * @returns {Boolean}\r\n */\r\n isTruthy = value => !!value,\r\n\r\n /**\r\n * Returns whether `value` is 'falsy' or not\r\n * @function module:boolean.isFalsy\r\n * @param value\r\n * @returns {Boolean}\r\n */\r\n isFalsy = value => !value,\r\n\r\n /**\r\n * Returns `true`.\r\n * @function module:boolean.alwaysTrue\r\n * @returns {Boolean}\r\n */\r\n alwaysTrue = () => true,\r\n\r\n /**\r\n * Returns `false`.\r\n * @function module:boolean.alwaysFalse\r\n * @returns {Boolean}\r\n */\r\n alwaysFalse = () => false,\r\n\r\n /**\r\n * Equality operator.\r\n * @function module:boolean.equal\r\n * @param a {*}\r\n * @param b {*}\r\n * @returns {boolean}\r\n */\r\n equal = curry((a, b) => a === b),\r\n\r\n /**\r\n * Equality operator for all.\r\n * @function module:boolean.equalAll\r\n * @param a {*} - Item `0`.\r\n * @param args {...*} - Others\r\n * @returns {boolean}\r\n */\r\n equalAll = curry2((a, ...args) => args.every(b => equal(a, b)))\r\n\r\n;\r\n","import {length} from '../jsPlatform/object';\r\nimport {curry} from '../function/curry';\r\nimport {typeOf} from '../object/typeOf';\r\nimport {of} from '../object/of';\r\nimport {isFunctor, isset} from '../object/is';\r\n\r\n/**\r\n * Maps a function onto a List (string or array) or a functor (value containing a map method).\r\n * @function module:list.map\r\n * @param fn {Function} - Function to map on given value.\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\nconst map = curry((fn, xs) => {\r\n if (!isset(xs)) { return xs; }\r\n let out = of(xs),\r\n limit,\r\n i = 0;\r\n switch (typeOf(xs)) {\r\n case 'Array':\r\n limit = length(xs);\r\n if (!limit) { return out; }\r\n for (; i < limit; i += 1) {\r\n out.push(fn(xs[i], i, xs));\r\n }\r\n return out;\r\n case 'String':\r\n limit = length(xs);\r\n if (!xs) { return out; }\r\n for (; i < limit; i += 1) {\r\n out += fn(xs[i], i, xs);\r\n }\r\n return out;\r\n default:\r\n if (isFunctor(xs)) { return xs.map(fn); }\r\n\r\n // Other objects\r\n return Object.keys(xs).reduce((agg, key) => {\r\n out[key] = fn(xs[key], key, xs);\r\n return out;\r\n }, out);\r\n }\r\n});\r\n\r\nexport default map;\r\n","\r\nexport const\r\n\r\n /**\r\n * Pushes incoming `item` onto given array and returns said array.\r\n * @private\r\n * @param agg {Array}\r\n * @param item {*}\r\n * @returns {Array}\r\n */\r\n aggregateArray = (agg, item) => {\r\n agg.push(item);\r\n return agg;\r\n }\r\n\r\n;\r\n","/**\r\n * List operator utils module.\r\n * @module listUtils\r\n */\r\nimport {apply} from '../jsPlatform/function'; // un-curried version\r\nimport {slice} from '../jsPlatform/list'; // un-curried version good for both strings and arrays\r\nimport {length} from '../jsPlatform/object';\r\nimport {alwaysFalse} from '../boolean';\r\nimport map from './map';\r\nimport {curry, curry2} from '../function/curry';\r\n\r\nexport * from './aggregation';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns a slice of the given list from `startInd` to the end of the list.\r\n * @function module:listUtils.sliceFrom\r\n * @param startInd {Number}\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n sliceFrom = curry((startInd, xs) => slice(startInd, undefined, xs)),\r\n\r\n /**\r\n * Slices from index `0` to given index.\r\n * @function module:listUtils.sliceTo\r\n * @param toInd {Number}\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n sliceTo = curry((toInd, xs) => slice(0, toInd, xs)),\r\n\r\n /**\r\n * Slices a copy of list.\r\n * @function listUtils.sliceCopy\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n sliceCopy = sliceFrom(0),\r\n\r\n /**\r\n * Generic 'ascending order' ordering function (use by the likes of `list.sort` etc.)\r\n * @function module:listUtils.genericAscOrdering\r\n * @param a {*}\r\n * @param b {*}\r\n * @returns {number}\r\n */\r\n genericAscOrdering = curry((a, b) => {\r\n if (a > b) { return 1; }\r\n else if (a < b) { return -1; }\r\n return 0;\r\n }),\r\n\r\n /**\r\n * Returns length of all passed lists in list.\r\n * @function module:listUtils.lengths\r\n * @param lists ...{Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n lengths = curry2((...lists) => map(length, lists)),\r\n\r\n /**\r\n * Returns a list of lists trimmed to the shortest length in given list of lists. @background This method is used by the `zip*` functions to achieve their\r\n * 'slice to smallest' functionality.\r\n * @function module:listUtils.toShortest\r\n * @param lists {...(Array|String|*)}\r\n * @returns {Array|String|*}\r\n */\r\n toShortest = curry2((...lists) => {\r\n const listLengths = apply(lengths, lists),\r\n smallLen = Math.min.apply(Math, listLengths);\r\n return map((list, ind) => listLengths[ind] > smallLen ?\r\n sliceTo(smallLen, list) : sliceCopy(list), lists);\r\n }),\r\n\r\n /**\r\n * Reduces until predicate.\r\n * @function module:listUtils.reduceUntil\r\n * @param pred {Function} - `(item, index, list) => Boolean(...)`\r\n * @param op {Function} - Operation - `(agg, item, index, list) => agg`\r\n * @param agg {*} - Zero value.\r\n * @param xs {Array|String|*} - List.\r\n * @returns {*}\r\n */\r\n reduceUntil = curry((pred, op, agg, xs) => {\r\n const limit = length(xs);\r\n if (!limit) { return agg; }\r\n let ind = 0,\r\n result = agg;\r\n for (; ind < limit; ind++) {\r\n if (pred(xs[ind], ind, xs)) { break; }\r\n result = op(result, xs[ind], ind, xs);\r\n }\r\n return result;\r\n }),\r\n\r\n /**\r\n * Reduces until predicate (from right to left).\r\n * @function module:listUtils.reduceUntilRight\r\n * @param pred {Function} - `(item, index, list) => Boolean(...)`\r\n * @param op {Function} - Operation - `(agg, item, index, list) => agg`\r\n * @param agg {*} - Zero value.\r\n * @param xs {Array|String|*} - List.\r\n * @returns {*}\r\n */\r\n reduceUntilRight = curry((pred, op, agg, arr) => {\r\n const limit = length(arr);\r\n if (!limit) { return agg; }\r\n let ind = limit - 1,\r\n result = agg;\r\n for (; ind >= 0; ind--) {\r\n if (pred(arr[ind], ind, arr)) { break; }\r\n result = op(result, arr[ind], ind, arr);\r\n }\r\n return result;\r\n }),\r\n\r\n /**\r\n * Reduces a list with given operation (`op`) function.\r\n * @function module:listUtils.reduce\r\n * @param op {Function} - Operation - `(agg, item, index, list) => agg`\r\n * @param agg {*} - Zero value.\r\n * @param xs {Array|String|*} - List.\r\n * @returns {*}\r\n */\r\n reduce = reduceUntil(alwaysFalse),\r\n\r\n /**\r\n * Reduces a list with given operation (`op`) function (from right-to-left).\r\n * @function module:listUtils.reduceRight\r\n * @param op {Function} - Operation - `(agg, item, index, list) => agg`\r\n * @param agg {*} - Zero value.\r\n * @param xs {Array|String|*} - List.\r\n * @returns {*}\r\n */\r\n reduceRight = reduceUntilRight(alwaysFalse),\r\n\r\n /**\r\n * Gets last index of a list/list-like (Array|String|Function etc.).\r\n * @function module:listUtils.lastIndex\r\n * @param x {Array|String|*} - list like or list.\r\n * @returns {Number} - `-1` if no element found.\r\n */\r\n lastIndex = x => { const len = length(x); return len ? len - 1 : 0; },\r\n\r\n /**\r\n * Finds index in string or list.\r\n * @function module:listUtils.findIndexWhere\r\n * @param pred {Function} - Predicate.\r\n * @param arr {Array|String}\r\n * @returns {Number} - `-1` if predicate not matched else `index` found\r\n */\r\n findIndexWhere = curry((pred, arr) => {\r\n let ind = 0;\r\n const limit = length(arr);\r\n for (; ind < limit; ind += 1) {\r\n const predicateFulfilled = !!pred(arr[ind], ind, arr);\r\n if (predicateFulfilled) {\r\n return ind;\r\n }\r\n }\r\n return -1;\r\n }),\r\n\r\n /**\r\n * Finds index in list from right to left.\r\n * @function module:listUtils.findIndexWhereRight\r\n * @param pred {Function} - Predicate.\r\n * @param arr {Array|String}\r\n * @returns {Number} - `-1` if predicate not matched else `index` found\r\n */\r\n findIndexWhereRight = curry((pred, arr) => {\r\n let ind = length(arr) - 1;\r\n for (; ind >= 0; ind -= 1) {\r\n const predicateFulfilled = !!pred(arr[ind], ind, arr);\r\n if (predicateFulfilled) {\r\n return ind;\r\n }\r\n }\r\n return -1;\r\n }),\r\n\r\n /**\r\n * @function module:listUtils.findIndicesWhere\r\n * @param pred {Function}\r\n * @param xs {Array|String|*} - list or list like.\r\n * @returns {Array|undefined}\r\n */\r\n findIndicesWhere = curry((pred, xs) => {\r\n const limit = length(xs);\r\n let ind = 0,\r\n out = [];\r\n for (; ind < limit; ind++) {\r\n if (pred(xs[ind], ind, xs)) { out.push(ind); }\r\n }\r\n return out.length ? out : undefined;\r\n }),\r\n\r\n /**\r\n * @function module:listUtils.findWhere\r\n * @param pred {Function}\r\n * @param xs {Array|String|*} - list or list like.\r\n * @returns {*}\r\n */\r\n findWhere = curry((pred, xs) => {\r\n let ind = 0,\r\n limit = length(xs);\r\n if (!limit) { return; }\r\n for (; ind < limit; ind++) {\r\n let elm = xs[ind];\r\n if (pred(elm, ind, xs)) { return elm; }\r\n }\r\n })\r\n\r\n;\r\n","import {assignDeep} from './assignDeep';\r\nimport {keys} from '../jsPlatform/object';\r\nimport {reduce} from '../list/utils';\r\nimport {curry, curry2} from '../function/curry';\r\n\r\nexport const\r\n\r\n objUnion = curry((obj1, obj2) => assignDeep(obj1, obj2)),\r\n\r\n objIntersect = curry((obj1, obj2) => reduce((agg, key) => {\r\n if (obj2.hasOwnProperty(key)) {\r\n agg[key] = obj2[key];\r\n }\r\n return agg;\r\n }, {}, keys(obj1))),\r\n\r\n objDifference = curry((obj1, obj2) => reduce((agg, key) => {\r\n if (!obj2.hasOwnProperty(key)) {\r\n agg[key] = obj1[key];\r\n }\r\n return agg;\r\n }, {}, keys(obj1))),\r\n\r\n objComplement = curry2((obj0, ...objs) => reduce((agg, obj) =>\r\n assignDeep(agg, objDifference(obj, obj0)), {}, objs));\r\n","/**\r\n * @module console\r\n * @description Console exports.\r\n */\r\nexport const\r\n\r\n /**\r\n * `Console.log` method.\r\n * @function module:console.log\r\n * @params args {...*}\r\n * @returns {void}\r\n */\r\n log = console.log.bind(console),\r\n\r\n /**\r\n * `Console.error` method.\r\n * @function module:console.error\r\n * @params args {...*}\r\n * @returns {void}\r\n */\r\n error = console.error.bind(console),\r\n\r\n /**\r\n * Peeks (console.log) at incoming value(s) and returns the last value.\r\n * @function module:console.peek\r\n * @param args {...*}\r\n * @returns {*} Last given value (if one or more values) else first value.\r\n */\r\n peek = (...args) => (log(...args), args.pop())\r\n\r\n;\r\n","export const\r\n\r\n /**\r\n * Clones and object or array using `JSON.parse(JSON.stringify(...))` pattern.\r\n * @function module:object.jsonClone\r\n * @param x {*}\r\n * @returns {*}\r\n */\r\n jsonClone = x => JSON.parse(JSON.stringify(x))\r\n\r\n;\r\n","import {isArray, isType} from './is';\r\nimport {keys} from '../jsPlatform/object';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns an associated list from given object.\r\n * @note Useful for working with plain javascript objects.\r\n * @function module:object.toAssocList\r\n * @param obj {(Object|Array|*)}\r\n * @returns {Array.<*, *>}\r\n */\r\n toAssocList = obj => keys(obj).map(key => [key, obj[key]]),\r\n\r\n /**\r\n * Returns an associated list from given object (deeply (on incoming object's type)).\r\n * @note Does deep conversion on all values of passed in type's type.\r\n * @function module:object.toAssocListDeep\r\n * @param obj {*}\r\n * @param [TypeConstraint = Object] {(Constructor|Function)} - Type constraint to convert on.\r\n * @returns {*}\r\n */\r\n toAssocListDeep = (obj, TypeConstraint = Object) => keys(obj).map(key =>\r\n TypeConstraint && isType(TypeConstraint, obj[key]) ?\r\n [key, toAssocListDeep(obj[key], TypeConstraint)] :\r\n [key, obj[key]]\r\n ),\r\n\r\n /**\r\n * From associated list to object.\r\n * @function module:object.fromAssocList\r\n * @param xs {Array.} - Associated list.\r\n * @param [OutType = Object] {Constructor|Function} - Output type. Default `Object`.\r\n * @returns {*} - Default is `Object`\r\n */\r\n fromAssocList = (xs, OutType = Object) => xs.reduce((agg, [key, value]) => {\r\n agg[key] = value;\r\n return agg;\r\n }, new OutType()),\r\n\r\n /**\r\n * From associated list to object (deep conversion on associative lists (array of 2 value arrays)).\r\n * @note Considers array of arrays associated lists.\r\n * @function module:object.fromAssocListDeep\r\n * @param xs {Array.} - Associated list.\r\n * @param [OutType = Object] {Constructor|Function} - Output type. Default `Object`.\r\n * @returns {*} - Default is `Object`\r\n */\r\n fromAssocListDeep = (xs, OutType = Object) => xs.reduce((agg, [key, value]) => {\r\n if (isArray(value) && isArray(value[0]) && value[0].length === 2) {\r\n agg[key] = fromAssocListDeep(value, OutType);\r\n return agg;\r\n }\r\n agg[key] = value;\r\n return agg;\r\n }, new OutType())\r\n;\r\n","import {typeOf} from './typeOf';\r\nimport {toAssocList} from './assocList';\r\n\r\nexport const\r\n\r\n /**\r\n * Converts incoming value to an array.\r\n * @note For `WeakMap`, `WeakSet`, `Map` and `Set` result is the same as calling `Array.from` on such.\r\n * @note For `null`, `undefined`, `NaN`, `Number{}`, `Symbol{}`, `Boolean{}` returns an empty array.\r\n * @note Method does a shallow conversion;\r\n * @function module:object.toArray\r\n * @param x {*} - Thing to convert from.\r\n * @returns {Array}\r\n */\r\n toArray = x => {\r\n switch (typeOf(x)) {\r\n case 'Null':\r\n case 'Undefined':\r\n return [];\r\n case String.name:\r\n case Array.name:\r\n case 'WeakMap':\r\n case 'WeakSet':\r\n case 'Map':\r\n case 'Set':\r\n return Array.from(x);\r\n case Object.name:\r\n default:\r\n return toAssocList(x);\r\n }\r\n }\r\n\r\n;\r\n","/**\r\n * @module object\r\n * @description Object operations/combinators.\r\n */\r\n\r\nexport * from './jsPlatform/object';\r\nexport * from './object/lookup';\r\nexport * from './object/typeOf';\r\nexport * from './object/copy';\r\nexport * from './object/is';\r\nexport * from './object/of';\r\nexport * from './object/searchObj';\r\nexport * from './object/assignDeep';\r\nexport * from './object/setTheory';\r\nexport * from './object/console';\r\nexport * from './object/jsonClone';\r\nexport * from './object/toArray';\r\nexport * from './object/assocList';\r\n","import {reduceRight} from '../jsPlatform/array';\r\n\r\n/**\r\n * Composes all functions passed in from right to left passing each functions return value to\r\n * the function on the left of itself.\r\n * @function module:function.compose\r\n * @type {Function}\r\n * @param args {...{Function}}\r\n * @returns {Function}\r\n */\r\nexport const compose = (...args) =>\r\n arg0 => reduceRight((value, fn) => fn(value), arg0, args);\r\n","/**\r\n * @memberOf function\r\n */\r\n\r\n/**\r\n * Returns passed in parameter.\r\n * @haskellType `id :: a -> a`\r\n * @function module:function.id\r\n * @param x {*}\r\n * @returns {*}\r\n */\r\nexport const id = x => x;\r\n","/**\r\n * @memberOf function\r\n */\r\n\r\nimport {apply} from '../jsPlatform/function';\r\nimport {curry, curry2} from './curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Negates a function that takes one/no argument.\r\n * @function module:function.negateF\r\n * @param fn {Function}\r\n * @returns {function(*=): boolean}\r\n */\r\n negateF = fn => x => !fn(x),\r\n\r\n /**\r\n * Takes a function that takes two parameters and returns a negated version of given\r\n * function.\r\n * @function module:_negate.negateF2\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n negateF2 = fn => curry((a, b) => !fn(a, b)),\r\n\r\n /**\r\n * Takes a function that takes three parameters and returns a\r\n * negated version of given function.\r\n * @function module:_negate.negateF3\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n negateF3 = fn => curry((a, b, c) => !fn(a, b, c)),\r\n\r\n /**\r\n * Returns a negated version of given function.\r\n * Returned function is variadiac (takes one or more arguments).\r\n * @note function returned is uncurried.\r\n * @uncurried\r\n * @function module:function.negateFN\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n negateFN = fn => curry2((...args) => !apply(fn, args));\r\n","import {curry} from './curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Run `operation` until predicate returns `true` (like a functional\r\n * version of a while loop).\r\n * @function module:function.until\r\n * @param predicate {Function} :: a -> Boolean\r\n * @param operation {Function} :: a -> a\r\n * @param typeInstance {*} :: * - A monoidal zero or some starting point.\r\n * @returns {*} - What ever type `typeInstance` is\r\n */\r\n until = curry((predicate, operation, typeInstance) => {\r\n let result = typeInstance;\r\n while (!predicate(result)) {\r\n result = operation(result);\r\n }\r\n return result;\r\n });\r\n","import {typeOf} from '../object/typeOf';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns a function or throws an error if given `f` is not a function.\r\n * @function module:function.fnOrError\r\n * @param symbolName {String} - Error message prefix.\r\n * @param f {Function|*} - Expected function.\r\n * @returns {Function}\r\n * @throws {Error} - Error if `f` is not of `function`\r\n */\r\n fnOrError = (symbolName, f) => {\r\n if (!f || !(f instanceof Function)) {\r\n throw new Error(`${symbolName} should be a function. ` +\r\n `Type received: ${typeOf(f)}; Value received: ${f}.`);\r\n }\r\n return f;\r\n }\r\n\r\n;\r\n","/**\r\n * No-op ('op' as in 'operation') - Performs no operation 'always' (good for places where\r\n * a value should always be a function etc.).\r\n * @function module:function.noop\r\n * @returns {undefined}\r\n */\r\nexport const noop = () => undefined;\r\n","/**\r\n * @module function\r\n */\r\nexport * from './jsPlatform/function';\r\nexport * from './function/compose';\r\nexport * from './function/curry';\r\nexport * from './function/flip';\r\nexport * from './function/id';\r\nexport * from './function/negate';\r\nexport * from './function/until';\r\nexport * from './function/fnOrError';\r\nexport * from './function/noop';\r\n","/**\r\n * @module object\r\n */\r\nimport {curry} from '../function/curry';\r\n\r\n/**\r\n * Normalizes step for `from` and `to` combination.\r\n * @function module:list.normalizeStep\r\n * @param from {Number}\r\n * @param to {Number}\r\n * @param [step = 1] {Number}\r\n * @returns {Number}\r\n * @private\r\n */\r\nconst normalizeStep = (from, to, step) => {\r\n if (from > to) {\r\n return step > 0 ? -step : step; // make step negative\r\n }\r\n return step < 0 ? -1 * step : step; // make step positive\r\n};\r\n\r\nexport const\r\n\r\n /**\r\n * Range function - gives you an array contain numbers in given range.\r\n * @note normalizes `step` to be valid if range numbers given are invalid\r\n * (forces `step` to be negative if range required is in the negative direction\r\n * and forces `step` to be positive if range required is in the other direction).\r\n * @function module:list.range\r\n * @param from {Number}\r\n * @param to {Number}\r\n * @param [step = 1] {Number}\r\n * @returns {Array.}\r\n */\r\n range = curry((from, to, step = 1) => {\r\n let i = from;\r\n const out = [];\r\n step = normalizeStep(from, to, step);\r\n if (step === 0 || from === to) { return [from]; }\r\n for (; (to - i) * step >= 0; i += step) { out.push(i); }\r\n return out;\r\n })\r\n;\r\n","/**\r\n * Created by elydelacruz on 9/6/2017.\r\n */\r\n\r\nimport {fPureTakesOne} from '../utils';\r\n\r\n/**\r\n * Functional version of `String.prototype.split`.\r\n * @function module:_string.split\r\n * @param separator {String|RegExp}\r\n * @param str {String}\r\n * @returns {Array}\r\n */\r\nexport const split = fPureTakesOne('split');\r\n","/**\r\n * @module jsPlatform_\r\n * @private\r\n */\r\nexport * from './jsPlatform/object';\r\nexport * from './jsPlatform/array';\r\nexport * from './jsPlatform/list';\r\nexport * from './jsPlatform/string';\r\nexport * from './jsPlatform/function';\r\n","/**\r\n * List operations module.\r\n * @module list\r\n */\r\nimport {concat as listAppend, indexOf, slice, includes} from './jsPlatform/list';\r\nimport {apply} from './jsPlatform/function';\r\nimport {length} from './jsPlatform/object';\r\nimport {negateF3, negateF2} from './function/negate';\r\nimport {curry, curry2, curry3} from './function/curry';\r\nimport {isTruthy, isFalsy} from './boolean';\r\nimport {lookup} from './object/lookup';\r\nimport {of} from './object/of';\r\nimport {isset, isString} from './object/is';\r\nimport {typeOf} from './object/typeOf';\r\nimport map from './list/map';\r\n\r\nimport {\r\n sliceFrom, sliceTo, lengths,\r\n toShortest, aggregateArray,\r\n reduceUntil, reduce, reduceRight, lastIndex,\r\n findIndexWhere, findIndexWhereRight, findIndicesWhere,\r\n findWhere, sliceCopy, genericAscOrdering\r\n}\r\n from './list/utils';\r\n\r\nexport * from './list/range';\r\n\r\nexport * from './list/utils';\r\n\r\nexport {map};\r\n\r\nexport {slice, includes, indexOf, lastIndexOf, push} from './jsPlatform';\r\n\r\nexport const\r\n\r\n /**\r\n * Append two, or more, lists, i.e.,\r\n * @example\r\n * expectEqual(append(take(13, alphabetString), drop(13, alphabetString)), alphabetString); // true\r\n *\r\n * // Another example\r\n * const result = append(\r\n * alphabetStr.split(''),\r\n * alphabetStr.split('')\r\n * ),\r\n * expected = repeat(2, alphabetStr).split('');\r\n *\r\n * shallowEquals(result, expected) === true // `true`\r\n *\r\n * @function module:list.append\r\n * @param [args] {...(Array|String|*)} - One or more lists or list likes (strings etc.).\r\n * @returns {(Array|String|*)} - Same type as list like passed in.\r\n */\r\n append = curry2((...args) => apply(listAppend, args)),\r\n\r\n /**\r\n * Returns head of list (first item of list).\r\n * @haskellType `head :: [a] -> a`\r\n * @function module:list.head\r\n * @param x {Array|String}\r\n * @returns {*} - First item from list\r\n */\r\n head = x => x[0],\r\n\r\n /**\r\n * Returns last item of list.\r\n * @haskellType `last :: [a] -> a`\r\n * @function module:list.last\r\n * @param xs {Array|String}\r\n * @returns {*}\r\n */\r\n last = xs => xs[lastIndex(xs)],\r\n\r\n /**\r\n * Returns tail part of list (everything after the first item as new list).\r\n * @haskelType `tail :: [a] -> [a]`\r\n * @function module:list.tail\r\n * @param xs {Array|String}\r\n * @returns {Array|String}\r\n */\r\n tail = xs => sliceFrom(1, xs),\r\n\r\n /**\r\n * Returns everything except last item of list as new list.\r\n * @haskellType `init :: [a] -> [a]`\r\n * @function module:list.init\r\n * @param xs {Array|String}\r\n * @returns {Array|String}\r\n */\r\n init = xs => sliceTo(lastIndex(xs), xs),\r\n\r\n /**\r\n * Returns `head` and `tail` of passed in list/string in a tuple.\r\n * @haskellType `uncons :: [a] -> Maybe (a, [a])`\r\n * @function module:list.uncons\r\n * @param xs {Array|String}\r\n * @returns {Array|undefined}\r\n */\r\n uncons = xs => !xs || length(xs) === 0 ? undefined : [head(xs), tail(xs)],\r\n\r\n /**\r\n * Returns `tail` and `head` of passed in list/string in a tuple.\r\n * @haskellType `unconsr :: [a] -> Maybe ([a], a)`\r\n * @function module:list.unconsr\r\n * @param xs {Array|String}\r\n * @returns {Array|String|*|undefined}\r\n */\r\n unconsr = xs => !xs || length(xs) === 0 ? undefined : [init(xs), last(xs)],\r\n\r\n /**\r\n * Concatenates all the elements of a container of lists.\r\n * @haskellType `concat :: Foldable t => t [a] -> [a]`\r\n * @function module:list.concat\r\n * @param xs {Array}\r\n * @returns {Array}\r\n */\r\n concat = xs => {\r\n switch (length(xs)) {\r\n case undefined:\r\n case 0:\r\n return [];\r\n case 1:\r\n const item0 = xs[0];\r\n return item0 && item0.slice ? sliceCopy(item0) : item0;\r\n case 2:\r\n default:\r\n return apply(append, xs);\r\n }\r\n },\r\n\r\n /**\r\n * Map a function over all the elements of a container and concatenate the resulting lists.\r\n * @haskellType `concatMap :: Foldable t => (a -> [b]) -> t a -> [b]`\r\n * @function module:list.concatMap\r\n * @param fn {Function}\r\n * @param foldableOfA {Array}\r\n * @returns {Array}\r\n */\r\n concatMap = curry((fn, foldableOfA) => concat(map(fn, foldableOfA))),\r\n\r\n /**\r\n * Returns a copy of the passed in list reverses.\r\n * @haskellType `reverse :: [a] -> [a]`\r\n * @function module:list.reverse\r\n * @param xs {Array|String}\r\n * @returns {Array|String}\r\n */\r\n reverse = xs => {\r\n if (!isset(xs) || !xs.length) {\r\n return xs;\r\n }\r\n let out = of(xs),\r\n i = xs.length - 1;\r\n switch (typeOf(xs)) {\r\n case 'String':\r\n for (; i >= 0; i -= 1) {\r\n out += xs[i];\r\n }\r\n return out;\r\n default:\r\n for (; i >= 0; i -= 1) {\r\n out.push(xs[i]);\r\n }\r\n return out;\r\n }\r\n },\r\n\r\n /**\r\n * Takes an element and a list and `intersperses' that element between the\r\n * elements of the list.\r\n * @function module:list.intersperse\r\n * @note In our version of the function javascript is loosely typed so,\r\n * so is our function (to much overhead to make it typed) so `between` can be any value.\r\n * @param between {*} - Should be of the same type of elements contained in list.\r\n * @param arr {Array|String} - List.\r\n * @returns {Array|String}\r\n */\r\n intersperse = curry((between, xs) => {\r\n if (!xs || !xs.length) {\r\n return xs;\r\n }\r\n const limit = xs.length,\r\n lastInd = limit - 1;\r\n let out = of(xs),\r\n i = 0;\r\n if (isString(xs)) {\r\n for (; i < limit; i += 1) {\r\n out += i === lastInd ?\r\n xs[i] : xs[i] + between;\r\n }\r\n return out;\r\n }\r\n for (; i < limit; i += 1) {\r\n if (i === lastInd) {\r\n out.push(xs[i]);\r\n } else {\r\n out.push(xs[i], between);\r\n }\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * `intercalate xs xss` is equivalent to (concat (intersperse xs xss)). It inserts the list xs in between the lists in xss and concatenates the result.\r\n * @haskellType `intercalate :: [a] -> [[a]] -> [a]`\r\n * @function module:list.intercalate\r\n * @param xs {Array|String}\r\n * @param xss {Array|String}\r\n * @returns {Array|String}\r\n */\r\n intercalate = curry((xs, xss) => {\r\n if (isString(xss)) {\r\n return intersperse(xs, xss);\r\n }\r\n return concat(intersperse(xs, xss));\r\n }),\r\n\r\n /**\r\n * Transposes rows and columns into lists by index; E.g.,\r\n * Haskell example:\r\n * ```\r\n * transpose [[1,2,3],[4,5,6]] == [[1,4],[2,5],[3,6]]\r\n *\r\n * -- Notice the shorter arrays are ignored after their last index is copied over:\r\n * transpose [[10,11],[20],[],[30,31,32]] == [[10,20,30],[11,31],[32]]\r\n * ```\r\n * @note from columns to rows.\r\n * @note Empty lists are ignored.\r\n * @haskellType `transpose :: [[a]] -> [[a]]`\r\n * @function module:list.transpose\r\n * @param xss {Array}\r\n * @returns {Array}\r\n */\r\n transpose = xss => {\r\n let numLists = length(xss),\r\n ind = 0, ind2;\r\n if (!numLists) {\r\n return [];\r\n }\r\n const listLengths = apply(lengths, xss),\r\n longestListLen = maximum(listLengths),\r\n outLists = [];\r\n for (; ind < longestListLen; ind += 1) {\r\n const outList = [];\r\n for (ind2 = 0; ind2 < numLists; ind2 += 1) {\r\n if (listLengths[ind2] < ind + 1) {\r\n continue;\r\n }\r\n outList.push(xss[ind2][ind]);\r\n }\r\n outLists.push(outList);\r\n }\r\n return filter(x => length(x) > 0, outLists);\r\n },\r\n\r\n /**\r\n * Generates 2^n sub-sequences for passed in sequence (string/list) (`n` is\r\n * the length of the passed in sequence so: 2^length(xs)).\r\n * Note: The return value doubles per index/character passed in so use with caution!\r\n * Also note that for 2^16 (or for a sequence of 16 characters) this algorithm\r\n * will generate 65536 sub-sequences! So caution should be taken to not\r\n * use this with sequences above a certain length on certain platform (the browser thread in specific).\r\n * @function module:list.subsequences\r\n * @jsperftest https://jsperf.com/subsequences\r\n * @param xs {Array|String}\r\n * @returns {Array.}\r\n */\r\n subsequences = xs => {\r\n const listLen = length(xs),\r\n len = Math.pow(2, listLen),\r\n out = [];\r\n for (let i = 0; i < len; i += 1) {\r\n let entry = [];\r\n for (let j = 0; j < listLen; j += 1) {\r\n if (i & (1 << j)) {\r\n entry.push(xs[j]);\r\n }\r\n }\r\n out.push(entry);\r\n }\r\n return out;\r\n },\r\n\r\n /**\r\n * Returns an array with the given indices swapped.\r\n * @function module:list.swapped\r\n * @param ind1 {Number}\r\n * @param ind2 {Number}\r\n * @param list {Array}\r\n * @returns {Array} - Copy of incoming with swapped values at indices.\r\n */\r\n swapped = curry((ind1, ind2, list) => {\r\n const out = sliceCopy(list),\r\n tmp = out[ind1];\r\n out[ind1] = out[ind2];\r\n out[ind2] = tmp;\r\n return out;\r\n }),\r\n\r\n /**\r\n * Returns a list of permutations for passed in list.\r\n * Use caution with lists above a length of 15 (will take long due to nature of\r\n * algorithm).\r\n * @function module:list.permutations\r\n * @param xs {Array} - List.\r\n * @returns {Array} - Array of permutations.\r\n */\r\n permutations = xs => {\r\n const limit = length(xs);\r\n\r\n if (!limit || limit === 1) {\r\n return [xs];\r\n }\r\n\r\n let list = sliceCopy(xs),\r\n c = repeat(limit, 0),\r\n i = 0;\r\n\r\n const out = [list];\r\n\r\n for (; i < limit; i++) {\r\n if (c[i] < i) {\r\n list = swapped(i % 2 === 0 ? 0 : c[i], i, list);\r\n out.push(list);\r\n c[i] += 1;\r\n i = 0;\r\n continue;\r\n }\r\n c[i] = 0;\r\n }\r\n\r\n return out;\r\n },\r\n\r\n /**\r\n * Left associative fold. Reduces a container of elements down by the given operation (same as [].reduce).\r\n * @function module:list.foldl\r\n * @param fn {Function}\r\n * @param zero {*} - Aggregator.\r\n * @param functor {Array}\r\n * @returns {*} - Whatever type is lastly returned from `fn`.\r\n */\r\n foldl = reduce,\r\n\r\n /**\r\n * Right associative fold. Reduces a container of elements down by the given operation (same as [].reduceRight).\r\n * @function module:list.foldr\r\n * @param fn {Function}\r\n * @param zero {*} - Aggregator.\r\n * @param functor {Array}\r\n * @returns {*} - Whatever type is lastly returned from `fn`.\r\n */\r\n foldr = reduceRight,\r\n\r\n /**\r\n * A variant of `foldl` except that this one doesn't require the starting point. The starting point/value will be pulled\r\n * out from a copy of the container.\r\n * @function module:list.foldl1\r\n * @param op {Function}\r\n * @param xs {Array}\r\n * @returns {*} - Whatever type is lastly returned from `op`.\r\n */\r\n foldl1 = curry((op, xs) => {\r\n const parts = uncons(xs);\r\n return !parts ? [] : reduce(op, parts[0], parts[1]);\r\n }),\r\n\r\n /**\r\n * A variant of `foldr` except that this one doesn't require the starting point/value. The starting point/value will be pulled\r\n * out from a copy of the container.\r\n * @function module:list.foldr1\r\n * @param op {Function}\r\n * @param xs {Array}\r\n * @returns {*} - Whatever type is lastly returned from `op`.\r\n */\r\n foldr1 = curry((op, xs) => {\r\n const parts = unconsr(xs);\r\n return !parts ? [] : reduceRight(op, parts[1], parts[0]);\r\n }),\r\n\r\n /**\r\n * Performs a map then a reduce all in one (from left-to-right). Returns a tuple\r\n * containing the aggregated value and the result of mapping the passed in function on passed in list.\r\n * @function module:list.mapAccumL\r\n * @param op {Function} - Function : [aggregated, mapResult]\r\n * @param zero {*} - An instance of the passed in list type used to aggregateArray on.\r\n * @param xs {Array} - list type.\r\n * @return {Array} - [aggregated, list]\r\n */\r\n mapAccumL = curry((op, zero, xs) => {\r\n const list = sliceCopy(xs),\r\n limit = length(xs);\r\n if (!limit) {\r\n return [zero, list];\r\n }\r\n let ind = 0,\r\n agg = zero,\r\n mapped = [],\r\n tuple;\r\n for (; ind < limit; ind++) {\r\n tuple = op(agg, list[ind], ind);\r\n agg = tuple[0];\r\n mapped = tuple[1];\r\n }\r\n return [agg, mapped];\r\n }),\r\n\r\n /**\r\n * Performs a map and a reduce all in one (from right-to-left). Returns a tuple\r\n * containing the aggregated value and the result of mapping the passed in function on passed in list.\r\n * @function module:list.mapAccumR\r\n * @param op {Function} - Function : [aggregated, mapResult]\r\n * @param zero {*} - An instance of the passed in list type used to aggregateArray on.\r\n * @param xs {Array} - list type.\r\n * @return {Array} - [aggregated, list]\r\n */\r\n mapAccumR = curry((op, zero, xs) => {\r\n const list = sliceCopy(xs),\r\n limit = length(xs);\r\n if (!limit) {\r\n return [zero, list];\r\n }\r\n let ind = limit - 1,\r\n agg = zero,\r\n mapped = [],\r\n tuple;\r\n for (; ind >= 0; ind--) {\r\n tuple = op(agg, list[ind], ind);\r\n agg = tuple[0];\r\n mapped = tuple[1];\r\n }\r\n return [agg, mapped];\r\n }),\r\n\r\n /**\r\n * iterate f x returns an infinite list of repeated applications of f to x.\r\n * @function module:list.iterate\r\n * @example `iterate(5, f, x) == [x, f(x), f(f(x)), ...]`\r\n * @param limit {Number}\r\n * @param op {Function} - Operation.\r\n * @param x {*} - Starting point.\r\n * @returns {*}\r\n */\r\n iterate = curry((limit, op, x) => {\r\n let ind = 0,\r\n out = [],\r\n lastX = x;\r\n for (; ind < limit; ind += 1) {\r\n out.push(lastX);\r\n lastX = op(lastX, ind);\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Repeats `x` `limit` number of times.\r\n * @function module:list.repeat\r\n * @param limit {Number}\r\n * @param x {*}\r\n * @return {Array}\r\n */\r\n repeat = curry((limit, x) => iterate(limit, a => a, x)),\r\n\r\n /**\r\n * Same as `repeat` due to the nature of javascript (see haskell version for usage).\r\n * @function module:list.replicate\r\n * @param limit {Number}\r\n * @param x {*}\r\n * @return {Array}\r\n */\r\n replicate = repeat,\r\n\r\n /**\r\n * Replicates a list `limit` number of times and appends the results (concat)\r\n * @function module:list.cycle\r\n * @param limit {Number}\r\n * @param xs {Array}\r\n * @returns {Array}\r\n */\r\n cycle = curry((limit, xs) => concat(replicate(limit, xs))),\r\n\r\n /**\r\n * Unfolds a value into a list of somethings.\r\n * @haskellType `unfoldr :: (b -> Maybe (a, b)) -> b -> [a]`\r\n * @function module:list.unfoldr\r\n * @param op {Function} - Operation to perform (should return a two component tuple (item to aggregateArray and item to unfold in next iteration).\r\n * @param x {*} - Starting parameter to unfold from.\r\n * @returns {Array} - An array of whatever you return from `op` yielded.\r\n */\r\n unfoldr = curry((op, x) => {\r\n let ind = 0,\r\n out = [],\r\n resultTuple = op(x, ind, out);\r\n while (resultTuple) {\r\n out.push(resultTuple[0]);\r\n resultTuple = op(resultTuple[1], ++ind, out);\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Finds index in string or list (alias for `findIndex`).\r\n * @function module:list.findIndex\r\n * @param pred {Function} - Predicate.\r\n * @param arr {Array|String}\r\n * @returns {Number} - `-1` if predicate not matched else `index` found\r\n */\r\n findIndex = findIndexWhere,\r\n\r\n /**\r\n * @function module:list.findIndices\r\n * @param pred {Function}\r\n * @param xs {Array} - list or list like.\r\n * @returns {Array|undefined}\r\n */\r\n findIndices = findIndicesWhere,\r\n\r\n /**\r\n * @function module:list.elemIndex\r\n * @param x {*} - Element to search for.\r\n * @param xs {Array} - list or list like.\r\n * @returns {*}\r\n */\r\n elemIndex = curry((x, xs) => {\r\n const foundInd = indexOf(x, xs);\r\n return foundInd !== -1 ? foundInd : undefined;\r\n }),\r\n\r\n /**\r\n * @function module:list.elemIndices\r\n * @param value {*} - Element to search for.\r\n * @param xs {Array} - list or list like.\r\n * @returns {*}\r\n */\r\n elemIndices = curry((value, xs) => findIndices(x => x === value, xs)),\r\n\r\n /**\r\n * Takes `n` items from start of list to `limit` (exclusive).\r\n * @function module:list.take\r\n * @param list {Array|String}\r\n * @param limit {Number}\r\n * @returns {String|Array} - Passed in type's type\r\n */\r\n take = sliceTo,\r\n\r\n /**\r\n * Drops `n` items from start of list to `count` (exclusive).\r\n * @function module:list.drop\r\n * @param list {Array|String}\r\n * @param count {Number}\r\n * @returns {String|Array} - Passed in type's type\r\n */\r\n drop = sliceFrom,\r\n\r\n /**\r\n * Splits `x` in two at given `index` (exclusive (includes element/character at\r\n * given index in second part of returned list)).\r\n * @function module:list.splitAt\r\n * @param ind {Number} - Index to split at.\r\n * @param list {Array|String} - functor (list or string) to split.\r\n * @returns {Array|String} - List like type passed\r\n */\r\n splitAt = (ind, list) => [sliceTo(ind, list), sliceFrom(ind, list)],\r\n\r\n /**\r\n * Gives an list with passed elements while predicate was true.\r\n * @function module:list.takeWhile\r\n * @param pred {Function} - Predicate<*, index, list|string>\r\n * @param list {Array|String}\r\n * @returns {Array}\r\n */\r\n takeWhile = curry((pred, list) =>\r\n reduceUntil(\r\n negateF3(pred), // predicate\r\n isString(list) ?\r\n (agg, x) => agg + x :\r\n aggregateArray, // operation\r\n of(list), // aggregate\r\n list\r\n )),\r\n\r\n /**\r\n * Returns an list without elements that match predicate.\r\n * @function module:list.dropWhile\r\n * @param pred {Function} - Predicate<*, index, list|string>\r\n * @param list {Array|String}\r\n * @refactor\r\n * @returns {Array|String}\r\n */\r\n dropWhile = curry((pred, list) => {\r\n const limit = length(list),\r\n splitPoint =\r\n findIndexWhere(\r\n (x, i, xs) => !pred(x, i, xs),\r\n list\r\n );\r\n\r\n return splitPoint === -1 ?\r\n sliceFrom(limit, list) :\r\n slice(splitPoint, limit, list);\r\n }),\r\n\r\n /**\r\n * @function module:list.dropWhileEnd\r\n * @param pred {Function} - Predicate<*, index, list|string>\r\n * @param list {Array|String}\r\n * @refactor\r\n * @returns {Array|String}\r\n */\r\n dropWhileEnd = curry((pred, list) => {\r\n const splitPoint =\r\n findIndexWhereRight(\r\n (x, i, xs) => !pred(x, i, xs),\r\n list\r\n );\r\n if (splitPoint === -1) {\r\n return of(list);\r\n }\r\n return sliceTo(splitPoint + 1, list);\r\n }),\r\n\r\n /**\r\n * Gives you the `span` of items matching predicate\r\n * and items not matching predicate; E.g., Gives an\r\n * array of arrays; E.g., [[matching-items], [non-matching-items]]\r\n * @function list.span\r\n * @param pred {Function} - List predicate (`(x, i, list) => bool`)\r\n * @param list {Array|String}\r\n * @returns {(Array>|Array)}\r\n * @type {Function}\r\n */\r\n span = curry((pred, list) => {\r\n const splitPoint = findIndexWhere(negateF3(pred), list);\r\n return splitPoint === -1 ?\r\n [sliceFrom(0, list), of(list)] :\r\n splitAt(splitPoint, list);\r\n }),\r\n\r\n /**\r\n * breakOnList, applied to a predicate p and a list xs, returns a tuple\r\n * where first element is longest prefix (possibly empty) of xs of elements\r\n * that do not satisfy p and second element is the remainder of the list:\r\n * @haskellExample\r\n * Replace `break` with `breakOnList` for our version.\r\n * ```\r\n * breakOnList (> 3) [1,2,3,4,1,2,3,4] == ([1,2,3],[4,1,2,3,4])\r\n * breakOnList (< 9) [1,2,3] == ([],[1,2,3])\r\n * breakOnList (> 9) [1,2,3] == ([1,2,3],[])\r\n * ```\r\n * @function module:list.breakOnList\r\n * @param pred {Function}\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n breakOnList = curry((pred, list) => {\r\n const splitPoint = findIndexWhere(negateF3(pred), list);\r\n return splitPoint === -1 ?\r\n [of(list), sliceFrom(0, list)] : reverse(splitAt(splitPoint, list));\r\n }),\r\n\r\n /**\r\n * Gets item at index.\r\n * @function module:list.at\r\n * @param ind {Number} - Index.\r\n * @param xs {Array} - list or list like.\r\n * @returns {*|undefined} - Item or `undefined`.\r\n */\r\n at = lookup,\r\n\r\n /**\r\n * Find an item in structure of elements based on given predicate (`pred`).\r\n * @function module:list.find\r\n * @param pred {Function}\r\n * @param xs {Array} - list or list like.\r\n * @returns {*} - Found item.\r\n */\r\n find = findWhere,\r\n\r\n /**\r\n * For each function (same as `[].forEach` except in functional format).\r\n * @function module:list.forEach\r\n * @param fn {Function} - Operation (`(element, index, list) => {...}`, etc.)\r\n * @param xs {(Array|String)}\r\n * @returns {void}\r\n */\r\n forEach = curry((fn, list) => {\r\n const limit = length(list);\r\n if (!limit) {\r\n return;\r\n }\r\n let ind = 0;\r\n for (; ind < limit; ind += 1) {\r\n fn(list[ind], ind, list);\r\n }\r\n }),\r\n\r\n /**\r\n * Filters a structure of elements using given predicate (`pred`) (same as `[].filter`).\r\n * @function module:list.filter\r\n * @param pred {Function}\r\n * @param xs {Array} - list or list like.\r\n * @returns {Array} - Structure of filtered elements.\r\n */\r\n filter = curry((pred, xs) => {\r\n let ind = 0,\r\n limit = length(xs),\r\n out = [];\r\n if (!limit) {\r\n return out;\r\n }\r\n for (; ind < limit; ind++) {\r\n if (pred(xs[ind], ind, xs)) {\r\n out.push(xs[ind]);\r\n }\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Partitions a list on a predicate; Items that match predicate are in first list in tuple; Items that\r\n * do not match the tuple are in second list in the returned tuple.\r\n * Essentially `[filter(p, xs), filter(negateF3(p), xs)]`.\r\n * @function module:list.partition\r\n * @param pred {Function} - Predicate\r\n * @param list {Array}\r\n * @returns {Array|String} - Tuple of arrays or strings (depends on incoming list (of type list or string)).\r\n */\r\n partition = curry((pred, list) =>\r\n !length(list) ?\r\n [[], []] :\r\n [filter(pred, list), filter(negateF3(pred), list)]),\r\n\r\n /**\r\n * Returns a boolean indicating whether an element exists in given structure of elements.\r\n * @function module:list.elem\r\n * @param element {*}\r\n * @param xs {Array}\r\n * @returns {Boolean}\r\n */\r\n elem = includes,\r\n\r\n /**\r\n * The opposite of `elem` - Returns a boolean indicating whether an element exists in given list.\r\n * @function module:list.notElem\r\n * @param element {*}\r\n * @param xs {Array}\r\n * @returns {Boolean}\r\n */\r\n notElem = negateF2(includes),\r\n\r\n /**\r\n * Checks if list `xs1` is a prefix of list `xs2`\r\n * @function module:list.isPrefixOf\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {boolean}\r\n */\r\n isPrefixOf = curry((xs1, xs2) => {\r\n const limit1 = length(xs1),\r\n limit2 = length(xs2);\r\n if (limit2 < limit1 || !limit1 || !limit2 || indexOf(xs1[0], xs2) === -1) {\r\n return false;\r\n }\r\n let ind = 0;\r\n for (; ind < limit1; ind++) {\r\n if (xs1[ind] !== xs2[ind]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }),\r\n\r\n /**\r\n * Checks if list `xs1` is a suffix of list `xs2`\r\n * @function module:list.isSuffixOf\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {boolean}\r\n */\r\n isSuffixOf = curry((xs1, xs2) => {\r\n const limit1 = length(xs1),\r\n limit2 = length(xs2);\r\n if (limit2 < limit1 || !limit1 || !limit2 || indexOf(xs1[0], xs2) === -1) {\r\n return false;\r\n }\r\n let ind1 = limit1 - 1,\r\n ind2 = limit2 - 1;\r\n for (; ind1 >= 0; ind1--) {\r\n if (xs1[ind1] !== xs2[ind2]) {\r\n return false;\r\n }\r\n ind2 -= 1;\r\n }\r\n return true;\r\n }),\r\n\r\n /**\r\n * Checks if list `xs1` is an infix of list `xs2`\r\n * @function module:list.isInfixOf\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {boolean}\r\n */\r\n isInfixOf = curry((xs1, xs2) => {\r\n const limit1 = length(xs1),\r\n limit2 = length(xs2);\r\n if (limit2 < limit1 || !limit1 || !limit2) {\r\n return false;\r\n }\r\n let ind1,\r\n foundLen,\r\n ind = 0;\r\n for (; ind < limit2; ind += 1) {\r\n foundLen = 0;\r\n for (ind1 = 0; ind1 < limit1; ind1 += 1) {\r\n if (xs2[ind1 + ind] === xs1[ind1]) {\r\n foundLen += 1;\r\n }\r\n if (foundLen === limit1) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }),\r\n\r\n /**\r\n * Checks if list `xs1` is a sub-sequence of list `xs2`\r\n * @function module:list.isSubsequenceOf\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {boolean}\r\n */\r\n isSubsequenceOf = curry((xs1, xs2) => {\r\n const len = Math.pow(2, length(xs2)),\r\n lenXs1 = length(xs1);\r\n let foundLen,\r\n i;\r\n for (i = 0; i < len; i += 1) {\r\n foundLen = 0;\r\n for (let j = 0; j < len; j += 1) {\r\n if (i & (1 << j) && indexOf(xs2[j], xs1) > -1) {\r\n foundLen += 1;\r\n }\r\n if (foundLen === lenXs1) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }),\r\n\r\n /**\r\n * The group function takes a list and returns a list of lists such that\r\n * the concatenation of the result is equal to the argument. Moreover, each\r\n * sublist in the result contains only equal elements. For example,\r\n * `group \"Mississippi\" = [\"M\",\"i\",\"ss\",\"i\",\"ss\",\"i\",\"pp\",\"i\"]`\r\n * It is a special case of groupBy, which allows the programmer to supply\r\n * their own equality test.\r\n * @haskellType `group :: Eq a => [a] -> [[a]]`\r\n * @function module:list.group\r\n * @param xs {Array|String}\r\n * @returns {Array|*}\r\n */\r\n group = xs => groupBy((a, b) => a === b, xs),\r\n\r\n /**\r\n * Allows you to group items in a list based on your supplied equality check.\r\n * @note Sames `group` but allows you to specify equality operation.\r\n * @haskellType `groupBy :: (a -> a -> Bool) -> [a] -> [[a]]`\r\n * @function module:list.groupBy\r\n * @param equalityOp {Function}\r\n * @param xs {Array}\r\n * @returns {*}\r\n */\r\n groupBy = curry((equalityOp, xs) => {\r\n const limit = length(xs);\r\n if (!limit) {\r\n return sliceCopy(xs);\r\n }\r\n let ind = 0,\r\n prevItem,\r\n item,\r\n predOp = x => {\r\n if (equalityOp(x, prevItem)) {\r\n ind++;\r\n }\r\n if (equalityOp(x, item)) {\r\n prevItem = x;\r\n return true;\r\n }\r\n return false;\r\n },\r\n agg = [];\r\n for (; ind < limit; ind += 1) {\r\n item = xs[ind];\r\n agg.push(takeWhile(predOp, slice(ind, limit, xs)));\r\n }\r\n return agg;\r\n }),\r\n\r\n /**\r\n * The inits function returns all initial segments of the argument, shortest first. For example,\r\n * ```\r\n * shallowEquals(inits('abc'), ['','a','ab','abc'])\r\n * ```\r\n * @function module:list.inits\r\n * @haskellType `inits :: [a] -> [[a]]`\r\n * @param xs {Array}\r\n * @returns {Array}\r\n */\r\n inits = xs => {\r\n let limit = length(xs),\r\n ind = 0,\r\n agg = [];\r\n if (!limit) {\r\n return [];\r\n }\r\n for (; ind <= limit; ind += 1) {\r\n agg.push(sliceTo(ind, xs));\r\n }\r\n return agg;\r\n }, //map(list => init(list), xs),\r\n\r\n /**\r\n * The inits function returns all initial segments of the argument, shortest first. For example,\r\n * ```\r\n * shallowEquals(tails('abc'), ['abc', 'bc', 'c',''])\r\n * ```\r\n * @function module:list.tails\r\n * @haskellType `tails :: [a] -> [[a]]`\r\n * @param xs {Array}\r\n * @returns {Array}\r\n */\r\n tails = xs => {\r\n let limit = length(xs),\r\n ind = 0,\r\n agg = [];\r\n if (!limit) {\r\n return [];\r\n }\r\n for (; ind <= limit; ind += 1) {\r\n agg.push(slice(ind, limit, xs));\r\n }\r\n return agg;\r\n }, //map(list => tail(list), xs),\r\n\r\n /**\r\n * Strips prefix list from given list\r\n * @function module:list.stripPrefix\r\n * @param prefix {Array|String|*}\r\n * @param list {Array|string|*}\r\n * @returns {Array|*}\r\n */\r\n stripPrefix = curry((prefix, list) =>\r\n isPrefixOf(prefix, list) ?\r\n splitAt(length(prefix), list)[1] :\r\n sliceCopy(list)),\r\n\r\n /**\r\n * zip takes two lists and returns a list of corresponding pairs.\r\n * If one input list is short, excess elements of the longer list are discarded.\r\n * @haskellType `zip :: [a] -> [b] -> [(a, b)]`\r\n * @function module:list.zip\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @returns {Array>}\r\n */\r\n zip = curry((arr1, arr2) => {\r\n if (!length(arr1) || !length(arr2)) {\r\n return [];\r\n }\r\n const [a1, a2] = toShortest(arr1, arr2);\r\n return reduce((agg, item, ind) =>\r\n aggregateArray(agg, [item, a2[ind]]),\r\n [], a1);\r\n }),\r\n\r\n /**\r\n * zipN takes one or more lists and returns a list containing lists of all indices\r\n * at a given index, index by index.\r\n * If one input list is short, excess elements of the longer list are discarded.\r\n * @function module:list.zipN\r\n * @param lists {Array|String} - One ore more lists of the same type.\r\n * @returns {Array}\r\n */\r\n zipN = curry2((...lists) => {\r\n const trimmedLists = apply(toShortest, lists);\r\n return reduce((agg, item, ind) =>\r\n aggregateArray(agg, map(xs => xs[ind], trimmedLists)),\r\n [], trimmedLists[0]);\r\n }),\r\n\r\n /**\r\n * @haskellType `zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]`\r\n * @function module:list.zip3\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @param arr3 {Array}\r\n * @returns {Array>}\r\n */\r\n zip3 = curry((arr1, arr2, arr3) => zipN(arr1, arr2, arr3)),\r\n\r\n /**\r\n * @haskellType `zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]`\r\n * @function module:list.zip4\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @param arr3 {Array}\r\n * @param arr4 {Array}\r\n * @returns {Array>}\r\n */\r\n zip4 = curry((arr1, arr2, arr3, arr4) => zipN(arr1, arr2, arr3, arr4)),\r\n\r\n /**\r\n * @haskellType `zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]`\r\n * @function module:list.zip5\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @param arr3 {Array}\r\n * @param arr4 {Array}\r\n * @param arr5 {Array}\r\n * @returns {Array>}\r\n */\r\n zip5 = curry((arr1, arr2, arr3, arr4, arr5) => zipN(arr1, arr2, arr3, arr4, arr5)),\r\n\r\n /**\r\n * zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]\r\n * zipWith generalises zip by zipping with the function given as the\r\n * first argument, instead of a function tupling function (function that returns a tuple). For example,\r\n * zipWith (+) is applied to two lists to produce the list of corresponding sums.\r\n * @note `_|_` means bottom or perpetual (@see\r\n * - https://wiki.haskell.org/Bottom\r\n * - https://stackoverflow.com/questions/19794681/what-does-this-syntax-mean-in-haskell-or\r\n * )\r\n * @example\r\n * ```\r\n * zipWith f [] _|_ = []\r\n * ```\r\n * @haskellType `zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]`\r\n * @function module:list.zipWith\r\n * @param op {Function} - Takes two parts of a tuple and returns a tuple.\r\n * E.g., ` op :: a -> b -> (a, b)`\r\n * @param xs1 {Array}\r\n * @param xs2 {Array}\r\n * @returns {Array>}\r\n */\r\n zipWith = curry((op, xs1, xs2) => {\r\n if (!length(xs1) || !length(xs2)) {\r\n return [];\r\n }\r\n const [a1, a2] = toShortest(xs1, xs2);\r\n return reduce((agg, item, ind) =>\r\n aggregateArray(agg, op(item, a2[ind])),\r\n [], a1);\r\n }),\r\n\r\n /**\r\n * Zips all given lists with tupling function. Note: Haskell types do not have\r\n * a way (that I know of) to show one or more for params in a function so `@haskellType` below\r\n * is left there for general purpose not for exactness as is told by aforementioned.\r\n * @haskellType `zipWithN :: (a -> b -> c) -> [a] -> [b] -> [c]` - Where `N` is the number\r\n * of lists to zip.\r\n * @function module:list.zipWithN\r\n * @param op {Function} - Takes expected number of parts for tuple and returns a tuple\r\n * of said parts:\r\n * E.g., ` op :: a -> b -> c -> (a, b, c)`\r\n * @param lists ...{Array}\r\n * @returns {Array>}\r\n */\r\n zipWithN = curry3((op, ...lists) => {\r\n const trimmedLists = apply(toShortest, lists),\r\n lenOfTrimmed = length(trimmedLists);\r\n if (!lenOfTrimmed) {\r\n return [];\r\n }\r\n else if (lenOfTrimmed === 1) {\r\n return sliceTo(length(trimmedLists[0]), trimmedLists[0]);\r\n }\r\n return reduce((agg, item, ind) =>\r\n aggregateArray(agg, apply(op, map(xs => xs[ind], trimmedLists))),\r\n [], trimmedLists[0]);\r\n }),\r\n\r\n /**\r\n * Zips 3 lists with tupling function.\r\n * @haskellType `zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]`\r\n * @function module:list.zipWith3\r\n * @param op {Function} - Takes expected number of parts for tuple and returns a tuple\r\n * of said parts:\r\n * E.g., ` op :: a -> b -> c -> (a, b, c)`\r\n * @param xs1 {Array}\r\n * @param xs2 {Array}\r\n * @param xs3 {Array}\r\n * @returns {Array>}\r\n */\r\n zipWith3 = curry((op, xs1, xs2, xs3) => zipWithN(op, xs1, xs2, xs3)),\r\n\r\n /**\r\n * Zips 4 lists with tupling function.\r\n * @haskellType `zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]`\r\n * @function module:list.zipWith4\r\n * @param op {Function} - Takes expected number of parts for tuple and returns a tuple\r\n * of said parts:\r\n * E.g., ` op :: a -> b -> c -> d -> (a, b, c, d)`\r\n * @param xs1 {Array}\r\n * @param xs2 {Array}\r\n * @param xs3 {Array}\r\n * @param xs4 {Array}\r\n * @returns {Array>}\r\n */\r\n zipWith4 = curry((op, xs1, xs2, xs3, xs4) => zipWithN(op, xs1, xs2, xs3, xs4)),\r\n\r\n /**\r\n * Zips 5 lists.\r\n * @haskellType `zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]`\r\n * @function module:list.zipWith5\r\n * @param op {Function} - Takes expected number of parts for tuple and returns a tuple\r\n * of said parts:\r\n * E.g., ` op :: a -> b -> c -> d -> e -> (a, b, c, d, e)`\r\n * @param xs1 {Array}\r\n * @param xs2 {Array}\r\n * @param xs3 {Array}\r\n * @param xs4 {Array}\r\n * @param xs5 {Array}\r\n * @returns {Array>}\r\n */\r\n zipWith5 = curry((op, xs1, xs2, xs3, xs4, xs5) => zipWithN(op, xs1, xs2, xs3, xs4, xs5)),\r\n\r\n /**\r\n * unzip transforms a list of pairs into a list of first components and a list of second components.\r\n * @haskellType `unzip :: [(a, b)] -> ([a], [b])`\r\n * @function module:list.unzip\r\n * @param arr {Array|*}\r\n * @returns {Array|*}\r\n */\r\n unzip = foldl((agg, item) => {\r\n agg[0].push(item[0]);\r\n agg[1].push(item[1]);\r\n return agg;\r\n }, [[], []]),\r\n\r\n /**\r\n * unzip transforms a list of pairs into a list of first components and a list of second components.\r\n * @sudoHaskellType `unzipN :: [(a, b, ...x)] -> ([a], [b], ...[x])`\r\n * @function module:list.unzipN\r\n * @param list {Array|*} - List of tuples (lists).\r\n * @returns {Array|*}\r\n */\r\n unzipN = list => {\r\n if (!length(list)) {\r\n return [];\r\n }\r\n const lenItem0 = length(list[0]);\r\n let zero = lenItem0 ?\r\n unfoldr(numLists => numLists-- ? [[], numLists] : undefined, lenItem0) :\r\n [];\r\n return foldl((agg, item) => {\r\n agg.forEach((outList, ind) => outList.push(item[ind]));\r\n return agg;\r\n }, zero, list);\r\n },\r\n\r\n /**\r\n * Returns true if any item in container passes predicate `p`.\r\n * @function module:list.any\r\n * @param p {Function} - Predicate.\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n any = curry((p, xs) => {\r\n let ind = 0,\r\n limit = length(xs);\r\n if (!limit) {\r\n return false;\r\n }\r\n for (; ind < limit; ind += 1) {\r\n if (p(xs[ind])) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }),\r\n\r\n /**\r\n * Returns true if all items in container pass predicate `p`.\r\n * @function module:list.all\r\n * @param p {Function} - Predicate.\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n all = curry((p, xs) => {\r\n const limit = length(xs);\r\n let ind = 0;\r\n if (!limit) {\r\n return false;\r\n }\r\n for (; ind < limit; ind++) {\r\n if (!p(xs[ind], ind, xs)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }),\r\n\r\n /**\r\n * Conjuction of container of bools (or truthy and/or falsy values); Returns\r\n * `true` if all in container are 'truthy' else returns `false`\r\n * @function module:list.and\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n and = xs => all(isTruthy, xs),\r\n\r\n /**\r\n * Returns a boolean indicating whether any item in container is 'truthy' or not.\r\n * **Note** The haskell type for this function only takes two items, but here\r\n * we allow the passing of more than one item (may change later to adhere to the haskell type).\r\n * @function module:list.or\r\n * @haskellType `or :: Bool -> Bool -> Bool`\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n or = xs => any(isTruthy, xs),\r\n\r\n /**\r\n * Returns a boolean indicating whether all items in container are 'falsy' or not.\r\n * **Note** The haskell type for this function only takes two items, but here\r\n * we allow the passing of more than one item (may change later to adhere to the haskell type).\r\n * @function module:list.not\r\n * @haskellType `not :: Bool -> Bool`\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n not = xs => all(isFalsy, xs),\r\n\r\n /**\r\n * Computes the sum of the numbers of a structure.\r\n * @function module:list.sum\r\n * @haskellType `sum :: (List t, Num a) => t a -> a`\r\n * @param list {Array|String}\r\n * @returns {Number}\r\n */\r\n sum = list => foldl((agg, x) => agg + x, 0, list),\r\n\r\n /**\r\n * Computes the product of the numbers of a structure.\r\n * @function module:list.product\r\n * @haskellType `product :: (List t, Num a) => t a -> a`\r\n * @param list {Array|String}\r\n * @returns {Number}\r\n */\r\n product = list => foldl((agg, x) => agg * x, 1, list),\r\n\r\n /**\r\n * Returns the largest element in a non-empty structure of elements.\r\n * @function module:list.maximum\r\n * @haskellType `maximum :: forall a . Ord a => t a -> a`\r\n * @param list {Array|String}\r\n * @returns {*} - Whatever type the array is made of (if any).\r\n */\r\n maximum = list => last(sortBy(genericAscOrdering, list)),\r\n\r\n /**\r\n * Returns the smallest element in a non-empty structure of elements.\r\n * @function module:list.minimum\r\n * @haskellType `minimum :: forall a . Ord a => t a -> a`\r\n * @param list {Array|String}\r\n * @returns {*} - Whatever type the array is made of (if any).\r\n */\r\n minimum = list => head(sortBy(genericAscOrdering, list)),\r\n\r\n /**\r\n * scanl is similar to foldl, but returns a list of successive reduced values from the left:\r\n * ```\r\n * scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]\r\n * ```\r\n * Also note that:\r\n * ```\r\n * last (scanl f z xs) == foldl f z xs.\r\n * ```\r\n * @function module:list.scanl\r\n * @param fn {Function}\r\n * @param zero {*}\r\n * @param xs {Array}\r\n * @returns {Array|*}\r\n */\r\n scanl = curry((fn, zero, xs) => {\r\n if (!xs || !length(xs)) {\r\n return [];\r\n }\r\n const limit = length(xs);\r\n let ind = 0,\r\n result = zero,\r\n out = [];\r\n while (ind < limit) {\r\n result = fn(result, xs[ind], ind, xs);\r\n out.push(result);\r\n ind++;\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * `scanl1` is a variant of `scanl` that has no starting value argument:\r\n * `shallowCompare(scanl1(fn, [x1, x2, ...]), [x1, fn(x1, x2), ...]) // true`\r\n * @function module:list.scanl1\r\n * @param fn {Function}\r\n * @param xs {Array}\r\n * @returns {Array|*}\r\n */\r\n scanl1 = curry((fn, xs) => {\r\n if (!xs || !xs.length) {\r\n return [];\r\n }\r\n return scanl(fn, head(xs), tail(xs));\r\n }),\r\n\r\n /**\r\n * Same as `scanl` but from the right (similiar to `foldr`'s relationship to 'foldl').\r\n * Note also `scanr`'s relationship ot `foldr`:\r\n * `head (scanr(fn, z, xs)) === foldr(fn, z, xs).\r\n * @function module:list.scanr\r\n * @param fn {Function}\r\n * @param zero {*}\r\n * @param xs {Array}\r\n * @returns {Array|*}\r\n */\r\n scanr = curry((fn, zero, xs) => {\r\n if (!xs || !length(xs)) {\r\n return [];\r\n }\r\n const limit = length(xs);\r\n let ind = limit - 1,\r\n result = xs[0],\r\n out = [];\r\n while (ind > -1) {\r\n result = fn(result, xs[ind], ind, xs);\r\n out.push(result);\r\n ind--;\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Same as `scanr` but takes no zero/accumulator value.\r\n * @function module:list.scanr1\r\n * @param fn {Function}\r\n * @param xs {Array}\r\n * @returns {Array|*}\r\n */\r\n scanr1 = curry((fn, xs) => {\r\n if (!xs || !xs.length) {\r\n return [];\r\n }\r\n return scanr(fn, last(xs), init(xs));\r\n }),\r\n\r\n /**\r\n * The nub function removes duplicate elements from a list.\r\n * In particular, it keeps only the first occurrence of each element.\r\n * (The name nub means `essence'.) It is a special case of nubBy, which\r\n * allows the programmer to supply their own equality test.\r\n * ```shallowCompare( nub ([1,2,3,4,3,2,1,2,4,3,5]), [1,2,3,4,5] )```\r\n * @function module:list.nub\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n nub = list => nubBy((a, b) => a === b, list),\r\n\r\n /**\r\n * `remove(x, xs)` removes the first occurrence of `x` from `xs`.\r\n * For example, `remove('a', 'banana') === 'bnana';`\r\n * @function module:list.remove\r\n * @param x {*}\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n remove = curry((x, list) => removeBy((a, b) => a === b, x, list)),\r\n\r\n /**\r\n * The sort function implements a stable sorting algorithm.\r\n * It is a special case of sortBy, which allows the programmer\r\n * to supply their own comparison function.\r\n * ```shallowCompare(sort ([1,6,4,3,2,5]), [1,2,3,4,5,6]) // true```\r\n * @function module:list.sort\r\n * @param xs {Array|String|*}\r\n * @returns {Array}\r\n */\r\n sort = xs => sortBy(genericAscOrdering, xs),\r\n\r\n /**\r\n * Sort a list by comparing the results of a key function applied to each\r\n * element. sortOn f is equivalent to sortBy (comparing f), but has the\r\n * performance advantage of only evaluating f once for each element in the\r\n * input list. This is called the decorate-sort-undecorate paradigm, or\r\n * Schwartzian transform.\r\n *\r\n * Elements are arranged from from lowest to highest, keeping duplicates\r\n * in the order they appeared in the input.\r\n *\r\n * Ex:\r\n * ```\r\n * shallowEquals(\r\n * sortOn (head, [[2, \"world\"], [4, \"!\"], [1, \"Hello\"]]),\r\n * [[1,\"Hello\"],[2,\"world\"],[4,\"!\"]]\r\n * ) // true\r\n * ```\r\n * @function module:list.sortOn\r\n * @param valueFn {Function}\r\n * @param xs {Array|String|*}\r\n * @returns {Array}\r\n */\r\n sortOn = curry((valueFn, xs) =>\r\n\r\n // Un-decorate\r\n map(decorated => decorated[1],\r\n\r\n // Decorate and sort\r\n sortBy(\r\n // Ordering\r\n ([a0], [b0]) => genericAscOrdering(a0, b0),\r\n\r\n // Decorate\r\n map(item => [valueFn(item), item], xs)\r\n )\r\n )\r\n ),\r\n\r\n /**\r\n * The sortBy function is the non-overloaded (in haskell terms) version of sort.\r\n * @haskellExample ```\r\n * >>> sortBy (\\(a,_) (b,_) -> compare a b) [(2, \"world\"), (4, \"!\"), (1, \"Hello\")]\r\n * [(1,\"Hello\"),(2,\"world\"),(4,\"!\")]\r\n * ```\r\n * @function module:list.sortBy\r\n * @param orderingFn {Function}\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n sortBy = curry((orderingFn, xs) => sliceCopy(xs).sort(orderingFn || genericAscOrdering)),\r\n\r\n /**\r\n * The insert function takes an element and a list and inserts the element\r\n * into the list at the first position where it is less than or equal to the\r\n * next element. In particular, if the list is sorted before the call, the\r\n * result will also be sorted. It is a special case of insertBy, which allows\r\n * the programmer to supply their own comparison function.\r\n * @function module:list.insert\r\n * @param x {*}\r\n * @param xs {Array|*}\r\n * @returns {Array}\r\n */\r\n insert = curry((x, xs) => {\r\n if (!xs.length) {\r\n return of(xs, x);\r\n }\r\n const foundIndex = findIndex(item => x <= item, xs);\r\n return foundIndex === -1 ? concat([xs, of(xs, x)]) :\r\n concat(intersperse(of(xs, x), splitAt(foundIndex, xs)));\r\n }),\r\n\r\n /**\r\n * A version of `insert` that allows you to specify the ordering of the inserted\r\n * item; Before/at, or after\r\n * @function module:list.insertBy\r\n * @haskellType `insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]`\r\n * @note `Ordering` means 'something that is order-able'\r\n * operated on by this functions logic.\r\n * @param orderingFn {Function} - A function that returns `-1`, `0`, or 1`.\r\n * @param x {*} - Value to insert.\r\n * @param xs {Array} - List to insert into (note new list is returned)\r\n * @returns {Array} - New list.\r\n */\r\n insertBy = curry((orderingFn, x, xs) => {\r\n const limit = length(xs);\r\n if (!limit) {\r\n return [x];\r\n }\r\n let ind = 0;\r\n for (; ind < limit; ind += 1) {\r\n if (orderingFn(x, xs[ind]) <= 0) {\r\n const parts = splitAt(ind, xs);\r\n return concat([parts[0], [x], parts[1]]);\r\n }\r\n }\r\n return aggregateArray(sliceCopy(xs), x);\r\n }),\r\n\r\n /**\r\n * The nubBy function behaves just like nub, except it uses a user-supplied equality predicate.\r\n * @function module:list.nubBy\r\n * @param pred {Function}\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n nubBy = curry((pred, list) => {\r\n if (!length(list)) {\r\n return [];\r\n }\r\n const limit = length(list);\r\n let ind = 0,\r\n currItem,\r\n out = [],\r\n anyOp = storedItem => pred(currItem, storedItem);\r\n for (; ind < limit; ind += 1) {\r\n currItem = list[ind];\r\n if (any(anyOp, out)) {\r\n continue;\r\n }\r\n out.push(currItem);\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Behaves the same as `remove`, but takes a user-supplied equality predicate.\r\n * @function module:list.removeBy\r\n * @param pred {Function} - Equality predicate `(a, b) => bool`\r\n * @param x {*}\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n removeBy = curry((pred, x, list) => {\r\n const foundIndex = findIndex(item => pred(x, item), list);\r\n if (foundIndex > -1) {\r\n const parts = splitAt(foundIndex, list);\r\n return append(parts[0], tail(parts[1]));\r\n }\r\n return sliceCopy(list);\r\n }),\r\n\r\n /**\r\n * The `removeFirstsBy` function takes a predicate and two lists and returns the first list with the first\r\n * occurrence of each element of the second list removed.\r\n * @function module:list.removeFirstBy\r\n * @param pred {Function}\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {Array}\r\n */\r\n removeFirstsBy = curry((pred, xs1, xs2) =>\r\n foldl((agg, x) => removeBy(pred, x, agg), xs1, xs2)),\r\n\r\n /**\r\n * Returns the union on elements matching boolean check passed in.\r\n * @function module:list.unionBy\r\n * @param pred {Function} - `pred :: a -> a -> Bool`\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @returns {Array}\r\n */\r\n unionBy = curry((pred, arr1, arr2) =>\r\n foldl((agg, b) => {\r\n const alreadyAdded = any(a => pred(a, b), agg);\r\n return !alreadyAdded ? (agg.push(b), agg) : agg;\r\n }, sliceCopy(arr1), arr2\r\n )),\r\n\r\n /**\r\n * Creates a union on matching elements from array1.\r\n * @function module:list.union\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @returns {Array}\r\n */\r\n union = curry((arr1, arr2) =>\r\n append(arr1,\r\n filter(elm => !includes(elm, arr1), arr2))),\r\n\r\n /**\r\n * Performs an intersection on list 1 with elements from list 2.\r\n * @function module:list.intersect\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @returns {Array}\r\n */\r\n intersect = curry((arr1, arr2) =>\r\n !arr1 || !arr2 || (!arr1 && !arr2) ? [] :\r\n filter(elm => includes(elm, arr2), arr1)),\r\n\r\n /**\r\n * Returns an intersection by predicate.\r\n * @function module:list.intersectBy\r\n * @param pred {Function} - `pred :: a -> b -> Bool`\r\n * @param list1 {Array}\r\n * @param list2 {Array}\r\n * @return {Array}\r\n */\r\n intersectBy = curry((pred, list1, list2) =>\r\n foldl((agg, a) =>\r\n any(b => pred(a, b), list2) ? (agg.push(a), agg) : agg\r\n , [], list1)),\r\n\r\n /**\r\n * Returns the difference of list 1 from list 2.\r\n * @note The `difference` operation here is non-associative; E.g., `a - b` is not equal to `b - a`;\r\n * @function module:list.difference\r\n * @param array1 {Array}\r\n * @param array2 {Array}\r\n * @returns {Array}\r\n */\r\n difference = curry((array1, array2) => { // augment this with max length and min length ordering on op\r\n if (array1 && !array2) {\r\n return sliceCopy(array1);\r\n }\r\n else if (!array1 && array2 || (!array1 && !array2)) {\r\n return [];\r\n }\r\n return reduce((agg, elm) =>\r\n !includes(elm, array2) ? (agg.push(elm), agg) : agg\r\n , [], array1);\r\n }),\r\n\r\n /**\r\n * Returns the complement of list 0 and the reset of the passed in arrays.\r\n * @function module:list.complement\r\n * @param arr0 {Array}\r\n * @param arrays {...Array}\r\n * @returns {Array}\r\n */\r\n complement = curry2((arr0, ...arrays) =>\r\n reduce((agg, arr) => append(agg, difference(arr, arr0)), [], arrays));\r\n","/**\r\n * @module errorThrowing\r\n * @description Contains error throwing facilities for when a value doesn't match a type.\r\n */\r\nimport {typeOf} from './object/typeOf';\r\nimport {isArray, toTypeRef, toTypeRefName, isOfType} from './object/is';\r\nimport {curry} from './function/curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Pretty prints an array of types/type-strings for use by error messages;\r\n * Outputs \"`SomeTypeName`, ...\" from [SomeType, 'SomeTypeName', etc...]\r\n * @function module:errorThrowing.typeRefsToStringOrError\r\n * @param types {Array|TypesArray}\r\n * @return {String}\r\n * @private\r\n */\r\n typeRefsToStringOrError = types => types.length ?\r\n types.map(type => `\\`${toTypeRefName(type)}\\``).join(', ') : '',\r\n\r\n /**\r\n * Prints a message from an object. Object signature:\r\n * {contextName, valueName, value, expectedTypeName, foundTypeName, messageSuffix}\r\n * @function module:errorThrowing.defaultErrorMessageCall\r\n * @param tmplContext {Object|TemplateContext} - Object to use in error template.\r\n * @returns {string}\r\n * @private\r\n */\r\n defaultErrorMessageCall = tmplContext => {\r\n const {\r\n contextName, valueName, value, expectedTypeName,\r\n foundTypeName, messageSuffix\r\n } = tmplContext,\r\n isMultiTypeNames = isArray(expectedTypeName),\r\n typesCopy = isMultiTypeNames ? 'of type' : 'of one of the types',\r\n typesToMatchCopy = isMultiTypeNames ? typeRefsToStringOrError(expectedTypeName) : expectedTypeName;\r\n return (contextName ? `\\`${contextName}.` : '`') +\r\n `${valueName}\\` is not ${typesCopy}: ${typesToMatchCopy}. ` +\r\n `Type received: ${foundTypeName}. Value: ${value};` +\r\n `${messageSuffix ? ' ' + messageSuffix + ';' : ''}`;\r\n },\r\n\r\n /**\r\n * Gets the error message thrower seeded with passed in errorMessage template call.\r\n * @function module:errorThrowing.getErrorIfNotTypeThrower$\r\n * @param errorMessageCall {Function|ErrorMessageCall}\r\n * @param typeChecker {Function|TypeChecker} - Function:Boolean\r\n * @returns {Function|ErrorIfNotType}\r\n * @private\r\n */\r\n _getErrorIfNotTypeThrower = (errorMessageCall, typeChecker = isOfType) =>\r\n (ValueType, contextName, valueName, value, messageSuffix = null) => {\r\n const expectedTypeName = toTypeRef(ValueType),\r\n foundTypeName = typeOf(value);\r\n if (typeChecker(ValueType, value)) { return value; } // Value matches type\r\n throw new Error(errorMessageCall(\r\n {contextName, valueName, value, expectedTypeName, foundTypeName, messageSuffix}\r\n ));\r\n },\r\n\r\n /**\r\n * Gets the error message thrower seeded with passed in errorMessage template call.\r\n * @function module:errorThrowing.getErrorIfNotTypesThrower$\r\n * @param errorMessageCall {Function|ErrorMessageCall}\r\n * @param typeChecker {Function|TypeChecker} - Function:Boolean\r\n * @returns {Function|ErrorIfNotTypes}\r\n * @private\r\n */\r\n _getErrorIfNotTypesThrower = (errorMessageCall, typeChecker = isOfType) =>\r\n (valueTypes, contextName, valueName, value, messageSuffix = null) => {\r\n const expectedTypeNames = valueTypes.map(toTypeRef),\r\n matchFound = valueTypes.some(ValueType => typeChecker(ValueType, value)),\r\n foundTypeName = typeOf(value);\r\n if (matchFound) { return value; }\r\n throw new Error(\r\n errorMessageCall({\r\n contextName, valueName, value,\r\n expectedTypeName: expectedTypeNames, foundTypeName,\r\n messageSuffix\r\n })\r\n );\r\n },\r\n\r\n /**\r\n * Checks that passed in `value` is of given `type`. Throws an error if value\r\n * is not of given `type`. This is the un-curried version. For the curried version\r\n * see `module:errorThrowing.errorIfNotType`.\r\n * @function module:errorThrowing.errorIfNotType$\r\n * @param type {String|Function} - Type's name or type itself.\r\n * @param contextName {String} - Name of context to attribute errors if thrown.\r\n * @param valueName {String} - String rep of value.\r\n * @param value {*}\r\n * @param [messageSuffix=null] {String} - Optional.\r\n * @returns {*} - Given `value` if `value` matches passed in type.\r\n * @private\r\n */\r\n _errorIfNotType = _getErrorIfNotTypeThrower(defaultErrorMessageCall),\r\n\r\n /**\r\n * Checks that passed in `value` is of one of the given `types`. Throws an error if value\r\n * is not of one of the given `types`. This is the un-curried version. For the curried version\r\n * see `module:errorThrowing.errorIfNotTypes`.\r\n * @type {Function|module:errorThrowing.errorIfNotTypes}\r\n * @function module:errorThrowing.errorIfNotTypes$\r\n * @param types {Array} - Array of one or more types or type names themselves.\r\n * @param contextName {String} - Name of context to attribute errors if thrown.\r\n * @param valueName {String} - String rep of value.\r\n * @param value {*}\r\n * @returns {*} - Given `value` if `value` matches passed in type.\r\n * @private\r\n */\r\n _errorIfNotTypes = _getErrorIfNotTypesThrower(defaultErrorMessageCall),\r\n\r\n /**\r\n * Returns a function that can be used to ensure that values are of a given type.\r\n * Also throws informative error messages containing the value types, names, expected type names,\r\n * etc.\r\n * @function module:errorThrowing.getErrorIfNotTypeThrower\r\n * @param errorMessageCall {Function|ErrorMessageCall} - Template function (takes an info-object and returns a printed string).\r\n * @returns {Function|ErrorIfNotType} - Returns a function with the same signature as `errorIfNotType` though curried.\r\n */\r\n getErrorIfNotTypeThrower = errorMessageCall => curry(_getErrorIfNotTypeThrower(errorMessageCall)),\r\n\r\n /**\r\n * Returns a function that can be used to ensure that a value is of one or more given types.\r\n * The returned function is used in cases where informative error messages\r\n * containing the value types, names, expected type names, are-required/should-be-used etc.\r\n * @function module:errorThrowing.getErrorIfNotTypesThrower\r\n * @param errorMessageCall {Function|ErrorMessageCall} - Template function (takes an info-object and returns a printed string).\r\n * @returns {Function|ErrorIfNotTypes} - Returns a function with the same signature as `errorIfNotTypes` though curried.\r\n */\r\n getErrorIfNotTypesThrower = errorMessageCall => curry(_getErrorIfNotTypesThrower(errorMessageCall)),\r\n\r\n /**\r\n * Checks that passed in `value` is of given `type`. Throws an error if value\r\n * is not of given `type`. Curried.\r\n * @function module:errorThrowing.errorIfNotType\r\n * @param type {String|Function} - Type's name or type itself.\r\n * @param contextName {String} - Name of context to attribute errors if thrown.\r\n * @param valueName {String} - String rep of value.\r\n * @param value {*}\r\n * @param [messageSuffix=null] {String} - Optional.\r\n * @returns {*} - Given `value` if `value` matches passed in type.\r\n * @curried\r\n */\r\n errorIfNotType = curry(_errorIfNotType),\r\n\r\n /**\r\n * Checks that passed in `value` is of one of the given `types`. Throws an error if value\r\n * is not of one of the given `types`. Curried.\r\n * @function module:errorThrowing.errorIfNotTypes\r\n * @param types {Array} - Array of one or more types or type names themselves.\r\n * @param contextName {String} - Name of context to attribute errors if thrown.\r\n * @param valueName {String} - String rep of value.\r\n * @param value {*}\r\n * @returns {*} - Given `value` if `value` matches passed in type.\r\n * @curried\r\n */\r\n errorIfNotTypes = curry(_errorIfNotTypes)\r\n;\r\n\r\n/**\r\n * @typedef {*} Any - Synonym for 'any value'.\r\n */\r\n\r\n/**\r\n * @typedef {String|Function} TypeRef\r\n * @description Type reference. Type itself or Type's name; E.g., `Type.name`;\r\n */\r\n\r\n/**\r\n * @typedef {Object} TemplateContext\r\n * @description Template context used for error message renderers (functions that take a context obj and return a string).\r\n * @property value {*}\r\n * @property valueName {String}\r\n * @property expectedTypeName {String} - Expected name of constructor of `value`; E.g., usually `SomeConstructor.name`;\r\n * @property foundTypeName {String} - Found types name; E.g., `FoundConstructor.name`;\r\n * @property [messageSuffix=null] {*} - Message suffix (sometimes an extra hint or instructions for\r\n * directing user to fix where his/her error has occurred). Optional.\r\n */\r\n\r\n/**\r\n * @typedef {Array<(String|Function)>} TypesArray\r\n */\r\n\r\n/**\r\n * @typedef {Function} TypeChecker\r\n * @description Checks whether a value is of given type.\r\n * @param Type {TypeRef} - a Type or it's name; E.g., `Type.name`.\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n\r\n/**\r\n * @typedef {Function} ErrorMessageCall\r\n * @description Error message template function.\r\n * @param tmplContext {TemplateContext}\r\n * @returns {String}\r\n */\r\n\r\n/**\r\n * @typedef {Function} ErrorIfNotType\r\n * @description Used to ensure value matches passed in type.\r\n * @param type {TypeRef} - Constructor name or constructor.\r\n * @param contextName {String}\r\n * @param valueName {String}\r\n * @param value {*}\r\n * @throws {Error} - If value doesn't match type.\r\n * @returns {*} - What ever value is.\r\n */\r\n\r\n/**\r\n * @typedef {Function} ErrorIfNotTypes\r\n * @description Used to ensure a value matches one of one or more types passed in.\r\n * @param valueTypes {TypesArray} - Array of constructor names or constructors.\r\n * @param contextName {String}\r\n * @param valueName {String}\r\n * @param value {*}\r\n * @throws {Error} - If value doesn't match type.\r\n * @returns {*} - Whatever value is.\r\n */\r\n","/**\r\n * @module string\r\n * @description Contains functions for strings.\r\n */\r\nimport {intercalate, map, filter} from './list';\r\nimport {split} from './jsPlatform/string';\r\nimport {compose} from './function/compose';\r\nimport {join} from './jsPlatform/array';\r\nimport {_errorIfNotType} from './errorThrowing';\r\n\r\nexport {split};\r\n\r\nexport const\r\n\r\n /**\r\n * Splits a string on all '\\n', '\\r', '\\n\\r', or '\\r\\n' characters.\r\n * @function module:string.lines\r\n * @param str {String}\r\n * @returns {Array}\r\n */\r\n lines = split(/[\\n\\r]/gm),\r\n\r\n /**\r\n * Splits a string on all '\\s' and/or all '\\t' characters.\r\n * @function module:string.words\r\n * @param str{String}\r\n * @returns {Array}\r\n */\r\n words = split(/[\\s\\t]/gm),\r\n\r\n /**\r\n * Intersperse an array of strings with '\\s' and then concats them.\r\n * @function module:string.unwords\r\n * @param arr {String}\r\n * @returns {Array}\r\n */\r\n unwords = intercalate(' '),\r\n\r\n /**\r\n * Intersperses a '\\n' character into a list of strings and then concats it.\r\n * @function module:string.unlines\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n unlines = intercalate('\\n'),\r\n\r\n /**\r\n * Lower cases first character of a non-empty string.\r\n * @function module:string.lcaseFirst\r\n * @param xs {String}\r\n * @returns {string}\r\n * @throws {Error} - Throws error if receiving anything that is not a string.\r\n */\r\n lcaseFirst = xs => {\r\n _errorIfNotType(String, 'lcaseFirst', 'xs', xs);\r\n return xs[0].toLowerCase() + xs.substring(1);\r\n },\r\n\r\n /**\r\n * Upper cases first character of a non-empty string.\r\n * @function module:string.ucaseFirst\r\n * @param xs {String}\r\n * @returns {string}\r\n * @throws {Error} - Throws error if receiving anything that is not a string.\r\n */\r\n ucaseFirst = xs => {\r\n _errorIfNotType(String, 'ucaseFirst', 'xs', xs);\r\n return xs[0].toUpperCase() + xs.substring(1);\r\n },\r\n\r\n /**\r\n * Camel cases (class case) a string.\r\n * @function module:string.camelCase\r\n * @param xs {String}\r\n * @param [pattern=/[^a-z\\d/i]/] {RegExp} - Pattern to split on. Optional.\r\n * @throws {Error} - Throws error if param `xs` is not a string.\r\n * @returns {string}\r\n * @curried\r\n */\r\n camelCase = (xs, pattern = /[^a-z\\d]/i) => compose(\r\n join(''),\r\n map(str => ucaseFirst(str.toLowerCase())),\r\n filter(x => !!x),\r\n split(pattern)\r\n )(_errorIfNotType(String, 'camelCase', 'xs', xs)),\r\n\r\n /**\r\n * Class cases a string. Uses pattern /[^a-z\\d/i]/ to split on.\r\n * If you require a different pattern use `string.camelCase(str, pattern)`\r\n * and then upper case first character (`ucaseFirst`).\r\n * @function module:string.classCase\r\n * @param xs {String}\r\n * @returns {string}\r\n * @throws {Error} - Throws error if `xs` is not a string (via `camelCase` call).\r\n */\r\n classCase = compose(ucaseFirst, camelCase)\r\n\r\n;\r\n\r\n/**\r\n * Functional version of `String.prototype.split`.\r\n * @function module:string.split\r\n * @param separator {String|RegExp}\r\n * @param str {String}\r\n * @returns {Array}\r\n */\r\n","/**\r\n * @module fjl\r\n * @description Exports all module methods (object, list, string modules etc.).\r\n * @goal to include everything from haskell's Prelude where it makes sense in order to create\r\n * a subset of functions which can make the javascript developer more efficient and make his/her\r\n * code more concise (and functional).\r\n * @motivation preludejs, lodash/fp, RamdaJs, Haskell.\r\n * @see http://hackage.haskell.org/package/base-4.10.0.0/docs/Prelude.html\r\n * @see http://hackage.haskell.org/package/base-4.10.0.0/docs/Data-List.html\r\n */\r\nexport * from './object';\r\nexport * from './boolean';\r\nexport * from './function';\r\nexport * from './list';\r\nexport * from './string';\r\nexport * from './utils';\r\nexport * from './errorThrowing';\r\n\r\n/**\r\n * @typedef {String|Function|ArrayBufferConstructor|ArrayConstructor|BooleanConstructor|MapConstructor|NumberConstructor|SetConstructor|WeakMapConstructor|WeakSetConstructor} TypeRef\r\n * @description Type reference. Either actual type or type's name; E.g., `Type.name`\r\n * Also note: Class cased names are use for values that do not have `name` properties; Namely: 'Null', 'NaN' and 'Undefined' (for their respective values respectively).\r\n */\r\n"],"names":["returnCurried","executeArity","unmetArityNum","fn","argsToCurry","func","x","executeAsCurriedFunc","Array","from","arguments","a","b","c","d","e","args","unmetArity","concatedArgs","concat","canBeCalled","length","newExpectedArity","curryN","Function","Error","curry","curry2","curry3","curry4","curry5","fPureTakesOne","name","arg","f","fPureTakes2","arg1","arg2","fPureTakes3","arg3","fPureTakes4","arg4","fPureTakes5","arg5","fPureTakesOneOrMore","defineReverse","prototype","reverse","reduceRight","agg","item","push","map","filter","reduce","forEach","some","every","join","apply","call","flipN","flip","flip3","flip4","flip5","instanceOf","instanceConstructor","instance","hasOwnProperty","native","Object","getOwnPropertyNames","key","operation","keys","assign","obj0","objs","topAgg","obj","_Number","Number","_NaN","_Null","_Undefined","typeOf","value","retVal","undefined","constructorName","constructor","isNaN","_String","String","_Object","_Boolean","Boolean","_Function","_Array","_Symbol","_Map","_Set","_WeakMap","_WeakSet","toTypeRef","type","toTypeRefs","types","toTypeRefName","Type","ref","toTypeRefNames","isFunction","isType","isOfType","isClass","test","substr","isCallable","isArray","isObject","isBoolean","isNumber","isString","isMap","isSet","isWeakMap","isWeakSet","isUndefined","isNull","isSymbol","isUsableImmutablePrimitive","typeOfX","isset","isEmptyList","isEmptyObject","isEmptyCollection","size","isEmpty","isOneOf","typeName","isFunctor","lookup","of","copy","out","slice","Symbol","Promise","searchObj","nsString","indexOf","parts","split","limit","ind","parent","node","assignDeep","propDescription","getOwnPropertyDescriptor","get","set","writable","includes","xs","lastIndexOf","isTruthy","isFalsy","alwaysTrue","alwaysFalse","equal","equalAll","i","aggregateArray","sliceFrom","startInd","sliceTo","toInd","sliceCopy","genericAscOrdering","lengths","lists","toShortest","listLengths","smallLen","Math","min","list","reduceUntil","pred","op","result","reduceUntilRight","arr","lastIndex","len","findIndexWhere","predicateFulfilled","findIndexWhereRight","findIndicesWhere","findWhere","elm","objUnion","obj1","obj2","objIntersect","objDifference","objComplement","log","console","bind","error","peek","pop","jsonClone","JSON","parse","stringify","toAssocList","toAssocListDeep","TypeConstraint","fromAssocList","OutType","fromAssocListDeep","toArray","compose","arg0","id","negateF","negateF2","negateF3","negateFN","until","predicate","typeInstance","fnOrError","symbolName","noop","normalizeStep","to","step","range","append","listAppend","head","last","tail","init","uncons","unconsr","item0","concatMap","foldableOfA","intersperse","between","lastInd","intercalate","xss","transpose","numLists","ind2","longestListLen","maximum","outLists","outList","subsequences","listLen","pow","entry","j","swapped","ind1","tmp","permutations","repeat","foldl","foldr","foldl1","foldr1","mapAccumL","zero","mapped","tuple","mapAccumR","iterate","lastX","replicate","cycle","unfoldr","resultTuple","findIndex","findIndices","elemIndex","foundInd","elemIndices","take","drop","splitAt","takeWhile","dropWhile","splitPoint","dropWhileEnd","span","breakOnList","at","find","partition","elem","notElem","isPrefixOf","xs1","xs2","limit1","limit2","isSuffixOf","isInfixOf","foundLen","isSubsequenceOf","lenXs1","group","groupBy","equalityOp","prevItem","predOp","inits","tails","stripPrefix","prefix","zip","arr1","arr2","a1","a2","zipN","trimmedLists","zip3","arr3","zip4","arr4","zip5","arr5","zipWith","zipWithN","lenOfTrimmed","zipWith3","xs3","zipWith4","xs4","zipWith5","xs5","unzip","unzipN","lenItem0","any","p","all","and","or","not","sum","product","sortBy","minimum","scanl","scanl1","scanr","scanr1","nub","nubBy","remove","removeBy","sort","sortOn","valueFn","decorated","a0","b0","orderingFn","insert","foundIndex","insertBy","currItem","anyOp","storedItem","removeFirstsBy","unionBy","alreadyAdded","union","intersect","intersectBy","list1","list2","difference","array1","array2","complement","arr0","arrays","typeRefsToStringOrError","defaultErrorMessageCall","tmplContext","contextName","valueName","expectedTypeName","foundTypeName","messageSuffix","isMultiTypeNames","typesCopy","typesToMatchCopy","_getErrorIfNotTypeThrower","errorMessageCall","typeChecker","ValueType","_getErrorIfNotTypesThrower","valueTypes","expectedTypeNames","matchFound","_errorIfNotType","_errorIfNotTypes","getErrorIfNotTypeThrower","getErrorIfNotTypesThrower","errorIfNotType","errorIfNotTypes","lines","words","unwords","unlines","lcaseFirst","toLowerCase","substring","ucaseFirst","toUpperCase","camelCase","pattern","str","classCase"],"mappings":"AAAA;;;;;;;;;;;AAWA,MAWIA,aAAa,GAAG,CAACC,YAAD,EAAeC,aAAf,EAA8BC,EAA9B,EAAkCC,WAAlC,KAAkD;UACtDF,aAAR;SACS,CAAL;;aAEW,SAASG,IAAT,CAAcC,CAAd,EAAiB;;eAEbC,oBAAoB,CAACJ,EAAD,EAAKF,YAAL,EAAmBC,aAAnB,EAAkCM,KAAK,CAACC,IAAN,CAAWC,SAAX,CAAlC,EAAyDN,WAAzD,CAA3B;OAFJ;;SAIC,CAAL;;aAEW,SAASC,IAAT,CAAcM,CAAd,EAAiBC,CAAjB,EAAoB;;eAEhBL,oBAAoB,CAACJ,EAAD,EAAKF,YAAL,EAAmBC,aAAnB,EAAkCM,KAAK,CAACC,IAAN,CAAWC,SAAX,CAAlC,EAAyDN,WAAzD,CAA3B;OAFJ;;SAIC,CAAL;;aAEW,SAASC,IAAT,CAAcM,CAAd,EAAiBC,CAAjB,EAAoBC,CAApB,EAAuB;;eAEnBN,oBAAoB,CAACJ,EAAD,EAAKF,YAAL,EAAmBC,aAAnB,EAAkCM,KAAK,CAACC,IAAN,CAAWC,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AF,CAAMwQ,WAAN,KAAsBxQ,EAAE,CAACyQ,SAAH,CAAa,CAAb,CAA7B;CA3CD;MAqDHC,UAAU,GAAG1Q,EAAE,IAAI;EACf6P,eAAe,CAACrU,MAAD,EAAS,YAAT,EAAuB,IAAvB,EAA6BwE,EAA7B,CAAf;;SACOA,EAAE,CAAC,CAAD,CAAF,CAAM2Q,WAAN,KAAsB3Q,EAAE,CAACyQ,SAAH,CAAa,CAAb,CAA7B;CAvDD;MAmEHG,SAAS,GAAG,CAAC5Q,EAAD,EAAK6Q,OAAO,GAAG,WAAf,KAA+BhN,OAAO,CAC1CzK,IAAI,CAAC,EAAD,CADsC,EAE1CN,KAAG,CAACgY,GAAG,IAAIJ,UAAU,CAACI,GAAG,CAACN,WAAJ,EAAD,CAAlB,CAFuC,EAG1CzX,QAAM,CAAC/C,CAAC,IAAI,CAAC,CAACA,CAAR,CAHoC,EAI1CoJ,KAAK,CAACyR,OAAD,CAJqC,CAAP,CAKrChB,eAAe,CAACrU,MAAD,EAAS,WAAT,EAAsB,IAAtB,EAA4BwE,EAA5B,CALsB,CAnExC;MAmFH+Q,SAAS,GAAGlN,OAAO,CAAC6M,UAAD,EAAaE,SAAb,CAnFhB;;;;;;;;;ACZP;;;;;;;;;;AAUA;;;;;;;;;"} \ No newline at end of file diff --git a/dist/es6-module/fjl.mjs b/dist/es6-module/fjl.mjs index a8033217..814d58e3 100644 --- a/dist/es6-module/fjl.mjs +++ b/dist/es6-module/fjl.mjs @@ -1676,5 +1676,11 @@ const classCase = compose(ucaseFirst, camelCase); * @see http://hackage.haskell.org/package/base-4.10.0.0/docs/Data-List.html */ +/** + * @typedef {String|Function|ArrayBufferConstructor|ArrayConstructor|BooleanConstructor|MapConstructor|NumberConstructor|SetConstructor|WeakMapConstructor|WeakSetConstructor} TypeRef + * @description Type reference. Either actual type or type's name; E.g., `Type.name` + * Also note: Class cased names are use for values that do not have `name` properties; Namely: 'Null', 'NaN' and 'Undefined' (for their respective values respectively). + */ + export { instanceOf, hasOwnProperty, length, native, keys, assign, lookup, typeOf, copy, toTypeRef, toTypeRefs, toTypeRefName, toTypeRefNames, isFunction, isType, isOfType, isClass, isCallable, isArray, isObject, isBoolean, isNumber, isString, isMap, isSet, isWeakMap, isWeakSet, isUndefined, isNull, isSymbol, isUsableImmutablePrimitive, isEmptyList, isEmptyObject, isEmptyCollection, isEmpty, isset, isOneOf, isFunctor, of, searchObj, assignDeep, objUnion, objIntersect, objDifference, objComplement, log, error, peek, jsonClone, toArray, toAssocList, toAssocListDeep, fromAssocList, fromAssocListDeep, isTruthy, isFalsy, alwaysTrue, alwaysFalse, equal, equalAll, apply, call, compose, curryN, curry, curry2, curry3, curry4, curry5, flipN, flip, flip3, flip4, flip5, id, negateF, negateF2, negateF3, negateFN, until, fnOrError, noop, map$1 as map, append, head, last, tail, init, uncons, unconsr, concat$1 as concat, concatMap, reverse$1 as reverse, intersperse, intercalate, transpose, subsequences, swapped, permutations, foldl, foldr, foldl1, foldr1, mapAccumL, mapAccumR, iterate, repeat, replicate, cycle, unfoldr, findIndex, findIndices, elemIndex, elemIndices, take, drop, splitAt, takeWhile, dropWhile, dropWhileEnd, span, breakOnList, at, find, forEach$1 as forEach, filter$1 as filter, partition, elem, notElem, isPrefixOf, isSuffixOf, isInfixOf, isSubsequenceOf, group, groupBy, inits, tails, stripPrefix, zip, zipN, zip3, zip4, zip5, zipWith, zipWithN, zipWith3, zipWith4, zipWith5, unzip, unzipN, any, all, and, or, not, sum, product, maximum, minimum, scanl, scanl1, scanr, scanr1, nub, remove, sort, sortOn, sortBy, insert, insertBy, nubBy, removeBy, removeFirstsBy, unionBy, union, intersect, intersectBy, difference, complement, slice, includes, indexOf, lastIndexOf, push, range, sliceFrom, sliceTo, sliceCopy, genericAscOrdering, lengths, toShortest, reduceUntil, reduceUntilRight, reduce$1 as reduce, reduceRight$1 as reduceRight, lastIndex, findIndexWhere, findIndexWhereRight, findIndicesWhere, findWhere, aggregateArray, split, lines, words, unwords, unlines, lcaseFirst, ucaseFirst, camelCase, classCase, fPureTakesOne, fPureTakes2, fPureTakes3, fPureTakes4, fPureTakes5, fPureTakesOneOrMore, typeRefsToStringOrError, defaultErrorMessageCall, _getErrorIfNotTypeThrower, _getErrorIfNotTypesThrower, _errorIfNotType, _errorIfNotTypes, getErrorIfNotTypeThrower, getErrorIfNotTypesThrower, errorIfNotType, errorIfNotTypes }; //# sourceMappingURL=fjl.mjs.map diff --git a/dist/es6-module/fjl.mjs.map b/dist/es6-module/fjl.mjs.map index d4256b31..36b2eb32 100644 --- a/dist/es6-module/fjl.mjs.map +++ b/dist/es6-module/fjl.mjs.map @@ -1 +1 @@ -{"version":3,"file":"fjl.mjs","sources":["../../src/function/curry.js","../../src/utils.js","../../src/jsPlatform/array.js","../../src/jsPlatform/function.js","../../src/function/flip.js","../../src/jsPlatform/object.js","../../src/object/typeOf.js","../../src/object/is.js","../../src/object/lookup.js","../../src/object/of.js","../../src/object/copy.js","../../src/object/searchObj.js","../../src/object/assignDeep.js","../../src/jsPlatform/list.js","../../src/boolean.js","../../src/list/map.js","../../src/list/aggregation.js","../../src/list/utils.js","../../src/object/setTheory.js","../../src/object/console.js","../../src/object/jsonClone.js","../../src/object/assocList.js","../../src/object/toArray.js","../../src/object.js","../../src/function/compose.js","../../src/function/id.js","../../src/function/negate.js","../../src/function/until.js","../../src/function/fnOrError.js","../../src/function/noop.js","../../src/function.js","../../src/list/range.js","../../src/jsPlatform/string.js","../../src/jsPlatform.js","../../src/list.js","../../src/errorThrowing.js","../../src/string.js","../../src/fjl.js"],"sourcesContent":["/**\r\n * @author elydelacruz\r\n * @created 12/6/2016.\r\n * @memberOf function\r\n * @description \"Curry strict\" and \"curry arbitrarily\" functions (`curry`, `curryN`).\r\n */\r\n\r\n/**\r\n * @private\r\n * @type {string}\r\n */\r\nconst\r\n\r\n /**\r\n * Returns curried function.\r\n * @private\r\n * @param executeArity {Number}\r\n * @param unmetArityNum {Number}\r\n * @param fn {Function}\r\n * @param argsToCurry {...*}\r\n * @returns {Function} - Curried function.\r\n */\r\n returnCurried = (executeArity, unmetArityNum, fn, argsToCurry) => {\r\n switch (unmetArityNum) {\r\n case 1:\r\n /* eslint-disable */\r\n return function func(x) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n case 2:\r\n /* eslint-disable */\r\n return function func(a, b) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n case 3:\r\n /* eslint-disable */\r\n return function func(a, b, c) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n case 4:\r\n /* eslint-disable */\r\n return function func(a, b, c, d) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n case 5:\r\n /* eslint-disable */\r\n return function func(a, b, c, d, e) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n default:\r\n return (...args) => executeAsCurriedFunc(fn, executeArity, unmetArityNum, args, argsToCurry);\r\n }\r\n },\r\n\r\n /**\r\n * Returns curried function if unmetArity is not met else returns result of executing\r\n * final function.\r\n * @private\r\n * @param fn {Function}\r\n * @param executeArity {Number}\r\n * @param unmetArity {Number}\r\n * @param args {Array<*>}\r\n * @param argsToCurry {Array<*>}\r\n * @returns {Function|*} - Curried function or result of 'finally' executed function.\r\n */\r\n executeAsCurriedFunc = (fn, executeArity, unmetArity, args, argsToCurry) => {\r\n let concatedArgs = argsToCurry.concat(args),\r\n canBeCalled = (concatedArgs.length >= executeArity) || !executeArity,\r\n newExpectedArity = executeArity - concatedArgs.length;\r\n return !canBeCalled ?\r\n returnCurried(executeArity, newExpectedArity, fn, concatedArgs) :\r\n fn(...concatedArgs);\r\n }\r\n;\r\n\r\nexport const\r\n\r\n /**\r\n * Curries a function up to a given arity.\r\n * @function module:function.curryN\r\n * @param executeArity {Number}\r\n * @param fn {Function}\r\n * @param argsToCurry {...*}\r\n * @returns {Function}\r\n * @throws {Error} - When `fn` is not a function.\r\n */\r\n curryN = (executeArity, fn, ...argsToCurry) => {\r\n if (!fn || !(fn instanceof Function)) {\r\n throw new Error(`\\`curry*\\` functions expect first parameter to be of type \\`Function\\` though received ${fn}?`);\r\n }\r\n return returnCurried(executeArity, executeArity - argsToCurry.length, fn, argsToCurry);\r\n },\r\n\r\n /**\r\n * Curries a function based on it's defined arity (note: rest args param (`...rest`) are not counted in arity).\r\n * @function module:function.curry\r\n * @param fn {Function}\r\n * @param argsToCurry {...*}\r\n * @returns {Function}\r\n */\r\n curry = (fn, ...argsToCurry) => curryN((fn || {}).length, fn, ...argsToCurry),\r\n\r\n /**\r\n * Curries a function up to an arity of 2 (won't call function until 2 or more args).\r\n * @function module:function.curry2\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n curry2 = fn => curryN(2, fn),\r\n\r\n /**\r\n * Curries a function up to an arity of 3 (won't call function until 3 or more args).\r\n * @function module:function.curry3\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n curry3 = fn => curryN(3, fn),\r\n\r\n /**\r\n * Curries a function up to an arity of 4 (won't call function until 4 or more args).\r\n * @function module:function.curry4\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n curry4 = fn => curryN(4, fn),\r\n\r\n /**\r\n * Curries a function up to an arity of 5 (won't call function until 5 or more args).\r\n * @function module:function.curry5\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n curry5 = fn => curryN(5, fn);\r\n","/**\r\n * @module utils\r\n */\r\nimport {curry, curry2} from './function/curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns a function that takes an argument and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakesOne\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakesOne = name => curry((arg, f) => f[name](arg)),\r\n\r\n /**\r\n * Returns a function that takes 2 arguments and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakes2\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakes2 = name => curry((arg1, arg2, f) => f[name](arg1, arg2)),\r\n\r\n /**\r\n * Returns a function that takes 3 arguments and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakes3\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakes3 = name => curry((arg1, arg2, arg3, f) => f[name](arg1, arg2, arg3)),\r\n\r\n /**\r\n * Returns a function that takes 4 arguments and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakes4\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakes4 = name => curry((arg1, arg2, arg3, arg4, f) => f[name](arg1, arg2, arg3, arg4)),\r\n\r\n /**\r\n * Returns a function that takes 5 arguments and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakes5\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakes5 = name => curry((arg1, arg2, arg3, arg4, arg5, f) => f[name](arg1, arg2, arg3, arg4, arg5)),\r\n\r\n /**\r\n * Returns a function that takes an object and one or more arguments on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakesOneOrMore\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakesOneOrMore = name => curry2((f, ...args) => f[name](...args))\r\n\r\n;\r\n","/**\r\n * Created by elyde on 7/20/2017.\r\n * Functional versions of common array methods (`map`, `filter`, etc.) (un-curried);\r\n * @module _jsPlatform_arrayOps\r\n * @private\r\n */\r\n\r\nimport {fPureTakesOne, fPureTakes2, fPureTakesOneOrMore} from '../utils';\r\n\r\nexport const\r\n\r\n /**\r\n * Array.prototype.reverse generator (generates a function that calls the prototype version or a\r\n * shimmed version if it doesn't exist).\r\n * @returns {Function}\r\n */\r\n defineReverse = () =>\r\n Array.prototype.reverse ? x => x.reverse() :\r\n x => x.reduceRight((agg, item) => {\r\n agg.push(item);\r\n return agg;\r\n }, []),\r\n\r\n /**\r\n * Maps a function to functor (list etc.).\r\n * @function module:_jsPlatform_array.map\r\n * @param fn {Function}\r\n * @param functor {Array|{map: {Function}}}\r\n * @returns {Array|{map: {Function}}}\r\n */\r\n map = fPureTakesOne('map'),\r\n\r\n /**\r\n * Filters a functor (list etc.) with passed in function.\r\n * @function module:_jsPlatform_array.filter\r\n * @param fn {Function}\r\n * @param functor {Array|{filter: {Function}}}\r\n * @returns {Array|{filter: {Function}}}\r\n */\r\n filter = fPureTakesOne('filter'),\r\n\r\n /**\r\n * Reduces a foldable (list etc.) with passed in function.\r\n * @function module:_jsPlatform_array.reduce\r\n * @param fn {Function}\r\n * @param functor {Array|{reduce: {Function}}}\r\n * @returns {Array|{reduce: {Function}}}\r\n */\r\n reduce = fPureTakes2('reduce'),\r\n\r\n /**\r\n * Reduces a foldable (list etc.) from the right with passed in function.\r\n * @function module:_jsPlatform_array.reduceRight\r\n * @param fn {Function}\r\n * @param functor {Array|{reduceRight: {Function}}}\r\n * @returns {Array|{reduceRight: {Function}}}\r\n */\r\n reduceRight = fPureTakes2('reduceRight'),\r\n\r\n /**\r\n * For each on functor (Array|Object|etc.).\r\n * @param fn {Function}\r\n * @param functor {Array|Object|*}\r\n * @return {*|Array|Object} - The type of object you pass in unless it doesn't have a `forEach` method.\r\n * @throws {Error} - When passed in functor doesn't have a `forEach` method.\r\n */\r\n forEach = fPureTakesOne('forEach'),\r\n\r\n /**\r\n * Returns `true` if `fn` (predicate) returns true for at least one item\r\n * in functor else returns `false`.\r\n * @param fn {Function} - Predicate.\r\n * @param functor {Array|Object|*}\r\n * @return {*|Array|Object} - The type passed.\r\n * @throws {Error} - When passed in object doesn't have a `some` method.\r\n */\r\n some = fPureTakesOne('some'),\r\n\r\n /**\r\n * Returns `true` if `fn` (predicate) returns true for all items in functor else returns `false`.\r\n * @param fn {Function} - Predicate.\r\n * @param functor {Array|Object|*}\r\n * @return {*|Array|Object} - The type passed.\r\n * @throws {Error} - When passed in object doesn't have an `every` method.\r\n */\r\n every = fPureTakesOne('every'),\r\n\r\n /**\r\n * Array.prototype.join\r\n * @function module:listPrelude.join\r\n * @param separator {String|RegExp}\r\n * @param arr {Array}\r\n * @returns {String}\r\n */\r\n join = fPureTakesOne('join'),\r\n\r\n /**\r\n * Same as Array.prototype.push\r\n * @param item {*}\r\n * @param arr {Array}\r\n * @returns {Number}\r\n */\r\n push = fPureTakesOneOrMore('push'),\r\n\r\n /**\r\n * Reverses an list (shimmed if not exists).\r\n * @function module:listPrelude.reverse\r\n * @return {Array}\r\n */\r\n reverse = defineReverse();\r\n","import {curry, curry2} from '../function/curry';\r\n\r\n/**\r\n * Created by elydelacruz on 9/7/2017.\r\n * @memberOf function\r\n */\r\nexport const\r\n\r\n /**\r\n * Functional `apply` function (takes no context).\r\n * @function module:function.apply\r\n * @param fn {Function}\r\n * @param args {Array|*}\r\n * @returns {*}\r\n */\r\n apply = curry((fn, args) => fn.apply(null, args)),\r\n\r\n /**\r\n * Functional `call` function (takes no context).\r\n * @function module:function.call\r\n * @param fn {Function}\r\n * @param args {...*}\r\n * @returns {*}\r\n */\r\n call = curry2((fn, ...args) => fn.call(null, ...args));\r\n","import {reverse} from '../jsPlatform/array';\r\nimport {apply, call} from '../jsPlatform/function';\r\nimport {curry, curry2} from './curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns a curried function requiring given functions arguments in reverse\r\n * (returned function expects 2 or more variables (curried at 2 or more args)).\r\n * @function module:function.flipN\r\n * @param fn {Function}\r\n * @returns {Function}\r\n * @curried\r\n */\r\n flipN = fn => curry2((...args) => apply(fn, reverse(args))),\r\n\r\n /**\r\n * Flips a function's first and second arguments and and returns a new function requiring said arguments in reverse.\r\n * @function module:function.flip\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n flip = fn => curry((b, a) => call(fn, a, b)),\r\n\r\n /**\r\n * Same as `flip` except returns a flipped function of arity 3.\r\n * @function module:function.flip3\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n flip3 = fn => curry((c, b, a) => call(fn, a, b, c)),\r\n\r\n /**\r\n * Same as `flip` except returns a flipped function of arity 4.\r\n * @function module:function.flip4\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n flip4 = fn => curry((d, c, b, a) => call(fn, a, b, c, d)),\r\n\r\n /**\r\n * Same as `flip` except returns a flipped function of arity 5.\r\n * @function module:function.flip5\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n flip5 = fn => curry((e, d, c, b, a) => call(fn, a, b, c, d, e));\r\n","/**\r\n * @memberOf object\r\n * @description Defines some of the platform methods for objects (the ones used within `fjl`).\r\n */\r\n\r\nimport {fPureTakesOne} from '../utils';\r\nimport {curry, curry2} from '../function/curry';\r\nimport {flip, flip3, flip4, flip5} from '../function/flip';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns whether constructor has derived object.\r\n * @function module:object.instanceOf\r\n * @param instanceConstructor {Function} - Constructor.\r\n * @param instance {*}\r\n * @instance {*}\r\n * @returns {Boolean}\r\n */\r\n instanceOf = curry((instanceConstructor, instance) =>\r\n instance instanceof instanceConstructor),\r\n\r\n /**\r\n * @function module:object.hasOwnProperty\r\n * @param propName {*}\r\n * @param typeInstance {*}\r\n * @returns {Boolean}\r\n * @deprecated - Use property directly instead.\r\n */\r\n hasOwnProperty = fPureTakesOne('hasOwnProperty'),\r\n\r\n /**\r\n * @function module:object.length\r\n * @param x {*}\r\n * @returns {Number}\r\n * @throws {Error} - Throws an error if value doesn't have a `length` property (\r\n * `null`, `undefined`, {Boolean}, Symbol, et. al.).\r\n */\r\n length = x => x.length,\r\n\r\n /**\r\n * Contains all the static functions from `Object` but curried and flipped;\r\n * @example\r\n * // E.g., `Object.defineProperties(obj, descriptor)` can now be used like\r\n * import {defineProperties} from 'fjl'\r\n * defineProperties(descriptor, someObj),\r\n * // Et. al.\r\n * @memberOf module:object\r\n * @type {{...Object}}\r\n */\r\n native = Object.getOwnPropertyNames(Object).reduce((agg, key) => {\r\n if (typeof Object[key] !== 'function') {\r\n return agg;\r\n }\r\n const operation = Object[key];\r\n switch (operation.length) {\r\n case 2:\r\n agg[key] = flip(operation);\r\n break;\r\n case 3:\r\n agg[key] = flip3(operation);\r\n break;\r\n case 4:\r\n agg[key] = flip4(operation);\r\n break;\r\n case 5:\r\n agg[key] = flip5(operation);\r\n break;\r\n default:\r\n agg[key] = Object[key];\r\n break;\r\n }\r\n return agg;\r\n }, {}),\r\n\r\n /**\r\n * Gets passed in object's own enumerable keys (same as `Object.keys`).\r\n * @function module:object.keys\r\n * @param obj {*}\r\n * @returns {Array}\r\n */\r\n {keys} = native,\r\n\r\n /**\r\n * Defined as `Object.assign` else is the same thing but shimmed.\r\n * @function module:object.assign\r\n * @param obj0 {Object}\r\n * @param objs {...{Object}}\r\n * @returns {Object}\r\n */\r\n assign = (() => Object.assign ?\r\n (obj0, ...objs) => Object.assign(obj0, ...objs) :\r\n curry2((obj0, ...objs) => objs.reduce((topAgg, obj) => {\r\n return Object.keys(obj).reduce((agg, key) => {\r\n agg[key] = obj[key];\r\n return agg;\r\n }, topAgg);\r\n }, obj0))\r\n )();\r\n","/**\r\n * Created by elyde on 12/18/2016.\r\n * @memberOf object\r\n */\r\nconst _Number = Number.name,\r\n _NaN = 'NaN',\r\n _Null = 'Null',\r\n _Undefined = 'Undefined';\r\n\r\n/**\r\n * Returns the constructor/class/type name of a value.\r\n * @note Returns 'NaN' if value is of type `Number` and value is `isNaN`.\r\n * @note Returns 'Undefined' if value is `undefined`\r\n * @note Returns 'Null' if value is `null`\r\n * For values that have no concrete constructors and/or casters\r\n * (null, NaN, and undefined) we returned normalized names for them ('Null', 'NaN', 'Number')\r\n * @function module:object.typeOf\r\n * @param value {*}\r\n * @returns {string} - Constructor's name or derived name (in the case of `null`, `undefined`, or `NaN` (whose\r\n * normalized names are 'Null', 'Undefined', 'NaN' respectively).\r\n */\r\nexport function typeOf (value) {\r\n let retVal;\r\n if (value === undefined) {\r\n retVal = _Undefined;\r\n }\r\n else if (value === null) {\r\n retVal = _Null;\r\n }\r\n else {\r\n let constructorName = (value).constructor.name;\r\n retVal = constructorName === _Number && isNaN(value) ?\r\n _NaN : constructorName;\r\n }\r\n return retVal;\r\n}\r\n","/**\r\n * Created by elyde on 12/18/2016.\r\n * @memberOf object\r\n */\r\n\r\nimport {typeOf} from './typeOf';\r\nimport {instanceOf, length, keys} from '../jsPlatform/object';\r\nimport {curry} from '../function/curry';\r\n\r\nlet _String = String.name,\r\n _Number = Number.name,\r\n _Object = Object.name,\r\n _Boolean = Boolean.name,\r\n _Function = Function.name,\r\n _Array = Array.name,\r\n _Symbol = 'Symbol',\r\n _Map = 'Map',\r\n _Set = 'Set',\r\n _WeakMap = 'WeakMap',\r\n _WeakSet = 'WeakSet',\r\n _Null = 'Null',\r\n _Undefined = 'Undefined',\r\n _NaN = 'NaN';\r\n\r\nexport const\r\n\r\n /**\r\n * Resolves/normalizes a type name from either a string or a constructor.\r\n * @function module:object.toTypeRef\r\n * @param type {Function|String} - String or function representing a type.\r\n * @returns {String}\r\n * @todo write tests for this function.\r\n */\r\n toTypeRef = type => {\r\n if (!type) {\r\n return typeOf(type);\r\n }\r\n else if (type.constructor === String || (type instanceof Function)) {\r\n return type;\r\n }\r\n return typeOf(type);\r\n },\r\n\r\n /**\r\n * Returns an array of type refs from possible type refs (converts null, undefined, NaN, and other values into\r\n * type refs (either constructor name or constructor name based on whether value(s) is a string, a constructor, or not).\r\n * @function module:object.toTypeRefs\r\n * @param types {...(TypeRef|*)}\r\n * @returns {Array}\r\n * @todo Ensure tests are written for this function.\r\n */\r\n toTypeRefs = (...types) => types.map(toTypeRef),\r\n\r\n /**\r\n * Returns possible Type's TypeRef name.\r\n * @function module:object.toTypeRefName\r\n * @param Type {(TypeRef|*)}\r\n * @returns {String}\r\n * @todo Ensure tests are written for this function.\r\n */\r\n toTypeRefName = Type => {\r\n const ref = toTypeRef(Type);\r\n return ref instanceof Function ? ref.name : ref;\r\n },\r\n\r\n /**\r\n * Returns possible Types' TypeRef names.\r\n * @function module:object.toTypeRefNames\r\n * @param types {...(TypeRef|*)}\r\n * @returns {String[]}\r\n * @todo Ensure tests are written for this function.\r\n */\r\n toTypeRefNames = (...types) => types.map(toTypeRefName),\r\n\r\n /**\r\n * Returns whether a value is a function or not.\r\n * @function module:object.isFunction\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isFunction = instanceOf(Function),\r\n\r\n /**\r\n * Strict type checker. Checks if given value is a direct instance of given type; E.g.,\r\n * @example\r\n * isType(String, 'abcdefg') === true // true\r\n * isType(String.name, 'abcdefg') === true\r\n * isType(Number, NaN) === false\r\n * isType(Number, 99) === true\r\n * isType('Null', 99) === false // though, for `null` and `undefined` checks\r\n * // @see `isset`, in this module, instead\r\n * isType('Undefined', undefined) === true // true\r\n *\r\n * @note Useful where absolute types, or some semblance thereof, are required.\r\n * @function module:object.isType\r\n * @param type {Function|ObjectConstructor|String} - Constructor or constructor name\r\n * @param obj {*}\r\n * @return {Boolean}\r\n */\r\n isType = curry((type, obj) => typeOf(obj) === toTypeRefName(type)),\r\n\r\n /**\r\n * Loose type checker; E.g., If `type` is not a constructor, but a constructor name, does a type check on\r\n * constructor names, else if first check fails and `type` is a constructor, performs an `instanceof` check\r\n * on value with constructor.\r\n * @note Use care when checking for `Array` and/or `Object` since the both are considered objects by `instanceof` checker.\r\n * @note For `null` and `undefined` their class cased names can be used for type checks\r\n * `isOfType('Null', null) === true (passes strict type check)` (or better yet `isset` can be used).\r\n * @throwsafe - Doesn't throw on `null` or `undefined` `obj` values.\r\n * @example\r\n * isOfType(Number, 99) === true // true (passes strict type check (numbers are not instances of `Number`\r\n * // constructor)\r\n * isOfType('Number', 99) === true // true (passes strict type check)\r\n * isOfType(Number, NaN) === true // true. (passes instance of check)\r\n * // If you want \"true\" strict type checking use `isType`\r\n * isOfType(Object, []) === true // true (passes instance of check)\r\n * isOfType(Array, []) === true // true (passes instance of check)\r\n * isOfType(Object, {}) === true // true (passes instance of check)\r\n * isOfType(Object.name, {}) === true // true (Passes strict type check)\r\n * class Abc extends String {}\r\n * isOfType(String, new Abc('abcd')) // true (passes instanceof check)\r\n *\r\n * @function module:object.isOfType\r\n * @param type {Function|String} - Type reference (constructor or `constructor.name`).\r\n * @param x {*} - Value to check.\r\n * @returns {Boolean}\r\n */\r\n isOfType = curry((type, x) => isType(type, x) || instanceOf(type, x)),\r\n\r\n /**\r\n * Checks if `value` is an es2015 `class`.\r\n * @function module:object.isClass\r\n * @param x {*}\r\n * @returns {boolean}\r\n */\r\n isClass = x => x && /^\\s{0,3}class\\s{1,3}/.test((x + '').substr(0, 10)),\r\n\r\n /**\r\n * Returns a boolean depicting whether a value is callable or not.\r\n * @function module:object.isCallable\r\n * @tentative\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isCallable = x => isFunction(x) && !isClass(x),\r\n\r\n /**\r\n * Checks if value is an array (same as `Array.isArray`).\r\n * @function module:object.isArray\r\n * @param value {*}\r\n * @returns {boolean}\r\n */\r\n {isArray} = Array,\r\n\r\n /**\r\n * Checks whether value is an object or not.\r\n * @function module:object.isObject\r\n * @param value\r\n * @returns {Boolean}\r\n */\r\n isObject = isType(_Object),\r\n\r\n /**\r\n * Checks if value is a boolean.\r\n * @function module:object.isBoolean\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isBoolean = isType(_Boolean),\r\n\r\n /**\r\n * Checks if value is a valid number (also checks if isNaN so that you don't have to).\r\n * @function module:object.isNumber\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isNumber = isType(_Number),\r\n\r\n /**\r\n * Checks whether value is a string or not.\r\n * @function module:object.isString\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isString = isType(_String),\r\n\r\n /**\r\n * Checks whether value is of `Map` or not.\r\n * @function module:object.isMap\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isMap = isType(_Map),\r\n\r\n /**\r\n * Checks whether value is of `Set` or not.\r\n * @function module:object.isSet\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isSet = isType(_Set),\r\n\r\n /**\r\n * Checks whether value is of `WeakMap` or not.\r\n * @function module:object.isWeakMap\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isWeakMap =isType(_WeakMap),\r\n\r\n /**\r\n * Checks whether value is of `WeakSet` or not.\r\n * @function module:object.isWeakSet\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isWeakSet = isType(_WeakSet),\r\n\r\n /**\r\n * Checks if value is undefined.\r\n * @function module:object.isUndefined\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isUndefined = isType(_Undefined),\r\n\r\n /**\r\n * Checks if value is null.\r\n * @function module:object.isNull\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isNull = isType(_Null),\r\n\r\n /**\r\n * Checks if value is a `Symbol`.\r\n * @function module:object.isSymbol\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isSymbol = isType(_Symbol),\r\n\r\n /**\r\n * Checks if given `x` is set and of one of\r\n * [String, Boolean, Number, Symbol] (null and undefined are immutable\r\n * but are not \"usable\" (usually not what we want to operate on).\r\n * @function module:object.isUsableImmutablePrimitive\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isUsableImmutablePrimitive = x => {\r\n const typeOfX = typeOf(x);\r\n return isset(x) &&\r\n [_String, _Number, _Boolean, _Symbol]\r\n .some(Type => Type === typeOfX);\r\n },\r\n\r\n /**\r\n * Checks if !length.\r\n * @function module:object.isEmptyList\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isEmptyList = x => !length(x),\r\n\r\n /**\r\n * Checks if object has own properties/enumerable-props or not.\r\n * @function module:object.isEmptyObject\r\n * @param obj {*}\r\n * @returns {Boolean}\r\n */\r\n isEmptyObject = obj => isEmptyList(keys(obj)),\r\n\r\n /**\r\n * Checks if collection is empty or not (Map, WeakMap, WeakSet, Set etc.).\r\n * @function module:object.isEmptyCollection\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isEmptyCollection = x => x.size === 0,\r\n\r\n /**\r\n * Checks to see if passed in value is empty; I.e.,\r\n * check for one of '', 0, `null`, `undefined`, `false`, empty array, empty object, empty function (zero arity),\r\n * or empty collection (es6 Map, Set, WeakMap, or WeakSet etc. (`!value.size`);\r\n * @function module:object.isEmpty\r\n * @param value {*} - Value to check.\r\n * @returns {Boolean}\r\n */\r\n isEmpty = value => {\r\n if (!value) { // if '', 0, `null`, `undefined`, or `false` then is empty\r\n return true;\r\n }\r\n switch (typeOf(value)) {\r\n case _Array:\r\n case _Function:\r\n return !value.length;\r\n case _Number: // zero and NaN checks happened above so `if number` then it's 'not-an-empty-number' (lol)\r\n return false;\r\n case _Object:\r\n return !keys(value).length;\r\n case _Map:\r\n case _Set:\r\n case _WeakSet:\r\n case _WeakMap:\r\n return !value.size;\r\n case _NaN:\r\n return true;\r\n default:\r\n return !value;\r\n }\r\n },\r\n\r\n /**\r\n * Returns whether passed in values is defined and not null or not.\r\n * @function module:object.isset\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isset = x => x !== null && x !== undefined,\r\n\r\n /**\r\n * Checks to see if `x` is of one of the given type refs.\r\n * @function object.isOneOf\r\n * @param x {*}\r\n * @param types {...(TypeRef|*)}\r\n * @returns {boolean}\r\n * @todo write tests for this function.\r\n */\r\n isOneOf = (x, ...types) => {\r\n const typeName = typeOf(x);\r\n return toTypeRefNames(types).some(name => typeName === name);\r\n },\r\n\r\n isFunctor = x => x && x.map && instanceOf(Function, x.map)\r\n\r\n;\r\n","/**\r\n * @memberOf object\r\n */\r\n\r\nimport {isset} from './is';\r\nimport {curry} from '../function/curry';\r\n\r\n/**\r\n * Looks up property and returns it's value; Else `undefined`.\r\n * Method is null safe (will not throw on `null` or `undefined`).\r\n * @function module:object.lookup\r\n * @param key {String} - Key to search on `obj`\r\n * @param obj {Object} - Object to search `name` on.\r\n * @returns {*}\r\n */\r\nexport const lookup = curry((key, obj) => isset(obj) ? obj[key] : undefined);\r\n","import {isFunction, isset, isUsableImmutablePrimitive} from './is';\r\nimport {apply} from '../jsPlatform/function';\r\n\r\n/**\r\n * Creates a value `of` given type; Checks for one of the following construction strategies (in order listed):\r\n * @example\r\n * // - If exists `(value).constructor.of` uses this.\r\n * // - If value is of one String, Boolean, Symbol, or Number types calls it's\r\n * // constructor as a function (in cast form; E.g., `constructor(...args)` )\r\n * // - Else if constructor is a function, thus far, then calls constructor using\r\n * // the `new` keyword (with any passed in args).\r\n\r\n * @function module:object.of\r\n * @param x {*} - Value to derive returned value's type from.\r\n * @param [args] {...*} - Any args to pass in to matched construction strategy.\r\n * @returns {*|undefined} - New value of given value's type else `undefined`.\r\n */\r\nexport const of = (x, ...args) => {\r\n if (!isset(x)) { return undefined; }\r\n const constructor = x.constructor;\r\n if (constructor.hasOwnProperty('of')) {\r\n return apply(constructor.of, args);\r\n }\r\n else if (isUsableImmutablePrimitive(x)) {\r\n return apply(constructor, args);\r\n }\r\n else if (isFunction(constructor)) {\r\n return new constructor(...args);\r\n }\r\n return undefined;\r\n};\r\n","import {typeOf} from './typeOf';\r\nimport {of} from './of';\r\n\r\nexport const\r\n\r\n /**\r\n * Make a copy of a value or optionally copy incoming value onto an outgoing value (second parameter).\r\n * @note If incoming thing is an immmutable primitive (string, number, symbol, null, undefined, boolean)\r\n * it is returned as is.\r\n * @function module:object.copy\r\n * @param x {*} - Thing to copy.\r\n * @param [out = undefined] {*} - Optional value to copy on to. Not required.\r\n * @returns {*} - Copied thing or optionally outgoing value copied onto.\r\n */\r\n copy = (x, out) => {\r\n // if `null`, `undefined`, `''`, `0`, `false` return\r\n if (!x) { return x; }\r\n switch (typeOf(x)) {\r\n case Array.name:\r\n return !out ? x.slice(0) : Object.assign(out, x);\r\n\r\n // If immutable primitive, return it\r\n case Symbol.name:\r\n case Boolean.name:\r\n case String.name:\r\n case Number.name:\r\n case Promise.name:\r\n case Function.name:\r\n case 'NaN':\r\n case 'Null':\r\n case 'Undefined':\r\n return x;\r\n\r\n case 'Map':\r\n case 'Set':\r\n case 'WeakMap':\r\n case 'WeakSet':\r\n return new x.constructor(Array.from(x));\r\n\r\n // Else make copy\r\n default:\r\n return Object.assign(!out ? of(x) : out, x);\r\n }\r\n }\r\n;\r\n\r\nexport default copy;\r\n","import {isset} from './is';\r\nimport {curry} from '../function/curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Gives you value at key/namespace-key within `obj`; E.g.,\r\n * searchObj('all.your.base', {all: {your: {base: 99}}}) === 99 // `true`\r\n * @note If key is unreachable (undefined) returns `undefined`.\r\n * Useful in cases where we do not want to check each key along the way before getting/checking value; E.g.,\r\n * @example\r\n * ```\r\n * if (obj && obj.all && obj.all.your && obj.all.your.base) {\r\n * // Thing we want to do\r\n * }\r\n *\r\n * // So with our function becomes\r\n * if (searchObj('all.your.base', obj)) {\r\n * // Thing we want to do\r\n * }\r\n * ```\r\n * @function module:object.searchObj\r\n * @param nsString {String}\r\n * @param obj {*}\r\n * @returns {*}\r\n */\r\n searchObj = curry((nsString, obj) => {\r\n if (!obj) { return obj; }\r\n if (nsString.indexOf('.') === -1) {\r\n return obj[nsString];\r\n }\r\n const parts = nsString.split('.'),\r\n limit = parts.length;\r\n let ind = 0,\r\n parent = obj;\r\n for (; ind < limit; ind += 1) {\r\n const node = parent[parts[ind]];\r\n if (!isset(node)) {\r\n return node;\r\n }\r\n parent = node;\r\n }\r\n return parent;\r\n })\r\n;\r\n","\r\nimport {isObject} from './is';\r\nimport {keys} from '../jsPlatform/object';\r\nimport {curry2} from '../function/curry';\r\n\r\nexport const\r\n /**\r\n * Merges all objects down into one (takes two or more args).\r\n * @function module:object.assignDeep\r\n * @param obj0 {Object}\r\n * @param [objs] {...{Object}} - One or more objects to merge onto `obj0`.\r\n * @returns {Object}\r\n */\r\n assignDeep = curry2((obj0, ...objs) =>\r\n !obj0 ? obj0 : objs.reduce((topAgg, obj) =>\r\n !obj ? topAgg : keys(obj).reduce((agg, key) => {\r\n let propDescription = Object.getOwnPropertyDescriptor(agg, key);\r\n // If property is not writable move to next item in collection\r\n if (agg.hasOwnProperty(key) && propDescription &&\r\n !(propDescription.get && propDescription.set) &&\r\n !propDescription.writable) {\r\n return agg;\r\n }\r\n if (isObject(agg[key]) && isObject(obj[key])) {\r\n assignDeep(agg[key], obj[key]);\r\n }\r\n else { agg[key] = obj[key]; }\r\n return agg;\r\n }, topAgg)\r\n , obj0));\r\n","/**\r\n * List operations that overlap (apart from globally overlapping props and functions like `length`)\r\n * on both strings and arrays.\r\n * @memberOf list\r\n */\r\n\r\nimport {fPureTakesOne, fPureTakes2, fPureTakesOneOrMore} from '../utils';\r\n\r\nexport const\r\n\r\n /**\r\n * Concats/appends all functors onto the end of first functor.\r\n * Note: functors passed in after the first one must be of the same type.\r\n * @function module:list.concat\r\n * @param functor {Array|Object|*}\r\n * @param ...functor {Array|Object|*}\r\n * @return {*|Array|Object} - The type passed.\r\n * @throws {Error} - When passed in object doesn't have an `every` method.\r\n */\r\n concat = fPureTakesOneOrMore('concat'),\r\n\r\n /**\r\n * Same as Array.prototype.slice\r\n * @function module:list.slice\r\n * @param separator {String|RegExp}\r\n * @param arr{Array}\r\n * @returns {Array}\r\n */\r\n slice = fPureTakes2('slice'),\r\n\r\n /**\r\n * `Array.prototype.includes` or shim.\r\n * @function module:list.includes\r\n * @param value {*}\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n includes = (() => 'includes' in Array.prototype ?\r\n fPureTakesOne('includes') :\r\n (value, xs) => xs.indexOf(value) > -1)(),\r\n\r\n /**\r\n * Searches list/list-like for given element `x`.\r\n * @function module:list.indexOf\r\n * @param x {*} - Element to search for.\r\n * @param xs {Array|String|*} - list or list like to look in.\r\n * @returns {Number} - `-1` if element not found else index at which it is found.\r\n */\r\n indexOf = fPureTakesOne('indexOf'),\r\n\r\n /**\r\n * Last index of (`Array.prototype.lastIndexOf`).\r\n * @function module:list.lastIndexOf\r\n * @param x {*} - Element to search for.\r\n * @param xs {Array|String|*} - list or list like to look in.\r\n * @returns {Number} - `-1` if element not found else index at which it is found.\r\n */\r\n lastIndexOf = fPureTakesOne('lastIndexOf')\r\n\r\n;\r\n","/**\r\n * @module boolean\r\n * @description Contains functional version of 'always-true', 'always-false', 'is-truthy', and 'is-falsy'.\r\n */\r\nimport {curry, curry2} from './function/curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns whether `value` is 'truthy' or not\r\n * @function module:boolean.isTruthy\r\n * @param value\r\n * @returns {Boolean}\r\n */\r\n isTruthy = value => !!value,\r\n\r\n /**\r\n * Returns whether `value` is 'falsy' or not\r\n * @function module:boolean.isFalsy\r\n * @param value\r\n * @returns {Boolean}\r\n */\r\n isFalsy = value => !value,\r\n\r\n /**\r\n * Returns `true`.\r\n * @function module:boolean.alwaysTrue\r\n * @returns {Boolean}\r\n */\r\n alwaysTrue = () => true,\r\n\r\n /**\r\n * Returns `false`.\r\n * @function module:boolean.alwaysFalse\r\n * @returns {Boolean}\r\n */\r\n alwaysFalse = () => false,\r\n\r\n /**\r\n * Equality operator.\r\n * @function module:boolean.equal\r\n * @param a {*}\r\n * @param b {*}\r\n * @returns {boolean}\r\n */\r\n equal = curry((a, b) => a === b),\r\n\r\n /**\r\n * Equality operator for all.\r\n * @function module:boolean.equalAll\r\n * @param a {*} - Item `0`.\r\n * @param args {...*} - Others\r\n * @returns {boolean}\r\n */\r\n equalAll = curry2((a, ...args) => args.every(b => equal(a, b)))\r\n\r\n;\r\n","import {length} from '../jsPlatform/object';\r\nimport {curry} from '../function/curry';\r\nimport {typeOf} from '../object/typeOf';\r\nimport {of} from '../object/of';\r\nimport {isFunctor, isset} from '../object/is';\r\n\r\n/**\r\n * Maps a function onto a List (string or array) or a functor (value containing a map method).\r\n * @function module:list.map\r\n * @param fn {Function} - Function to map on given value.\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\nconst map = curry((fn, xs) => {\r\n if (!isset(xs)) { return xs; }\r\n let out = of(xs),\r\n limit,\r\n i = 0;\r\n switch (typeOf(xs)) {\r\n case 'Array':\r\n limit = length(xs);\r\n if (!limit) { return out; }\r\n for (; i < limit; i += 1) {\r\n out.push(fn(xs[i], i, xs));\r\n }\r\n return out;\r\n case 'String':\r\n limit = length(xs);\r\n if (!xs) { return out; }\r\n for (; i < limit; i += 1) {\r\n out += fn(xs[i], i, xs);\r\n }\r\n return out;\r\n default:\r\n if (isFunctor(xs)) { return xs.map(fn); }\r\n\r\n // Other objects\r\n return Object.keys(xs).reduce((agg, key) => {\r\n out[key] = fn(xs[key], key, xs);\r\n return out;\r\n }, out);\r\n }\r\n});\r\n\r\nexport default map;\r\n","\r\nexport const\r\n\r\n /**\r\n * Pushes incoming `item` onto given array and returns said array.\r\n * @private\r\n * @param agg {Array}\r\n * @param item {*}\r\n * @returns {Array}\r\n */\r\n aggregateArray = (agg, item) => {\r\n agg.push(item);\r\n return agg;\r\n }\r\n\r\n;\r\n","/**\r\n * List operator utils module.\r\n * @module listUtils\r\n */\r\nimport {apply} from '../jsPlatform/function'; // un-curried version\r\nimport {slice} from '../jsPlatform/list'; // un-curried version good for both strings and arrays\r\nimport {length} from '../jsPlatform/object';\r\nimport {alwaysFalse} from '../boolean';\r\nimport map from './map';\r\nimport {curry, curry2} from '../function/curry';\r\n\r\nexport * from './aggregation';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns a slice of the given list from `startInd` to the end of the list.\r\n * @function module:listUtils.sliceFrom\r\n * @param startInd {Number}\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n sliceFrom = curry((startInd, xs) => slice(startInd, undefined, xs)),\r\n\r\n /**\r\n * Slices from index `0` to given index.\r\n * @function module:listUtils.sliceTo\r\n * @param toInd {Number}\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n sliceTo = curry((toInd, xs) => slice(0, toInd, xs)),\r\n\r\n /**\r\n * Slices a copy of list.\r\n * @function listUtils.sliceCopy\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n sliceCopy = sliceFrom(0),\r\n\r\n /**\r\n * Generic 'ascending order' ordering function (use by the likes of `list.sort` etc.)\r\n * @function module:listUtils.genericAscOrdering\r\n * @param a {*}\r\n * @param b {*}\r\n * @returns {number}\r\n */\r\n genericAscOrdering = curry((a, b) => {\r\n if (a > b) { return 1; }\r\n else if (a < b) { return -1; }\r\n return 0;\r\n }),\r\n\r\n /**\r\n * Returns length of all passed lists in list.\r\n * @function module:listUtils.lengths\r\n * @param lists ...{Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n lengths = curry2((...lists) => map(length, lists)),\r\n\r\n /**\r\n * Returns a list of lists trimmed to the shortest length in given list of lists. @background This method is used by the `zip*` functions to achieve their\r\n * 'slice to smallest' functionality.\r\n * @function module:listUtils.toShortest\r\n * @param lists {...(Array|String|*)}\r\n * @returns {Array|String|*}\r\n */\r\n toShortest = curry2((...lists) => {\r\n const listLengths = apply(lengths, lists),\r\n smallLen = Math.min.apply(Math, listLengths);\r\n return map((list, ind) => listLengths[ind] > smallLen ?\r\n sliceTo(smallLen, list) : sliceCopy(list), lists);\r\n }),\r\n\r\n /**\r\n * Reduces until predicate.\r\n * @function module:listUtils.reduceUntil\r\n * @param pred {Function} - `(item, index, list) => Boolean(...)`\r\n * @param op {Function} - Operation - `(agg, item, index, list) => agg`\r\n * @param agg {*} - Zero value.\r\n * @param xs {Array|String|*} - List.\r\n * @returns {*}\r\n */\r\n reduceUntil = curry((pred, op, agg, xs) => {\r\n const limit = length(xs);\r\n if (!limit) { return agg; }\r\n let ind = 0,\r\n result = agg;\r\n for (; ind < limit; ind++) {\r\n if (pred(xs[ind], ind, xs)) { break; }\r\n result = op(result, xs[ind], ind, xs);\r\n }\r\n return result;\r\n }),\r\n\r\n /**\r\n * Reduces until predicate (from right to left).\r\n * @function module:listUtils.reduceUntilRight\r\n * @param pred {Function} - `(item, index, list) => Boolean(...)`\r\n * @param op {Function} - Operation - `(agg, item, index, list) => agg`\r\n * @param agg {*} - Zero value.\r\n * @param xs {Array|String|*} - List.\r\n * @returns {*}\r\n */\r\n reduceUntilRight = curry((pred, op, agg, arr) => {\r\n const limit = length(arr);\r\n if (!limit) { return agg; }\r\n let ind = limit - 1,\r\n result = agg;\r\n for (; ind >= 0; ind--) {\r\n if (pred(arr[ind], ind, arr)) { break; }\r\n result = op(result, arr[ind], ind, arr);\r\n }\r\n return result;\r\n }),\r\n\r\n /**\r\n * Reduces a list with given operation (`op`) function.\r\n * @function module:listUtils.reduce\r\n * @param op {Function} - Operation - `(agg, item, index, list) => agg`\r\n * @param agg {*} - Zero value.\r\n * @param xs {Array|String|*} - List.\r\n * @returns {*}\r\n */\r\n reduce = reduceUntil(alwaysFalse),\r\n\r\n /**\r\n * Reduces a list with given operation (`op`) function (from right-to-left).\r\n * @function module:listUtils.reduceRight\r\n * @param op {Function} - Operation - `(agg, item, index, list) => agg`\r\n * @param agg {*} - Zero value.\r\n * @param xs {Array|String|*} - List.\r\n * @returns {*}\r\n */\r\n reduceRight = reduceUntilRight(alwaysFalse),\r\n\r\n /**\r\n * Gets last index of a list/list-like (Array|String|Function etc.).\r\n * @function module:listUtils.lastIndex\r\n * @param x {Array|String|*} - list like or list.\r\n * @returns {Number} - `-1` if no element found.\r\n */\r\n lastIndex = x => { const len = length(x); return len ? len - 1 : 0; },\r\n\r\n /**\r\n * Finds index in string or list.\r\n * @function module:listUtils.findIndexWhere\r\n * @param pred {Function} - Predicate.\r\n * @param arr {Array|String}\r\n * @returns {Number} - `-1` if predicate not matched else `index` found\r\n */\r\n findIndexWhere = curry((pred, arr) => {\r\n let ind = 0;\r\n const limit = length(arr);\r\n for (; ind < limit; ind += 1) {\r\n const predicateFulfilled = !!pred(arr[ind], ind, arr);\r\n if (predicateFulfilled) {\r\n return ind;\r\n }\r\n }\r\n return -1;\r\n }),\r\n\r\n /**\r\n * Finds index in list from right to left.\r\n * @function module:listUtils.findIndexWhereRight\r\n * @param pred {Function} - Predicate.\r\n * @param arr {Array|String}\r\n * @returns {Number} - `-1` if predicate not matched else `index` found\r\n */\r\n findIndexWhereRight = curry((pred, arr) => {\r\n let ind = length(arr) - 1;\r\n for (; ind >= 0; ind -= 1) {\r\n const predicateFulfilled = !!pred(arr[ind], ind, arr);\r\n if (predicateFulfilled) {\r\n return ind;\r\n }\r\n }\r\n return -1;\r\n }),\r\n\r\n /**\r\n * @function module:listUtils.findIndicesWhere\r\n * @param pred {Function}\r\n * @param xs {Array|String|*} - list or list like.\r\n * @returns {Array|undefined}\r\n */\r\n findIndicesWhere = curry((pred, xs) => {\r\n const limit = length(xs);\r\n let ind = 0,\r\n out = [];\r\n for (; ind < limit; ind++) {\r\n if (pred(xs[ind], ind, xs)) { out.push(ind); }\r\n }\r\n return out.length ? out : undefined;\r\n }),\r\n\r\n /**\r\n * @function module:listUtils.findWhere\r\n * @param pred {Function}\r\n * @param xs {Array|String|*} - list or list like.\r\n * @returns {*}\r\n */\r\n findWhere = curry((pred, xs) => {\r\n let ind = 0,\r\n limit = length(xs);\r\n if (!limit) { return; }\r\n for (; ind < limit; ind++) {\r\n let elm = xs[ind];\r\n if (pred(elm, ind, xs)) { return elm; }\r\n }\r\n })\r\n\r\n;\r\n","import {assignDeep} from './assignDeep';\r\nimport {keys} from '../jsPlatform/object';\r\nimport {reduce} from '../list/utils';\r\nimport {curry, curry2} from '../function/curry';\r\n\r\nexport const\r\n\r\n objUnion = curry((obj1, obj2) => assignDeep(obj1, obj2)),\r\n\r\n objIntersect = curry((obj1, obj2) => reduce((agg, key) => {\r\n if (obj2.hasOwnProperty(key)) {\r\n agg[key] = obj2[key];\r\n }\r\n return agg;\r\n }, {}, keys(obj1))),\r\n\r\n objDifference = curry((obj1, obj2) => reduce((agg, key) => {\r\n if (!obj2.hasOwnProperty(key)) {\r\n agg[key] = obj1[key];\r\n }\r\n return agg;\r\n }, {}, keys(obj1))),\r\n\r\n objComplement = curry2((obj0, ...objs) => reduce((agg, obj) =>\r\n assignDeep(agg, objDifference(obj, obj0)), {}, objs));\r\n","/**\r\n * @module console\r\n * @description Console exports.\r\n */\r\nexport const\r\n\r\n /**\r\n * `Console.log` method.\r\n * @function module:console.log\r\n * @params args {...*}\r\n * @returns {void}\r\n */\r\n log = console.log.bind(console),\r\n\r\n /**\r\n * `Console.error` method.\r\n * @function module:console.error\r\n * @params args {...*}\r\n * @returns {void}\r\n */\r\n error = console.error.bind(console),\r\n\r\n /**\r\n * Peeks (console.log) at incoming value(s) and returns the last value.\r\n * @function module:console.peek\r\n * @param args {...*}\r\n * @returns {*} Last given value (if one or more values) else first value.\r\n */\r\n peek = (...args) => (log(...args), args.pop())\r\n\r\n;\r\n","export const\r\n\r\n /**\r\n * Clones and object or array using `JSON.parse(JSON.stringify(...))` pattern.\r\n * @function module:object.jsonClone\r\n * @param x {*}\r\n * @returns {*}\r\n */\r\n jsonClone = x => JSON.parse(JSON.stringify(x))\r\n\r\n;\r\n","import {isArray, isType} from './is';\r\nimport {keys} from '../jsPlatform/object';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns an associated list from given object.\r\n * @note Useful for working with plain javascript objects.\r\n * @function module:object.toAssocList\r\n * @param obj {(Object|Array|*)}\r\n * @returns {Array.<*, *>}\r\n */\r\n toAssocList = obj => keys(obj).map(key => [key, obj[key]]),\r\n\r\n /**\r\n * Returns an associated list from given object (deeply (on incoming object's type)).\r\n * @note Does deep conversion on all values of passed in type's type.\r\n * @function module:object.toAssocListDeep\r\n * @param obj {*}\r\n * @param [TypeConstraint = Object] {(Constructor|Function)} - Type constraint to convert on.\r\n * @returns {*}\r\n */\r\n toAssocListDeep = (obj, TypeConstraint = Object) => keys(obj).map(key =>\r\n TypeConstraint && isType(TypeConstraint, obj[key]) ?\r\n [key, toAssocListDeep(obj[key], TypeConstraint)] :\r\n [key, obj[key]]\r\n ),\r\n\r\n /**\r\n * From associated list to object.\r\n * @function module:object.fromAssocList\r\n * @param xs {Array.} - Associated list.\r\n * @param [OutType = Object] {Constructor|Function} - Output type. Default `Object`.\r\n * @returns {*} - Default is `Object`\r\n */\r\n fromAssocList = (xs, OutType = Object) => xs.reduce((agg, [key, value]) => {\r\n agg[key] = value;\r\n return agg;\r\n }, new OutType()),\r\n\r\n /**\r\n * From associated list to object (deep conversion on associative lists (array of 2 value arrays)).\r\n * @note Considers array of arrays associated lists.\r\n * @function module:object.fromAssocListDeep\r\n * @param xs {Array.} - Associated list.\r\n * @param [OutType = Object] {Constructor|Function} - Output type. Default `Object`.\r\n * @returns {*} - Default is `Object`\r\n */\r\n fromAssocListDeep = (xs, OutType = Object) => xs.reduce((agg, [key, value]) => {\r\n if (isArray(value) && isArray(value[0]) && value[0].length === 2) {\r\n agg[key] = fromAssocListDeep(value, OutType);\r\n return agg;\r\n }\r\n agg[key] = value;\r\n return agg;\r\n }, new OutType())\r\n;\r\n","import {typeOf} from './typeOf';\r\nimport {toAssocList} from './assocList';\r\n\r\nexport const\r\n\r\n /**\r\n * Converts incoming value to an array.\r\n * @note For `WeakMap`, `WeakSet`, `Map` and `Set` result is the same as calling `Array.from` on such.\r\n * @note For `null`, `undefined`, `NaN`, `Number{}`, `Symbol{}`, `Boolean{}` returns an empty array.\r\n * @note Method does a shallow conversion;\r\n * @function module:object.toArray\r\n * @param x {*} - Thing to convert from.\r\n * @returns {Array}\r\n */\r\n toArray = x => {\r\n switch (typeOf(x)) {\r\n case 'Null':\r\n case 'Undefined':\r\n return [];\r\n case String.name:\r\n case Array.name:\r\n case 'WeakMap':\r\n case 'WeakSet':\r\n case 'Map':\r\n case 'Set':\r\n return Array.from(x);\r\n case Object.name:\r\n default:\r\n return toAssocList(x);\r\n }\r\n }\r\n\r\n;\r\n","/**\r\n * @module object\r\n * @description Object operations/combinators.\r\n */\r\n\r\nexport * from './jsPlatform/object';\r\nexport * from './object/lookup';\r\nexport * from './object/typeOf';\r\nexport * from './object/copy';\r\nexport * from './object/is';\r\nexport * from './object/of';\r\nexport * from './object/searchObj';\r\nexport * from './object/assignDeep';\r\nexport * from './object/setTheory';\r\nexport * from './object/console';\r\nexport * from './object/jsonClone';\r\nexport * from './object/toArray';\r\nexport * from './object/assocList';\r\n","import {reduceRight} from '../jsPlatform/array';\r\n\r\n/**\r\n * Composes all functions passed in from right to left passing each functions return value to\r\n * the function on the left of itself.\r\n * @function module:function.compose\r\n * @type {Function}\r\n * @param args {...{Function}}\r\n * @returns {Function}\r\n */\r\nexport const compose = (...args) =>\r\n arg0 => reduceRight((value, fn) => fn(value), arg0, args);\r\n","/**\r\n * @memberOf function\r\n */\r\n\r\n/**\r\n * Returns passed in parameter.\r\n * @haskellType `id :: a -> a`\r\n * @function module:function.id\r\n * @param x {*}\r\n * @returns {*}\r\n */\r\nexport const id = x => x;\r\n","/**\r\n * @memberOf function\r\n */\r\n\r\nimport {apply} from '../jsPlatform/function';\r\nimport {curry, curry2} from './curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Negates a function that takes one/no argument.\r\n * @function module:function.negateF\r\n * @param fn {Function}\r\n * @returns {function(*=): boolean}\r\n */\r\n negateF = fn => x => !fn(x),\r\n\r\n /**\r\n * Takes a function that takes two parameters and returns a negated version of given\r\n * function.\r\n * @function module:_negate.negateF2\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n negateF2 = fn => curry((a, b) => !fn(a, b)),\r\n\r\n /**\r\n * Takes a function that takes three parameters and returns a\r\n * negated version of given function.\r\n * @function module:_negate.negateF3\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n negateF3 = fn => curry((a, b, c) => !fn(a, b, c)),\r\n\r\n /**\r\n * Returns a negated version of given function.\r\n * Returned function is variadiac (takes one or more arguments).\r\n * @note function returned is uncurried.\r\n * @uncurried\r\n * @function module:function.negateFN\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n negateFN = fn => curry2((...args) => !apply(fn, args));\r\n","import {curry} from './curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Run `operation` until predicate returns `true` (like a functional\r\n * version of a while loop).\r\n * @function module:function.until\r\n * @param predicate {Function} :: a -> Boolean\r\n * @param operation {Function} :: a -> a\r\n * @param typeInstance {*} :: * - A monoidal zero or some starting point.\r\n * @returns {*} - What ever type `typeInstance` is\r\n */\r\n until = curry((predicate, operation, typeInstance) => {\r\n let result = typeInstance;\r\n while (!predicate(result)) {\r\n result = operation(result);\r\n }\r\n return result;\r\n });\r\n","import {typeOf} from '../object/typeOf';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns a function or throws an error if given `f` is not a function.\r\n * @function module:function.fnOrError\r\n * @param symbolName {String} - Error message prefix.\r\n * @param f {Function|*} - Expected function.\r\n * @returns {Function}\r\n * @throws {Error} - Error if `f` is not of `function`\r\n */\r\n fnOrError = (symbolName, f) => {\r\n if (!f || !(f instanceof Function)) {\r\n throw new Error(`${symbolName} should be a function. ` +\r\n `Type received: ${typeOf(f)}; Value received: ${f}.`);\r\n }\r\n return f;\r\n }\r\n\r\n;\r\n","/**\r\n * No-op ('op' as in 'operation') - Performs no operation 'always' (good for places where\r\n * a value should always be a function etc.).\r\n * @function module:function.noop\r\n * @returns {undefined}\r\n */\r\nexport const noop = () => undefined;\r\n","/**\r\n * @module function\r\n */\r\nexport * from './jsPlatform/function';\r\nexport * from './function/compose';\r\nexport * from './function/curry';\r\nexport * from './function/flip';\r\nexport * from './function/id';\r\nexport * from './function/negate';\r\nexport * from './function/until';\r\nexport * from './function/fnOrError';\r\nexport * from './function/noop';\r\n","/**\r\n * @module object\r\n */\r\nimport {curry} from '../function/curry';\r\n\r\n/**\r\n * Normalizes step for `from` and `to` combination.\r\n * @function module:list.normalizeStep\r\n * @param from {Number}\r\n * @param to {Number}\r\n * @param [step = 1] {Number}\r\n * @returns {Number}\r\n * @private\r\n */\r\nconst normalizeStep = (from, to, step) => {\r\n if (from > to) {\r\n return step > 0 ? -step : step; // make step negative\r\n }\r\n return step < 0 ? -1 * step : step; // make step positive\r\n};\r\n\r\nexport const\r\n\r\n /**\r\n * Range function - gives you an array contain numbers in given range.\r\n * @note normalizes `step` to be valid if range numbers given are invalid\r\n * (forces `step` to be negative if range required is in the negative direction\r\n * and forces `step` to be positive if range required is in the other direction).\r\n * @function module:list.range\r\n * @param from {Number}\r\n * @param to {Number}\r\n * @param [step = 1] {Number}\r\n * @returns {Array.}\r\n */\r\n range = curry((from, to, step = 1) => {\r\n let i = from;\r\n const out = [];\r\n step = normalizeStep(from, to, step);\r\n if (step === 0 || from === to) { return [from]; }\r\n for (; (to - i) * step >= 0; i += step) { out.push(i); }\r\n return out;\r\n })\r\n;\r\n","/**\r\n * Created by elydelacruz on 9/6/2017.\r\n */\r\n\r\nimport {fPureTakesOne} from '../utils';\r\n\r\n/**\r\n * Functional version of `String.prototype.split`.\r\n * @function module:_string.split\r\n * @param separator {String|RegExp}\r\n * @param str {String}\r\n * @returns {Array}\r\n */\r\nexport const split = fPureTakesOne('split');\r\n","/**\r\n * @module jsPlatform_\r\n * @private\r\n */\r\nexport * from './jsPlatform/object';\r\nexport * from './jsPlatform/array';\r\nexport * from './jsPlatform/list';\r\nexport * from './jsPlatform/string';\r\nexport * from './jsPlatform/function';\r\n","/**\r\n * List operations module.\r\n * @module list\r\n */\r\nimport {concat as listAppend, indexOf, slice, includes} from './jsPlatform/list';\r\nimport {apply} from './jsPlatform/function';\r\nimport {length} from './jsPlatform/object';\r\nimport {negateF3, negateF2} from './function/negate';\r\nimport {curry, curry2, curry3} from './function/curry';\r\nimport {isTruthy, isFalsy} from './boolean';\r\nimport {lookup} from './object/lookup';\r\nimport {of} from './object/of';\r\nimport {isset, isString} from './object/is';\r\nimport {typeOf} from './object/typeOf';\r\nimport map from './list/map';\r\n\r\nimport {\r\n sliceFrom, sliceTo, lengths,\r\n toShortest, aggregateArray,\r\n reduceUntil, reduce, reduceRight, lastIndex,\r\n findIndexWhere, findIndexWhereRight, findIndicesWhere,\r\n findWhere, sliceCopy, genericAscOrdering\r\n}\r\n from './list/utils';\r\n\r\nexport * from './list/range';\r\n\r\nexport * from './list/utils';\r\n\r\nexport {map};\r\n\r\nexport {slice, includes, indexOf, lastIndexOf, push} from './jsPlatform';\r\n\r\nexport const\r\n\r\n /**\r\n * Append two, or more, lists, i.e.,\r\n * @example\r\n * expectEqual(append(take(13, alphabetString), drop(13, alphabetString)), alphabetString); // true\r\n *\r\n * // Another example\r\n * const result = append(\r\n * alphabetStr.split(''),\r\n * alphabetStr.split('')\r\n * ),\r\n * expected = repeat(2, alphabetStr).split('');\r\n *\r\n * shallowEquals(result, expected) === true // `true`\r\n *\r\n * @function module:list.append\r\n * @param [args] {...(Array|String|*)} - One or more lists or list likes (strings etc.).\r\n * @returns {(Array|String|*)} - Same type as list like passed in.\r\n */\r\n append = curry2((...args) => apply(listAppend, args)),\r\n\r\n /**\r\n * Returns head of list (first item of list).\r\n * @haskellType `head :: [a] -> a`\r\n * @function module:list.head\r\n * @param x {Array|String}\r\n * @returns {*} - First item from list\r\n */\r\n head = x => x[0],\r\n\r\n /**\r\n * Returns last item of list.\r\n * @haskellType `last :: [a] -> a`\r\n * @function module:list.last\r\n * @param xs {Array|String}\r\n * @returns {*}\r\n */\r\n last = xs => xs[lastIndex(xs)],\r\n\r\n /**\r\n * Returns tail part of list (everything after the first item as new list).\r\n * @haskelType `tail :: [a] -> [a]`\r\n * @function module:list.tail\r\n * @param xs {Array|String}\r\n * @returns {Array|String}\r\n */\r\n tail = xs => sliceFrom(1, xs),\r\n\r\n /**\r\n * Returns everything except last item of list as new list.\r\n * @haskellType `init :: [a] -> [a]`\r\n * @function module:list.init\r\n * @param xs {Array|String}\r\n * @returns {Array|String}\r\n */\r\n init = xs => sliceTo(lastIndex(xs), xs),\r\n\r\n /**\r\n * Returns `head` and `tail` of passed in list/string in a tuple.\r\n * @haskellType `uncons :: [a] -> Maybe (a, [a])`\r\n * @function module:list.uncons\r\n * @param xs {Array|String}\r\n * @returns {Array|undefined}\r\n */\r\n uncons = xs => !xs || length(xs) === 0 ? undefined : [head(xs), tail(xs)],\r\n\r\n /**\r\n * Returns `tail` and `head` of passed in list/string in a tuple.\r\n * @haskellType `unconsr :: [a] -> Maybe ([a], a)`\r\n * @function module:list.unconsr\r\n * @param xs {Array|String}\r\n * @returns {Array|String|*|undefined}\r\n */\r\n unconsr = xs => !xs || length(xs) === 0 ? undefined : [init(xs), last(xs)],\r\n\r\n /**\r\n * Concatenates all the elements of a container of lists.\r\n * @haskellType `concat :: Foldable t => t [a] -> [a]`\r\n * @function module:list.concat\r\n * @param xs {Array}\r\n * @returns {Array}\r\n */\r\n concat = xs => {\r\n switch (length(xs)) {\r\n case undefined:\r\n case 0:\r\n return [];\r\n case 1:\r\n const item0 = xs[0];\r\n return item0 && item0.slice ? sliceCopy(item0) : item0;\r\n case 2:\r\n default:\r\n return apply(append, xs);\r\n }\r\n },\r\n\r\n /**\r\n * Map a function over all the elements of a container and concatenate the resulting lists.\r\n * @haskellType `concatMap :: Foldable t => (a -> [b]) -> t a -> [b]`\r\n * @function module:list.concatMap\r\n * @param fn {Function}\r\n * @param foldableOfA {Array}\r\n * @returns {Array}\r\n */\r\n concatMap = curry((fn, foldableOfA) => concat(map(fn, foldableOfA))),\r\n\r\n /**\r\n * Returns a copy of the passed in list reverses.\r\n * @haskellType `reverse :: [a] -> [a]`\r\n * @function module:list.reverse\r\n * @param xs {Array|String}\r\n * @returns {Array|String}\r\n */\r\n reverse = xs => {\r\n if (!isset(xs) || !xs.length) {\r\n return xs;\r\n }\r\n let out = of(xs),\r\n i = xs.length - 1;\r\n switch (typeOf(xs)) {\r\n case 'String':\r\n for (; i >= 0; i -= 1) {\r\n out += xs[i];\r\n }\r\n return out;\r\n default:\r\n for (; i >= 0; i -= 1) {\r\n out.push(xs[i]);\r\n }\r\n return out;\r\n }\r\n },\r\n\r\n /**\r\n * Takes an element and a list and `intersperses' that element between the\r\n * elements of the list.\r\n * @function module:list.intersperse\r\n * @note In our version of the function javascript is loosely typed so,\r\n * so is our function (to much overhead to make it typed) so `between` can be any value.\r\n * @param between {*} - Should be of the same type of elements contained in list.\r\n * @param arr {Array|String} - List.\r\n * @returns {Array|String}\r\n */\r\n intersperse = curry((between, xs) => {\r\n if (!xs || !xs.length) {\r\n return xs;\r\n }\r\n const limit = xs.length,\r\n lastInd = limit - 1;\r\n let out = of(xs),\r\n i = 0;\r\n if (isString(xs)) {\r\n for (; i < limit; i += 1) {\r\n out += i === lastInd ?\r\n xs[i] : xs[i] + between;\r\n }\r\n return out;\r\n }\r\n for (; i < limit; i += 1) {\r\n if (i === lastInd) {\r\n out.push(xs[i]);\r\n } else {\r\n out.push(xs[i], between);\r\n }\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * `intercalate xs xss` is equivalent to (concat (intersperse xs xss)). It inserts the list xs in between the lists in xss and concatenates the result.\r\n * @haskellType `intercalate :: [a] -> [[a]] -> [a]`\r\n * @function module:list.intercalate\r\n * @param xs {Array|String}\r\n * @param xss {Array|String}\r\n * @returns {Array|String}\r\n */\r\n intercalate = curry((xs, xss) => {\r\n if (isString(xss)) {\r\n return intersperse(xs, xss);\r\n }\r\n return concat(intersperse(xs, xss));\r\n }),\r\n\r\n /**\r\n * Transposes rows and columns into lists by index; E.g.,\r\n * Haskell example:\r\n * ```\r\n * transpose [[1,2,3],[4,5,6]] == [[1,4],[2,5],[3,6]]\r\n *\r\n * -- Notice the shorter arrays are ignored after their last index is copied over:\r\n * transpose [[10,11],[20],[],[30,31,32]] == [[10,20,30],[11,31],[32]]\r\n * ```\r\n * @note from columns to rows.\r\n * @note Empty lists are ignored.\r\n * @haskellType `transpose :: [[a]] -> [[a]]`\r\n * @function module:list.transpose\r\n * @param xss {Array}\r\n * @returns {Array}\r\n */\r\n transpose = xss => {\r\n let numLists = length(xss),\r\n ind = 0, ind2;\r\n if (!numLists) {\r\n return [];\r\n }\r\n const listLengths = apply(lengths, xss),\r\n longestListLen = maximum(listLengths),\r\n outLists = [];\r\n for (; ind < longestListLen; ind += 1) {\r\n const outList = [];\r\n for (ind2 = 0; ind2 < numLists; ind2 += 1) {\r\n if (listLengths[ind2] < ind + 1) {\r\n continue;\r\n }\r\n outList.push(xss[ind2][ind]);\r\n }\r\n outLists.push(outList);\r\n }\r\n return filter(x => length(x) > 0, outLists);\r\n },\r\n\r\n /**\r\n * Generates 2^n sub-sequences for passed in sequence (string/list) (`n` is\r\n * the length of the passed in sequence so: 2^length(xs)).\r\n * Note: The return value doubles per index/character passed in so use with caution!\r\n * Also note that for 2^16 (or for a sequence of 16 characters) this algorithm\r\n * will generate 65536 sub-sequences! So caution should be taken to not\r\n * use this with sequences above a certain length on certain platform (the browser thread in specific).\r\n * @function module:list.subsequences\r\n * @jsperftest https://jsperf.com/subsequences\r\n * @param xs {Array|String}\r\n * @returns {Array.}\r\n */\r\n subsequences = xs => {\r\n const listLen = length(xs),\r\n len = Math.pow(2, listLen),\r\n out = [];\r\n for (let i = 0; i < len; i += 1) {\r\n let entry = [];\r\n for (let j = 0; j < listLen; j += 1) {\r\n if (i & (1 << j)) {\r\n entry.push(xs[j]);\r\n }\r\n }\r\n out.push(entry);\r\n }\r\n return out;\r\n },\r\n\r\n /**\r\n * Returns an array with the given indices swapped.\r\n * @function module:list.swapped\r\n * @param ind1 {Number}\r\n * @param ind2 {Number}\r\n * @param list {Array}\r\n * @returns {Array} - Copy of incoming with swapped values at indices.\r\n */\r\n swapped = curry((ind1, ind2, list) => {\r\n const out = sliceCopy(list),\r\n tmp = out[ind1];\r\n out[ind1] = out[ind2];\r\n out[ind2] = tmp;\r\n return out;\r\n }),\r\n\r\n /**\r\n * Returns a list of permutations for passed in list.\r\n * Use caution with lists above a length of 15 (will take long due to nature of\r\n * algorithm).\r\n * @function module:list.permutations\r\n * @param xs {Array} - List.\r\n * @returns {Array} - Array of permutations.\r\n */\r\n permutations = xs => {\r\n const limit = length(xs);\r\n\r\n if (!limit || limit === 1) {\r\n return [xs];\r\n }\r\n\r\n let list = sliceCopy(xs),\r\n c = repeat(limit, 0),\r\n i = 0;\r\n\r\n const out = [list];\r\n\r\n for (; i < limit; i++) {\r\n if (c[i] < i) {\r\n list = swapped(i % 2 === 0 ? 0 : c[i], i, list);\r\n out.push(list);\r\n c[i] += 1;\r\n i = 0;\r\n continue;\r\n }\r\n c[i] = 0;\r\n }\r\n\r\n return out;\r\n },\r\n\r\n /**\r\n * Left associative fold. Reduces a container of elements down by the given operation (same as [].reduce).\r\n * @function module:list.foldl\r\n * @param fn {Function}\r\n * @param zero {*} - Aggregator.\r\n * @param functor {Array}\r\n * @returns {*} - Whatever type is lastly returned from `fn`.\r\n */\r\n foldl = reduce,\r\n\r\n /**\r\n * Right associative fold. Reduces a container of elements down by the given operation (same as [].reduceRight).\r\n * @function module:list.foldr\r\n * @param fn {Function}\r\n * @param zero {*} - Aggregator.\r\n * @param functor {Array}\r\n * @returns {*} - Whatever type is lastly returned from `fn`.\r\n */\r\n foldr = reduceRight,\r\n\r\n /**\r\n * A variant of `foldl` except that this one doesn't require the starting point. The starting point/value will be pulled\r\n * out from a copy of the container.\r\n * @function module:list.foldl1\r\n * @param op {Function}\r\n * @param xs {Array}\r\n * @returns {*} - Whatever type is lastly returned from `op`.\r\n */\r\n foldl1 = curry((op, xs) => {\r\n const parts = uncons(xs);\r\n return !parts ? [] : reduce(op, parts[0], parts[1]);\r\n }),\r\n\r\n /**\r\n * A variant of `foldr` except that this one doesn't require the starting point/value. The starting point/value will be pulled\r\n * out from a copy of the container.\r\n * @function module:list.foldr1\r\n * @param op {Function}\r\n * @param xs {Array}\r\n * @returns {*} - Whatever type is lastly returned from `op`.\r\n */\r\n foldr1 = curry((op, xs) => {\r\n const parts = unconsr(xs);\r\n return !parts ? [] : reduceRight(op, parts[1], parts[0]);\r\n }),\r\n\r\n /**\r\n * Performs a map then a reduce all in one (from left-to-right). Returns a tuple\r\n * containing the aggregated value and the result of mapping the passed in function on passed in list.\r\n * @function module:list.mapAccumL\r\n * @param op {Function} - Function : [aggregated, mapResult]\r\n * @param zero {*} - An instance of the passed in list type used to aggregateArray on.\r\n * @param xs {Array} - list type.\r\n * @return {Array} - [aggregated, list]\r\n */\r\n mapAccumL = curry((op, zero, xs) => {\r\n const list = sliceCopy(xs),\r\n limit = length(xs);\r\n if (!limit) {\r\n return [zero, list];\r\n }\r\n let ind = 0,\r\n agg = zero,\r\n mapped = [],\r\n tuple;\r\n for (; ind < limit; ind++) {\r\n tuple = op(agg, list[ind], ind);\r\n agg = tuple[0];\r\n mapped = tuple[1];\r\n }\r\n return [agg, mapped];\r\n }),\r\n\r\n /**\r\n * Performs a map and a reduce all in one (from right-to-left). Returns a tuple\r\n * containing the aggregated value and the result of mapping the passed in function on passed in list.\r\n * @function module:list.mapAccumR\r\n * @param op {Function} - Function : [aggregated, mapResult]\r\n * @param zero {*} - An instance of the passed in list type used to aggregateArray on.\r\n * @param xs {Array} - list type.\r\n * @return {Array} - [aggregated, list]\r\n */\r\n mapAccumR = curry((op, zero, xs) => {\r\n const list = sliceCopy(xs),\r\n limit = length(xs);\r\n if (!limit) {\r\n return [zero, list];\r\n }\r\n let ind = limit - 1,\r\n agg = zero,\r\n mapped = [],\r\n tuple;\r\n for (; ind >= 0; ind--) {\r\n tuple = op(agg, list[ind], ind);\r\n agg = tuple[0];\r\n mapped = tuple[1];\r\n }\r\n return [agg, mapped];\r\n }),\r\n\r\n /**\r\n * iterate f x returns an infinite list of repeated applications of f to x.\r\n * @function module:list.iterate\r\n * @example `iterate(5, f, x) == [x, f(x), f(f(x)), ...]`\r\n * @param limit {Number}\r\n * @param op {Function} - Operation.\r\n * @param x {*} - Starting point.\r\n * @returns {*}\r\n */\r\n iterate = curry((limit, op, x) => {\r\n let ind = 0,\r\n out = [],\r\n lastX = x;\r\n for (; ind < limit; ind += 1) {\r\n out.push(lastX);\r\n lastX = op(lastX, ind);\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Repeats `x` `limit` number of times.\r\n * @function module:list.repeat\r\n * @param limit {Number}\r\n * @param x {*}\r\n * @return {Array}\r\n */\r\n repeat = curry((limit, x) => iterate(limit, a => a, x)),\r\n\r\n /**\r\n * Same as `repeat` due to the nature of javascript (see haskell version for usage).\r\n * @function module:list.replicate\r\n * @param limit {Number}\r\n * @param x {*}\r\n * @return {Array}\r\n */\r\n replicate = repeat,\r\n\r\n /**\r\n * Replicates a list `limit` number of times and appends the results (concat)\r\n * @function module:list.cycle\r\n * @param limit {Number}\r\n * @param xs {Array}\r\n * @returns {Array}\r\n */\r\n cycle = curry((limit, xs) => concat(replicate(limit, xs))),\r\n\r\n /**\r\n * Unfolds a value into a list of somethings.\r\n * @haskellType `unfoldr :: (b -> Maybe (a, b)) -> b -> [a]`\r\n * @function module:list.unfoldr\r\n * @param op {Function} - Operation to perform (should return a two component tuple (item to aggregateArray and item to unfold in next iteration).\r\n * @param x {*} - Starting parameter to unfold from.\r\n * @returns {Array} - An array of whatever you return from `op` yielded.\r\n */\r\n unfoldr = curry((op, x) => {\r\n let ind = 0,\r\n out = [],\r\n resultTuple = op(x, ind, out);\r\n while (resultTuple) {\r\n out.push(resultTuple[0]);\r\n resultTuple = op(resultTuple[1], ++ind, out);\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Finds index in string or list (alias for `findIndex`).\r\n * @function module:list.findIndex\r\n * @param pred {Function} - Predicate.\r\n * @param arr {Array|String}\r\n * @returns {Number} - `-1` if predicate not matched else `index` found\r\n */\r\n findIndex = findIndexWhere,\r\n\r\n /**\r\n * @function module:list.findIndices\r\n * @param pred {Function}\r\n * @param xs {Array} - list or list like.\r\n * @returns {Array|undefined}\r\n */\r\n findIndices = findIndicesWhere,\r\n\r\n /**\r\n * @function module:list.elemIndex\r\n * @param x {*} - Element to search for.\r\n * @param xs {Array} - list or list like.\r\n * @returns {*}\r\n */\r\n elemIndex = curry((x, xs) => {\r\n const foundInd = indexOf(x, xs);\r\n return foundInd !== -1 ? foundInd : undefined;\r\n }),\r\n\r\n /**\r\n * @function module:list.elemIndices\r\n * @param value {*} - Element to search for.\r\n * @param xs {Array} - list or list like.\r\n * @returns {*}\r\n */\r\n elemIndices = curry((value, xs) => findIndices(x => x === value, xs)),\r\n\r\n /**\r\n * Takes `n` items from start of list to `limit` (exclusive).\r\n * @function module:list.take\r\n * @param list {Array|String}\r\n * @param limit {Number}\r\n * @returns {String|Array} - Passed in type's type\r\n */\r\n take = sliceTo,\r\n\r\n /**\r\n * Drops `n` items from start of list to `count` (exclusive).\r\n * @function module:list.drop\r\n * @param list {Array|String}\r\n * @param count {Number}\r\n * @returns {String|Array} - Passed in type's type\r\n */\r\n drop = sliceFrom,\r\n\r\n /**\r\n * Splits `x` in two at given `index` (exclusive (includes element/character at\r\n * given index in second part of returned list)).\r\n * @function module:list.splitAt\r\n * @param ind {Number} - Index to split at.\r\n * @param list {Array|String} - functor (list or string) to split.\r\n * @returns {Array|String} - List like type passed\r\n */\r\n splitAt = (ind, list) => [sliceTo(ind, list), sliceFrom(ind, list)],\r\n\r\n /**\r\n * Gives an list with passed elements while predicate was true.\r\n * @function module:list.takeWhile\r\n * @param pred {Function} - Predicate<*, index, list|string>\r\n * @param list {Array|String}\r\n * @returns {Array}\r\n */\r\n takeWhile = curry((pred, list) =>\r\n reduceUntil(\r\n negateF3(pred), // predicate\r\n isString(list) ?\r\n (agg, x) => agg + x :\r\n aggregateArray, // operation\r\n of(list), // aggregate\r\n list\r\n )),\r\n\r\n /**\r\n * Returns an list without elements that match predicate.\r\n * @function module:list.dropWhile\r\n * @param pred {Function} - Predicate<*, index, list|string>\r\n * @param list {Array|String}\r\n * @refactor\r\n * @returns {Array|String}\r\n */\r\n dropWhile = curry((pred, list) => {\r\n const limit = length(list),\r\n splitPoint =\r\n findIndexWhere(\r\n (x, i, xs) => !pred(x, i, xs),\r\n list\r\n );\r\n\r\n return splitPoint === -1 ?\r\n sliceFrom(limit, list) :\r\n slice(splitPoint, limit, list);\r\n }),\r\n\r\n /**\r\n * @function module:list.dropWhileEnd\r\n * @param pred {Function} - Predicate<*, index, list|string>\r\n * @param list {Array|String}\r\n * @refactor\r\n * @returns {Array|String}\r\n */\r\n dropWhileEnd = curry((pred, list) => {\r\n const splitPoint =\r\n findIndexWhereRight(\r\n (x, i, xs) => !pred(x, i, xs),\r\n list\r\n );\r\n if (splitPoint === -1) {\r\n return of(list);\r\n }\r\n return sliceTo(splitPoint + 1, list);\r\n }),\r\n\r\n /**\r\n * Gives you the `span` of items matching predicate\r\n * and items not matching predicate; E.g., Gives an\r\n * array of arrays; E.g., [[matching-items], [non-matching-items]]\r\n * @function list.span\r\n * @param pred {Function} - List predicate (`(x, i, list) => bool`)\r\n * @param list {Array|String}\r\n * @returns {(Array>|Array)}\r\n * @type {Function}\r\n */\r\n span = curry((pred, list) => {\r\n const splitPoint = findIndexWhere(negateF3(pred), list);\r\n return splitPoint === -1 ?\r\n [sliceFrom(0, list), of(list)] :\r\n splitAt(splitPoint, list);\r\n }),\r\n\r\n /**\r\n * breakOnList, applied to a predicate p and a list xs, returns a tuple\r\n * where first element is longest prefix (possibly empty) of xs of elements\r\n * that do not satisfy p and second element is the remainder of the list:\r\n * @haskellExample\r\n * Replace `break` with `breakOnList` for our version.\r\n * ```\r\n * breakOnList (> 3) [1,2,3,4,1,2,3,4] == ([1,2,3],[4,1,2,3,4])\r\n * breakOnList (< 9) [1,2,3] == ([],[1,2,3])\r\n * breakOnList (> 9) [1,2,3] == ([1,2,3],[])\r\n * ```\r\n * @function module:list.breakOnList\r\n * @param pred {Function}\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n breakOnList = curry((pred, list) => {\r\n const splitPoint = findIndexWhere(negateF3(pred), list);\r\n return splitPoint === -1 ?\r\n [of(list), sliceFrom(0, list)] : reverse(splitAt(splitPoint, list));\r\n }),\r\n\r\n /**\r\n * Gets item at index.\r\n * @function module:list.at\r\n * @param ind {Number} - Index.\r\n * @param xs {Array} - list or list like.\r\n * @returns {*|undefined} - Item or `undefined`.\r\n */\r\n at = lookup,\r\n\r\n /**\r\n * Find an item in structure of elements based on given predicate (`pred`).\r\n * @function module:list.find\r\n * @param pred {Function}\r\n * @param xs {Array} - list or list like.\r\n * @returns {*} - Found item.\r\n */\r\n find = findWhere,\r\n\r\n /**\r\n * For each function (same as `[].forEach` except in functional format).\r\n * @function module:list.forEach\r\n * @param fn {Function} - Operation (`(element, index, list) => {...}`, etc.)\r\n * @param xs {(Array|String)}\r\n * @returns {void}\r\n */\r\n forEach = curry((fn, list) => {\r\n const limit = length(list);\r\n if (!limit) {\r\n return;\r\n }\r\n let ind = 0;\r\n for (; ind < limit; ind += 1) {\r\n fn(list[ind], ind, list);\r\n }\r\n }),\r\n\r\n /**\r\n * Filters a structure of elements using given predicate (`pred`) (same as `[].filter`).\r\n * @function module:list.filter\r\n * @param pred {Function}\r\n * @param xs {Array} - list or list like.\r\n * @returns {Array} - Structure of filtered elements.\r\n */\r\n filter = curry((pred, xs) => {\r\n let ind = 0,\r\n limit = length(xs),\r\n out = [];\r\n if (!limit) {\r\n return out;\r\n }\r\n for (; ind < limit; ind++) {\r\n if (pred(xs[ind], ind, xs)) {\r\n out.push(xs[ind]);\r\n }\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Partitions a list on a predicate; Items that match predicate are in first list in tuple; Items that\r\n * do not match the tuple are in second list in the returned tuple.\r\n * Essentially `[filter(p, xs), filter(negateF3(p), xs)]`.\r\n * @function module:list.partition\r\n * @param pred {Function} - Predicate\r\n * @param list {Array}\r\n * @returns {Array|String} - Tuple of arrays or strings (depends on incoming list (of type list or string)).\r\n */\r\n partition = curry((pred, list) =>\r\n !length(list) ?\r\n [[], []] :\r\n [filter(pred, list), filter(negateF3(pred), list)]),\r\n\r\n /**\r\n * Returns a boolean indicating whether an element exists in given structure of elements.\r\n * @function module:list.elem\r\n * @param element {*}\r\n * @param xs {Array}\r\n * @returns {Boolean}\r\n */\r\n elem = includes,\r\n\r\n /**\r\n * The opposite of `elem` - Returns a boolean indicating whether an element exists in given list.\r\n * @function module:list.notElem\r\n * @param element {*}\r\n * @param xs {Array}\r\n * @returns {Boolean}\r\n */\r\n notElem = negateF2(includes),\r\n\r\n /**\r\n * Checks if list `xs1` is a prefix of list `xs2`\r\n * @function module:list.isPrefixOf\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {boolean}\r\n */\r\n isPrefixOf = curry((xs1, xs2) => {\r\n const limit1 = length(xs1),\r\n limit2 = length(xs2);\r\n if (limit2 < limit1 || !limit1 || !limit2 || indexOf(xs1[0], xs2) === -1) {\r\n return false;\r\n }\r\n let ind = 0;\r\n for (; ind < limit1; ind++) {\r\n if (xs1[ind] !== xs2[ind]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }),\r\n\r\n /**\r\n * Checks if list `xs1` is a suffix of list `xs2`\r\n * @function module:list.isSuffixOf\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {boolean}\r\n */\r\n isSuffixOf = curry((xs1, xs2) => {\r\n const limit1 = length(xs1),\r\n limit2 = length(xs2);\r\n if (limit2 < limit1 || !limit1 || !limit2 || indexOf(xs1[0], xs2) === -1) {\r\n return false;\r\n }\r\n let ind1 = limit1 - 1,\r\n ind2 = limit2 - 1;\r\n for (; ind1 >= 0; ind1--) {\r\n if (xs1[ind1] !== xs2[ind2]) {\r\n return false;\r\n }\r\n ind2 -= 1;\r\n }\r\n return true;\r\n }),\r\n\r\n /**\r\n * Checks if list `xs1` is an infix of list `xs2`\r\n * @function module:list.isInfixOf\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {boolean}\r\n */\r\n isInfixOf = curry((xs1, xs2) => {\r\n const limit1 = length(xs1),\r\n limit2 = length(xs2);\r\n if (limit2 < limit1 || !limit1 || !limit2) {\r\n return false;\r\n }\r\n let ind1,\r\n foundLen,\r\n ind = 0;\r\n for (; ind < limit2; ind += 1) {\r\n foundLen = 0;\r\n for (ind1 = 0; ind1 < limit1; ind1 += 1) {\r\n if (xs2[ind1 + ind] === xs1[ind1]) {\r\n foundLen += 1;\r\n }\r\n if (foundLen === limit1) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }),\r\n\r\n /**\r\n * Checks if list `xs1` is a sub-sequence of list `xs2`\r\n * @function module:list.isSubsequenceOf\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {boolean}\r\n */\r\n isSubsequenceOf = curry((xs1, xs2) => {\r\n const len = Math.pow(2, length(xs2)),\r\n lenXs1 = length(xs1);\r\n let foundLen,\r\n i;\r\n for (i = 0; i < len; i += 1) {\r\n foundLen = 0;\r\n for (let j = 0; j < len; j += 1) {\r\n if (i & (1 << j) && indexOf(xs2[j], xs1) > -1) {\r\n foundLen += 1;\r\n }\r\n if (foundLen === lenXs1) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }),\r\n\r\n /**\r\n * The group function takes a list and returns a list of lists such that\r\n * the concatenation of the result is equal to the argument. Moreover, each\r\n * sublist in the result contains only equal elements. For example,\r\n * `group \"Mississippi\" = [\"M\",\"i\",\"ss\",\"i\",\"ss\",\"i\",\"pp\",\"i\"]`\r\n * It is a special case of groupBy, which allows the programmer to supply\r\n * their own equality test.\r\n * @haskellType `group :: Eq a => [a] -> [[a]]`\r\n * @function module:list.group\r\n * @param xs {Array|String}\r\n * @returns {Array|*}\r\n */\r\n group = xs => groupBy((a, b) => a === b, xs),\r\n\r\n /**\r\n * Allows you to group items in a list based on your supplied equality check.\r\n * @note Sames `group` but allows you to specify equality operation.\r\n * @haskellType `groupBy :: (a -> a -> Bool) -> [a] -> [[a]]`\r\n * @function module:list.groupBy\r\n * @param equalityOp {Function}\r\n * @param xs {Array}\r\n * @returns {*}\r\n */\r\n groupBy = curry((equalityOp, xs) => {\r\n const limit = length(xs);\r\n if (!limit) {\r\n return sliceCopy(xs);\r\n }\r\n let ind = 0,\r\n prevItem,\r\n item,\r\n predOp = x => {\r\n if (equalityOp(x, prevItem)) {\r\n ind++;\r\n }\r\n if (equalityOp(x, item)) {\r\n prevItem = x;\r\n return true;\r\n }\r\n return false;\r\n },\r\n agg = [];\r\n for (; ind < limit; ind += 1) {\r\n item = xs[ind];\r\n agg.push(takeWhile(predOp, slice(ind, limit, xs)));\r\n }\r\n return agg;\r\n }),\r\n\r\n /**\r\n * The inits function returns all initial segments of the argument, shortest first. For example,\r\n * ```\r\n * shallowEquals(inits('abc'), ['','a','ab','abc'])\r\n * ```\r\n * @function module:list.inits\r\n * @haskellType `inits :: [a] -> [[a]]`\r\n * @param xs {Array}\r\n * @returns {Array}\r\n */\r\n inits = xs => {\r\n let limit = length(xs),\r\n ind = 0,\r\n agg = [];\r\n if (!limit) {\r\n return [];\r\n }\r\n for (; ind <= limit; ind += 1) {\r\n agg.push(sliceTo(ind, xs));\r\n }\r\n return agg;\r\n }, //map(list => init(list), xs),\r\n\r\n /**\r\n * The inits function returns all initial segments of the argument, shortest first. For example,\r\n * ```\r\n * shallowEquals(tails('abc'), ['abc', 'bc', 'c',''])\r\n * ```\r\n * @function module:list.tails\r\n * @haskellType `tails :: [a] -> [[a]]`\r\n * @param xs {Array}\r\n * @returns {Array}\r\n */\r\n tails = xs => {\r\n let limit = length(xs),\r\n ind = 0,\r\n agg = [];\r\n if (!limit) {\r\n return [];\r\n }\r\n for (; ind <= limit; ind += 1) {\r\n agg.push(slice(ind, limit, xs));\r\n }\r\n return agg;\r\n }, //map(list => tail(list), xs),\r\n\r\n /**\r\n * Strips prefix list from given list\r\n * @function module:list.stripPrefix\r\n * @param prefix {Array|String|*}\r\n * @param list {Array|string|*}\r\n * @returns {Array|*}\r\n */\r\n stripPrefix = curry((prefix, list) =>\r\n isPrefixOf(prefix, list) ?\r\n splitAt(length(prefix), list)[1] :\r\n sliceCopy(list)),\r\n\r\n /**\r\n * zip takes two lists and returns a list of corresponding pairs.\r\n * If one input list is short, excess elements of the longer list are discarded.\r\n * @haskellType `zip :: [a] -> [b] -> [(a, b)]`\r\n * @function module:list.zip\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @returns {Array>}\r\n */\r\n zip = curry((arr1, arr2) => {\r\n if (!length(arr1) || !length(arr2)) {\r\n return [];\r\n }\r\n const [a1, a2] = toShortest(arr1, arr2);\r\n return reduce((agg, item, ind) =>\r\n aggregateArray(agg, [item, a2[ind]]),\r\n [], a1);\r\n }),\r\n\r\n /**\r\n * zipN takes one or more lists and returns a list containing lists of all indices\r\n * at a given index, index by index.\r\n * If one input list is short, excess elements of the longer list are discarded.\r\n * @function module:list.zipN\r\n * @param lists {Array|String} - One ore more lists of the same type.\r\n * @returns {Array}\r\n */\r\n zipN = curry2((...lists) => {\r\n const trimmedLists = apply(toShortest, lists);\r\n return reduce((agg, item, ind) =>\r\n aggregateArray(agg, map(xs => xs[ind], trimmedLists)),\r\n [], trimmedLists[0]);\r\n }),\r\n\r\n /**\r\n * @haskellType `zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]`\r\n * @function module:list.zip3\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @param arr3 {Array}\r\n * @returns {Array>}\r\n */\r\n zip3 = curry((arr1, arr2, arr3) => zipN(arr1, arr2, arr3)),\r\n\r\n /**\r\n * @haskellType `zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]`\r\n * @function module:list.zip4\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @param arr3 {Array}\r\n * @param arr4 {Array}\r\n * @returns {Array>}\r\n */\r\n zip4 = curry((arr1, arr2, arr3, arr4) => zipN(arr1, arr2, arr3, arr4)),\r\n\r\n /**\r\n * @haskellType `zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]`\r\n * @function module:list.zip5\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @param arr3 {Array}\r\n * @param arr4 {Array}\r\n * @param arr5 {Array}\r\n * @returns {Array>}\r\n */\r\n zip5 = curry((arr1, arr2, arr3, arr4, arr5) => zipN(arr1, arr2, arr3, arr4, arr5)),\r\n\r\n /**\r\n * zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]\r\n * zipWith generalises zip by zipping with the function given as the\r\n * first argument, instead of a function tupling function (function that returns a tuple). For example,\r\n * zipWith (+) is applied to two lists to produce the list of corresponding sums.\r\n * @note `_|_` means bottom or perpetual (@see\r\n * - https://wiki.haskell.org/Bottom\r\n * - https://stackoverflow.com/questions/19794681/what-does-this-syntax-mean-in-haskell-or\r\n * )\r\n * @example\r\n * ```\r\n * zipWith f [] _|_ = []\r\n * ```\r\n * @haskellType `zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]`\r\n * @function module:list.zipWith\r\n * @param op {Function} - Takes two parts of a tuple and returns a tuple.\r\n * E.g., ` op :: a -> b -> (a, b)`\r\n * @param xs1 {Array}\r\n * @param xs2 {Array}\r\n * @returns {Array>}\r\n */\r\n zipWith = curry((op, xs1, xs2) => {\r\n if (!length(xs1) || !length(xs2)) {\r\n return [];\r\n }\r\n const [a1, a2] = toShortest(xs1, xs2);\r\n return reduce((agg, item, ind) =>\r\n aggregateArray(agg, op(item, a2[ind])),\r\n [], a1);\r\n }),\r\n\r\n /**\r\n * Zips all given lists with tupling function. Note: Haskell types do not have\r\n * a way (that I know of) to show one or more for params in a function so `@haskellType` below\r\n * is left there for general purpose not for exactness as is told by aforementioned.\r\n * @haskellType `zipWithN :: (a -> b -> c) -> [a] -> [b] -> [c]` - Where `N` is the number\r\n * of lists to zip.\r\n * @function module:list.zipWithN\r\n * @param op {Function} - Takes expected number of parts for tuple and returns a tuple\r\n * of said parts:\r\n * E.g., ` op :: a -> b -> c -> (a, b, c)`\r\n * @param lists ...{Array}\r\n * @returns {Array>}\r\n */\r\n zipWithN = curry3((op, ...lists) => {\r\n const trimmedLists = apply(toShortest, lists),\r\n lenOfTrimmed = length(trimmedLists);\r\n if (!lenOfTrimmed) {\r\n return [];\r\n }\r\n else if (lenOfTrimmed === 1) {\r\n return sliceTo(length(trimmedLists[0]), trimmedLists[0]);\r\n }\r\n return reduce((agg, item, ind) =>\r\n aggregateArray(agg, apply(op, map(xs => xs[ind], trimmedLists))),\r\n [], trimmedLists[0]);\r\n }),\r\n\r\n /**\r\n * Zips 3 lists with tupling function.\r\n * @haskellType `zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]`\r\n * @function module:list.zipWith3\r\n * @param op {Function} - Takes expected number of parts for tuple and returns a tuple\r\n * of said parts:\r\n * E.g., ` op :: a -> b -> c -> (a, b, c)`\r\n * @param xs1 {Array}\r\n * @param xs2 {Array}\r\n * @param xs3 {Array}\r\n * @returns {Array>}\r\n */\r\n zipWith3 = curry((op, xs1, xs2, xs3) => zipWithN(op, xs1, xs2, xs3)),\r\n\r\n /**\r\n * Zips 4 lists with tupling function.\r\n * @haskellType `zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]`\r\n * @function module:list.zipWith4\r\n * @param op {Function} - Takes expected number of parts for tuple and returns a tuple\r\n * of said parts:\r\n * E.g., ` op :: a -> b -> c -> d -> (a, b, c, d)`\r\n * @param xs1 {Array}\r\n * @param xs2 {Array}\r\n * @param xs3 {Array}\r\n * @param xs4 {Array}\r\n * @returns {Array>}\r\n */\r\n zipWith4 = curry((op, xs1, xs2, xs3, xs4) => zipWithN(op, xs1, xs2, xs3, xs4)),\r\n\r\n /**\r\n * Zips 5 lists.\r\n * @haskellType `zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]`\r\n * @function module:list.zipWith5\r\n * @param op {Function} - Takes expected number of parts for tuple and returns a tuple\r\n * of said parts:\r\n * E.g., ` op :: a -> b -> c -> d -> e -> (a, b, c, d, e)`\r\n * @param xs1 {Array}\r\n * @param xs2 {Array}\r\n * @param xs3 {Array}\r\n * @param xs4 {Array}\r\n * @param xs5 {Array}\r\n * @returns {Array>}\r\n */\r\n zipWith5 = curry((op, xs1, xs2, xs3, xs4, xs5) => zipWithN(op, xs1, xs2, xs3, xs4, xs5)),\r\n\r\n /**\r\n * unzip transforms a list of pairs into a list of first components and a list of second components.\r\n * @haskellType `unzip :: [(a, b)] -> ([a], [b])`\r\n * @function module:list.unzip\r\n * @param arr {Array|*}\r\n * @returns {Array|*}\r\n */\r\n unzip = foldl((agg, item) => {\r\n agg[0].push(item[0]);\r\n agg[1].push(item[1]);\r\n return agg;\r\n }, [[], []]),\r\n\r\n /**\r\n * unzip transforms a list of pairs into a list of first components and a list of second components.\r\n * @sudoHaskellType `unzipN :: [(a, b, ...x)] -> ([a], [b], ...[x])`\r\n * @function module:list.unzipN\r\n * @param list {Array|*} - List of tuples (lists).\r\n * @returns {Array|*}\r\n */\r\n unzipN = list => {\r\n if (!length(list)) {\r\n return [];\r\n }\r\n const lenItem0 = length(list[0]);\r\n let zero = lenItem0 ?\r\n unfoldr(numLists => numLists-- ? [[], numLists] : undefined, lenItem0) :\r\n [];\r\n return foldl((agg, item) => {\r\n agg.forEach((outList, ind) => outList.push(item[ind]));\r\n return agg;\r\n }, zero, list);\r\n },\r\n\r\n /**\r\n * Returns true if any item in container passes predicate `p`.\r\n * @function module:list.any\r\n * @param p {Function} - Predicate.\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n any = curry((p, xs) => {\r\n let ind = 0,\r\n limit = length(xs);\r\n if (!limit) {\r\n return false;\r\n }\r\n for (; ind < limit; ind += 1) {\r\n if (p(xs[ind])) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }),\r\n\r\n /**\r\n * Returns true if all items in container pass predicate `p`.\r\n * @function module:list.all\r\n * @param p {Function} - Predicate.\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n all = curry((p, xs) => {\r\n const limit = length(xs);\r\n let ind = 0;\r\n if (!limit) {\r\n return false;\r\n }\r\n for (; ind < limit; ind++) {\r\n if (!p(xs[ind], ind, xs)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }),\r\n\r\n /**\r\n * Conjuction of container of bools (or truthy and/or falsy values); Returns\r\n * `true` if all in container are 'truthy' else returns `false`\r\n * @function module:list.and\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n and = xs => all(isTruthy, xs),\r\n\r\n /**\r\n * Returns a boolean indicating whether any item in container is 'truthy' or not.\r\n * **Note** The haskell type for this function only takes two items, but here\r\n * we allow the passing of more than one item (may change later to adhere to the haskell type).\r\n * @function module:list.or\r\n * @haskellType `or :: Bool -> Bool -> Bool`\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n or = xs => any(isTruthy, xs),\r\n\r\n /**\r\n * Returns a boolean indicating whether all items in container are 'falsy' or not.\r\n * **Note** The haskell type for this function only takes two items, but here\r\n * we allow the passing of more than one item (may change later to adhere to the haskell type).\r\n * @function module:list.not\r\n * @haskellType `not :: Bool -> Bool`\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n not = xs => all(isFalsy, xs),\r\n\r\n /**\r\n * Computes the sum of the numbers of a structure.\r\n * @function module:list.sum\r\n * @haskellType `sum :: (List t, Num a) => t a -> a`\r\n * @param list {Array|String}\r\n * @returns {Number}\r\n */\r\n sum = list => foldl((agg, x) => agg + x, 0, list),\r\n\r\n /**\r\n * Computes the product of the numbers of a structure.\r\n * @function module:list.product\r\n * @haskellType `product :: (List t, Num a) => t a -> a`\r\n * @param list {Array|String}\r\n * @returns {Number}\r\n */\r\n product = list => foldl((agg, x) => agg * x, 1, list),\r\n\r\n /**\r\n * Returns the largest element in a non-empty structure of elements.\r\n * @function module:list.maximum\r\n * @haskellType `maximum :: forall a . Ord a => t a -> a`\r\n * @param list {Array|String}\r\n * @returns {*} - Whatever type the array is made of (if any).\r\n */\r\n maximum = list => last(sortBy(genericAscOrdering, list)),\r\n\r\n /**\r\n * Returns the smallest element in a non-empty structure of elements.\r\n * @function module:list.minimum\r\n * @haskellType `minimum :: forall a . Ord a => t a -> a`\r\n * @param list {Array|String}\r\n * @returns {*} - Whatever type the array is made of (if any).\r\n */\r\n minimum = list => head(sortBy(genericAscOrdering, list)),\r\n\r\n /**\r\n * scanl is similar to foldl, but returns a list of successive reduced values from the left:\r\n * ```\r\n * scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]\r\n * ```\r\n * Also note that:\r\n * ```\r\n * last (scanl f z xs) == foldl f z xs.\r\n * ```\r\n * @function module:list.scanl\r\n * @param fn {Function}\r\n * @param zero {*}\r\n * @param xs {Array}\r\n * @returns {Array|*}\r\n */\r\n scanl = curry((fn, zero, xs) => {\r\n if (!xs || !length(xs)) {\r\n return [];\r\n }\r\n const limit = length(xs);\r\n let ind = 0,\r\n result = zero,\r\n out = [];\r\n while (ind < limit) {\r\n result = fn(result, xs[ind], ind, xs);\r\n out.push(result);\r\n ind++;\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * `scanl1` is a variant of `scanl` that has no starting value argument:\r\n * `shallowCompare(scanl1(fn, [x1, x2, ...]), [x1, fn(x1, x2), ...]) // true`\r\n * @function module:list.scanl1\r\n * @param fn {Function}\r\n * @param xs {Array}\r\n * @returns {Array|*}\r\n */\r\n scanl1 = curry((fn, xs) => {\r\n if (!xs || !xs.length) {\r\n return [];\r\n }\r\n return scanl(fn, head(xs), tail(xs));\r\n }),\r\n\r\n /**\r\n * Same as `scanl` but from the right (similiar to `foldr`'s relationship to 'foldl').\r\n * Note also `scanr`'s relationship ot `foldr`:\r\n * `head (scanr(fn, z, xs)) === foldr(fn, z, xs).\r\n * @function module:list.scanr\r\n * @param fn {Function}\r\n * @param zero {*}\r\n * @param xs {Array}\r\n * @returns {Array|*}\r\n */\r\n scanr = curry((fn, zero, xs) => {\r\n if (!xs || !length(xs)) {\r\n return [];\r\n }\r\n const limit = length(xs);\r\n let ind = limit - 1,\r\n result = xs[0],\r\n out = [];\r\n while (ind > -1) {\r\n result = fn(result, xs[ind], ind, xs);\r\n out.push(result);\r\n ind--;\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Same as `scanr` but takes no zero/accumulator value.\r\n * @function module:list.scanr1\r\n * @param fn {Function}\r\n * @param xs {Array}\r\n * @returns {Array|*}\r\n */\r\n scanr1 = curry((fn, xs) => {\r\n if (!xs || !xs.length) {\r\n return [];\r\n }\r\n return scanr(fn, last(xs), init(xs));\r\n }),\r\n\r\n /**\r\n * The nub function removes duplicate elements from a list.\r\n * In particular, it keeps only the first occurrence of each element.\r\n * (The name nub means `essence'.) It is a special case of nubBy, which\r\n * allows the programmer to supply their own equality test.\r\n * ```shallowCompare( nub ([1,2,3,4,3,2,1,2,4,3,5]), [1,2,3,4,5] )```\r\n * @function module:list.nub\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n nub = list => nubBy((a, b) => a === b, list),\r\n\r\n /**\r\n * `remove(x, xs)` removes the first occurrence of `x` from `xs`.\r\n * For example, `remove('a', 'banana') === 'bnana';`\r\n * @function module:list.remove\r\n * @param x {*}\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n remove = curry((x, list) => removeBy((a, b) => a === b, x, list)),\r\n\r\n /**\r\n * The sort function implements a stable sorting algorithm.\r\n * It is a special case of sortBy, which allows the programmer\r\n * to supply their own comparison function.\r\n * ```shallowCompare(sort ([1,6,4,3,2,5]), [1,2,3,4,5,6]) // true```\r\n * @function module:list.sort\r\n * @param xs {Array|String|*}\r\n * @returns {Array}\r\n */\r\n sort = xs => sortBy(genericAscOrdering, xs),\r\n\r\n /**\r\n * Sort a list by comparing the results of a key function applied to each\r\n * element. sortOn f is equivalent to sortBy (comparing f), but has the\r\n * performance advantage of only evaluating f once for each element in the\r\n * input list. This is called the decorate-sort-undecorate paradigm, or\r\n * Schwartzian transform.\r\n *\r\n * Elements are arranged from from lowest to highest, keeping duplicates\r\n * in the order they appeared in the input.\r\n *\r\n * Ex:\r\n * ```\r\n * shallowEquals(\r\n * sortOn (head, [[2, \"world\"], [4, \"!\"], [1, \"Hello\"]]),\r\n * [[1,\"Hello\"],[2,\"world\"],[4,\"!\"]]\r\n * ) // true\r\n * ```\r\n * @function module:list.sortOn\r\n * @param valueFn {Function}\r\n * @param xs {Array|String|*}\r\n * @returns {Array}\r\n */\r\n sortOn = curry((valueFn, xs) =>\r\n\r\n // Un-decorate\r\n map(decorated => decorated[1],\r\n\r\n // Decorate and sort\r\n sortBy(\r\n // Ordering\r\n ([a0], [b0]) => genericAscOrdering(a0, b0),\r\n\r\n // Decorate\r\n map(item => [valueFn(item), item], xs)\r\n )\r\n )\r\n ),\r\n\r\n /**\r\n * The sortBy function is the non-overloaded (in haskell terms) version of sort.\r\n * @haskellExample ```\r\n * >>> sortBy (\\(a,_) (b,_) -> compare a b) [(2, \"world\"), (4, \"!\"), (1, \"Hello\")]\r\n * [(1,\"Hello\"),(2,\"world\"),(4,\"!\")]\r\n * ```\r\n * @function module:list.sortBy\r\n * @param orderingFn {Function}\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n sortBy = curry((orderingFn, xs) => sliceCopy(xs).sort(orderingFn || genericAscOrdering)),\r\n\r\n /**\r\n * The insert function takes an element and a list and inserts the element\r\n * into the list at the first position where it is less than or equal to the\r\n * next element. In particular, if the list is sorted before the call, the\r\n * result will also be sorted. It is a special case of insertBy, which allows\r\n * the programmer to supply their own comparison function.\r\n * @function module:list.insert\r\n * @param x {*}\r\n * @param xs {Array|*}\r\n * @returns {Array}\r\n */\r\n insert = curry((x, xs) => {\r\n if (!xs.length) {\r\n return of(xs, x);\r\n }\r\n const foundIndex = findIndex(item => x <= item, xs);\r\n return foundIndex === -1 ? concat([xs, of(xs, x)]) :\r\n concat(intersperse(of(xs, x), splitAt(foundIndex, xs)));\r\n }),\r\n\r\n /**\r\n * A version of `insert` that allows you to specify the ordering of the inserted\r\n * item; Before/at, or after\r\n * @function module:list.insertBy\r\n * @haskellType `insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]`\r\n * @note `Ordering` means 'something that is order-able'\r\n * operated on by this functions logic.\r\n * @param orderingFn {Function} - A function that returns `-1`, `0`, or 1`.\r\n * @param x {*} - Value to insert.\r\n * @param xs {Array} - List to insert into (note new list is returned)\r\n * @returns {Array} - New list.\r\n */\r\n insertBy = curry((orderingFn, x, xs) => {\r\n const limit = length(xs);\r\n if (!limit) {\r\n return [x];\r\n }\r\n let ind = 0;\r\n for (; ind < limit; ind += 1) {\r\n if (orderingFn(x, xs[ind]) <= 0) {\r\n const parts = splitAt(ind, xs);\r\n return concat([parts[0], [x], parts[1]]);\r\n }\r\n }\r\n return aggregateArray(sliceCopy(xs), x);\r\n }),\r\n\r\n /**\r\n * The nubBy function behaves just like nub, except it uses a user-supplied equality predicate.\r\n * @function module:list.nubBy\r\n * @param pred {Function}\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n nubBy = curry((pred, list) => {\r\n if (!length(list)) {\r\n return [];\r\n }\r\n const limit = length(list);\r\n let ind = 0,\r\n currItem,\r\n out = [],\r\n anyOp = storedItem => pred(currItem, storedItem);\r\n for (; ind < limit; ind += 1) {\r\n currItem = list[ind];\r\n if (any(anyOp, out)) {\r\n continue;\r\n }\r\n out.push(currItem);\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Behaves the same as `remove`, but takes a user-supplied equality predicate.\r\n * @function module:list.removeBy\r\n * @param pred {Function} - Equality predicate `(a, b) => bool`\r\n * @param x {*}\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n removeBy = curry((pred, x, list) => {\r\n const foundIndex = findIndex(item => pred(x, item), list);\r\n if (foundIndex > -1) {\r\n const parts = splitAt(foundIndex, list);\r\n return append(parts[0], tail(parts[1]));\r\n }\r\n return sliceCopy(list);\r\n }),\r\n\r\n /**\r\n * The `removeFirstsBy` function takes a predicate and two lists and returns the first list with the first\r\n * occurrence of each element of the second list removed.\r\n * @function module:list.removeFirstBy\r\n * @param pred {Function}\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {Array}\r\n */\r\n removeFirstsBy = curry((pred, xs1, xs2) =>\r\n foldl((agg, x) => removeBy(pred, x, agg), xs1, xs2)),\r\n\r\n /**\r\n * Returns the union on elements matching boolean check passed in.\r\n * @function module:list.unionBy\r\n * @param pred {Function} - `pred :: a -> a -> Bool`\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @returns {Array}\r\n */\r\n unionBy = curry((pred, arr1, arr2) =>\r\n foldl((agg, b) => {\r\n const alreadyAdded = any(a => pred(a, b), agg);\r\n return !alreadyAdded ? (agg.push(b), agg) : agg;\r\n }, sliceCopy(arr1), arr2\r\n )),\r\n\r\n /**\r\n * Creates a union on matching elements from array1.\r\n * @function module:list.union\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @returns {Array}\r\n */\r\n union = curry((arr1, arr2) =>\r\n append(arr1,\r\n filter(elm => !includes(elm, arr1), arr2))),\r\n\r\n /**\r\n * Performs an intersection on list 1 with elements from list 2.\r\n * @function module:list.intersect\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @returns {Array}\r\n */\r\n intersect = curry((arr1, arr2) =>\r\n !arr1 || !arr2 || (!arr1 && !arr2) ? [] :\r\n filter(elm => includes(elm, arr2), arr1)),\r\n\r\n /**\r\n * Returns an intersection by predicate.\r\n * @function module:list.intersectBy\r\n * @param pred {Function} - `pred :: a -> b -> Bool`\r\n * @param list1 {Array}\r\n * @param list2 {Array}\r\n * @return {Array}\r\n */\r\n intersectBy = curry((pred, list1, list2) =>\r\n foldl((agg, a) =>\r\n any(b => pred(a, b), list2) ? (agg.push(a), agg) : agg\r\n , [], list1)),\r\n\r\n /**\r\n * Returns the difference of list 1 from list 2.\r\n * @note The `difference` operation here is non-associative; E.g., `a - b` is not equal to `b - a`;\r\n * @function module:list.difference\r\n * @param array1 {Array}\r\n * @param array2 {Array}\r\n * @returns {Array}\r\n */\r\n difference = curry((array1, array2) => { // augment this with max length and min length ordering on op\r\n if (array1 && !array2) {\r\n return sliceCopy(array1);\r\n }\r\n else if (!array1 && array2 || (!array1 && !array2)) {\r\n return [];\r\n }\r\n return reduce((agg, elm) =>\r\n !includes(elm, array2) ? (agg.push(elm), agg) : agg\r\n , [], array1);\r\n }),\r\n\r\n /**\r\n * Returns the complement of list 0 and the reset of the passed in arrays.\r\n * @function module:list.complement\r\n * @param arr0 {Array}\r\n * @param arrays {...Array}\r\n * @returns {Array}\r\n */\r\n complement = curry2((arr0, ...arrays) =>\r\n reduce((agg, arr) => append(agg, difference(arr, arr0)), [], arrays));\r\n","/**\r\n * @module errorThrowing\r\n * @description Contains error throwing facilities for when a value doesn't match a type.\r\n */\r\nimport {typeOf} from './object/typeOf';\r\nimport {isArray, toTypeRef, toTypeRefName, isOfType} from './object/is';\r\nimport {curry} from './function/curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Pretty prints an array of types/type-strings for use by error messages;\r\n * Outputs \"`SomeTypeName`, ...\" from [SomeType, 'SomeTypeName', etc...]\r\n * @function module:errorThrowing.typeRefsToStringOrError\r\n * @param types {Array|TypesArray}\r\n * @return {String}\r\n * @private\r\n */\r\n typeRefsToStringOrError = types => types.length ?\r\n types.map(type => `\\`${toTypeRefName(type)}\\``).join(', ') : '',\r\n\r\n /**\r\n * Prints a message from an object. Object signature:\r\n * {contextName, valueName, value, expectedTypeName, foundTypeName, messageSuffix}\r\n * @function module:errorThrowing.defaultErrorMessageCall\r\n * @param tmplContext {Object|TemplateContext} - Object to use in error template.\r\n * @returns {string}\r\n * @private\r\n */\r\n defaultErrorMessageCall = tmplContext => {\r\n const {\r\n contextName, valueName, value, expectedTypeName,\r\n foundTypeName, messageSuffix\r\n } = tmplContext,\r\n isMultiTypeNames = isArray(expectedTypeName),\r\n typesCopy = isMultiTypeNames ? 'of type' : 'of one of the types',\r\n typesToMatchCopy = isMultiTypeNames ? typeRefsToStringOrError(expectedTypeName) : expectedTypeName;\r\n return (contextName ? `\\`${contextName}.` : '`') +\r\n `${valueName}\\` is not ${typesCopy}: ${typesToMatchCopy}. ` +\r\n `Type received: ${foundTypeName}. Value: ${value};` +\r\n `${messageSuffix ? ' ' + messageSuffix + ';' : ''}`;\r\n },\r\n\r\n /**\r\n * Gets the error message thrower seeded with passed in errorMessage template call.\r\n * @function module:errorThrowing.getErrorIfNotTypeThrower$\r\n * @param errorMessageCall {Function|ErrorMessageCall}\r\n * @param typeChecker {Function|TypeChecker} - Function:Boolean\r\n * @returns {Function|ErrorIfNotType}\r\n * @private\r\n */\r\n _getErrorIfNotTypeThrower = (errorMessageCall, typeChecker = isOfType) =>\r\n (ValueType, contextName, valueName, value, messageSuffix = null) => {\r\n const expectedTypeName = toTypeRef(ValueType),\r\n foundTypeName = typeOf(value);\r\n if (typeChecker(ValueType, value)) { return value; } // Value matches type\r\n throw new Error(errorMessageCall(\r\n {contextName, valueName, value, expectedTypeName, foundTypeName, messageSuffix}\r\n ));\r\n },\r\n\r\n /**\r\n * Gets the error message thrower seeded with passed in errorMessage template call.\r\n * @function module:errorThrowing.getErrorIfNotTypesThrower$\r\n * @param errorMessageCall {Function|ErrorMessageCall}\r\n * @param typeChecker {Function|TypeChecker} - Function:Boolean\r\n * @returns {Function|ErrorIfNotTypes}\r\n * @private\r\n */\r\n _getErrorIfNotTypesThrower = (errorMessageCall, typeChecker = isOfType) =>\r\n (valueTypes, contextName, valueName, value, messageSuffix = null) => {\r\n const expectedTypeNames = valueTypes.map(toTypeRef),\r\n matchFound = valueTypes.some(ValueType => typeChecker(ValueType, value)),\r\n foundTypeName = typeOf(value);\r\n if (matchFound) { return value; }\r\n throw new Error(\r\n errorMessageCall({\r\n contextName, valueName, value,\r\n expectedTypeName: expectedTypeNames, foundTypeName,\r\n messageSuffix\r\n })\r\n );\r\n },\r\n\r\n /**\r\n * Checks that passed in `value` is of given `type`. Throws an error if value\r\n * is not of given `type`. This is the un-curried version. For the curried version\r\n * see `module:errorThrowing.errorIfNotType`.\r\n * @function module:errorThrowing.errorIfNotType$\r\n * @param type {String|Function} - Type's name or type itself.\r\n * @param contextName {String} - Name of context to attribute errors if thrown.\r\n * @param valueName {String} - String rep of value.\r\n * @param value {*}\r\n * @param [messageSuffix=null] {String} - Optional.\r\n * @returns {*} - Given `value` if `value` matches passed in type.\r\n * @private\r\n */\r\n _errorIfNotType = _getErrorIfNotTypeThrower(defaultErrorMessageCall),\r\n\r\n /**\r\n * Checks that passed in `value` is of one of the given `types`. Throws an error if value\r\n * is not of one of the given `types`. This is the un-curried version. For the curried version\r\n * see `module:errorThrowing.errorIfNotTypes`.\r\n * @type {Function|module:errorThrowing.errorIfNotTypes}\r\n * @function module:errorThrowing.errorIfNotTypes$\r\n * @param types {Array} - Array of one or more types or type names themselves.\r\n * @param contextName {String} - Name of context to attribute errors if thrown.\r\n * @param valueName {String} - String rep of value.\r\n * @param value {*}\r\n * @returns {*} - Given `value` if `value` matches passed in type.\r\n * @private\r\n */\r\n _errorIfNotTypes = _getErrorIfNotTypesThrower(defaultErrorMessageCall),\r\n\r\n /**\r\n * Returns a function that can be used to ensure that values are of a given type.\r\n * Also throws informative error messages containing the value types, names, expected type names,\r\n * etc.\r\n * @function module:errorThrowing.getErrorIfNotTypeThrower\r\n * @param errorMessageCall {Function|ErrorMessageCall} - Template function (takes an info-object and returns a printed string).\r\n * @returns {Function|ErrorIfNotType} - Returns a function with the same signature as `errorIfNotType` though curried.\r\n */\r\n getErrorIfNotTypeThrower = errorMessageCall => curry(_getErrorIfNotTypeThrower(errorMessageCall)),\r\n\r\n /**\r\n * Returns a function that can be used to ensure that a value is of one or more given types.\r\n * The returned function is used in cases where informative error messages\r\n * containing the value types, names, expected type names, are-required/should-be-used etc.\r\n * @function module:errorThrowing.getErrorIfNotTypesThrower\r\n * @param errorMessageCall {Function|ErrorMessageCall} - Template function (takes an info-object and returns a printed string).\r\n * @returns {Function|ErrorIfNotTypes} - Returns a function with the same signature as `errorIfNotTypes` though curried.\r\n */\r\n getErrorIfNotTypesThrower = errorMessageCall => curry(_getErrorIfNotTypesThrower(errorMessageCall)),\r\n\r\n /**\r\n * Checks that passed in `value` is of given `type`. Throws an error if value\r\n * is not of given `type`. Curried.\r\n * @function module:errorThrowing.errorIfNotType\r\n * @param type {String|Function} - Type's name or type itself.\r\n * @param contextName {String} - Name of context to attribute errors if thrown.\r\n * @param valueName {String} - String rep of value.\r\n * @param value {*}\r\n * @param [messageSuffix=null] {String} - Optional.\r\n * @returns {*} - Given `value` if `value` matches passed in type.\r\n * @curried\r\n */\r\n errorIfNotType = curry(_errorIfNotType),\r\n\r\n /**\r\n * Checks that passed in `value` is of one of the given `types`. Throws an error if value\r\n * is not of one of the given `types`. Curried.\r\n * @function module:errorThrowing.errorIfNotTypes\r\n * @param types {Array} - Array of one or more types or type names themselves.\r\n * @param contextName {String} - Name of context to attribute errors if thrown.\r\n * @param valueName {String} - String rep of value.\r\n * @param value {*}\r\n * @returns {*} - Given `value` if `value` matches passed in type.\r\n * @curried\r\n */\r\n errorIfNotTypes = curry(_errorIfNotTypes)\r\n;\r\n\r\n/**\r\n * @typedef {*} Any - Synonym for 'any value'.\r\n */\r\n\r\n/**\r\n * @typedef {String|Function} TypeRef\r\n * @description Type reference. Type itself or Type's name; E.g., `Type.name`;\r\n */\r\n\r\n/**\r\n * @typedef {Object} TemplateContext\r\n * @description Template context used for error message renderers (functions that take a context obj and return a string).\r\n * @property value {*}\r\n * @property valueName {String}\r\n * @property expectedTypeName {String} - Expected name of constructor of `value`; E.g., usually `SomeConstructor.name`;\r\n * @property foundTypeName {String} - Found types name; E.g., `FoundConstructor.name`;\r\n * @property [messageSuffix=null] {*} - Message suffix (sometimes an extra hint or instructions for\r\n * directing user to fix where his/her error has occurred). Optional.\r\n */\r\n\r\n/**\r\n * @typedef {Array<(String|Function)>} TypesArray\r\n */\r\n\r\n/**\r\n * @typedef {Function} TypeChecker\r\n * @description Checks whether a value is of given type.\r\n * @param Type {TypeRef} - a Type or it's name; E.g., `Type.name`.\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n\r\n/**\r\n * @typedef {Function} ErrorMessageCall\r\n * @description Error message template function.\r\n * @param tmplContext {TemplateContext}\r\n * @returns {String}\r\n */\r\n\r\n/**\r\n * @typedef {Function} ErrorIfNotType\r\n * @description Used to ensure value matches passed in type.\r\n * @param type {TypeRef} - Constructor name or constructor.\r\n * @param contextName {String}\r\n * @param valueName {String}\r\n * @param value {*}\r\n * @throws {Error} - If value doesn't match type.\r\n * @returns {*} - What ever value is.\r\n */\r\n\r\n/**\r\n * @typedef {Function} ErrorIfNotTypes\r\n * @description Used to ensure a value matches one of one or more types passed in.\r\n * @param valueTypes {TypesArray} - Array of constructor names or constructors.\r\n * @param contextName {String}\r\n * @param valueName {String}\r\n * @param value {*}\r\n * @throws {Error} - If value doesn't match type.\r\n * @returns {*} - Whatever value is.\r\n */\r\n","/**\r\n * @module string\r\n * @description Contains functions for strings.\r\n */\r\nimport {intercalate, map, filter} from './list';\r\nimport {split} from './jsPlatform/string';\r\nimport {compose} from './function/compose';\r\nimport {join} from './jsPlatform/array';\r\nimport {_errorIfNotType} from './errorThrowing';\r\n\r\nexport {split};\r\n\r\nexport const\r\n\r\n /**\r\n * Splits a string on all '\\n', '\\r', '\\n\\r', or '\\r\\n' characters.\r\n * @function module:string.lines\r\n * @param str {String}\r\n * @returns {Array}\r\n */\r\n lines = split(/[\\n\\r]/gm),\r\n\r\n /**\r\n * Splits a string on all '\\s' and/or all '\\t' characters.\r\n * @function module:string.words\r\n * @param str{String}\r\n * @returns {Array}\r\n */\r\n words = split(/[\\s\\t]/gm),\r\n\r\n /**\r\n * Intersperse an array of strings with '\\s' and then concats them.\r\n * @function module:string.unwords\r\n * @param arr {String}\r\n * @returns {Array}\r\n */\r\n unwords = intercalate(' '),\r\n\r\n /**\r\n * Intersperses a '\\n' character into a list of strings and then concats it.\r\n * @function module:string.unlines\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n unlines = intercalate('\\n'),\r\n\r\n /**\r\n * Lower cases first character of a non-empty string.\r\n * @function module:string.lcaseFirst\r\n * @param xs {String}\r\n * @returns {string}\r\n * @throws {Error} - Throws error if receiving anything that is not a string.\r\n */\r\n lcaseFirst = xs => {\r\n _errorIfNotType(String, 'lcaseFirst', 'xs', xs);\r\n return xs[0].toLowerCase() + xs.substring(1);\r\n },\r\n\r\n /**\r\n * Upper cases first character of a non-empty string.\r\n * @function module:string.ucaseFirst\r\n * @param xs {String}\r\n * @returns {string}\r\n * @throws {Error} - Throws error if receiving anything that is not a string.\r\n */\r\n ucaseFirst = xs => {\r\n _errorIfNotType(String, 'ucaseFirst', 'xs', xs);\r\n return xs[0].toUpperCase() + xs.substring(1);\r\n },\r\n\r\n /**\r\n * Camel cases (class case) a string.\r\n * @function module:string.camelCase\r\n * @param xs {String}\r\n * @param [pattern=/[^a-z\\d/i]/] {RegExp} - Pattern to split on. Optional.\r\n * @throws {Error} - Throws error if param `xs` is not a string.\r\n * @returns {string}\r\n * @curried\r\n */\r\n camelCase = (xs, pattern = /[^a-z\\d]/i) => compose(\r\n join(''),\r\n map(str => ucaseFirst(str.toLowerCase())),\r\n filter(x => !!x),\r\n split(pattern)\r\n )(_errorIfNotType(String, 'camelCase', 'xs', xs)),\r\n\r\n /**\r\n * Class cases a string. Uses pattern /[^a-z\\d/i]/ to split on.\r\n * If you require a different pattern use `string.camelCase(str, pattern)`\r\n * and then upper case first character (`ucaseFirst`).\r\n * @function module:string.classCase\r\n * @param xs {String}\r\n * @returns {string}\r\n * @throws {Error} - Throws error if `xs` is not a string (via `camelCase` call).\r\n */\r\n classCase = compose(ucaseFirst, camelCase)\r\n\r\n;\r\n\r\n/**\r\n * Functional version of `String.prototype.split`.\r\n * @function module:string.split\r\n * @param separator {String|RegExp}\r\n * @param str {String}\r\n * @returns {Array}\r\n */\r\n","/**\r\n * @module fjl\r\n * @description Exports all module methods (object, list, string modules etc.).\r\n * @goal to include everything from haskell's Prelude where it makes sense in order to create\r\n * a subset of functions which can make the javascript developer more efficient and make his/her\r\n * code more concise (and functional).\r\n * @motivation preludejs, lodash/fp, RamdaJs, Haskell.\r\n * @see http://hackage.haskell.org/package/base-4.10.0.0/docs/Prelude.html\r\n * @see http://hackage.haskell.org/package/base-4.10.0.0/docs/Data-List.html\r\n */\r\nexport * from './object';\r\nexport * from './boolean';\r\nexport * from './function';\r\nexport * from './list';\r\nexport * from './string';\r\nexport * from './utils';\r\nexport * from './errorThrowing';\r\n"],"names":["returnCurried","executeArity","unmetArityNum","fn","argsToCurry","func","x","executeAsCurriedFunc","Array","from","arguments","a","b","c","d","e","args","unmetArity","concatedArgs","concat","canBeCalled","length","newExpectedArity","curryN","Function","Error","curry","curry2","curry3","curry4","curry5","fPureTakesOne","name","arg","f","fPureTakes2","arg1","arg2","fPureTakes3","arg3","fPureTakes4","arg4","fPureTakes5","arg5","fPureTakesOneOrMore","defineReverse","prototype","reverse","reduceRight","agg","item","push","map","filter","reduce","forEach","some","every","join","apply","call","flipN","flip","flip3","flip4","flip5","instanceOf","instanceConstructor","instance","hasOwnProperty","native","Object","getOwnPropertyNames","key","operation","keys","assign","obj0","objs","topAgg","obj","_Number","Number","_NaN","_Null","_Undefined","typeOf","value","retVal","undefined","constructorName","constructor","isNaN","_String","String","_Object","_Boolean","Boolean","_Function","_Array","_Symbol","_Map","_Set","_WeakMap","_WeakSet","toTypeRef","type","toTypeRefs","types","toTypeRefName","Type","ref","toTypeRefNames","isFunction","isType","isOfType","isClass","test","substr","isCallable","isArray","isObject","isBoolean","isNumber","isString","isMap","isSet","isWeakMap","isWeakSet","isUndefined","isNull","isSymbol","isUsableImmutablePrimitive","typeOfX","isset","isEmptyList","isEmptyObject","isEmptyCollection","size","isEmpty","isOneOf","typeName","isFunctor","lookup","of","copy","out","slice","Symbol","Promise","searchObj","nsString","indexOf","parts","split","limit","ind","parent","node","assignDeep","propDescription","getOwnPropertyDescriptor","get","set","writable","includes","xs","lastIndexOf","isTruthy","isFalsy","alwaysTrue","alwaysFalse","equal","equalAll","i","aggregateArray","sliceFrom","startInd","sliceTo","toInd","sliceCopy","genericAscOrdering","lengths","lists","toShortest","listLengths","smallLen","Math","min","list","reduceUntil","pred","op","result","reduceUntilRight","arr","lastIndex","len","findIndexWhere","predicateFulfilled","findIndexWhereRight","findIndicesWhere","findWhere","elm","objUnion","obj1","obj2","objIntersect","objDifference","objComplement","log","console","bind","error","peek","pop","jsonClone","JSON","parse","stringify","toAssocList","toAssocListDeep","TypeConstraint","fromAssocList","OutType","fromAssocListDeep","toArray","compose","arg0","id","negateF","negateF2","negateF3","negateFN","until","predicate","typeInstance","fnOrError","symbolName","noop","normalizeStep","to","step","range","append","listAppend","head","last","tail","init","uncons","unconsr","item0","concatMap","foldableOfA","intersperse","between","lastInd","intercalate","xss","transpose","numLists","ind2","longestListLen","maximum","outLists","outList","subsequences","listLen","pow","entry","j","swapped","ind1","tmp","permutations","repeat","foldl","foldr","foldl1","foldr1","mapAccumL","zero","mapped","tuple","mapAccumR","iterate","lastX","replicate","cycle","unfoldr","resultTuple","findIndex","findIndices","elemIndex","foundInd","elemIndices","take","drop","splitAt","takeWhile","dropWhile","splitPoint","dropWhileEnd","span","breakOnList","at","find","partition","elem","notElem","isPrefixOf","xs1","xs2","limit1","limit2","isSuffixOf","isInfixOf","foundLen","isSubsequenceOf","lenXs1","group","groupBy","equalityOp","prevItem","predOp","inits","tails","stripPrefix","prefix","zip","arr1","arr2","a1","a2","zipN","trimmedLists","zip3","arr3","zip4","arr4","zip5","arr5","zipWith","zipWithN","lenOfTrimmed","zipWith3","xs3","zipWith4","xs4","zipWith5","xs5","unzip","unzipN","lenItem0","any","p","all","and","or","not","sum","product","sortBy","minimum","scanl","scanl1","scanr","scanr1","nub","nubBy","remove","removeBy","sort","sortOn","valueFn","decorated","a0","b0","orderingFn","insert","foundIndex","insertBy","currItem","anyOp","storedItem","removeFirstsBy","unionBy","alreadyAdded","union","intersect","intersectBy","list1","list2","difference","array1","array2","complement","arr0","arrays","typeRefsToStringOrError","defaultErrorMessageCall","tmplContext","contextName","valueName","expectedTypeName","foundTypeName","messageSuffix","isMultiTypeNames","typesCopy","typesToMatchCopy","_getErrorIfNotTypeThrower","errorMessageCall","typeChecker","ValueType","_getErrorIfNotTypesThrower","valueTypes","expectedTypeNames","matchFound","_errorIfNotType","_errorIfNotTypes","getErrorIfNotTypeThrower","getErrorIfNotTypesThrower","errorIfNotType","errorIfNotTypes","lines","words","unwords","unlines","lcaseFirst","toLowerCase","substring","ucaseFirst","toUpperCase","camelCase","pattern","str","classCase"],"mappings":"AAAA;;;;;;;;;;;AAWA,MAWIA,aAAa,GAAG,CAACC,YAAD,EAAeC,aAAf,EAA8BC,EAA9B,EAAkCC,WAAlC,KAAkD;UACtDF,aAAR;SACS,CAAL;;aAEW,SAASG,IAAT,CAAcC,CAAd,EAAiB;;eAEbC,oBAAoB,CAACJ,EAAD,EAAKF,YAAL,EAAmBC,aAAnB,EAAkCM,KAAK,CAACC,IAAN,CAAWC,SAAX,CAAlC,EAAyDN,WAAzD,CAA3B;OAFJ;;SAIC,CAAL;;aAEW,SAASC,IAAT,CAAcM,CAAd,EAAiBC,CAAjB,EAAoB;;eAEhBL,oBAAoB,CAACJ,EAAD,EAAKF,YAAL,EAAmBC,aAAnB,EAAkCM,KAAK,CAACC,IAAN,CAAWC,SAAX,CAAlC,EAAyDN,WAAzD,CAA3B;OAFJ;;SAIC,CAAL;;aAEW,SAASC,IAAT,CAAcM,CAAd,EAAiBC,CAAjB,EAAoBC,CAApB,EAAuB;;eAEnBN,oBAAoB,CAACJ,EAAD,EAAKF,YAAL,EAAmBC,aAAnB,EAAkCM,KAAK,CAACC,IAAN,CAAWC,SAAX,CAAlC,EAAyDN,WAAzD,CAA3B;OAFJ;;SAIC,CAAL;;aAEW,SAASC,IAAT,CAAcM,CAAd,EAAiBC,CAAjB,EAAoBC,CAApB,EAAuBC,CAAvB,EAA0B;;eAEtBP,oBAAoB,CAACJ,EAAD,EAAKF,YAAL,EAAmBC,aAAnB,EAAkCM,KAAK,CAACC,IAAN,CAAWC,SAAX,CAAlC,EAAyDN,WAAzD,CAA3B;OAFJ;;SAIC,CAAL;;aAEW,SAASC,IAAT,C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,CAAC5Q,EAAD,EAAK6Q,OAAO,GAAG,WAAf,KAA+BhN,OAAO,CAC1CzK,IAAI,CAAC,EAAD,CADsC,EAE1CN,KAAG,CAACgY,GAAG,IAAIJ,UAAU,CAACI,GAAG,CAACN,WAAJ,EAAD,CAAlB,CAFuC,EAG1CzX,QAAM,CAAC/C,CAAC,IAAI,CAAC,CAACA,CAAR,CAHoC,EAI1CoJ,KAAK,CAACyR,OAAD,CAJqC,CAAP,CAKrChB,eAAe,CAACrU,MAAD,EAAS,WAAT,EAAsB,IAAtB,EAA4BwE,EAA5B,CALsB,CAnExC;MAmFH+Q,SAAS,GAAGlN,OAAO,CAAC6M,UAAD,EAAaE,SAAb,CAnFhB;;;;;;;;;ACZP;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"fjl.mjs","sources":["../../src/function/curry.js","../../src/utils.js","../../src/jsPlatform/array.js","../../src/jsPlatform/function.js","../../src/function/flip.js","../../src/jsPlatform/object.js","../../src/object/typeOf.js","../../src/object/is.js","../../src/object/lookup.js","../../src/object/of.js","../../src/object/copy.js","../../src/object/searchObj.js","../../src/object/assignDeep.js","../../src/jsPlatform/list.js","../../src/boolean.js","../../src/list/map.js","../../src/list/aggregation.js","../../src/list/utils.js","../../src/object/setTheory.js","../../src/object/console.js","../../src/object/jsonClone.js","../../src/object/assocList.js","../../src/object/toArray.js","../../src/object.js","../../src/function/compose.js","../../src/function/id.js","../../src/function/negate.js","../../src/function/until.js","../../src/function/fnOrError.js","../../src/function/noop.js","../../src/function.js","../../src/list/range.js","../../src/jsPlatform/string.js","../../src/jsPlatform.js","../../src/list.js","../../src/errorThrowing.js","../../src/string.js","../../src/fjl.js"],"sourcesContent":["/**\r\n * @author elydelacruz\r\n * @created 12/6/2016.\r\n * @memberOf function\r\n * @description \"Curry strict\" and \"curry arbitrarily\" functions (`curry`, `curryN`).\r\n */\r\n\r\n/**\r\n * @private\r\n * @type {string}\r\n */\r\nconst\r\n\r\n /**\r\n * Returns curried function.\r\n * @private\r\n * @param executeArity {Number}\r\n * @param unmetArityNum {Number}\r\n * @param fn {Function}\r\n * @param argsToCurry {...*}\r\n * @returns {Function} - Curried function.\r\n */\r\n returnCurried = (executeArity, unmetArityNum, fn, argsToCurry) => {\r\n switch (unmetArityNum) {\r\n case 1:\r\n /* eslint-disable */\r\n return function func(x) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n case 2:\r\n /* eslint-disable */\r\n return function func(a, b) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n case 3:\r\n /* eslint-disable */\r\n return function func(a, b, c) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n case 4:\r\n /* eslint-disable */\r\n return function func(a, b, c, d) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n case 5:\r\n /* eslint-disable */\r\n return function func(a, b, c, d, e) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n default:\r\n return (...args) => executeAsCurriedFunc(fn, executeArity, unmetArityNum, args, argsToCurry);\r\n }\r\n },\r\n\r\n /**\r\n * Returns curried function if unmetArity is not met else returns result of executing\r\n * final function.\r\n * @private\r\n * @param fn {Function}\r\n * @param executeArity {Number}\r\n * @param unmetArity {Number}\r\n * @param args {Array<*>}\r\n * @param argsToCurry {Array<*>}\r\n * @returns {Function|*} - Curried function or result of 'finally' executed function.\r\n */\r\n executeAsCurriedFunc = (fn, executeArity, unmetArity, args, argsToCurry) => {\r\n let concatedArgs = argsToCurry.concat(args),\r\n canBeCalled = (concatedArgs.length >= executeArity) || !executeArity,\r\n newExpectedArity = executeArity - concatedArgs.length;\r\n return !canBeCalled ?\r\n returnCurried(executeArity, newExpectedArity, fn, concatedArgs) :\r\n fn(...concatedArgs);\r\n }\r\n;\r\n\r\nexport const\r\n\r\n /**\r\n * Curries a function up to a given arity.\r\n * @function module:function.curryN\r\n * @param executeArity {Number}\r\n * @param fn {Function}\r\n * @param argsToCurry {...*}\r\n * @returns {Function}\r\n * @throws {Error} - When `fn` is not a function.\r\n */\r\n curryN = (executeArity, fn, ...argsToCurry) => {\r\n if (!fn || !(fn instanceof Function)) {\r\n throw new Error(`\\`curry*\\` functions expect first parameter to be of type \\`Function\\` though received ${fn}?`);\r\n }\r\n return returnCurried(executeArity, executeArity - argsToCurry.length, fn, argsToCurry);\r\n },\r\n\r\n /**\r\n * Curries a function based on it's defined arity (note: rest args param (`...rest`) are not counted in arity).\r\n * @function module:function.curry\r\n * @param fn {Function}\r\n * @param argsToCurry {...*}\r\n * @returns {Function}\r\n */\r\n curry = (fn, ...argsToCurry) => curryN((fn || {}).length, fn, ...argsToCurry),\r\n\r\n /**\r\n * Curries a function up to an arity of 2 (won't call function until 2 or more args).\r\n * @function module:function.curry2\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n curry2 = fn => curryN(2, fn),\r\n\r\n /**\r\n * Curries a function up to an arity of 3 (won't call function until 3 or more args).\r\n * @function module:function.curry3\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n curry3 = fn => curryN(3, fn),\r\n\r\n /**\r\n * Curries a function up to an arity of 4 (won't call function until 4 or more args).\r\n * @function module:function.curry4\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n curry4 = fn => curryN(4, fn),\r\n\r\n /**\r\n * Curries a function up to an arity of 5 (won't call function until 5 or more args).\r\n * @function module:function.curry5\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n curry5 = fn => curryN(5, fn);\r\n","/**\r\n * @module utils\r\n */\r\nimport {curry, curry2} from './function/curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns a function that takes an argument and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakesOne\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakesOne = name => curry((arg, f) => f[name](arg)),\r\n\r\n /**\r\n * Returns a function that takes 2 arguments and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakes2\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakes2 = name => curry((arg1, arg2, f) => f[name](arg1, arg2)),\r\n\r\n /**\r\n * Returns a function that takes 3 arguments and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakes3\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakes3 = name => curry((arg1, arg2, arg3, f) => f[name](arg1, arg2, arg3)),\r\n\r\n /**\r\n * Returns a function that takes 4 arguments and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakes4\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakes4 = name => curry((arg1, arg2, arg3, arg4, f) => f[name](arg1, arg2, arg3, arg4)),\r\n\r\n /**\r\n * Returns a function that takes 5 arguments and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakes5\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakes5 = name => curry((arg1, arg2, arg3, arg4, arg5, f) => f[name](arg1, arg2, arg3, arg4, arg5)),\r\n\r\n /**\r\n * Returns a function that takes an object and one or more arguments on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakesOneOrMore\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakesOneOrMore = name => curry2((f, ...args) => f[name](...args))\r\n\r\n;\r\n","/**\r\n * Created by elyde on 7/20/2017.\r\n * Functional versions of common array methods (`map`, `filter`, etc.) (un-curried);\r\n * @module _jsPlatform_arrayOps\r\n * @private\r\n */\r\n\r\nimport {fPureTakesOne, fPureTakes2, fPureTakesOneOrMore} from '../utils';\r\n\r\nexport const\r\n\r\n /**\r\n * Array.prototype.reverse generator (generates a function that calls the prototype version or a\r\n * shimmed version if it doesn't exist).\r\n * @returns {Function}\r\n */\r\n defineReverse = () =>\r\n Array.prototype.reverse ? x => x.reverse() :\r\n x => x.reduceRight((agg, item) => {\r\n agg.push(item);\r\n return agg;\r\n }, []),\r\n\r\n /**\r\n * Maps a function to functor (list etc.).\r\n * @function module:_jsPlatform_array.map\r\n * @param fn {Function}\r\n * @param functor {Array|{map: {Function}}}\r\n * @returns {Array|{map: {Function}}}\r\n */\r\n map = fPureTakesOne('map'),\r\n\r\n /**\r\n * Filters a functor (list etc.) with passed in function.\r\n * @function module:_jsPlatform_array.filter\r\n * @param fn {Function}\r\n * @param functor {Array|{filter: {Function}}}\r\n * @returns {Array|{filter: {Function}}}\r\n */\r\n filter = fPureTakesOne('filter'),\r\n\r\n /**\r\n * Reduces a foldable (list etc.) with passed in function.\r\n * @function module:_jsPlatform_array.reduce\r\n * @param fn {Function}\r\n * @param functor {Array|{reduce: {Function}}}\r\n * @returns {Array|{reduce: {Function}}}\r\n */\r\n reduce = fPureTakes2('reduce'),\r\n\r\n /**\r\n * Reduces a foldable (list etc.) from the right with passed in function.\r\n * @function module:_jsPlatform_array.reduceRight\r\n * @param fn {Function}\r\n * @param functor {Array|{reduceRight: {Function}}}\r\n * @returns {Array|{reduceRight: {Function}}}\r\n */\r\n reduceRight = fPureTakes2('reduceRight'),\r\n\r\n /**\r\n * For each on functor (Array|Object|etc.).\r\n * @param fn {Function}\r\n * @param functor {Array|Object|*}\r\n * @return {*|Array|Object} - The type of object you pass in unless it doesn't have a `forEach` method.\r\n * @throws {Error} - When passed in functor doesn't have a `forEach` method.\r\n */\r\n forEach = fPureTakesOne('forEach'),\r\n\r\n /**\r\n * Returns `true` if `fn` (predicate) returns true for at least one item\r\n * in functor else returns `false`.\r\n * @param fn {Function} - Predicate.\r\n * @param functor {Array|Object|*}\r\n * @return {*|Array|Object} - The type passed.\r\n * @throws {Error} - When passed in object doesn't have a `some` method.\r\n */\r\n some = fPureTakesOne('some'),\r\n\r\n /**\r\n * Returns `true` if `fn` (predicate) returns true for all items in functor else returns `false`.\r\n * @param fn {Function} - Predicate.\r\n * @param functor {Array|Object|*}\r\n * @return {*|Array|Object} - The type passed.\r\n * @throws {Error} - When passed in object doesn't have an `every` method.\r\n */\r\n every = fPureTakesOne('every'),\r\n\r\n /**\r\n * Array.prototype.join\r\n * @function module:listPrelude.join\r\n * @param separator {String|RegExp}\r\n * @param arr {Array}\r\n * @returns {String}\r\n */\r\n join = fPureTakesOne('join'),\r\n\r\n /**\r\n * Same as Array.prototype.push\r\n * @param item {*}\r\n * @param arr {Array}\r\n * @returns {Number}\r\n */\r\n push = fPureTakesOneOrMore('push'),\r\n\r\n /**\r\n * Reverses an list (shimmed if not exists).\r\n * @function module:listPrelude.reverse\r\n * @return {Array}\r\n */\r\n reverse = defineReverse();\r\n","import {curry, curry2} from '../function/curry';\r\n\r\n/**\r\n * Created by elydelacruz on 9/7/2017.\r\n * @memberOf function\r\n */\r\nexport const\r\n\r\n /**\r\n * Functional `apply` function (takes no context).\r\n * @function module:function.apply\r\n * @param fn {Function}\r\n * @param args {Array|*}\r\n * @returns {*}\r\n */\r\n apply = curry((fn, args) => fn.apply(null, args)),\r\n\r\n /**\r\n * Functional `call` function (takes no context).\r\n * @function module:function.call\r\n * @param fn {Function}\r\n * @param args {...*}\r\n * @returns {*}\r\n */\r\n call = curry2((fn, ...args) => fn.call(null, ...args));\r\n","import {reverse} from '../jsPlatform/array';\r\nimport {apply, call} from '../jsPlatform/function';\r\nimport {curry, curry2} from './curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns a curried function requiring given functions arguments in reverse\r\n * (returned function expects 2 or more variables (curried at 2 or more args)).\r\n * @function module:function.flipN\r\n * @param fn {Function}\r\n * @returns {Function}\r\n * @curried\r\n */\r\n flipN = fn => curry2((...args) => apply(fn, reverse(args))),\r\n\r\n /**\r\n * Flips a function's first and second arguments and and returns a new function requiring said arguments in reverse.\r\n * @function module:function.flip\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n flip = fn => curry((b, a) => call(fn, a, b)),\r\n\r\n /**\r\n * Same as `flip` except returns a flipped function of arity 3.\r\n * @function module:function.flip3\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n flip3 = fn => curry((c, b, a) => call(fn, a, b, c)),\r\n\r\n /**\r\n * Same as `flip` except returns a flipped function of arity 4.\r\n * @function module:function.flip4\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n flip4 = fn => curry((d, c, b, a) => call(fn, a, b, c, d)),\r\n\r\n /**\r\n * Same as `flip` except returns a flipped function of arity 5.\r\n * @function module:function.flip5\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n flip5 = fn => curry((e, d, c, b, a) => call(fn, a, b, c, d, e));\r\n","/**\r\n * @memberOf object\r\n * @description Defines some of the platform methods for objects (the ones used within `fjl`).\r\n */\r\n\r\nimport {fPureTakesOne} from '../utils';\r\nimport {curry, curry2} from '../function/curry';\r\nimport {flip, flip3, flip4, flip5} from '../function/flip';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns whether constructor has derived object.\r\n * @function module:object.instanceOf\r\n * @param instanceConstructor {Function} - Constructor.\r\n * @param instance {*}\r\n * @instance {*}\r\n * @returns {Boolean}\r\n */\r\n instanceOf = curry((instanceConstructor, instance) =>\r\n instance instanceof instanceConstructor),\r\n\r\n /**\r\n * @function module:object.hasOwnProperty\r\n * @param propName {*}\r\n * @param typeInstance {*}\r\n * @returns {Boolean}\r\n * @deprecated - Use property directly instead.\r\n */\r\n hasOwnProperty = fPureTakesOne('hasOwnProperty'),\r\n\r\n /**\r\n * @function module:object.length\r\n * @param x {*}\r\n * @returns {Number}\r\n * @throws {Error} - Throws an error if value doesn't have a `length` property (\r\n * `null`, `undefined`, {Boolean}, Symbol, et. al.).\r\n */\r\n length = x => x.length,\r\n\r\n /**\r\n * Contains all the static functions from `Object` but curried and flipped;\r\n * @example\r\n * // E.g., `Object.defineProperties(obj, descriptor)` can now be used like\r\n * import {defineProperties} from 'fjl'\r\n * defineProperties(descriptor, someObj),\r\n * // Et. al.\r\n * @memberOf module:object\r\n * @type {{...Object}}\r\n */\r\n native = Object.getOwnPropertyNames(Object).reduce((agg, key) => {\r\n if (typeof Object[key] !== 'function') {\r\n return agg;\r\n }\r\n const operation = Object[key];\r\n switch (operation.length) {\r\n case 2:\r\n agg[key] = flip(operation);\r\n break;\r\n case 3:\r\n agg[key] = flip3(operation);\r\n break;\r\n case 4:\r\n agg[key] = flip4(operation);\r\n break;\r\n case 5:\r\n agg[key] = flip5(operation);\r\n break;\r\n default:\r\n agg[key] = Object[key];\r\n break;\r\n }\r\n return agg;\r\n }, {}),\r\n\r\n /**\r\n * Gets passed in object's own enumerable keys (same as `Object.keys`).\r\n * @function module:object.keys\r\n * @param obj {*}\r\n * @returns {Array}\r\n */\r\n {keys} = native,\r\n\r\n /**\r\n * Defined as `Object.assign` else is the same thing but shimmed.\r\n * @function module:object.assign\r\n * @param obj0 {Object}\r\n * @param objs {...{Object}}\r\n * @returns {Object}\r\n */\r\n assign = (() => Object.assign ?\r\n (obj0, ...objs) => Object.assign(obj0, ...objs) :\r\n curry2((obj0, ...objs) => objs.reduce((topAgg, obj) => {\r\n return Object.keys(obj).reduce((agg, key) => {\r\n agg[key] = obj[key];\r\n return agg;\r\n }, topAgg);\r\n }, obj0))\r\n )();\r\n","/**\r\n * Created by elyde on 12/18/2016.\r\n * @memberOf object\r\n */\r\nconst _Number = Number.name,\r\n _NaN = 'NaN',\r\n _Null = 'Null',\r\n _Undefined = 'Undefined';\r\n\r\n/**\r\n * Returns the constructor/class/type name of a value.\r\n * @note Returns 'NaN' if value is of type `Number` and value is `isNaN`.\r\n * @note Returns 'Undefined' if value is `undefined`\r\n * @note Returns 'Null' if value is `null`\r\n * For values that have no concrete constructors and/or casters\r\n * (null, NaN, and undefined) we returned normalized names for them ('Null', 'NaN', 'Number')\r\n * @function module:object.typeOf\r\n * @param value {*}\r\n * @returns {string} - Constructor's name or derived name (in the case of `null`, `undefined`, or `NaN` (whose\r\n * normalized names are 'Null', 'Undefined', 'NaN' respectively).\r\n */\r\nexport function typeOf (value) {\r\n let retVal;\r\n if (value === undefined) {\r\n retVal = _Undefined;\r\n }\r\n else if (value === null) {\r\n retVal = _Null;\r\n }\r\n else {\r\n let constructorName = (value).constructor.name;\r\n retVal = constructorName === _Number && isNaN(value) ?\r\n _NaN : constructorName;\r\n }\r\n return retVal;\r\n}\r\n","/**\r\n * Created by elyde on 12/18/2016.\r\n * @memberOf object\r\n */\r\n\r\nimport {typeOf} from './typeOf';\r\nimport {instanceOf, length, keys} from '../jsPlatform/object';\r\nimport {curry} from '../function/curry';\r\n\r\nlet _String = String.name,\r\n _Number = Number.name,\r\n _Object = Object.name,\r\n _Boolean = Boolean.name,\r\n _Function = Function.name,\r\n _Array = Array.name,\r\n _Symbol = 'Symbol',\r\n _Map = 'Map',\r\n _Set = 'Set',\r\n _WeakMap = 'WeakMap',\r\n _WeakSet = 'WeakSet',\r\n _Null = 'Null',\r\n _Undefined = 'Undefined',\r\n _NaN = 'NaN';\r\n\r\nexport const\r\n\r\n /**\r\n * Resolves/normalizes a type name from either a string or a constructor.\r\n * @function module:object.toTypeRef\r\n * @param type {Function|String} - String or function representing a type.\r\n * @returns {String}\r\n * @todo write tests for this function.\r\n */\r\n toTypeRef = type => {\r\n if (!type) {\r\n return typeOf(type);\r\n }\r\n else if (type.constructor === String || (type instanceof Function)) {\r\n return type;\r\n }\r\n return typeOf(type);\r\n },\r\n\r\n /**\r\n * Returns an array of type refs from possible type refs (converts null, undefined, NaN, and other values into\r\n * type refs (either constructor name or constructor name based on whether value(s) is a string, a constructor, or not).\r\n * @function module:object.toTypeRefs\r\n * @param types {...(TypeRef|*)}\r\n * @returns {Array}\r\n * @todo Ensure tests are written for this function.\r\n */\r\n toTypeRefs = (...types) => types.map(toTypeRef),\r\n\r\n /**\r\n * Returns possible Type's TypeRef name.\r\n * @function module:object.toTypeRefName\r\n * @param Type {(TypeRef|*)}\r\n * @returns {String}\r\n * @todo Ensure tests are written for this function.\r\n */\r\n toTypeRefName = Type => {\r\n const ref = toTypeRef(Type);\r\n return ref instanceof Function ? ref.name : ref;\r\n },\r\n\r\n /**\r\n * Returns possible Types' TypeRef names.\r\n * @function module:object.toTypeRefNames\r\n * @param types {...(TypeRef|*)}\r\n * @returns {String[]}\r\n * @todo Ensure tests are written for this function.\r\n */\r\n toTypeRefNames = (...types) => types.map(toTypeRefName),\r\n\r\n /**\r\n * Returns whether a value is a function or not.\r\n * @function module:object.isFunction\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isFunction = instanceOf(Function),\r\n\r\n /**\r\n * Strict type checker. Checks if given value is a direct instance of given type; E.g.,\r\n * @example\r\n * isType(String, 'abcdefg') === true // true\r\n * isType(String.name, 'abcdefg') === true\r\n * isType(Number, NaN) === false\r\n * isType(Number, 99) === true\r\n * isType('Null', 99) === false // though, for `null` and `undefined` checks\r\n * // @see `isset`, in this module, instead\r\n * isType('Undefined', undefined) === true // true\r\n *\r\n * @note Useful where absolute types, or some semblance thereof, are required.\r\n * @function module:object.isType\r\n * @param type {Function|ObjectConstructor|String} - Constructor or constructor name\r\n * @param obj {*}\r\n * @return {Boolean}\r\n */\r\n isType = curry((type, obj) => typeOf(obj) === toTypeRefName(type)),\r\n\r\n /**\r\n * Loose type checker; E.g., If `type` is not a constructor, but a constructor name, does a type check on\r\n * constructor names, else if first check fails and `type` is a constructor, performs an `instanceof` check\r\n * on value with constructor.\r\n * @note Use care when checking for `Array` and/or `Object` since the both are considered objects by `instanceof` checker.\r\n * @note For `null` and `undefined` their class cased names can be used for type checks\r\n * `isOfType('Null', null) === true (passes strict type check)` (or better yet `isset` can be used).\r\n * @throwsafe - Doesn't throw on `null` or `undefined` `obj` values.\r\n * @example\r\n * isOfType(Number, 99) === true // true (passes strict type check (numbers are not instances of `Number`\r\n * // constructor)\r\n * isOfType('Number', 99) === true // true (passes strict type check)\r\n * isOfType(Number, NaN) === true // true. (passes instance of check)\r\n * // If you want \"true\" strict type checking use `isType`\r\n * isOfType(Object, []) === true // true (passes instance of check)\r\n * isOfType(Array, []) === true // true (passes instance of check)\r\n * isOfType(Object, {}) === true // true (passes instance of check)\r\n * isOfType(Object.name, {}) === true // true (Passes strict type check)\r\n * class Abc extends String {}\r\n * isOfType(String, new Abc('abcd')) // true (passes instanceof check)\r\n *\r\n * @function module:object.isOfType\r\n * @param type {Function|String} - Type reference (constructor or `constructor.name`).\r\n * @param x {*} - Value to check.\r\n * @returns {Boolean}\r\n */\r\n isOfType = curry((type, x) => isType(type, x) || instanceOf(type, x)),\r\n\r\n /**\r\n * Checks if `value` is an es2015 `class`.\r\n * @function module:object.isClass\r\n * @param x {*}\r\n * @returns {boolean}\r\n */\r\n isClass = x => x && /^\\s{0,3}class\\s{1,3}/.test((x + '').substr(0, 10)),\r\n\r\n /**\r\n * Returns a boolean depicting whether a value is callable or not.\r\n * @function module:object.isCallable\r\n * @tentative\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isCallable = x => isFunction(x) && !isClass(x),\r\n\r\n /**\r\n * Checks if value is an array (same as `Array.isArray`).\r\n * @function module:object.isArray\r\n * @param value {*}\r\n * @returns {boolean}\r\n */\r\n {isArray} = Array,\r\n\r\n /**\r\n * Checks whether value is an object or not.\r\n * @function module:object.isObject\r\n * @param value\r\n * @returns {Boolean}\r\n */\r\n isObject = isType(_Object),\r\n\r\n /**\r\n * Checks if value is a boolean.\r\n * @function module:object.isBoolean\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isBoolean = isType(_Boolean),\r\n\r\n /**\r\n * Checks if value is a valid number (also checks if isNaN so that you don't have to).\r\n * @function module:object.isNumber\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isNumber = isType(_Number),\r\n\r\n /**\r\n * Checks whether value is a string or not.\r\n * @function module:object.isString\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isString = isType(_String),\r\n\r\n /**\r\n * Checks whether value is of `Map` or not.\r\n * @function module:object.isMap\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isMap = isType(_Map),\r\n\r\n /**\r\n * Checks whether value is of `Set` or not.\r\n * @function module:object.isSet\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isSet = isType(_Set),\r\n\r\n /**\r\n * Checks whether value is of `WeakMap` or not.\r\n * @function module:object.isWeakMap\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isWeakMap =isType(_WeakMap),\r\n\r\n /**\r\n * Checks whether value is of `WeakSet` or not.\r\n * @function module:object.isWeakSet\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isWeakSet = isType(_WeakSet),\r\n\r\n /**\r\n * Checks if value is undefined.\r\n * @function module:object.isUndefined\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isUndefined = isType(_Undefined),\r\n\r\n /**\r\n * Checks if value is null.\r\n * @function module:object.isNull\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isNull = isType(_Null),\r\n\r\n /**\r\n * Checks if value is a `Symbol`.\r\n * @function module:object.isSymbol\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isSymbol = isType(_Symbol),\r\n\r\n /**\r\n * Checks if given `x` is set and of one of\r\n * [String, Boolean, Number, Symbol] (null and undefined are immutable\r\n * but are not \"usable\" (usually not what we want to operate on).\r\n * @function module:object.isUsableImmutablePrimitive\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isUsableImmutablePrimitive = x => {\r\n const typeOfX = typeOf(x);\r\n return isset(x) &&\r\n [_String, _Number, _Boolean, _Symbol]\r\n .some(Type => Type === typeOfX);\r\n },\r\n\r\n /**\r\n * Checks if !length.\r\n * @function module:object.isEmptyList\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isEmptyList = x => !length(x),\r\n\r\n /**\r\n * Checks if object has own properties/enumerable-props or not.\r\n * @function module:object.isEmptyObject\r\n * @param obj {*}\r\n * @returns {Boolean}\r\n */\r\n isEmptyObject = obj => isEmptyList(keys(obj)),\r\n\r\n /**\r\n * Checks if collection is empty or not (Map, WeakMap, WeakSet, Set etc.).\r\n * @function module:object.isEmptyCollection\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isEmptyCollection = x => x.size === 0,\r\n\r\n /**\r\n * Checks to see if passed in value is empty; I.e.,\r\n * check for one of '', 0, `null`, `undefined`, `false`, empty array, empty object, empty function (zero arity),\r\n * or empty collection (es6 Map, Set, WeakMap, or WeakSet etc. (`!value.size`);\r\n * @function module:object.isEmpty\r\n * @param value {*} - Value to check.\r\n * @returns {Boolean}\r\n */\r\n isEmpty = value => {\r\n if (!value) { // if '', 0, `null`, `undefined`, or `false` then is empty\r\n return true;\r\n }\r\n switch (typeOf(value)) {\r\n case _Array:\r\n case _Function:\r\n return !value.length;\r\n case _Number: // zero and NaN checks happened above so `if number` then it's 'not-an-empty-number' (lol)\r\n return false;\r\n case _Object:\r\n return !keys(value).length;\r\n case _Map:\r\n case _Set:\r\n case _WeakSet:\r\n case _WeakMap:\r\n return !value.size;\r\n case _NaN:\r\n return true;\r\n default:\r\n return !value;\r\n }\r\n },\r\n\r\n /**\r\n * Returns whether passed in values is defined and not null or not.\r\n * @function module:object.isset\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isset = x => x !== null && x !== undefined,\r\n\r\n /**\r\n * Checks to see if `x` is of one of the given type refs.\r\n * @function object.isOneOf\r\n * @param x {*}\r\n * @param types {...(TypeRef|*)}\r\n * @returns {boolean}\r\n * @todo write tests for this function.\r\n */\r\n isOneOf = (x, ...types) => {\r\n const typeName = typeOf(x);\r\n return toTypeRefNames(types).some(name => typeName === name);\r\n },\r\n\r\n isFunctor = x => x && x.map && instanceOf(Function, x.map)\r\n\r\n;\r\n","/**\r\n * @memberOf object\r\n */\r\n\r\nimport {isset} from './is';\r\nimport {curry} from '../function/curry';\r\n\r\n/**\r\n * Looks up property and returns it's value; Else `undefined`.\r\n * Method is null safe (will not throw on `null` or `undefined`).\r\n * @function module:object.lookup\r\n * @param key {String} - Key to search on `obj`\r\n * @param obj {Object} - Object to search `name` on.\r\n * @returns {*}\r\n */\r\nexport const lookup = curry((key, obj) => isset(obj) ? obj[key] : undefined);\r\n","import {isFunction, isset, isUsableImmutablePrimitive} from './is';\r\nimport {apply} from '../jsPlatform/function';\r\n\r\n/**\r\n * Creates a value `of` given type; Checks for one of the following construction strategies (in order listed):\r\n * @example\r\n * // - If exists `(value).constructor.of` uses this.\r\n * // - If value is of one String, Boolean, Symbol, or Number types calls it's\r\n * // constructor as a function (in cast form; E.g., `constructor(...args)` )\r\n * // - Else if constructor is a function, thus far, then calls constructor using\r\n * // the `new` keyword (with any passed in args).\r\n\r\n * @function module:object.of\r\n * @param x {*} - Value to derive returned value's type from.\r\n * @param [args] {...*} - Any args to pass in to matched construction strategy.\r\n * @returns {*|undefined} - New value of given value's type else `undefined`.\r\n */\r\nexport const of = (x, ...args) => {\r\n if (!isset(x)) { return undefined; }\r\n const constructor = x.constructor;\r\n if (constructor.hasOwnProperty('of')) {\r\n return apply(constructor.of, args);\r\n }\r\n else if (isUsableImmutablePrimitive(x)) {\r\n return apply(constructor, args);\r\n }\r\n else if (isFunction(constructor)) {\r\n return new constructor(...args);\r\n }\r\n return undefined;\r\n};\r\n","import {typeOf} from './typeOf';\r\nimport {of} from './of';\r\n\r\nexport const\r\n\r\n /**\r\n * Make a copy of a value or optionally copy incoming value onto an outgoing value (second parameter).\r\n * @note If incoming thing is an immmutable primitive (string, number, symbol, null, undefined, boolean)\r\n * it is returned as is.\r\n * @function module:object.copy\r\n * @param x {*} - Thing to copy.\r\n * @param [out = undefined] {*} - Optional value to copy on to. Not required.\r\n * @returns {*} - Copied thing or optionally outgoing value copied onto.\r\n */\r\n copy = (x, out) => {\r\n // if `null`, `undefined`, `''`, `0`, `false` return\r\n if (!x) { return x; }\r\n switch (typeOf(x)) {\r\n case Array.name:\r\n return !out ? x.slice(0) : Object.assign(out, x);\r\n\r\n // If immutable primitive, return it\r\n case Symbol.name:\r\n case Boolean.name:\r\n case String.name:\r\n case Number.name:\r\n case Promise.name:\r\n case Function.name:\r\n case 'NaN':\r\n case 'Null':\r\n case 'Undefined':\r\n return x;\r\n\r\n case 'Map':\r\n case 'Set':\r\n case 'WeakMap':\r\n case 'WeakSet':\r\n return new x.constructor(Array.from(x));\r\n\r\n // Else make copy\r\n default:\r\n return Object.assign(!out ? of(x) : out, x);\r\n }\r\n }\r\n;\r\n\r\nexport default copy;\r\n","import {isset} from './is';\r\nimport {curry} from '../function/curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Gives you value at key/namespace-key within `obj`; E.g.,\r\n * searchObj('all.your.base', {all: {your: {base: 99}}}) === 99 // `true`\r\n * @note If key is unreachable (undefined) returns `undefined`.\r\n * Useful in cases where we do not want to check each key along the way before getting/checking value; E.g.,\r\n * @example\r\n * ```\r\n * if (obj && obj.all && obj.all.your && obj.all.your.base) {\r\n * // Thing we want to do\r\n * }\r\n *\r\n * // So with our function becomes\r\n * if (searchObj('all.your.base', obj)) {\r\n * // Thing we want to do\r\n * }\r\n * ```\r\n * @function module:object.searchObj\r\n * @param nsString {String}\r\n * @param obj {*}\r\n * @returns {*}\r\n */\r\n searchObj = curry((nsString, obj) => {\r\n if (!obj) { return obj; }\r\n if (nsString.indexOf('.') === -1) {\r\n return obj[nsString];\r\n }\r\n const parts = nsString.split('.'),\r\n limit = parts.length;\r\n let ind = 0,\r\n parent = obj;\r\n for (; ind < limit; ind += 1) {\r\n const node = parent[parts[ind]];\r\n if (!isset(node)) {\r\n return node;\r\n }\r\n parent = node;\r\n }\r\n return parent;\r\n })\r\n;\r\n","\r\nimport {isObject} from './is';\r\nimport {keys} from '../jsPlatform/object';\r\nimport {curry2} from '../function/curry';\r\n\r\nexport const\r\n /**\r\n * Merges all objects down into one (takes two or more args).\r\n * @function module:object.assignDeep\r\n * @param obj0 {Object}\r\n * @param [objs] {...{Object}} - One or more objects to merge onto `obj0`.\r\n * @returns {Object}\r\n */\r\n assignDeep = curry2((obj0, ...objs) =>\r\n !obj0 ? obj0 : objs.reduce((topAgg, obj) =>\r\n !obj ? topAgg : keys(obj).reduce((agg, key) => {\r\n let propDescription = Object.getOwnPropertyDescriptor(agg, key);\r\n // If property is not writable move to next item in collection\r\n if (agg.hasOwnProperty(key) && propDescription &&\r\n !(propDescription.get && propDescription.set) &&\r\n !propDescription.writable) {\r\n return agg;\r\n }\r\n if (isObject(agg[key]) && isObject(obj[key])) {\r\n assignDeep(agg[key], obj[key]);\r\n }\r\n else { agg[key] = obj[key]; }\r\n return agg;\r\n }, topAgg)\r\n , obj0));\r\n","/**\r\n * List operations that overlap (apart from globally overlapping props and functions like `length`)\r\n * on both strings and arrays.\r\n * @memberOf list\r\n */\r\n\r\nimport {fPureTakesOne, fPureTakes2, fPureTakesOneOrMore} from '../utils';\r\n\r\nexport const\r\n\r\n /**\r\n * Concats/appends all functors onto the end of first functor.\r\n * Note: functors passed in after the first one must be of the same type.\r\n * @function module:list.concat\r\n * @param functor {Array|Object|*}\r\n * @param ...functor {Array|Object|*}\r\n * @return {*|Array|Object} - The type passed.\r\n * @throws {Error} - When passed in object doesn't have an `every` method.\r\n */\r\n concat = fPureTakesOneOrMore('concat'),\r\n\r\n /**\r\n * Same as Array.prototype.slice\r\n * @function module:list.slice\r\n * @param separator {String|RegExp}\r\n * @param arr{Array}\r\n * @returns {Array}\r\n */\r\n slice = fPureTakes2('slice'),\r\n\r\n /**\r\n * `Array.prototype.includes` or shim.\r\n * @function module:list.includes\r\n * @param value {*}\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n includes = (() => 'includes' in Array.prototype ?\r\n fPureTakesOne('includes') :\r\n (value, xs) => xs.indexOf(value) > -1)(),\r\n\r\n /**\r\n * Searches list/list-like for given element `x`.\r\n * @function module:list.indexOf\r\n * @param x {*} - Element to search for.\r\n * @param xs {Array|String|*} - list or list like to look in.\r\n * @returns {Number} - `-1` if element not found else index at which it is found.\r\n */\r\n indexOf = fPureTakesOne('indexOf'),\r\n\r\n /**\r\n * Last index of (`Array.prototype.lastIndexOf`).\r\n * @function module:list.lastIndexOf\r\n * @param x {*} - Element to search for.\r\n * @param xs {Array|String|*} - list or list like to look in.\r\n * @returns {Number} - `-1` if element not found else index at which it is found.\r\n */\r\n lastIndexOf = fPureTakesOne('lastIndexOf')\r\n\r\n;\r\n","/**\r\n * @module boolean\r\n * @description Contains functional version of 'always-true', 'always-false', 'is-truthy', and 'is-falsy'.\r\n */\r\nimport {curry, curry2} from './function/curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns whether `value` is 'truthy' or not\r\n * @function module:boolean.isTruthy\r\n * @param value\r\n * @returns {Boolean}\r\n */\r\n isTruthy = value => !!value,\r\n\r\n /**\r\n * Returns whether `value` is 'falsy' or not\r\n * @function module:boolean.isFalsy\r\n * @param value\r\n * @returns {Boolean}\r\n */\r\n isFalsy = value => !value,\r\n\r\n /**\r\n * Returns `true`.\r\n * @function module:boolean.alwaysTrue\r\n * @returns {Boolean}\r\n */\r\n alwaysTrue = () => true,\r\n\r\n /**\r\n * Returns `false`.\r\n * @function module:boolean.alwaysFalse\r\n * @returns {Boolean}\r\n */\r\n alwaysFalse = () => false,\r\n\r\n /**\r\n * Equality operator.\r\n * @function module:boolean.equal\r\n * @param a {*}\r\n * @param b {*}\r\n * @returns {boolean}\r\n */\r\n equal = curry((a, b) => a === b),\r\n\r\n /**\r\n * Equality operator for all.\r\n * @function module:boolean.equalAll\r\n * @param a {*} - Item `0`.\r\n * @param args {...*} - Others\r\n * @returns {boolean}\r\n */\r\n equalAll = curry2((a, ...args) => args.every(b => equal(a, b)))\r\n\r\n;\r\n","import {length} from '../jsPlatform/object';\r\nimport {curry} from '../function/curry';\r\nimport {typeOf} from '../object/typeOf';\r\nimport {of} from '../object/of';\r\nimport {isFunctor, isset} from '../object/is';\r\n\r\n/**\r\n * Maps a function onto a List (string or array) or a functor (value containing a map method).\r\n * @function module:list.map\r\n * @param fn {Function} - Function to map on given value.\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\nconst map = curry((fn, xs) => {\r\n if (!isset(xs)) { return xs; }\r\n let out = of(xs),\r\n limit,\r\n i = 0;\r\n switch (typeOf(xs)) {\r\n case 'Array':\r\n limit = length(xs);\r\n if (!limit) { return out; }\r\n for (; i < limit; i += 1) {\r\n out.push(fn(xs[i], i, xs));\r\n }\r\n return out;\r\n case 'String':\r\n limit = length(xs);\r\n if (!xs) { return out; }\r\n for (; i < limit; i += 1) {\r\n out += fn(xs[i], i, xs);\r\n }\r\n return out;\r\n default:\r\n if (isFunctor(xs)) { return xs.map(fn); }\r\n\r\n // Other objects\r\n return Object.keys(xs).reduce((agg, key) => {\r\n out[key] = fn(xs[key], key, xs);\r\n return out;\r\n }, out);\r\n }\r\n});\r\n\r\nexport default map;\r\n","\r\nexport const\r\n\r\n /**\r\n * Pushes incoming `item` onto given array and returns said array.\r\n * @private\r\n * @param agg {Array}\r\n * @param item {*}\r\n * @returns {Array}\r\n */\r\n aggregateArray = (agg, item) => {\r\n agg.push(item);\r\n return agg;\r\n }\r\n\r\n;\r\n","/**\r\n * List operator utils module.\r\n * @module listUtils\r\n */\r\nimport {apply} from '../jsPlatform/function'; // un-curried version\r\nimport {slice} from '../jsPlatform/list'; // un-curried version good for both strings and arrays\r\nimport {length} from '../jsPlatform/object';\r\nimport {alwaysFalse} from '../boolean';\r\nimport map from './map';\r\nimport {curry, curry2} from '../function/curry';\r\n\r\nexport * from './aggregation';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns a slice of the given list from `startInd` to the end of the list.\r\n * @function module:listUtils.sliceFrom\r\n * @param startInd {Number}\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n sliceFrom = curry((startInd, xs) => slice(startInd, undefined, xs)),\r\n\r\n /**\r\n * Slices from index `0` to given index.\r\n * @function module:listUtils.sliceTo\r\n * @param toInd {Number}\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n sliceTo = curry((toInd, xs) => slice(0, toInd, xs)),\r\n\r\n /**\r\n * Slices a copy of list.\r\n * @function listUtils.sliceCopy\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n sliceCopy = sliceFrom(0),\r\n\r\n /**\r\n * Generic 'ascending order' ordering function (use by the likes of `list.sort` etc.)\r\n * @function module:listUtils.genericAscOrdering\r\n * @param a {*}\r\n * @param b {*}\r\n * @returns {number}\r\n */\r\n genericAscOrdering = curry((a, b) => {\r\n if (a > b) { return 1; }\r\n else if (a < b) { return -1; }\r\n return 0;\r\n }),\r\n\r\n /**\r\n * Returns length of all passed lists in list.\r\n * @function module:listUtils.lengths\r\n * @param lists ...{Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n lengths = curry2((...lists) => map(length, lists)),\r\n\r\n /**\r\n * Returns a list of lists trimmed to the shortest length in given list of lists. @background This method is used by the `zip*` functions to achieve their\r\n * 'slice to smallest' functionality.\r\n * @function module:listUtils.toShortest\r\n * @param lists {...(Array|String|*)}\r\n * @returns {Array|String|*}\r\n */\r\n toShortest = curry2((...lists) => {\r\n const listLengths = apply(lengths, lists),\r\n smallLen = Math.min.apply(Math, listLengths);\r\n return map((list, ind) => listLengths[ind] > smallLen ?\r\n sliceTo(smallLen, list) : sliceCopy(list), lists);\r\n }),\r\n\r\n /**\r\n * Reduces until predicate.\r\n * @function module:listUtils.reduceUntil\r\n * @param pred {Function} - `(item, index, list) => Boolean(...)`\r\n * @param op {Function} - Operation - `(agg, item, index, list) => agg`\r\n * @param agg {*} - Zero value.\r\n * @param xs {Array|String|*} - List.\r\n * @returns {*}\r\n */\r\n reduceUntil = curry((pred, op, agg, xs) => {\r\n const limit = length(xs);\r\n if (!limit) { return agg; }\r\n let ind = 0,\r\n result = agg;\r\n for (; ind < limit; ind++) {\r\n if (pred(xs[ind], ind, xs)) { break; }\r\n result = op(result, xs[ind], ind, xs);\r\n }\r\n return result;\r\n }),\r\n\r\n /**\r\n * Reduces until predicate (from right to left).\r\n * @function module:listUtils.reduceUntilRight\r\n * @param pred {Function} - `(item, index, list) => Boolean(...)`\r\n * @param op {Function} - Operation - `(agg, item, index, list) => agg`\r\n * @param agg {*} - Zero value.\r\n * @param xs {Array|String|*} - List.\r\n * @returns {*}\r\n */\r\n reduceUntilRight = curry((pred, op, agg, arr) => {\r\n const limit = length(arr);\r\n if (!limit) { return agg; }\r\n let ind = limit - 1,\r\n result = agg;\r\n for (; ind >= 0; ind--) {\r\n if (pred(arr[ind], ind, arr)) { break; }\r\n result = op(result, arr[ind], ind, arr);\r\n }\r\n return result;\r\n }),\r\n\r\n /**\r\n * Reduces a list with given operation (`op`) function.\r\n * @function module:listUtils.reduce\r\n * @param op {Function} - Operation - `(agg, item, index, list) => agg`\r\n * @param agg {*} - Zero value.\r\n * @param xs {Array|String|*} - List.\r\n * @returns {*}\r\n */\r\n reduce = reduceUntil(alwaysFalse),\r\n\r\n /**\r\n * Reduces a list with given operation (`op`) function (from right-to-left).\r\n * @function module:listUtils.reduceRight\r\n * @param op {Function} - Operation - `(agg, item, index, list) => agg`\r\n * @param agg {*} - Zero value.\r\n * @param xs {Array|String|*} - List.\r\n * @returns {*}\r\n */\r\n reduceRight = reduceUntilRight(alwaysFalse),\r\n\r\n /**\r\n * Gets last index of a list/list-like (Array|String|Function etc.).\r\n * @function module:listUtils.lastIndex\r\n * @param x {Array|String|*} - list like or list.\r\n * @returns {Number} - `-1` if no element found.\r\n */\r\n lastIndex = x => { const len = length(x); return len ? len - 1 : 0; },\r\n\r\n /**\r\n * Finds index in string or list.\r\n * @function module:listUtils.findIndexWhere\r\n * @param pred {Function} - Predicate.\r\n * @param arr {Array|String}\r\n * @returns {Number} - `-1` if predicate not matched else `index` found\r\n */\r\n findIndexWhere = curry((pred, arr) => {\r\n let ind = 0;\r\n const limit = length(arr);\r\n for (; ind < limit; ind += 1) {\r\n const predicateFulfilled = !!pred(arr[ind], ind, arr);\r\n if (predicateFulfilled) {\r\n return ind;\r\n }\r\n }\r\n return -1;\r\n }),\r\n\r\n /**\r\n * Finds index in list from right to left.\r\n * @function module:listUtils.findIndexWhereRight\r\n * @param pred {Function} - Predicate.\r\n * @param arr {Array|String}\r\n * @returns {Number} - `-1` if predicate not matched else `index` found\r\n */\r\n findIndexWhereRight = curry((pred, arr) => {\r\n let ind = length(arr) - 1;\r\n for (; ind >= 0; ind -= 1) {\r\n const predicateFulfilled = !!pred(arr[ind], ind, arr);\r\n if (predicateFulfilled) {\r\n return ind;\r\n }\r\n }\r\n return -1;\r\n }),\r\n\r\n /**\r\n * @function module:listUtils.findIndicesWhere\r\n * @param pred {Function}\r\n * @param xs {Array|String|*} - list or list like.\r\n * @returns {Array|undefined}\r\n */\r\n findIndicesWhere = curry((pred, xs) => {\r\n const limit = length(xs);\r\n let ind = 0,\r\n out = [];\r\n for (; ind < limit; ind++) {\r\n if (pred(xs[ind], ind, xs)) { out.push(ind); }\r\n }\r\n return out.length ? out : undefined;\r\n }),\r\n\r\n /**\r\n * @function module:listUtils.findWhere\r\n * @param pred {Function}\r\n * @param xs {Array|String|*} - list or list like.\r\n * @returns {*}\r\n */\r\n findWhere = curry((pred, xs) => {\r\n let ind = 0,\r\n limit = length(xs);\r\n if (!limit) { return; }\r\n for (; ind < limit; ind++) {\r\n let elm = xs[ind];\r\n if (pred(elm, ind, xs)) { return elm; }\r\n }\r\n })\r\n\r\n;\r\n","import {assignDeep} from './assignDeep';\r\nimport {keys} from '../jsPlatform/object';\r\nimport {reduce} from '../list/utils';\r\nimport {curry, curry2} from '../function/curry';\r\n\r\nexport const\r\n\r\n objUnion = curry((obj1, obj2) => assignDeep(obj1, obj2)),\r\n\r\n objIntersect = curry((obj1, obj2) => reduce((agg, key) => {\r\n if (obj2.hasOwnProperty(key)) {\r\n agg[key] = obj2[key];\r\n }\r\n return agg;\r\n }, {}, keys(obj1))),\r\n\r\n objDifference = curry((obj1, obj2) => reduce((agg, key) => {\r\n if (!obj2.hasOwnProperty(key)) {\r\n agg[key] = obj1[key];\r\n }\r\n return agg;\r\n }, {}, keys(obj1))),\r\n\r\n objComplement = curry2((obj0, ...objs) => reduce((agg, obj) =>\r\n assignDeep(agg, objDifference(obj, obj0)), {}, objs));\r\n","/**\r\n * @module console\r\n * @description Console exports.\r\n */\r\nexport const\r\n\r\n /**\r\n * `Console.log` method.\r\n * @function module:console.log\r\n * @params args {...*}\r\n * @returns {void}\r\n */\r\n log = console.log.bind(console),\r\n\r\n /**\r\n * `Console.error` method.\r\n * @function module:console.error\r\n * @params args {...*}\r\n * @returns {void}\r\n */\r\n error = console.error.bind(console),\r\n\r\n /**\r\n * Peeks (console.log) at incoming value(s) and returns the last value.\r\n * @function module:console.peek\r\n * @param args {...*}\r\n * @returns {*} Last given value (if one or more values) else first value.\r\n */\r\n peek = (...args) => (log(...args), args.pop())\r\n\r\n;\r\n","export const\r\n\r\n /**\r\n * Clones and object or array using `JSON.parse(JSON.stringify(...))` pattern.\r\n * @function module:object.jsonClone\r\n * @param x {*}\r\n * @returns {*}\r\n */\r\n jsonClone = x => JSON.parse(JSON.stringify(x))\r\n\r\n;\r\n","import {isArray, isType} from './is';\r\nimport {keys} from '../jsPlatform/object';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns an associated list from given object.\r\n * @note Useful for working with plain javascript objects.\r\n * @function module:object.toAssocList\r\n * @param obj {(Object|Array|*)}\r\n * @returns {Array.<*, *>}\r\n */\r\n toAssocList = obj => keys(obj).map(key => [key, obj[key]]),\r\n\r\n /**\r\n * Returns an associated list from given object (deeply (on incoming object's type)).\r\n * @note Does deep conversion on all values of passed in type's type.\r\n * @function module:object.toAssocListDeep\r\n * @param obj {*}\r\n * @param [TypeConstraint = Object] {(Constructor|Function)} - Type constraint to convert on.\r\n * @returns {*}\r\n */\r\n toAssocListDeep = (obj, TypeConstraint = Object) => keys(obj).map(key =>\r\n TypeConstraint && isType(TypeConstraint, obj[key]) ?\r\n [key, toAssocListDeep(obj[key], TypeConstraint)] :\r\n [key, obj[key]]\r\n ),\r\n\r\n /**\r\n * From associated list to object.\r\n * @function module:object.fromAssocList\r\n * @param xs {Array.} - Associated list.\r\n * @param [OutType = Object] {Constructor|Function} - Output type. Default `Object`.\r\n * @returns {*} - Default is `Object`\r\n */\r\n fromAssocList = (xs, OutType = Object) => xs.reduce((agg, [key, value]) => {\r\n agg[key] = value;\r\n return agg;\r\n }, new OutType()),\r\n\r\n /**\r\n * From associated list to object (deep conversion on associative lists (array of 2 value arrays)).\r\n * @note Considers array of arrays associated lists.\r\n * @function module:object.fromAssocListDeep\r\n * @param xs {Array.} - Associated list.\r\n * @param [OutType = Object] {Constructor|Function} - Output type. Default `Object`.\r\n * @returns {*} - Default is `Object`\r\n */\r\n fromAssocListDeep = (xs, OutType = Object) => xs.reduce((agg, [key, value]) => {\r\n if (isArray(value) && isArray(value[0]) && value[0].length === 2) {\r\n agg[key] = fromAssocListDeep(value, OutType);\r\n return agg;\r\n }\r\n agg[key] = value;\r\n return agg;\r\n }, new OutType())\r\n;\r\n","import {typeOf} from './typeOf';\r\nimport {toAssocList} from './assocList';\r\n\r\nexport const\r\n\r\n /**\r\n * Converts incoming value to an array.\r\n * @note For `WeakMap`, `WeakSet`, `Map` and `Set` result is the same as calling `Array.from` on such.\r\n * @note For `null`, `undefined`, `NaN`, `Number{}`, `Symbol{}`, `Boolean{}` returns an empty array.\r\n * @note Method does a shallow conversion;\r\n * @function module:object.toArray\r\n * @param x {*} - Thing to convert from.\r\n * @returns {Array}\r\n */\r\n toArray = x => {\r\n switch (typeOf(x)) {\r\n case 'Null':\r\n case 'Undefined':\r\n return [];\r\n case String.name:\r\n case Array.name:\r\n case 'WeakMap':\r\n case 'WeakSet':\r\n case 'Map':\r\n case 'Set':\r\n return Array.from(x);\r\n case Object.name:\r\n default:\r\n return toAssocList(x);\r\n }\r\n }\r\n\r\n;\r\n","/**\r\n * @module object\r\n * @description Object operations/combinators.\r\n */\r\n\r\nexport * from './jsPlatform/object';\r\nexport * from './object/lookup';\r\nexport * from './object/typeOf';\r\nexport * from './object/copy';\r\nexport * from './object/is';\r\nexport * from './object/of';\r\nexport * from './object/searchObj';\r\nexport * from './object/assignDeep';\r\nexport * from './object/setTheory';\r\nexport * from './object/console';\r\nexport * from './object/jsonClone';\r\nexport * from './object/toArray';\r\nexport * from './object/assocList';\r\n","import {reduceRight} from '../jsPlatform/array';\r\n\r\n/**\r\n * Composes all functions passed in from right to left passing each functions return value to\r\n * the function on the left of itself.\r\n * @function module:function.compose\r\n * @type {Function}\r\n * @param args {...{Function}}\r\n * @returns {Function}\r\n */\r\nexport const compose = (...args) =>\r\n arg0 => reduceRight((value, fn) => fn(value), arg0, args);\r\n","/**\r\n * @memberOf function\r\n */\r\n\r\n/**\r\n * Returns passed in parameter.\r\n * @haskellType `id :: a -> a`\r\n * @function module:function.id\r\n * @param x {*}\r\n * @returns {*}\r\n */\r\nexport const id = x => x;\r\n","/**\r\n * @memberOf function\r\n */\r\n\r\nimport {apply} from '../jsPlatform/function';\r\nimport {curry, curry2} from './curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Negates a function that takes one/no argument.\r\n * @function module:function.negateF\r\n * @param fn {Function}\r\n * @returns {function(*=): boolean}\r\n */\r\n negateF = fn => x => !fn(x),\r\n\r\n /**\r\n * Takes a function that takes two parameters and returns a negated version of given\r\n * function.\r\n * @function module:_negate.negateF2\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n negateF2 = fn => curry((a, b) => !fn(a, b)),\r\n\r\n /**\r\n * Takes a function that takes three parameters and returns a\r\n * negated version of given function.\r\n * @function module:_negate.negateF3\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n negateF3 = fn => curry((a, b, c) => !fn(a, b, c)),\r\n\r\n /**\r\n * Returns a negated version of given function.\r\n * Returned function is variadiac (takes one or more arguments).\r\n * @note function returned is uncurried.\r\n * @uncurried\r\n * @function module:function.negateFN\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n negateFN = fn => curry2((...args) => !apply(fn, args));\r\n","import {curry} from './curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Run `operation` until predicate returns `true` (like a functional\r\n * version of a while loop).\r\n * @function module:function.until\r\n * @param predicate {Function} :: a -> Boolean\r\n * @param operation {Function} :: a -> a\r\n * @param typeInstance {*} :: * - A monoidal zero or some starting point.\r\n * @returns {*} - What ever type `typeInstance` is\r\n */\r\n until = curry((predicate, operation, typeInstance) => {\r\n let result = typeInstance;\r\n while (!predicate(result)) {\r\n result = operation(result);\r\n }\r\n return result;\r\n });\r\n","import {typeOf} from '../object/typeOf';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns a function or throws an error if given `f` is not a function.\r\n * @function module:function.fnOrError\r\n * @param symbolName {String} - Error message prefix.\r\n * @param f {Function|*} - Expected function.\r\n * @returns {Function}\r\n * @throws {Error} - Error if `f` is not of `function`\r\n */\r\n fnOrError = (symbolName, f) => {\r\n if (!f || !(f instanceof Function)) {\r\n throw new Error(`${symbolName} should be a function. ` +\r\n `Type received: ${typeOf(f)}; Value received: ${f}.`);\r\n }\r\n return f;\r\n }\r\n\r\n;\r\n","/**\r\n * No-op ('op' as in 'operation') - Performs no operation 'always' (good for places where\r\n * a value should always be a function etc.).\r\n * @function module:function.noop\r\n * @returns {undefined}\r\n */\r\nexport const noop = () => undefined;\r\n","/**\r\n * @module function\r\n */\r\nexport * from './jsPlatform/function';\r\nexport * from './function/compose';\r\nexport * from './function/curry';\r\nexport * from './function/flip';\r\nexport * from './function/id';\r\nexport * from './function/negate';\r\nexport * from './function/until';\r\nexport * from './function/fnOrError';\r\nexport * from './function/noop';\r\n","/**\r\n * @module object\r\n */\r\nimport {curry} from '../function/curry';\r\n\r\n/**\r\n * Normalizes step for `from` and `to` combination.\r\n * @function module:list.normalizeStep\r\n * @param from {Number}\r\n * @param to {Number}\r\n * @param [step = 1] {Number}\r\n * @returns {Number}\r\n * @private\r\n */\r\nconst normalizeStep = (from, to, step) => {\r\n if (from > to) {\r\n return step > 0 ? -step : step; // make step negative\r\n }\r\n return step < 0 ? -1 * step : step; // make step positive\r\n};\r\n\r\nexport const\r\n\r\n /**\r\n * Range function - gives you an array contain numbers in given range.\r\n * @note normalizes `step` to be valid if range numbers given are invalid\r\n * (forces `step` to be negative if range required is in the negative direction\r\n * and forces `step` to be positive if range required is in the other direction).\r\n * @function module:list.range\r\n * @param from {Number}\r\n * @param to {Number}\r\n * @param [step = 1] {Number}\r\n * @returns {Array.}\r\n */\r\n range = curry((from, to, step = 1) => {\r\n let i = from;\r\n const out = [];\r\n step = normalizeStep(from, to, step);\r\n if (step === 0 || from === to) { return [from]; }\r\n for (; (to - i) * step >= 0; i += step) { out.push(i); }\r\n return out;\r\n })\r\n;\r\n","/**\r\n * Created by elydelacruz on 9/6/2017.\r\n */\r\n\r\nimport {fPureTakesOne} from '../utils';\r\n\r\n/**\r\n * Functional version of `String.prototype.split`.\r\n * @function module:_string.split\r\n * @param separator {String|RegExp}\r\n * @param str {String}\r\n * @returns {Array}\r\n */\r\nexport const split = fPureTakesOne('split');\r\n","/**\r\n * @module jsPlatform_\r\n * @private\r\n */\r\nexport * from './jsPlatform/object';\r\nexport * from './jsPlatform/array';\r\nexport * from './jsPlatform/list';\r\nexport * from './jsPlatform/string';\r\nexport * from './jsPlatform/function';\r\n","/**\r\n * List operations module.\r\n * @module list\r\n */\r\nimport {concat as listAppend, indexOf, slice, includes} from './jsPlatform/list';\r\nimport {apply} from './jsPlatform/function';\r\nimport {length} from './jsPlatform/object';\r\nimport {negateF3, negateF2} from './function/negate';\r\nimport {curry, curry2, curry3} from './function/curry';\r\nimport {isTruthy, isFalsy} from './boolean';\r\nimport {lookup} from './object/lookup';\r\nimport {of} from './object/of';\r\nimport {isset, isString} from './object/is';\r\nimport {typeOf} from './object/typeOf';\r\nimport map from './list/map';\r\n\r\nimport {\r\n sliceFrom, sliceTo, lengths,\r\n toShortest, aggregateArray,\r\n reduceUntil, reduce, reduceRight, lastIndex,\r\n findIndexWhere, findIndexWhereRight, findIndicesWhere,\r\n findWhere, sliceCopy, genericAscOrdering\r\n}\r\n from './list/utils';\r\n\r\nexport * from './list/range';\r\n\r\nexport * from './list/utils';\r\n\r\nexport {map};\r\n\r\nexport {slice, includes, indexOf, lastIndexOf, push} from './jsPlatform';\r\n\r\nexport const\r\n\r\n /**\r\n * Append two, or more, lists, i.e.,\r\n * @example\r\n * expectEqual(append(take(13, alphabetString), drop(13, alphabetString)), alphabetString); // true\r\n *\r\n * // Another example\r\n * const result = append(\r\n * alphabetStr.split(''),\r\n * alphabetStr.split('')\r\n * ),\r\n * expected = repeat(2, alphabetStr).split('');\r\n *\r\n * shallowEquals(result, expected) === true // `true`\r\n *\r\n * @function module:list.append\r\n * @param [args] {...(Array|String|*)} - One or more lists or list likes (strings etc.).\r\n * @returns {(Array|String|*)} - Same type as list like passed in.\r\n */\r\n append = curry2((...args) => apply(listAppend, args)),\r\n\r\n /**\r\n * Returns head of list (first item of list).\r\n * @haskellType `head :: [a] -> a`\r\n * @function module:list.head\r\n * @param x {Array|String}\r\n * @returns {*} - First item from list\r\n */\r\n head = x => x[0],\r\n\r\n /**\r\n * Returns last item of list.\r\n * @haskellType `last :: [a] -> a`\r\n * @function module:list.last\r\n * @param xs {Array|String}\r\n * @returns {*}\r\n */\r\n last = xs => xs[lastIndex(xs)],\r\n\r\n /**\r\n * Returns tail part of list (everything after the first item as new list).\r\n * @haskelType `tail :: [a] -> [a]`\r\n * @function module:list.tail\r\n * @param xs {Array|String}\r\n * @returns {Array|String}\r\n */\r\n tail = xs => sliceFrom(1, xs),\r\n\r\n /**\r\n * Returns everything except last item of list as new list.\r\n * @haskellType `init :: [a] -> [a]`\r\n * @function module:list.init\r\n * @param xs {Array|String}\r\n * @returns {Array|String}\r\n */\r\n init = xs => sliceTo(lastIndex(xs), xs),\r\n\r\n /**\r\n * Returns `head` and `tail` of passed in list/string in a tuple.\r\n * @haskellType `uncons :: [a] -> Maybe (a, [a])`\r\n * @function module:list.uncons\r\n * @param xs {Array|String}\r\n * @returns {Array|undefined}\r\n */\r\n uncons = xs => !xs || length(xs) === 0 ? undefined : [head(xs), tail(xs)],\r\n\r\n /**\r\n * Returns `tail` and `head` of passed in list/string in a tuple.\r\n * @haskellType `unconsr :: [a] -> Maybe ([a], a)`\r\n * @function module:list.unconsr\r\n * @param xs {Array|String}\r\n * @returns {Array|String|*|undefined}\r\n */\r\n unconsr = xs => !xs || length(xs) === 0 ? undefined : [init(xs), last(xs)],\r\n\r\n /**\r\n * Concatenates all the elements of a container of lists.\r\n * @haskellType `concat :: Foldable t => t [a] -> [a]`\r\n * @function module:list.concat\r\n * @param xs {Array}\r\n * @returns {Array}\r\n */\r\n concat = xs => {\r\n switch (length(xs)) {\r\n case undefined:\r\n case 0:\r\n return [];\r\n case 1:\r\n const item0 = xs[0];\r\n return item0 && item0.slice ? sliceCopy(item0) : item0;\r\n case 2:\r\n default:\r\n return apply(append, xs);\r\n }\r\n },\r\n\r\n /**\r\n * Map a function over all the elements of a container and concatenate the resulting lists.\r\n * @haskellType `concatMap :: Foldable t => (a -> [b]) -> t a -> [b]`\r\n * @function module:list.concatMap\r\n * @param fn {Function}\r\n * @param foldableOfA {Array}\r\n * @returns {Array}\r\n */\r\n concatMap = curry((fn, foldableOfA) => concat(map(fn, foldableOfA))),\r\n\r\n /**\r\n * Returns a copy of the passed in list reverses.\r\n * @haskellType `reverse :: [a] -> [a]`\r\n * @function module:list.reverse\r\n * @param xs {Array|String}\r\n * @returns {Array|String}\r\n */\r\n reverse = xs => {\r\n if (!isset(xs) || !xs.length) {\r\n return xs;\r\n }\r\n let out = of(xs),\r\n i = xs.length - 1;\r\n switch (typeOf(xs)) {\r\n case 'String':\r\n for (; i >= 0; i -= 1) {\r\n out += xs[i];\r\n }\r\n return out;\r\n default:\r\n for (; i >= 0; i -= 1) {\r\n out.push(xs[i]);\r\n }\r\n return out;\r\n }\r\n },\r\n\r\n /**\r\n * Takes an element and a list and `intersperses' that element between the\r\n * elements of the list.\r\n * @function module:list.intersperse\r\n * @note In our version of the function javascript is loosely typed so,\r\n * so is our function (to much overhead to make it typed) so `between` can be any value.\r\n * @param between {*} - Should be of the same type of elements contained in list.\r\n * @param arr {Array|String} - List.\r\n * @returns {Array|String}\r\n */\r\n intersperse = curry((between, xs) => {\r\n if (!xs || !xs.length) {\r\n return xs;\r\n }\r\n const limit = xs.length,\r\n lastInd = limit - 1;\r\n let out = of(xs),\r\n i = 0;\r\n if (isString(xs)) {\r\n for (; i < limit; i += 1) {\r\n out += i === lastInd ?\r\n xs[i] : xs[i] + between;\r\n }\r\n return out;\r\n }\r\n for (; i < limit; i += 1) {\r\n if (i === lastInd) {\r\n out.push(xs[i]);\r\n } else {\r\n out.push(xs[i], between);\r\n }\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * `intercalate xs xss` is equivalent to (concat (intersperse xs xss)). It inserts the list xs in between the lists in xss and concatenates the result.\r\n * @haskellType `intercalate :: [a] -> [[a]] -> [a]`\r\n * @function module:list.intercalate\r\n * @param xs {Array|String}\r\n * @param xss {Array|String}\r\n * @returns {Array|String}\r\n */\r\n intercalate = curry((xs, xss) => {\r\n if (isString(xss)) {\r\n return intersperse(xs, xss);\r\n }\r\n return concat(intersperse(xs, xss));\r\n }),\r\n\r\n /**\r\n * Transposes rows and columns into lists by index; E.g.,\r\n * Haskell example:\r\n * ```\r\n * transpose [[1,2,3],[4,5,6]] == [[1,4],[2,5],[3,6]]\r\n *\r\n * -- Notice the shorter arrays are ignored after their last index is copied over:\r\n * transpose [[10,11],[20],[],[30,31,32]] == [[10,20,30],[11,31],[32]]\r\n * ```\r\n * @note from columns to rows.\r\n * @note Empty lists are ignored.\r\n * @haskellType `transpose :: [[a]] -> [[a]]`\r\n * @function module:list.transpose\r\n * @param xss {Array}\r\n * @returns {Array}\r\n */\r\n transpose = xss => {\r\n let numLists = length(xss),\r\n ind = 0, ind2;\r\n if (!numLists) {\r\n return [];\r\n }\r\n const listLengths = apply(lengths, xss),\r\n longestListLen = maximum(listLengths),\r\n outLists = [];\r\n for (; ind < longestListLen; ind += 1) {\r\n const outList = [];\r\n for (ind2 = 0; ind2 < numLists; ind2 += 1) {\r\n if (listLengths[ind2] < ind + 1) {\r\n continue;\r\n }\r\n outList.push(xss[ind2][ind]);\r\n }\r\n outLists.push(outList);\r\n }\r\n return filter(x => length(x) > 0, outLists);\r\n },\r\n\r\n /**\r\n * Generates 2^n sub-sequences for passed in sequence (string/list) (`n` is\r\n * the length of the passed in sequence so: 2^length(xs)).\r\n * Note: The return value doubles per index/character passed in so use with caution!\r\n * Also note that for 2^16 (or for a sequence of 16 characters) this algorithm\r\n * will generate 65536 sub-sequences! So caution should be taken to not\r\n * use this with sequences above a certain length on certain platform (the browser thread in specific).\r\n * @function module:list.subsequences\r\n * @jsperftest https://jsperf.com/subsequences\r\n * @param xs {Array|String}\r\n * @returns {Array.}\r\n */\r\n subsequences = xs => {\r\n const listLen = length(xs),\r\n len = Math.pow(2, listLen),\r\n out = [];\r\n for (let i = 0; i < len; i += 1) {\r\n let entry = [];\r\n for (let j = 0; j < listLen; j += 1) {\r\n if (i & (1 << j)) {\r\n entry.push(xs[j]);\r\n }\r\n }\r\n out.push(entry);\r\n }\r\n return out;\r\n },\r\n\r\n /**\r\n * Returns an array with the given indices swapped.\r\n * @function module:list.swapped\r\n * @param ind1 {Number}\r\n * @param ind2 {Number}\r\n * @param list {Array}\r\n * @returns {Array} - Copy of incoming with swapped values at indices.\r\n */\r\n swapped = curry((ind1, ind2, list) => {\r\n const out = sliceCopy(list),\r\n tmp = out[ind1];\r\n out[ind1] = out[ind2];\r\n out[ind2] = tmp;\r\n return out;\r\n }),\r\n\r\n /**\r\n * Returns a list of permutations for passed in list.\r\n * Use caution with lists above a length of 15 (will take long due to nature of\r\n * algorithm).\r\n * @function module:list.permutations\r\n * @param xs {Array} - List.\r\n * @returns {Array} - Array of permutations.\r\n */\r\n permutations = xs => {\r\n const limit = length(xs);\r\n\r\n if (!limit || limit === 1) {\r\n return [xs];\r\n }\r\n\r\n let list = sliceCopy(xs),\r\n c = repeat(limit, 0),\r\n i = 0;\r\n\r\n const out = [list];\r\n\r\n for (; i < limit; i++) {\r\n if (c[i] < i) {\r\n list = swapped(i % 2 === 0 ? 0 : c[i], i, list);\r\n out.push(list);\r\n c[i] += 1;\r\n i = 0;\r\n continue;\r\n }\r\n c[i] = 0;\r\n }\r\n\r\n return out;\r\n },\r\n\r\n /**\r\n * Left associative fold. Reduces a container of elements down by the given operation (same as [].reduce).\r\n * @function module:list.foldl\r\n * @param fn {Function}\r\n * @param zero {*} - Aggregator.\r\n * @param functor {Array}\r\n * @returns {*} - Whatever type is lastly returned from `fn`.\r\n */\r\n foldl = reduce,\r\n\r\n /**\r\n * Right associative fold. Reduces a container of elements down by the given operation (same as [].reduceRight).\r\n * @function module:list.foldr\r\n * @param fn {Function}\r\n * @param zero {*} - Aggregator.\r\n * @param functor {Array}\r\n * @returns {*} - Whatever type is lastly returned from `fn`.\r\n */\r\n foldr = reduceRight,\r\n\r\n /**\r\n * A variant of `foldl` except that this one doesn't require the starting point. The starting point/value will be pulled\r\n * out from a copy of the container.\r\n * @function module:list.foldl1\r\n * @param op {Function}\r\n * @param xs {Array}\r\n * @returns {*} - Whatever type is lastly returned from `op`.\r\n */\r\n foldl1 = curry((op, xs) => {\r\n const parts = uncons(xs);\r\n return !parts ? [] : reduce(op, parts[0], parts[1]);\r\n }),\r\n\r\n /**\r\n * A variant of `foldr` except that this one doesn't require the starting point/value. The starting point/value will be pulled\r\n * out from a copy of the container.\r\n * @function module:list.foldr1\r\n * @param op {Function}\r\n * @param xs {Array}\r\n * @returns {*} - Whatever type is lastly returned from `op`.\r\n */\r\n foldr1 = curry((op, xs) => {\r\n const parts = unconsr(xs);\r\n return !parts ? [] : reduceRight(op, parts[1], parts[0]);\r\n }),\r\n\r\n /**\r\n * Performs a map then a reduce all in one (from left-to-right). Returns a tuple\r\n * containing the aggregated value and the result of mapping the passed in function on passed in list.\r\n * @function module:list.mapAccumL\r\n * @param op {Function} - Function : [aggregated, mapResult]\r\n * @param zero {*} - An instance of the passed in list type used to aggregateArray on.\r\n * @param xs {Array} - list type.\r\n * @return {Array} - [aggregated, list]\r\n */\r\n mapAccumL = curry((op, zero, xs) => {\r\n const list = sliceCopy(xs),\r\n limit = length(xs);\r\n if (!limit) {\r\n return [zero, list];\r\n }\r\n let ind = 0,\r\n agg = zero,\r\n mapped = [],\r\n tuple;\r\n for (; ind < limit; ind++) {\r\n tuple = op(agg, list[ind], ind);\r\n agg = tuple[0];\r\n mapped = tuple[1];\r\n }\r\n return [agg, mapped];\r\n }),\r\n\r\n /**\r\n * Performs a map and a reduce all in one (from right-to-left). Returns a tuple\r\n * containing the aggregated value and the result of mapping the passed in function on passed in list.\r\n * @function module:list.mapAccumR\r\n * @param op {Function} - Function : [aggregated, mapResult]\r\n * @param zero {*} - An instance of the passed in list type used to aggregateArray on.\r\n * @param xs {Array} - list type.\r\n * @return {Array} - [aggregated, list]\r\n */\r\n mapAccumR = curry((op, zero, xs) => {\r\n const list = sliceCopy(xs),\r\n limit = length(xs);\r\n if (!limit) {\r\n return [zero, list];\r\n }\r\n let ind = limit - 1,\r\n agg = zero,\r\n mapped = [],\r\n tuple;\r\n for (; ind >= 0; ind--) {\r\n tuple = op(agg, list[ind], ind);\r\n agg = tuple[0];\r\n mapped = tuple[1];\r\n }\r\n return [agg, mapped];\r\n }),\r\n\r\n /**\r\n * iterate f x returns an infinite list of repeated applications of f to x.\r\n * @function module:list.iterate\r\n * @example `iterate(5, f, x) == [x, f(x), f(f(x)), ...]`\r\n * @param limit {Number}\r\n * @param op {Function} - Operation.\r\n * @param x {*} - Starting point.\r\n * @returns {*}\r\n */\r\n iterate = curry((limit, op, x) => {\r\n let ind = 0,\r\n out = [],\r\n lastX = x;\r\n for (; ind < limit; ind += 1) {\r\n out.push(lastX);\r\n lastX = op(lastX, ind);\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Repeats `x` `limit` number of times.\r\n * @function module:list.repeat\r\n * @param limit {Number}\r\n * @param x {*}\r\n * @return {Array}\r\n */\r\n repeat = curry((limit, x) => iterate(limit, a => a, x)),\r\n\r\n /**\r\n * Same as `repeat` due to the nature of javascript (see haskell version for usage).\r\n * @function module:list.replicate\r\n * @param limit {Number}\r\n * @param x {*}\r\n * @return {Array}\r\n */\r\n replicate = repeat,\r\n\r\n /**\r\n * Replicates a list `limit` number of times and appends the results (concat)\r\n * @function module:list.cycle\r\n * @param limit {Number}\r\n * @param xs {Array}\r\n * @returns {Array}\r\n */\r\n cycle = curry((limit, xs) => concat(replicate(limit, xs))),\r\n\r\n /**\r\n * Unfolds a value into a list of somethings.\r\n * @haskellType `unfoldr :: (b -> Maybe (a, b)) -> b -> [a]`\r\n * @function module:list.unfoldr\r\n * @param op {Function} - Operation to perform (should return a two component tuple (item to aggregateArray and item to unfold in next iteration).\r\n * @param x {*} - Starting parameter to unfold from.\r\n * @returns {Array} - An array of whatever you return from `op` yielded.\r\n */\r\n unfoldr = curry((op, x) => {\r\n let ind = 0,\r\n out = [],\r\n resultTuple = op(x, ind, out);\r\n while (resultTuple) {\r\n out.push(resultTuple[0]);\r\n resultTuple = op(resultTuple[1], ++ind, out);\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Finds index in string or list (alias for `findIndex`).\r\n * @function module:list.findIndex\r\n * @param pred {Function} - Predicate.\r\n * @param arr {Array|String}\r\n * @returns {Number} - `-1` if predicate not matched else `index` found\r\n */\r\n findIndex = findIndexWhere,\r\n\r\n /**\r\n * @function module:list.findIndices\r\n * @param pred {Function}\r\n * @param xs {Array} - list or list like.\r\n * @returns {Array|undefined}\r\n */\r\n findIndices = findIndicesWhere,\r\n\r\n /**\r\n * @function module:list.elemIndex\r\n * @param x {*} - Element to search for.\r\n * @param xs {Array} - list or list like.\r\n * @returns {*}\r\n */\r\n elemIndex = curry((x, xs) => {\r\n const foundInd = indexOf(x, xs);\r\n return foundInd !== -1 ? foundInd : undefined;\r\n }),\r\n\r\n /**\r\n * @function module:list.elemIndices\r\n * @param value {*} - Element to search for.\r\n * @param xs {Array} - list or list like.\r\n * @returns {*}\r\n */\r\n elemIndices = curry((value, xs) => findIndices(x => x === value, xs)),\r\n\r\n /**\r\n * Takes `n` items from start of list to `limit` (exclusive).\r\n * @function module:list.take\r\n * @param list {Array|String}\r\n * @param limit {Number}\r\n * @returns {String|Array} - Passed in type's type\r\n */\r\n take = sliceTo,\r\n\r\n /**\r\n * Drops `n` items from start of list to `count` (exclusive).\r\n * @function module:list.drop\r\n * @param list {Array|String}\r\n * @param count {Number}\r\n * @returns {String|Array} - Passed in type's type\r\n */\r\n drop = sliceFrom,\r\n\r\n /**\r\n * Splits `x` in two at given `index` (exclusive (includes element/character at\r\n * given index in second part of returned list)).\r\n * @function module:list.splitAt\r\n * @param ind {Number} - Index to split at.\r\n * @param list {Array|String} - functor (list or string) to split.\r\n * @returns {Array|String} - List like type passed\r\n */\r\n splitAt = (ind, list) => [sliceTo(ind, list), sliceFrom(ind, list)],\r\n\r\n /**\r\n * Gives an list with passed elements while predicate was true.\r\n * @function module:list.takeWhile\r\n * @param pred {Function} - Predicate<*, index, list|string>\r\n * @param list {Array|String}\r\n * @returns {Array}\r\n */\r\n takeWhile = curry((pred, list) =>\r\n reduceUntil(\r\n negateF3(pred), // predicate\r\n isString(list) ?\r\n (agg, x) => agg + x :\r\n aggregateArray, // operation\r\n of(list), // aggregate\r\n list\r\n )),\r\n\r\n /**\r\n * Returns an list without elements that match predicate.\r\n * @function module:list.dropWhile\r\n * @param pred {Function} - Predicate<*, index, list|string>\r\n * @param list {Array|String}\r\n * @refactor\r\n * @returns {Array|String}\r\n */\r\n dropWhile = curry((pred, list) => {\r\n const limit = length(list),\r\n splitPoint =\r\n findIndexWhere(\r\n (x, i, xs) => !pred(x, i, xs),\r\n list\r\n );\r\n\r\n return splitPoint === -1 ?\r\n sliceFrom(limit, list) :\r\n slice(splitPoint, limit, list);\r\n }),\r\n\r\n /**\r\n * @function module:list.dropWhileEnd\r\n * @param pred {Function} - Predicate<*, index, list|string>\r\n * @param list {Array|String}\r\n * @refactor\r\n * @returns {Array|String}\r\n */\r\n dropWhileEnd = curry((pred, list) => {\r\n const splitPoint =\r\n findIndexWhereRight(\r\n (x, i, xs) => !pred(x, i, xs),\r\n list\r\n );\r\n if (splitPoint === -1) {\r\n return of(list);\r\n }\r\n return sliceTo(splitPoint + 1, list);\r\n }),\r\n\r\n /**\r\n * Gives you the `span` of items matching predicate\r\n * and items not matching predicate; E.g., Gives an\r\n * array of arrays; E.g., [[matching-items], [non-matching-items]]\r\n * @function list.span\r\n * @param pred {Function} - List predicate (`(x, i, list) => bool`)\r\n * @param list {Array|String}\r\n * @returns {(Array>|Array)}\r\n * @type {Function}\r\n */\r\n span = curry((pred, list) => {\r\n const splitPoint = findIndexWhere(negateF3(pred), list);\r\n return splitPoint === -1 ?\r\n [sliceFrom(0, list), of(list)] :\r\n splitAt(splitPoint, list);\r\n }),\r\n\r\n /**\r\n * breakOnList, applied to a predicate p and a list xs, returns a tuple\r\n * where first element is longest prefix (possibly empty) of xs of elements\r\n * that do not satisfy p and second element is the remainder of the list:\r\n * @haskellExample\r\n * Replace `break` with `breakOnList` for our version.\r\n * ```\r\n * breakOnList (> 3) [1,2,3,4,1,2,3,4] == ([1,2,3],[4,1,2,3,4])\r\n * breakOnList (< 9) [1,2,3] == ([],[1,2,3])\r\n * breakOnList (> 9) [1,2,3] == ([1,2,3],[])\r\n * ```\r\n * @function module:list.breakOnList\r\n * @param pred {Function}\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n breakOnList = curry((pred, list) => {\r\n const splitPoint = findIndexWhere(negateF3(pred), list);\r\n return splitPoint === -1 ?\r\n [of(list), sliceFrom(0, list)] : reverse(splitAt(splitPoint, list));\r\n }),\r\n\r\n /**\r\n * Gets item at index.\r\n * @function module:list.at\r\n * @param ind {Number} - Index.\r\n * @param xs {Array} - list or list like.\r\n * @returns {*|undefined} - Item or `undefined`.\r\n */\r\n at = lookup,\r\n\r\n /**\r\n * Find an item in structure of elements based on given predicate (`pred`).\r\n * @function module:list.find\r\n * @param pred {Function}\r\n * @param xs {Array} - list or list like.\r\n * @returns {*} - Found item.\r\n */\r\n find = findWhere,\r\n\r\n /**\r\n * For each function (same as `[].forEach` except in functional format).\r\n * @function module:list.forEach\r\n * @param fn {Function} - Operation (`(element, index, list) => {...}`, etc.)\r\n * @param xs {(Array|String)}\r\n * @returns {void}\r\n */\r\n forEach = curry((fn, list) => {\r\n const limit = length(list);\r\n if (!limit) {\r\n return;\r\n }\r\n let ind = 0;\r\n for (; ind < limit; ind += 1) {\r\n fn(list[ind], ind, list);\r\n }\r\n }),\r\n\r\n /**\r\n * Filters a structure of elements using given predicate (`pred`) (same as `[].filter`).\r\n * @function module:list.filter\r\n * @param pred {Function}\r\n * @param xs {Array} - list or list like.\r\n * @returns {Array} - Structure of filtered elements.\r\n */\r\n filter = curry((pred, xs) => {\r\n let ind = 0,\r\n limit = length(xs),\r\n out = [];\r\n if (!limit) {\r\n return out;\r\n }\r\n for (; ind < limit; ind++) {\r\n if (pred(xs[ind], ind, xs)) {\r\n out.push(xs[ind]);\r\n }\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Partitions a list on a predicate; Items that match predicate are in first list in tuple; Items that\r\n * do not match the tuple are in second list in the returned tuple.\r\n * Essentially `[filter(p, xs), filter(negateF3(p), xs)]`.\r\n * @function module:list.partition\r\n * @param pred {Function} - Predicate\r\n * @param list {Array}\r\n * @returns {Array|String} - Tuple of arrays or strings (depends on incoming list (of type list or string)).\r\n */\r\n partition = curry((pred, list) =>\r\n !length(list) ?\r\n [[], []] :\r\n [filter(pred, list), filter(negateF3(pred), list)]),\r\n\r\n /**\r\n * Returns a boolean indicating whether an element exists in given structure of elements.\r\n * @function module:list.elem\r\n * @param element {*}\r\n * @param xs {Array}\r\n * @returns {Boolean}\r\n */\r\n elem = includes,\r\n\r\n /**\r\n * The opposite of `elem` - Returns a boolean indicating whether an element exists in given list.\r\n * @function module:list.notElem\r\n * @param element {*}\r\n * @param xs {Array}\r\n * @returns {Boolean}\r\n */\r\n notElem = negateF2(includes),\r\n\r\n /**\r\n * Checks if list `xs1` is a prefix of list `xs2`\r\n * @function module:list.isPrefixOf\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {boolean}\r\n */\r\n isPrefixOf = curry((xs1, xs2) => {\r\n const limit1 = length(xs1),\r\n limit2 = length(xs2);\r\n if (limit2 < limit1 || !limit1 || !limit2 || indexOf(xs1[0], xs2) === -1) {\r\n return false;\r\n }\r\n let ind = 0;\r\n for (; ind < limit1; ind++) {\r\n if (xs1[ind] !== xs2[ind]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }),\r\n\r\n /**\r\n * Checks if list `xs1` is a suffix of list `xs2`\r\n * @function module:list.isSuffixOf\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {boolean}\r\n */\r\n isSuffixOf = curry((xs1, xs2) => {\r\n const limit1 = length(xs1),\r\n limit2 = length(xs2);\r\n if (limit2 < limit1 || !limit1 || !limit2 || indexOf(xs1[0], xs2) === -1) {\r\n return false;\r\n }\r\n let ind1 = limit1 - 1,\r\n ind2 = limit2 - 1;\r\n for (; ind1 >= 0; ind1--) {\r\n if (xs1[ind1] !== xs2[ind2]) {\r\n return false;\r\n }\r\n ind2 -= 1;\r\n }\r\n return true;\r\n }),\r\n\r\n /**\r\n * Checks if list `xs1` is an infix of list `xs2`\r\n * @function module:list.isInfixOf\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {boolean}\r\n */\r\n isInfixOf = curry((xs1, xs2) => {\r\n const limit1 = length(xs1),\r\n limit2 = length(xs2);\r\n if (limit2 < limit1 || !limit1 || !limit2) {\r\n return false;\r\n }\r\n let ind1,\r\n foundLen,\r\n ind = 0;\r\n for (; ind < limit2; ind += 1) {\r\n foundLen = 0;\r\n for (ind1 = 0; ind1 < limit1; ind1 += 1) {\r\n if (xs2[ind1 + ind] === xs1[ind1]) {\r\n foundLen += 1;\r\n }\r\n if (foundLen === limit1) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }),\r\n\r\n /**\r\n * Checks if list `xs1` is a sub-sequence of list `xs2`\r\n * @function module:list.isSubsequenceOf\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {boolean}\r\n */\r\n isSubsequenceOf = curry((xs1, xs2) => {\r\n const len = Math.pow(2, length(xs2)),\r\n lenXs1 = length(xs1);\r\n let foundLen,\r\n i;\r\n for (i = 0; i < len; i += 1) {\r\n foundLen = 0;\r\n for (let j = 0; j < len; j += 1) {\r\n if (i & (1 << j) && indexOf(xs2[j], xs1) > -1) {\r\n foundLen += 1;\r\n }\r\n if (foundLen === lenXs1) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }),\r\n\r\n /**\r\n * The group function takes a list and returns a list of lists such that\r\n * the concatenation of the result is equal to the argument. Moreover, each\r\n * sublist in the result contains only equal elements. For example,\r\n * `group \"Mississippi\" = [\"M\",\"i\",\"ss\",\"i\",\"ss\",\"i\",\"pp\",\"i\"]`\r\n * It is a special case of groupBy, which allows the programmer to supply\r\n * their own equality test.\r\n * @haskellType `group :: Eq a => [a] -> [[a]]`\r\n * @function module:list.group\r\n * @param xs {Array|String}\r\n * @returns {Array|*}\r\n */\r\n group = xs => groupBy((a, b) => a === b, xs),\r\n\r\n /**\r\n * Allows you to group items in a list based on your supplied equality check.\r\n * @note Sames `group` but allows you to specify equality operation.\r\n * @haskellType `groupBy :: (a -> a -> Bool) -> [a] -> [[a]]`\r\n * @function module:list.groupBy\r\n * @param equalityOp {Function}\r\n * @param xs {Array}\r\n * @returns {*}\r\n */\r\n groupBy = curry((equalityOp, xs) => {\r\n const limit = length(xs);\r\n if (!limit) {\r\n return sliceCopy(xs);\r\n }\r\n let ind = 0,\r\n prevItem,\r\n item,\r\n predOp = x => {\r\n if (equalityOp(x, prevItem)) {\r\n ind++;\r\n }\r\n if (equalityOp(x, item)) {\r\n prevItem = x;\r\n return true;\r\n }\r\n return false;\r\n },\r\n agg = [];\r\n for (; ind < limit; ind += 1) {\r\n item = xs[ind];\r\n agg.push(takeWhile(predOp, slice(ind, limit, xs)));\r\n }\r\n return agg;\r\n }),\r\n\r\n /**\r\n * The inits function returns all initial segments of the argument, shortest first. For example,\r\n * ```\r\n * shallowEquals(inits('abc'), ['','a','ab','abc'])\r\n * ```\r\n * @function module:list.inits\r\n * @haskellType `inits :: [a] -> [[a]]`\r\n * @param xs {Array}\r\n * @returns {Array}\r\n */\r\n inits = xs => {\r\n let limit = length(xs),\r\n ind = 0,\r\n agg = [];\r\n if (!limit) {\r\n return [];\r\n }\r\n for (; ind <= limit; ind += 1) {\r\n agg.push(sliceTo(ind, xs));\r\n }\r\n return agg;\r\n }, //map(list => init(list), xs),\r\n\r\n /**\r\n * The inits function returns all initial segments of the argument, shortest first. For example,\r\n * ```\r\n * shallowEquals(tails('abc'), ['abc', 'bc', 'c',''])\r\n * ```\r\n * @function module:list.tails\r\n * @haskellType `tails :: [a] -> [[a]]`\r\n * @param xs {Array}\r\n * @returns {Array}\r\n */\r\n tails = xs => {\r\n let limit = length(xs),\r\n ind = 0,\r\n agg = [];\r\n if (!limit) {\r\n return [];\r\n }\r\n for (; ind <= limit; ind += 1) {\r\n agg.push(slice(ind, limit, xs));\r\n }\r\n return agg;\r\n }, //map(list => tail(list), xs),\r\n\r\n /**\r\n * Strips prefix list from given list\r\n * @function module:list.stripPrefix\r\n * @param prefix {Array|String|*}\r\n * @param list {Array|string|*}\r\n * @returns {Array|*}\r\n */\r\n stripPrefix = curry((prefix, list) =>\r\n isPrefixOf(prefix, list) ?\r\n splitAt(length(prefix), list)[1] :\r\n sliceCopy(list)),\r\n\r\n /**\r\n * zip takes two lists and returns a list of corresponding pairs.\r\n * If one input list is short, excess elements of the longer list are discarded.\r\n * @haskellType `zip :: [a] -> [b] -> [(a, b)]`\r\n * @function module:list.zip\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @returns {Array>}\r\n */\r\n zip = curry((arr1, arr2) => {\r\n if (!length(arr1) || !length(arr2)) {\r\n return [];\r\n }\r\n const [a1, a2] = toShortest(arr1, arr2);\r\n return reduce((agg, item, ind) =>\r\n aggregateArray(agg, [item, a2[ind]]),\r\n [], a1);\r\n }),\r\n\r\n /**\r\n * zipN takes one or more lists and returns a list containing lists of all indices\r\n * at a given index, index by index.\r\n * If one input list is short, excess elements of the longer list are discarded.\r\n * @function module:list.zipN\r\n * @param lists {Array|String} - One ore more lists of the same type.\r\n * @returns {Array}\r\n */\r\n zipN = curry2((...lists) => {\r\n const trimmedLists = apply(toShortest, lists);\r\n return reduce((agg, item, ind) =>\r\n aggregateArray(agg, map(xs => xs[ind], trimmedLists)),\r\n [], trimmedLists[0]);\r\n }),\r\n\r\n /**\r\n * @haskellType `zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]`\r\n * @function module:list.zip3\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @param arr3 {Array}\r\n * @returns {Array>}\r\n */\r\n zip3 = curry((arr1, arr2, arr3) => zipN(arr1, arr2, arr3)),\r\n\r\n /**\r\n * @haskellType `zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]`\r\n * @function module:list.zip4\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @param arr3 {Array}\r\n * @param arr4 {Array}\r\n * @returns {Array>}\r\n */\r\n zip4 = curry((arr1, arr2, arr3, arr4) => zipN(arr1, arr2, arr3, arr4)),\r\n\r\n /**\r\n * @haskellType `zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]`\r\n * @function module:list.zip5\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @param arr3 {Array}\r\n * @param arr4 {Array}\r\n * @param arr5 {Array}\r\n * @returns {Array>}\r\n */\r\n zip5 = curry((arr1, arr2, arr3, arr4, arr5) => zipN(arr1, arr2, arr3, arr4, arr5)),\r\n\r\n /**\r\n * zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]\r\n * zipWith generalises zip by zipping with the function given as the\r\n * first argument, instead of a function tupling function (function that returns a tuple). For example,\r\n * zipWith (+) is applied to two lists to produce the list of corresponding sums.\r\n * @note `_|_` means bottom or perpetual (@see\r\n * - https://wiki.haskell.org/Bottom\r\n * - https://stackoverflow.com/questions/19794681/what-does-this-syntax-mean-in-haskell-or\r\n * )\r\n * @example\r\n * ```\r\n * zipWith f [] _|_ = []\r\n * ```\r\n * @haskellType `zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]`\r\n * @function module:list.zipWith\r\n * @param op {Function} - Takes two parts of a tuple and returns a tuple.\r\n * E.g., ` op :: a -> b -> (a, b)`\r\n * @param xs1 {Array}\r\n * @param xs2 {Array}\r\n * @returns {Array>}\r\n */\r\n zipWith = curry((op, xs1, xs2) => {\r\n if (!length(xs1) || !length(xs2)) {\r\n return [];\r\n }\r\n const [a1, a2] = toShortest(xs1, xs2);\r\n return reduce((agg, item, ind) =>\r\n aggregateArray(agg, op(item, a2[ind])),\r\n [], a1);\r\n }),\r\n\r\n /**\r\n * Zips all given lists with tupling function. Note: Haskell types do not have\r\n * a way (that I know of) to show one or more for params in a function so `@haskellType` below\r\n * is left there for general purpose not for exactness as is told by aforementioned.\r\n * @haskellType `zipWithN :: (a -> b -> c) -> [a] -> [b] -> [c]` - Where `N` is the number\r\n * of lists to zip.\r\n * @function module:list.zipWithN\r\n * @param op {Function} - Takes expected number of parts for tuple and returns a tuple\r\n * of said parts:\r\n * E.g., ` op :: a -> b -> c -> (a, b, c)`\r\n * @param lists ...{Array}\r\n * @returns {Array>}\r\n */\r\n zipWithN = curry3((op, ...lists) => {\r\n const trimmedLists = apply(toShortest, lists),\r\n lenOfTrimmed = length(trimmedLists);\r\n if (!lenOfTrimmed) {\r\n return [];\r\n }\r\n else if (lenOfTrimmed === 1) {\r\n return sliceTo(length(trimmedLists[0]), trimmedLists[0]);\r\n }\r\n return reduce((agg, item, ind) =>\r\n aggregateArray(agg, apply(op, map(xs => xs[ind], trimmedLists))),\r\n [], trimmedLists[0]);\r\n }),\r\n\r\n /**\r\n * Zips 3 lists with tupling function.\r\n * @haskellType `zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]`\r\n * @function module:list.zipWith3\r\n * @param op {Function} - Takes expected number of parts for tuple and returns a tuple\r\n * of said parts:\r\n * E.g., ` op :: a -> b -> c -> (a, b, c)`\r\n * @param xs1 {Array}\r\n * @param xs2 {Array}\r\n * @param xs3 {Array}\r\n * @returns {Array>}\r\n */\r\n zipWith3 = curry((op, xs1, xs2, xs3) => zipWithN(op, xs1, xs2, xs3)),\r\n\r\n /**\r\n * Zips 4 lists with tupling function.\r\n * @haskellType `zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]`\r\n * @function module:list.zipWith4\r\n * @param op {Function} - Takes expected number of parts for tuple and returns a tuple\r\n * of said parts:\r\n * E.g., ` op :: a -> b -> c -> d -> (a, b, c, d)`\r\n * @param xs1 {Array}\r\n * @param xs2 {Array}\r\n * @param xs3 {Array}\r\n * @param xs4 {Array}\r\n * @returns {Array>}\r\n */\r\n zipWith4 = curry((op, xs1, xs2, xs3, xs4) => zipWithN(op, xs1, xs2, xs3, xs4)),\r\n\r\n /**\r\n * Zips 5 lists.\r\n * @haskellType `zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]`\r\n * @function module:list.zipWith5\r\n * @param op {Function} - Takes expected number of parts for tuple and returns a tuple\r\n * of said parts:\r\n * E.g., ` op :: a -> b -> c -> d -> e -> (a, b, c, d, e)`\r\n * @param xs1 {Array}\r\n * @param xs2 {Array}\r\n * @param xs3 {Array}\r\n * @param xs4 {Array}\r\n * @param xs5 {Array}\r\n * @returns {Array>}\r\n */\r\n zipWith5 = curry((op, xs1, xs2, xs3, xs4, xs5) => zipWithN(op, xs1, xs2, xs3, xs4, xs5)),\r\n\r\n /**\r\n * unzip transforms a list of pairs into a list of first components and a list of second components.\r\n * @haskellType `unzip :: [(a, b)] -> ([a], [b])`\r\n * @function module:list.unzip\r\n * @param arr {Array|*}\r\n * @returns {Array|*}\r\n */\r\n unzip = foldl((agg, item) => {\r\n agg[0].push(item[0]);\r\n agg[1].push(item[1]);\r\n return agg;\r\n }, [[], []]),\r\n\r\n /**\r\n * unzip transforms a list of pairs into a list of first components and a list of second components.\r\n * @sudoHaskellType `unzipN :: [(a, b, ...x)] -> ([a], [b], ...[x])`\r\n * @function module:list.unzipN\r\n * @param list {Array|*} - List of tuples (lists).\r\n * @returns {Array|*}\r\n */\r\n unzipN = list => {\r\n if (!length(list)) {\r\n return [];\r\n }\r\n const lenItem0 = length(list[0]);\r\n let zero = lenItem0 ?\r\n unfoldr(numLists => numLists-- ? [[], numLists] : undefined, lenItem0) :\r\n [];\r\n return foldl((agg, item) => {\r\n agg.forEach((outList, ind) => outList.push(item[ind]));\r\n return agg;\r\n }, zero, list);\r\n },\r\n\r\n /**\r\n * Returns true if any item in container passes predicate `p`.\r\n * @function module:list.any\r\n * @param p {Function} - Predicate.\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n any = curry((p, xs) => {\r\n let ind = 0,\r\n limit = length(xs);\r\n if (!limit) {\r\n return false;\r\n }\r\n for (; ind < limit; ind += 1) {\r\n if (p(xs[ind])) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }),\r\n\r\n /**\r\n * Returns true if all items in container pass predicate `p`.\r\n * @function module:list.all\r\n * @param p {Function} - Predicate.\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n all = curry((p, xs) => {\r\n const limit = length(xs);\r\n let ind = 0;\r\n if (!limit) {\r\n return false;\r\n }\r\n for (; ind < limit; ind++) {\r\n if (!p(xs[ind], ind, xs)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }),\r\n\r\n /**\r\n * Conjuction of container of bools (or truthy and/or falsy values); Returns\r\n * `true` if all in container are 'truthy' else returns `false`\r\n * @function module:list.and\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n and = xs => all(isTruthy, xs),\r\n\r\n /**\r\n * Returns a boolean indicating whether any item in container is 'truthy' or not.\r\n * **Note** The haskell type for this function only takes two items, but here\r\n * we allow the passing of more than one item (may change later to adhere to the haskell type).\r\n * @function module:list.or\r\n * @haskellType `or :: Bool -> Bool -> Bool`\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n or = xs => any(isTruthy, xs),\r\n\r\n /**\r\n * Returns a boolean indicating whether all items in container are 'falsy' or not.\r\n * **Note** The haskell type for this function only takes two items, but here\r\n * we allow the passing of more than one item (may change later to adhere to the haskell type).\r\n * @function module:list.not\r\n * @haskellType `not :: Bool -> Bool`\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n not = xs => all(isFalsy, xs),\r\n\r\n /**\r\n * Computes the sum of the numbers of a structure.\r\n * @function module:list.sum\r\n * @haskellType `sum :: (List t, Num a) => t a -> a`\r\n * @param list {Array|String}\r\n * @returns {Number}\r\n */\r\n sum = list => foldl((agg, x) => agg + x, 0, list),\r\n\r\n /**\r\n * Computes the product of the numbers of a structure.\r\n * @function module:list.product\r\n * @haskellType `product :: (List t, Num a) => t a -> a`\r\n * @param list {Array|String}\r\n * @returns {Number}\r\n */\r\n product = list => foldl((agg, x) => agg * x, 1, list),\r\n\r\n /**\r\n * Returns the largest element in a non-empty structure of elements.\r\n * @function module:list.maximum\r\n * @haskellType `maximum :: forall a . Ord a => t a -> a`\r\n * @param list {Array|String}\r\n * @returns {*} - Whatever type the array is made of (if any).\r\n */\r\n maximum = list => last(sortBy(genericAscOrdering, list)),\r\n\r\n /**\r\n * Returns the smallest element in a non-empty structure of elements.\r\n * @function module:list.minimum\r\n * @haskellType `minimum :: forall a . Ord a => t a -> a`\r\n * @param list {Array|String}\r\n * @returns {*} - Whatever type the array is made of (if any).\r\n */\r\n minimum = list => head(sortBy(genericAscOrdering, list)),\r\n\r\n /**\r\n * scanl is similar to foldl, but returns a list of successive reduced values from the left:\r\n * ```\r\n * scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]\r\n * ```\r\n * Also note that:\r\n * ```\r\n * last (scanl f z xs) == foldl f z xs.\r\n * ```\r\n * @function module:list.scanl\r\n * @param fn {Function}\r\n * @param zero {*}\r\n * @param xs {Array}\r\n * @returns {Array|*}\r\n */\r\n scanl = curry((fn, zero, xs) => {\r\n if (!xs || !length(xs)) {\r\n return [];\r\n }\r\n const limit = length(xs);\r\n let ind = 0,\r\n result = zero,\r\n out = [];\r\n while (ind < limit) {\r\n result = fn(result, xs[ind], ind, xs);\r\n out.push(result);\r\n ind++;\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * `scanl1` is a variant of `scanl` that has no starting value argument:\r\n * `shallowCompare(scanl1(fn, [x1, x2, ...]), [x1, fn(x1, x2), ...]) // true`\r\n * @function module:list.scanl1\r\n * @param fn {Function}\r\n * @param xs {Array}\r\n * @returns {Array|*}\r\n */\r\n scanl1 = curry((fn, xs) => {\r\n if (!xs || !xs.length) {\r\n return [];\r\n }\r\n return scanl(fn, head(xs), tail(xs));\r\n }),\r\n\r\n /**\r\n * Same as `scanl` but from the right (similiar to `foldr`'s relationship to 'foldl').\r\n * Note also `scanr`'s relationship ot `foldr`:\r\n * `head (scanr(fn, z, xs)) === foldr(fn, z, xs).\r\n * @function module:list.scanr\r\n * @param fn {Function}\r\n * @param zero {*}\r\n * @param xs {Array}\r\n * @returns {Array|*}\r\n */\r\n scanr = curry((fn, zero, xs) => {\r\n if (!xs || !length(xs)) {\r\n return [];\r\n }\r\n const limit = length(xs);\r\n let ind = limit - 1,\r\n result = xs[0],\r\n out = [];\r\n while (ind > -1) {\r\n result = fn(result, xs[ind], ind, xs);\r\n out.push(result);\r\n ind--;\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Same as `scanr` but takes no zero/accumulator value.\r\n * @function module:list.scanr1\r\n * @param fn {Function}\r\n * @param xs {Array}\r\n * @returns {Array|*}\r\n */\r\n scanr1 = curry((fn, xs) => {\r\n if (!xs || !xs.length) {\r\n return [];\r\n }\r\n return scanr(fn, last(xs), init(xs));\r\n }),\r\n\r\n /**\r\n * The nub function removes duplicate elements from a list.\r\n * In particular, it keeps only the first occurrence of each element.\r\n * (The name nub means `essence'.) It is a special case of nubBy, which\r\n * allows the programmer to supply their own equality test.\r\n * ```shallowCompare( nub ([1,2,3,4,3,2,1,2,4,3,5]), [1,2,3,4,5] )```\r\n * @function module:list.nub\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n nub = list => nubBy((a, b) => a === b, list),\r\n\r\n /**\r\n * `remove(x, xs)` removes the first occurrence of `x` from `xs`.\r\n * For example, `remove('a', 'banana') === 'bnana';`\r\n * @function module:list.remove\r\n * @param x {*}\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n remove = curry((x, list) => removeBy((a, b) => a === b, x, list)),\r\n\r\n /**\r\n * The sort function implements a stable sorting algorithm.\r\n * It is a special case of sortBy, which allows the programmer\r\n * to supply their own comparison function.\r\n * ```shallowCompare(sort ([1,6,4,3,2,5]), [1,2,3,4,5,6]) // true```\r\n * @function module:list.sort\r\n * @param xs {Array|String|*}\r\n * @returns {Array}\r\n */\r\n sort = xs => sortBy(genericAscOrdering, xs),\r\n\r\n /**\r\n * Sort a list by comparing the results of a key function applied to each\r\n * element. sortOn f is equivalent to sortBy (comparing f), but has the\r\n * performance advantage of only evaluating f once for each element in the\r\n * input list. This is called the decorate-sort-undecorate paradigm, or\r\n * Schwartzian transform.\r\n *\r\n * Elements are arranged from from lowest to highest, keeping duplicates\r\n * in the order they appeared in the input.\r\n *\r\n * Ex:\r\n * ```\r\n * shallowEquals(\r\n * sortOn (head, [[2, \"world\"], [4, \"!\"], [1, \"Hello\"]]),\r\n * [[1,\"Hello\"],[2,\"world\"],[4,\"!\"]]\r\n * ) // true\r\n * ```\r\n * @function module:list.sortOn\r\n * @param valueFn {Function}\r\n * @param xs {Array|String|*}\r\n * @returns {Array}\r\n */\r\n sortOn = curry((valueFn, xs) =>\r\n\r\n // Un-decorate\r\n map(decorated => decorated[1],\r\n\r\n // Decorate and sort\r\n sortBy(\r\n // Ordering\r\n ([a0], [b0]) => genericAscOrdering(a0, b0),\r\n\r\n // Decorate\r\n map(item => [valueFn(item), item], xs)\r\n )\r\n )\r\n ),\r\n\r\n /**\r\n * The sortBy function is the non-overloaded (in haskell terms) version of sort.\r\n * @haskellExample ```\r\n * >>> sortBy (\\(a,_) (b,_) -> compare a b) [(2, \"world\"), (4, \"!\"), (1, \"Hello\")]\r\n * [(1,\"Hello\"),(2,\"world\"),(4,\"!\")]\r\n * ```\r\n * @function module:list.sortBy\r\n * @param orderingFn {Function}\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n sortBy = curry((orderingFn, xs) => sliceCopy(xs).sort(orderingFn || genericAscOrdering)),\r\n\r\n /**\r\n * The insert function takes an element and a list and inserts the element\r\n * into the list at the first position where it is less than or equal to the\r\n * next element. In particular, if the list is sorted before the call, the\r\n * result will also be sorted. It is a special case of insertBy, which allows\r\n * the programmer to supply their own comparison function.\r\n * @function module:list.insert\r\n * @param x {*}\r\n * @param xs {Array|*}\r\n * @returns {Array}\r\n */\r\n insert = curry((x, xs) => {\r\n if (!xs.length) {\r\n return of(xs, x);\r\n }\r\n const foundIndex = findIndex(item => x <= item, xs);\r\n return foundIndex === -1 ? concat([xs, of(xs, x)]) :\r\n concat(intersperse(of(xs, x), splitAt(foundIndex, xs)));\r\n }),\r\n\r\n /**\r\n * A version of `insert` that allows you to specify the ordering of the inserted\r\n * item; Before/at, or after\r\n * @function module:list.insertBy\r\n * @haskellType `insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]`\r\n * @note `Ordering` means 'something that is order-able'\r\n * operated on by this functions logic.\r\n * @param orderingFn {Function} - A function that returns `-1`, `0`, or 1`.\r\n * @param x {*} - Value to insert.\r\n * @param xs {Array} - List to insert into (note new list is returned)\r\n * @returns {Array} - New list.\r\n */\r\n insertBy = curry((orderingFn, x, xs) => {\r\n const limit = length(xs);\r\n if (!limit) {\r\n return [x];\r\n }\r\n let ind = 0;\r\n for (; ind < limit; ind += 1) {\r\n if (orderingFn(x, xs[ind]) <= 0) {\r\n const parts = splitAt(ind, xs);\r\n return concat([parts[0], [x], parts[1]]);\r\n }\r\n }\r\n return aggregateArray(sliceCopy(xs), x);\r\n }),\r\n\r\n /**\r\n * The nubBy function behaves just like nub, except it uses a user-supplied equality predicate.\r\n * @function module:list.nubBy\r\n * @param pred {Function}\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n nubBy = curry((pred, list) => {\r\n if (!length(list)) {\r\n return [];\r\n }\r\n const limit = length(list);\r\n let ind = 0,\r\n currItem,\r\n out = [],\r\n anyOp = storedItem => pred(currItem, storedItem);\r\n for (; ind < limit; ind += 1) {\r\n currItem = list[ind];\r\n if (any(anyOp, out)) {\r\n continue;\r\n }\r\n out.push(currItem);\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Behaves the same as `remove`, but takes a user-supplied equality predicate.\r\n * @function module:list.removeBy\r\n * @param pred {Function} - Equality predicate `(a, b) => bool`\r\n * @param x {*}\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n removeBy = curry((pred, x, list) => {\r\n const foundIndex = findIndex(item => pred(x, item), list);\r\n if (foundIndex > -1) {\r\n const parts = splitAt(foundIndex, list);\r\n return append(parts[0], tail(parts[1]));\r\n }\r\n return sliceCopy(list);\r\n }),\r\n\r\n /**\r\n * The `removeFirstsBy` function takes a predicate and two lists and returns the first list with the first\r\n * occurrence of each element of the second list removed.\r\n * @function module:list.removeFirstBy\r\n * @param pred {Function}\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {Array}\r\n */\r\n removeFirstsBy = curry((pred, xs1, xs2) =>\r\n foldl((agg, x) => removeBy(pred, x, agg), xs1, xs2)),\r\n\r\n /**\r\n * Returns the union on elements matching boolean check passed in.\r\n * @function module:list.unionBy\r\n * @param pred {Function} - `pred :: a -> a -> Bool`\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @returns {Array}\r\n */\r\n unionBy = curry((pred, arr1, arr2) =>\r\n foldl((agg, b) => {\r\n const alreadyAdded = any(a => pred(a, b), agg);\r\n return !alreadyAdded ? (agg.push(b), agg) : agg;\r\n }, sliceCopy(arr1), arr2\r\n )),\r\n\r\n /**\r\n * Creates a union on matching elements from array1.\r\n * @function module:list.union\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @returns {Array}\r\n */\r\n union = curry((arr1, arr2) =>\r\n append(arr1,\r\n filter(elm => !includes(elm, arr1), arr2))),\r\n\r\n /**\r\n * Performs an intersection on list 1 with elements from list 2.\r\n * @function module:list.intersect\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @returns {Array}\r\n */\r\n intersect = curry((arr1, arr2) =>\r\n !arr1 || !arr2 || (!arr1 && !arr2) ? [] :\r\n filter(elm => includes(elm, arr2), arr1)),\r\n\r\n /**\r\n * Returns an intersection by predicate.\r\n * @function module:list.intersectBy\r\n * @param pred {Function} - `pred :: a -> b -> Bool`\r\n * @param list1 {Array}\r\n * @param list2 {Array}\r\n * @return {Array}\r\n */\r\n intersectBy = curry((pred, list1, list2) =>\r\n foldl((agg, a) =>\r\n any(b => pred(a, b), list2) ? (agg.push(a), agg) : agg\r\n , [], list1)),\r\n\r\n /**\r\n * Returns the difference of list 1 from list 2.\r\n * @note The `difference` operation here is non-associative; E.g., `a - b` is not equal to `b - a`;\r\n * @function module:list.difference\r\n * @param array1 {Array}\r\n * @param array2 {Array}\r\n * @returns {Array}\r\n */\r\n difference = curry((array1, array2) => { // augment this with max length and min length ordering on op\r\n if (array1 && !array2) {\r\n return sliceCopy(array1);\r\n }\r\n else if (!array1 && array2 || (!array1 && !array2)) {\r\n return [];\r\n }\r\n return reduce((agg, elm) =>\r\n !includes(elm, array2) ? (agg.push(elm), agg) : agg\r\n , [], array1);\r\n }),\r\n\r\n /**\r\n * Returns the complement of list 0 and the reset of the passed in arrays.\r\n * @function module:list.complement\r\n * @param arr0 {Array}\r\n * @param arrays {...Array}\r\n * @returns {Array}\r\n */\r\n complement = curry2((arr0, ...arrays) =>\r\n reduce((agg, arr) => append(agg, difference(arr, arr0)), [], arrays));\r\n","/**\r\n * @module errorThrowing\r\n * @description Contains error throwing facilities for when a value doesn't match a type.\r\n */\r\nimport {typeOf} from './object/typeOf';\r\nimport {isArray, toTypeRef, toTypeRefName, isOfType} from './object/is';\r\nimport {curry} from './function/curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Pretty prints an array of types/type-strings for use by error messages;\r\n * Outputs \"`SomeTypeName`, ...\" from [SomeType, 'SomeTypeName', etc...]\r\n * @function module:errorThrowing.typeRefsToStringOrError\r\n * @param types {Array|TypesArray}\r\n * @return {String}\r\n * @private\r\n */\r\n typeRefsToStringOrError = types => types.length ?\r\n types.map(type => `\\`${toTypeRefName(type)}\\``).join(', ') : '',\r\n\r\n /**\r\n * Prints a message from an object. Object signature:\r\n * {contextName, valueName, value, expectedTypeName, foundTypeName, messageSuffix}\r\n * @function module:errorThrowing.defaultErrorMessageCall\r\n * @param tmplContext {Object|TemplateContext} - Object to use in error template.\r\n * @returns {string}\r\n * @private\r\n */\r\n defaultErrorMessageCall = tmplContext => {\r\n const {\r\n contextName, valueName, value, expectedTypeName,\r\n foundTypeName, messageSuffix\r\n } = tmplContext,\r\n isMultiTypeNames = isArray(expectedTypeName),\r\n typesCopy = isMultiTypeNames ? 'of type' : 'of one of the types',\r\n typesToMatchCopy = isMultiTypeNames ? typeRefsToStringOrError(expectedTypeName) : expectedTypeName;\r\n return (contextName ? `\\`${contextName}.` : '`') +\r\n `${valueName}\\` is not ${typesCopy}: ${typesToMatchCopy}. ` +\r\n `Type received: ${foundTypeName}. Value: ${value};` +\r\n `${messageSuffix ? ' ' + messageSuffix + ';' : ''}`;\r\n },\r\n\r\n /**\r\n * Gets the error message thrower seeded with passed in errorMessage template call.\r\n * @function module:errorThrowing.getErrorIfNotTypeThrower$\r\n * @param errorMessageCall {Function|ErrorMessageCall}\r\n * @param typeChecker {Function|TypeChecker} - Function:Boolean\r\n * @returns {Function|ErrorIfNotType}\r\n * @private\r\n */\r\n _getErrorIfNotTypeThrower = (errorMessageCall, typeChecker = isOfType) =>\r\n (ValueType, contextName, valueName, value, messageSuffix = null) => {\r\n const expectedTypeName = toTypeRef(ValueType),\r\n foundTypeName = typeOf(value);\r\n if (typeChecker(ValueType, value)) { return value; } // Value matches type\r\n throw new Error(errorMessageCall(\r\n {contextName, valueName, value, expectedTypeName, foundTypeName, messageSuffix}\r\n ));\r\n },\r\n\r\n /**\r\n * Gets the error message thrower seeded with passed in errorMessage template call.\r\n * @function module:errorThrowing.getErrorIfNotTypesThrower$\r\n * @param errorMessageCall {Function|ErrorMessageCall}\r\n * @param typeChecker {Function|TypeChecker} - Function:Boolean\r\n * @returns {Function|ErrorIfNotTypes}\r\n * @private\r\n */\r\n _getErrorIfNotTypesThrower = (errorMessageCall, typeChecker = isOfType) =>\r\n (valueTypes, contextName, valueName, value, messageSuffix = null) => {\r\n const expectedTypeNames = valueTypes.map(toTypeRef),\r\n matchFound = valueTypes.some(ValueType => typeChecker(ValueType, value)),\r\n foundTypeName = typeOf(value);\r\n if (matchFound) { return value; }\r\n throw new Error(\r\n errorMessageCall({\r\n contextName, valueName, value,\r\n expectedTypeName: expectedTypeNames, foundTypeName,\r\n messageSuffix\r\n })\r\n );\r\n },\r\n\r\n /**\r\n * Checks that passed in `value` is of given `type`. Throws an error if value\r\n * is not of given `type`. This is the un-curried version. For the curried version\r\n * see `module:errorThrowing.errorIfNotType`.\r\n * @function module:errorThrowing.errorIfNotType$\r\n * @param type {String|Function} - Type's name or type itself.\r\n * @param contextName {String} - Name of context to attribute errors if thrown.\r\n * @param valueName {String} - String rep of value.\r\n * @param value {*}\r\n * @param [messageSuffix=null] {String} - Optional.\r\n * @returns {*} - Given `value` if `value` matches passed in type.\r\n * @private\r\n */\r\n _errorIfNotType = _getErrorIfNotTypeThrower(defaultErrorMessageCall),\r\n\r\n /**\r\n * Checks that passed in `value` is of one of the given `types`. Throws an error if value\r\n * is not of one of the given `types`. This is the un-curried version. For the curried version\r\n * see `module:errorThrowing.errorIfNotTypes`.\r\n * @type {Function|module:errorThrowing.errorIfNotTypes}\r\n * @function module:errorThrowing.errorIfNotTypes$\r\n * @param types {Array} - Array of one or more types or type names themselves.\r\n * @param contextName {String} - Name of context to attribute errors if thrown.\r\n * @param valueName {String} - String rep of value.\r\n * @param value {*}\r\n * @returns {*} - Given `value` if `value` matches passed in type.\r\n * @private\r\n */\r\n _errorIfNotTypes = _getErrorIfNotTypesThrower(defaultErrorMessageCall),\r\n\r\n /**\r\n * Returns a function that can be used to ensure that values are of a given type.\r\n * Also throws informative error messages containing the value types, names, expected type names,\r\n * etc.\r\n * @function module:errorThrowing.getErrorIfNotTypeThrower\r\n * @param errorMessageCall {Function|ErrorMessageCall} - Template function (takes an info-object and returns a printed string).\r\n * @returns {Function|ErrorIfNotType} - Returns a function with the same signature as `errorIfNotType` though curried.\r\n */\r\n getErrorIfNotTypeThrower = errorMessageCall => curry(_getErrorIfNotTypeThrower(errorMessageCall)),\r\n\r\n /**\r\n * Returns a function that can be used to ensure that a value is of one or more given types.\r\n * The returned function is used in cases where informative error messages\r\n * containing the value types, names, expected type names, are-required/should-be-used etc.\r\n * @function module:errorThrowing.getErrorIfNotTypesThrower\r\n * @param errorMessageCall {Function|ErrorMessageCall} - Template function (takes an info-object and returns a printed string).\r\n * @returns {Function|ErrorIfNotTypes} - Returns a function with the same signature as `errorIfNotTypes` though curried.\r\n */\r\n getErrorIfNotTypesThrower = errorMessageCall => curry(_getErrorIfNotTypesThrower(errorMessageCall)),\r\n\r\n /**\r\n * Checks that passed in `value` is of given `type`. Throws an error if value\r\n * is not of given `type`. Curried.\r\n * @function module:errorThrowing.errorIfNotType\r\n * @param type {String|Function} - Type's name or type itself.\r\n * @param contextName {String} - Name of context to attribute errors if thrown.\r\n * @param valueName {String} - String rep of value.\r\n * @param value {*}\r\n * @param [messageSuffix=null] {String} - Optional.\r\n * @returns {*} - Given `value` if `value` matches passed in type.\r\n * @curried\r\n */\r\n errorIfNotType = curry(_errorIfNotType),\r\n\r\n /**\r\n * Checks that passed in `value` is of one of the given `types`. Throws an error if value\r\n * is not of one of the given `types`. Curried.\r\n * @function module:errorThrowing.errorIfNotTypes\r\n * @param types {Array} - Array of one or more types or type names themselves.\r\n * @param contextName {String} - Name of context to attribute errors if thrown.\r\n * @param valueName {String} - String rep of value.\r\n * @param value {*}\r\n * @returns {*} - Given `value` if `value` matches passed in type.\r\n * @curried\r\n */\r\n errorIfNotTypes = curry(_errorIfNotTypes)\r\n;\r\n\r\n/**\r\n * @typedef {*} Any - Synonym for 'any value'.\r\n */\r\n\r\n/**\r\n * @typedef {String|Function} TypeRef\r\n * @description Type reference. Type itself or Type's name; E.g., `Type.name`;\r\n */\r\n\r\n/**\r\n * @typedef {Object} TemplateContext\r\n * @description Template context used for error message renderers (functions that take a context obj and return a string).\r\n * @property value {*}\r\n * @property valueName {String}\r\n * @property expectedTypeName {String} - Expected name of constructor of `value`; E.g., usually `SomeConstructor.name`;\r\n * @property foundTypeName {String} - Found types name; E.g., `FoundConstructor.name`;\r\n * @property [messageSuffix=null] {*} - Message suffix (sometimes an extra hint or instructions for\r\n * directing user to fix where his/her error has occurred). Optional.\r\n */\r\n\r\n/**\r\n * @typedef {Array<(String|Function)>} TypesArray\r\n */\r\n\r\n/**\r\n * @typedef {Function} TypeChecker\r\n * @description Checks whether a value is of given type.\r\n * @param Type {TypeRef} - a Type or it's name; E.g., `Type.name`.\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n\r\n/**\r\n * @typedef {Function} ErrorMessageCall\r\n * @description Error message template function.\r\n * @param tmplContext {TemplateContext}\r\n * @returns {String}\r\n */\r\n\r\n/**\r\n * @typedef {Function} ErrorIfNotType\r\n * @description Used to ensure value matches passed in type.\r\n * @param type {TypeRef} - Constructor name or constructor.\r\n * @param contextName {String}\r\n * @param valueName {String}\r\n * @param value {*}\r\n * @throws {Error} - If value doesn't match type.\r\n * @returns {*} - What ever value is.\r\n */\r\n\r\n/**\r\n * @typedef {Function} ErrorIfNotTypes\r\n * @description Used to ensure a value matches one of one or more types passed in.\r\n * @param valueTypes {TypesArray} - Array of constructor names or constructors.\r\n * @param contextName {String}\r\n * @param valueName {String}\r\n * @param value {*}\r\n * @throws {Error} - If value doesn't match type.\r\n * @returns {*} - Whatever value is.\r\n */\r\n","/**\r\n * @module string\r\n * @description Contains functions for strings.\r\n */\r\nimport {intercalate, map, filter} from './list';\r\nimport {split} from './jsPlatform/string';\r\nimport {compose} from './function/compose';\r\nimport {join} from './jsPlatform/array';\r\nimport {_errorIfNotType} from './errorThrowing';\r\n\r\nexport {split};\r\n\r\nexport const\r\n\r\n /**\r\n * Splits a string on all '\\n', '\\r', '\\n\\r', or '\\r\\n' characters.\r\n * @function module:string.lines\r\n * @param str {String}\r\n * @returns {Array}\r\n */\r\n lines = split(/[\\n\\r]/gm),\r\n\r\n /**\r\n * Splits a string on all '\\s' and/or all '\\t' characters.\r\n * @function module:string.words\r\n * @param str{String}\r\n * @returns {Array}\r\n */\r\n words = split(/[\\s\\t]/gm),\r\n\r\n /**\r\n * Intersperse an array of strings with '\\s' and then concats them.\r\n * @function module:string.unwords\r\n * @param arr {String}\r\n * @returns {Array}\r\n */\r\n unwords = intercalate(' '),\r\n\r\n /**\r\n * Intersperses a '\\n' character into a list of strings and then concats it.\r\n * @function module:string.unlines\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n unlines = intercalate('\\n'),\r\n\r\n /**\r\n * Lower cases first character of a non-empty string.\r\n * @function module:string.lcaseFirst\r\n * @param xs {String}\r\n * @returns {string}\r\n * @throws {Error} - Throws error if receiving anything that is not a string.\r\n */\r\n lcaseFirst = xs => {\r\n _errorIfNotType(String, 'lcaseFirst', 'xs', xs);\r\n return xs[0].toLowerCase() + xs.substring(1);\r\n },\r\n\r\n /**\r\n * Upper cases first character of a non-empty string.\r\n * @function module:string.ucaseFirst\r\n * @param xs {String}\r\n * @returns {string}\r\n * @throws {Error} - Throws error if receiving anything that is not a string.\r\n */\r\n ucaseFirst = xs => {\r\n _errorIfNotType(String, 'ucaseFirst', 'xs', xs);\r\n return xs[0].toUpperCase() + xs.substring(1);\r\n },\r\n\r\n /**\r\n * Camel cases (class case) a string.\r\n * @function module:string.camelCase\r\n * @param xs {String}\r\n * @param [pattern=/[^a-z\\d/i]/] {RegExp} - Pattern to split on. Optional.\r\n * @throws {Error} - Throws error if param `xs` is not a string.\r\n * @returns {string}\r\n * @curried\r\n */\r\n camelCase = (xs, pattern = /[^a-z\\d]/i) => compose(\r\n join(''),\r\n map(str => ucaseFirst(str.toLowerCase())),\r\n filter(x => !!x),\r\n split(pattern)\r\n )(_errorIfNotType(String, 'camelCase', 'xs', xs)),\r\n\r\n /**\r\n * Class cases a string. Uses pattern /[^a-z\\d/i]/ to split on.\r\n * If you require a different pattern use `string.camelCase(str, pattern)`\r\n * and then upper case first character (`ucaseFirst`).\r\n * @function module:string.classCase\r\n * @param xs {String}\r\n * @returns {string}\r\n * @throws {Error} - Throws error if `xs` is not a string (via `camelCase` call).\r\n */\r\n classCase = compose(ucaseFirst, camelCase)\r\n\r\n;\r\n\r\n/**\r\n * Functional version of `String.prototype.split`.\r\n * @function module:string.split\r\n * @param separator {String|RegExp}\r\n * @param str {String}\r\n * @returns {Array}\r\n */\r\n","/**\r\n * @module fjl\r\n * @description Exports all module methods (object, list, string modules etc.).\r\n * @goal to include everything from haskell's Prelude where it makes sense in order to create\r\n * a subset of functions which can make the javascript developer more efficient and make his/her\r\n * code more concise (and functional).\r\n * @motivation preludejs, lodash/fp, RamdaJs, Haskell.\r\n * @see http://hackage.haskell.org/package/base-4.10.0.0/docs/Prelude.html\r\n * @see http://hackage.haskell.org/package/base-4.10.0.0/docs/Data-List.html\r\n */\r\nexport * from './object';\r\nexport * from './boolean';\r\nexport * from './function';\r\nexport * from './list';\r\nexport * from './string';\r\nexport * from './utils';\r\nexport * from './errorThrowing';\r\n\r\n/**\r\n * @typedef {String|Function|ArrayBufferConstructor|ArrayConstructor|BooleanConstructor|MapConstructor|NumberConstructor|SetConstructor|WeakMapConstructor|WeakSetConstructor} TypeRef\r\n * @description Type reference. Either actual type or type's name; E.g., `Type.name`\r\n * Also note: Class cased names are use for values that do not have `name` properties; Namely: 'Null', 'NaN' and 'Undefined' (for their respective values respectively).\r\n */\r\n"],"names":["returnCurried","executeArity","unmetArityNum","fn","argsToCurry","func","x","executeAsCurriedFunc","Array","from","arguments","a","b","c","d","e","args","unmetArity","concatedArgs","concat","canBeCalled","length","newExpectedArity","curryN","Function","Error","curry","curry2","curry3","curry4","curry5","fPureTakesOne","name","arg","f","fPureTakes2","arg1","arg2","fPureTakes3","arg3","fPureTakes4","arg4","fPureTakes5","arg5","fPureTakesOneOrMore","defineReverse","prototype","reverse","reduceRight","agg","item","push","map","filter","reduce","forEach","some","every","join","apply","call","flipN","flip","flip3","flip4","flip5","instanceOf","instanceConstructor","instance","hasOwnProperty","native","Object","getOwnPropertyNames","key","operation","keys","assign","obj0","objs","topAgg","obj","_Number","Number","_NaN","_Null","_Undefined","typeOf","value","retVal","undefined","constructorName","constructor","isNaN","_String","String","_Object","_Boolean","Boolean","_Function","_Array","_Symbol","_Map","_Set","_WeakMap","_WeakSet","toTypeRef","type","toTypeRefs","types","toTypeRefName","Type","ref","toTypeRefNames","isFunction","isType","isOfType","isClass","test","substr","isCallable","isArray","isObject","isBoolean","isNumber","isString","isMap","isSet","isWeakMap","isWeakSet","isUndefined","isNull","isSymbol","isUsableImmutablePrimitive","typeOfX","isset","isEmptyList","isEmptyObject","isEmptyCollection","size","isEmpty","isOneOf","typeName","isFunctor","lookup","of","copy","out","slice","Symbol","Promise","searchObj","nsString","indexOf","parts","split","limit","ind","parent","node","assignDeep","propDescription","getOwnPropertyDescriptor","get","set","writable","includes","xs","lastIndexOf","isTruthy","isFalsy","alwaysTrue","alwaysFalse","equal","equalAll","i","aggregateArray","sliceFrom","startInd","sliceTo","toInd","sliceCopy","genericAscOrdering","lengths","lists","toShortest","listLengths","smallLen","Math","min","list","reduceUntil","pred","op","result","reduceUntilRight","arr","lastIndex","len","findIndexWhere","predicateFulfilled","findIndexWhereRight","findIndicesWhere","findWhere","elm","objUnion","obj1","obj2","objIntersect","objDifference","objComplement","log","console","bind","error","peek","pop","jsonClone","JSON","parse","stringify","toAssocList","toAssocListDeep","TypeConstraint","fromAssocList","OutType","fromAssocListDeep","toArray","compose","arg0","id","negateF","negateF2","negateF3","negateFN","until","predicate","typeInstance","fnOrError","symbolName","noop","normalizeStep","to","step","range","append","listAppend","head","last","tail","init","uncons","unconsr","item0","concatMap","foldableOfA","intersperse","between","lastInd","intercalate","xss","transpose","numLists","ind2","longestListLen","maximum","outLists","outList","subsequences","listLen","pow","entry","j","swapped","ind1","tmp","permutations","repeat","foldl","foldr","foldl1","foldr1","mapAccumL","zero","mapped","tuple","mapAccumR","iterate","lastX","replicate","cycle","unfoldr","resultTuple","findIndex","findIndices","elemIndex","foundInd","elemIndices","take","drop","splitAt","takeWhile","dropWhile","splitPoint","dropWhileEnd","span","breakOnList","at","find","partition","elem","notElem","isPrefixOf","xs1","xs2","limit1","limit2","isSuffixOf","isInfixOf","foundLen","isSubsequenceOf","lenXs1","group","groupBy","equalityOp","prevItem","predOp","inits","tails","stripPrefix","prefix","zip","arr1","arr2","a1","a2","zipN","trimmedLists","zip3","arr3","zip4","arr4","zip5","arr5","zipWith","zipWithN","lenOfTrimmed","zipWith3","xs3","zipWith4","xs4","zipWith5","xs5","unzip","unzipN","lenItem0","any","p","all","and","or","not","sum","product","sortBy","minimum","scanl","scanl1","scanr","scanr1","nub","nubBy","remove","removeBy","sort","sortOn","valueFn","decorated","a0","b0","orderingFn","insert","foundIndex","insertBy","currItem","anyOp","storedItem","removeFirstsBy","unionBy","alreadyAdded","union","intersect","intersectBy","list1","list2","difference","array1","array2","complement","arr0","arrays","typeRefsToStringOrError","defaultErrorMessageCall","tmplContext","contextName","valueName","expectedTypeName","foundTypeName","messageSuffix","isMultiTypeNames","typesCopy","typesToMatchCopy","_getErrorIfNotTypeThrower","errorMessageCall","typeChecker","ValueType","_getErrorIfNotTypesThrower","valueTypes","expectedTypeNames","matchFound","_errorIfNotType","_errorIfNotTypes","getErrorIfNotTypeThrower","getErrorIfNotTypesThrower","errorIfNotType","errorIfNotTypes","lines","words","unwords","unlines","lcaseFirst","toLowerCase","substring","ucaseFirst","toUpperCase","camelCase","pattern","str","classCase"],"mappings":"AAAA;;;;;;;;;;;AAWA,MAWIA,aAAa,GAAG,CAACC,YAAD,EAAeC,aAAf,EAA8BC,EAA9B,EAAkCC,WAAlC,KAAkD;UACtDF,aAAR;SACS,CAAL;;aAEW,SAASG,IAAT,CAAcC,CAAd,EAAiB;;eAEbC,oBAAoB,CAACJ,EAAD,EAAKF,YAAL,EAAmBC,aAAnB,EAAkCM,KAAK,CAACC,IAAN,CAAWC,SAAX,CAAlC,EAAyDN,WAAzD,CAA3B;OAFJ;;SAIC,CAAL;;aAEW,SAASC,IAAT,CAAcM,CAAd,EAAiBC,CAAjB,EAAoB;;eAEhBL,oBAAoB,CAACJ,EAAD,EAAKF,YAAL,EAAmBC,aAAnB,EAAkCM,KAAK,CAACC,IAAN,CAAWC,SAAX,CAAlC,EAAyDN,WAAzD,CAA3B;OAFJ;;SAIC,CAAL;;aAEW,SAASC,IAAT,CAAcM,CAAd,EAAiBC,CAAjB,EAAoBC,CAApB,EAAuB;;eAEnBN,oBAAoB,CAACJ,EAAD,EAAKF,YAAL,EAAmBC,aAAnB,EAAkCM,KAAK,CAACC,IAAN,CA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D,CAAF,CAAMwQ,WAAN,KAAsBxQ,EAAE,CAACyQ,SAAH,CAAa,CAAb,CAA7B;CA3CD;MAqDHC,UAAU,GAAG1Q,EAAE,IAAI;EACf6P,eAAe,CAACrU,MAAD,EAAS,YAAT,EAAuB,IAAvB,EAA6BwE,EAA7B,CAAf;;SACOA,EAAE,CAAC,CAAD,CAAF,CAAM2Q,WAAN,KAAsB3Q,EAAE,CAACyQ,SAAH,CAAa,CAAb,CAA7B;CAvDD;MAmEHG,SAAS,GAAG,CAAC5Q,EAAD,EAAK6Q,OAAO,GAAG,WAAf,KAA+BhN,OAAO,CAC1CzK,IAAI,CAAC,EAAD,CADsC,EAE1CN,KAAG,CAACgY,GAAG,IAAIJ,UAAU,CAACI,GAAG,CAACN,WAAJ,EAAD,CAAlB,CAFuC,EAG1CzX,QAAM,CAAC/C,CAAC,IAAI,CAAC,CAACA,CAAR,CAHoC,EAI1CoJ,KAAK,CAACyR,OAAD,CAJqC,CAAP,CAKrChB,eAAe,CAACrU,MAAD,EAAS,WAAT,EAAsB,IAAtB,EAA4BwE,EAA5B,CALsB,CAnExC;MAmFH+Q,SAAS,GAAGlN,OAAO,CAAC6M,UAAD,EAAaE,SAAb,CAnFhB;;;;;;;;;ACZP;;;;;;;;;;AAUA;;;;;;;;;"} \ No newline at end of file diff --git a/dist/iife/fjl.js b/dist/iife/fjl.js index d2ea35e2..900fad8c 100644 --- a/dist/iife/fjl.js +++ b/dist/iife/fjl.js @@ -2368,6 +2368,12 @@ var classCase = compose(ucaseFirst, camelCase); * @see http://hackage.haskell.org/package/base-4.10.0.0/docs/Data-List.html */ +/** + * @typedef {String|Function|ArrayBufferConstructor|ArrayConstructor|BooleanConstructor|MapConstructor|NumberConstructor|SetConstructor|WeakMapConstructor|WeakSetConstructor} TypeRef + * @description Type reference. Either actual type or type's name; E.g., `Type.name` + * Also note: Class cased names are use for values that do not have `name` properties; Namely: 'Null', 'NaN' and 'Undefined' (for their respective values respectively). + */ + exports.instanceOf = instanceOf; exports.hasOwnProperty = hasOwnProperty; exports.length = length; diff --git a/dist/iife/fjl.js.map b/dist/iife/fjl.js.map index 0acad8dc..7980fec7 100644 --- a/dist/iife/fjl.js.map +++ b/dist/iife/fjl.js.map @@ -1 +1 @@ -{"version":3,"file":"fjl.js","sources":["../../src/function/curry.js","../../src/utils.js","../../src/jsPlatform/array.js","../../src/jsPlatform/function.js","../../src/function/flip.js","../../src/jsPlatform/object.js","../../src/object/typeOf.js","../../src/object/is.js","../../src/object/lookup.js","../../src/object/of.js","../../src/object/copy.js","../../src/object/searchObj.js","../../src/object/assignDeep.js","../../src/jsPlatform/list.js","../../src/boolean.js","../../src/list/map.js","../../src/list/aggregation.js","../../src/list/utils.js","../../src/object/setTheory.js","../../src/object/console.js","../../src/object/jsonClone.js","../../src/object/assocList.js","../../src/object/toArray.js","../../src/object.js","../../src/function/compose.js","../../src/function/id.js","../../src/function/negate.js","../../src/function/until.js","../../src/function/fnOrError.js","../../src/function/noop.js","../../src/function.js","../../src/list/range.js","../../src/jsPlatform/string.js","../../src/jsPlatform.js","../../src/list.js","../../src/errorThrowing.js","../../src/string.js","../../src/fjl.js"],"sourcesContent":["/**\r\n * @author elydelacruz\r\n * @created 12/6/2016.\r\n * @memberOf function\r\n * @description \"Curry strict\" and \"curry arbitrarily\" functions (`curry`, `curryN`).\r\n */\r\n\r\n/**\r\n * @private\r\n * @type {string}\r\n */\r\nconst\r\n\r\n /**\r\n * Returns curried function.\r\n * @private\r\n * @param executeArity {Number}\r\n * @param unmetArityNum {Number}\r\n * @param fn {Function}\r\n * @param argsToCurry {...*}\r\n * @returns {Function} - Curried function.\r\n */\r\n returnCurried = (executeArity, unmetArityNum, fn, argsToCurry) => {\r\n switch (unmetArityNum) {\r\n case 1:\r\n /* eslint-disable */\r\n return function func(x) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n case 2:\r\n /* eslint-disable */\r\n return function func(a, b) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n case 3:\r\n /* eslint-disable */\r\n return function func(a, b, c) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n case 4:\r\n /* eslint-disable */\r\n return function func(a, b, c, d) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n case 5:\r\n /* eslint-disable */\r\n return function func(a, b, c, d, e) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n default:\r\n return (...args) => executeAsCurriedFunc(fn, executeArity, unmetArityNum, args, argsToCurry);\r\n }\r\n },\r\n\r\n /**\r\n * Returns curried function if unmetArity is not met else returns result of executing\r\n * final function.\r\n * @private\r\n * @param fn {Function}\r\n * @param executeArity {Number}\r\n * @param unmetArity {Number}\r\n * @param args {Array<*>}\r\n * @param argsToCurry {Array<*>}\r\n * @returns {Function|*} - Curried function or result of 'finally' executed function.\r\n */\r\n executeAsCurriedFunc = (fn, executeArity, unmetArity, args, argsToCurry) => {\r\n let concatedArgs = argsToCurry.concat(args),\r\n canBeCalled = (concatedArgs.length >= executeArity) || !executeArity,\r\n newExpectedArity = executeArity - concatedArgs.length;\r\n return !canBeCalled ?\r\n returnCurried(executeArity, newExpectedArity, fn, concatedArgs) :\r\n fn(...concatedArgs);\r\n }\r\n;\r\n\r\nexport const\r\n\r\n /**\r\n * Curries a function up to a given arity.\r\n * @function module:function.curryN\r\n * @param executeArity {Number}\r\n * @param fn {Function}\r\n * @param argsToCurry {...*}\r\n * @returns {Function}\r\n * @throws {Error} - When `fn` is not a function.\r\n */\r\n curryN = (executeArity, fn, ...argsToCurry) => {\r\n if (!fn || !(fn instanceof Function)) {\r\n throw new Error(`\\`curry*\\` functions expect first parameter to be of type \\`Function\\` though received ${fn}?`);\r\n }\r\n return returnCurried(executeArity, executeArity - argsToCurry.length, fn, argsToCurry);\r\n },\r\n\r\n /**\r\n * Curries a function based on it's defined arity (note: rest args param (`...rest`) are not counted in arity).\r\n * @function module:function.curry\r\n * @param fn {Function}\r\n * @param argsToCurry {...*}\r\n * @returns {Function}\r\n */\r\n curry = (fn, ...argsToCurry) => curryN((fn || {}).length, fn, ...argsToCurry),\r\n\r\n /**\r\n * Curries a function up to an arity of 2 (won't call function until 2 or more args).\r\n * @function module:function.curry2\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n curry2 = fn => curryN(2, fn),\r\n\r\n /**\r\n * Curries a function up to an arity of 3 (won't call function until 3 or more args).\r\n * @function module:function.curry3\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n curry3 = fn => curryN(3, fn),\r\n\r\n /**\r\n * Curries a function up to an arity of 4 (won't call function until 4 or more args).\r\n * @function module:function.curry4\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n curry4 = fn => curryN(4, fn),\r\n\r\n /**\r\n * Curries a function up to an arity of 5 (won't call function until 5 or more args).\r\n * @function module:function.curry5\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n curry5 = fn => curryN(5, fn);\r\n","/**\r\n * @module utils\r\n */\r\nimport {curry, curry2} from './function/curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns a function that takes an argument and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakesOne\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakesOne = name => curry((arg, f) => f[name](arg)),\r\n\r\n /**\r\n * Returns a function that takes 2 arguments and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakes2\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakes2 = name => curry((arg1, arg2, f) => f[name](arg1, arg2)),\r\n\r\n /**\r\n * Returns a function that takes 3 arguments and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakes3\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakes3 = name => curry((arg1, arg2, arg3, f) => f[name](arg1, arg2, arg3)),\r\n\r\n /**\r\n * Returns a function that takes 4 arguments and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakes4\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakes4 = name => curry((arg1, arg2, arg3, arg4, f) => f[name](arg1, arg2, arg3, arg4)),\r\n\r\n /**\r\n * Returns a function that takes 5 arguments and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakes5\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakes5 = name => curry((arg1, arg2, arg3, arg4, arg5, f) => f[name](arg1, arg2, arg3, arg4, arg5)),\r\n\r\n /**\r\n * Returns a function that takes an object and one or more arguments on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakesOneOrMore\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakesOneOrMore = name => curry2((f, ...args) => f[name](...args))\r\n\r\n;\r\n","/**\r\n * Created by elyde on 7/20/2017.\r\n * Functional versions of common array methods (`map`, `filter`, etc.) (un-curried);\r\n * @module _jsPlatform_arrayOps\r\n * @private\r\n */\r\n\r\nimport {fPureTakesOne, fPureTakes2, fPureTakesOneOrMore} from '../utils';\r\n\r\nexport const\r\n\r\n /**\r\n * Array.prototype.reverse generator (generates a function that calls the prototype version or a\r\n * shimmed version if it doesn't exist).\r\n * @returns {Function}\r\n */\r\n defineReverse = () =>\r\n Array.prototype.reverse ? x => x.reverse() :\r\n x => x.reduceRight((agg, item) => {\r\n agg.push(item);\r\n return agg;\r\n }, []),\r\n\r\n /**\r\n * Maps a function to functor (list etc.).\r\n * @function module:_jsPlatform_array.map\r\n * @param fn {Function}\r\n * @param functor {Array|{map: {Function}}}\r\n * @returns {Array|{map: {Function}}}\r\n */\r\n map = fPureTakesOne('map'),\r\n\r\n /**\r\n * Filters a functor (list etc.) with passed in function.\r\n * @function module:_jsPlatform_array.filter\r\n * @param fn {Function}\r\n * @param functor {Array|{filter: {Function}}}\r\n * @returns {Array|{filter: {Function}}}\r\n */\r\n filter = fPureTakesOne('filter'),\r\n\r\n /**\r\n * Reduces a foldable (list etc.) with passed in function.\r\n * @function module:_jsPlatform_array.reduce\r\n * @param fn {Function}\r\n * @param functor {Array|{reduce: {Function}}}\r\n * @returns {Array|{reduce: {Function}}}\r\n */\r\n reduce = fPureTakes2('reduce'),\r\n\r\n /**\r\n * Reduces a foldable (list etc.) from the right with passed in function.\r\n * @function module:_jsPlatform_array.reduceRight\r\n * @param fn {Function}\r\n * @param functor {Array|{reduceRight: {Function}}}\r\n * @returns {Array|{reduceRight: {Function}}}\r\n */\r\n reduceRight = fPureTakes2('reduceRight'),\r\n\r\n /**\r\n * For each on functor (Array|Object|etc.).\r\n * @param fn {Function}\r\n * @param functor {Array|Object|*}\r\n * @return {*|Array|Object} - The type of object you pass in unless it doesn't have a `forEach` method.\r\n * @throws {Error} - When passed in functor doesn't have a `forEach` method.\r\n */\r\n forEach = fPureTakesOne('forEach'),\r\n\r\n /**\r\n * Returns `true` if `fn` (predicate) returns true for at least one item\r\n * in functor else returns `false`.\r\n * @param fn {Function} - Predicate.\r\n * @param functor {Array|Object|*}\r\n * @return {*|Array|Object} - The type passed.\r\n * @throws {Error} - When passed in object doesn't have a `some` method.\r\n */\r\n some = fPureTakesOne('some'),\r\n\r\n /**\r\n * Returns `true` if `fn` (predicate) returns true for all items in functor else returns `false`.\r\n * @param fn {Function} - Predicate.\r\n * @param functor {Array|Object|*}\r\n * @return {*|Array|Object} - The type passed.\r\n * @throws {Error} - When passed in object doesn't have an `every` method.\r\n */\r\n every = fPureTakesOne('every'),\r\n\r\n /**\r\n * Array.prototype.join\r\n * @function module:listPrelude.join\r\n * @param separator {String|RegExp}\r\n * @param arr {Array}\r\n * @returns {String}\r\n */\r\n join = fPureTakesOne('join'),\r\n\r\n /**\r\n * Same as Array.prototype.push\r\n * @param item {*}\r\n * @param arr {Array}\r\n * @returns {Number}\r\n */\r\n push = fPureTakesOneOrMore('push'),\r\n\r\n /**\r\n * Reverses an list (shimmed if not exists).\r\n * @function module:listPrelude.reverse\r\n * @return {Array}\r\n */\r\n reverse = defineReverse();\r\n","import {curry, curry2} from '../function/curry';\r\n\r\n/**\r\n * Created by elydelacruz on 9/7/2017.\r\n * @memberOf function\r\n */\r\nexport const\r\n\r\n /**\r\n * Functional `apply` function (takes no context).\r\n * @function module:function.apply\r\n * @param fn {Function}\r\n * @param args {Array|*}\r\n * @returns {*}\r\n */\r\n apply = curry((fn, args) => fn.apply(null, args)),\r\n\r\n /**\r\n * Functional `call` function (takes no context).\r\n * @function module:function.call\r\n * @param fn {Function}\r\n * @param args {...*}\r\n * @returns {*}\r\n */\r\n call = curry2((fn, ...args) => fn.call(null, ...args));\r\n","import {reverse} from '../jsPlatform/array';\r\nimport {apply, call} from '../jsPlatform/function';\r\nimport {curry, curry2} from './curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns a curried function requiring given functions arguments in reverse\r\n * (returned function expects 2 or more variables (curried at 2 or more args)).\r\n * @function module:function.flipN\r\n * @param fn {Function}\r\n * @returns {Function}\r\n * @curried\r\n */\r\n flipN = fn => curry2((...args) => apply(fn, reverse(args))),\r\n\r\n /**\r\n * Flips a function's first and second arguments and and returns a new function requiring said arguments in reverse.\r\n * @function module:function.flip\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n flip = fn => curry((b, a) => call(fn, a, b)),\r\n\r\n /**\r\n * Same as `flip` except returns a flipped function of arity 3.\r\n * @function module:function.flip3\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n flip3 = fn => curry((c, b, a) => call(fn, a, b, c)),\r\n\r\n /**\r\n * Same as `flip` except returns a flipped function of arity 4.\r\n * @function module:function.flip4\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n flip4 = fn => curry((d, c, b, a) => call(fn, a, b, c, d)),\r\n\r\n /**\r\n * Same as `flip` except returns a flipped function of arity 5.\r\n * @function module:function.flip5\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n flip5 = fn => curry((e, d, c, b, a) => call(fn, a, b, c, d, e));\r\n","/**\r\n * @memberOf object\r\n * @description Defines some of the platform methods for objects (the ones used within `fjl`).\r\n */\r\n\r\nimport {fPureTakesOne} from '../utils';\r\nimport {curry, curry2} from '../function/curry';\r\nimport {flip, flip3, flip4, flip5} from '../function/flip';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns whether constructor has derived object.\r\n * @function module:object.instanceOf\r\n * @param instanceConstructor {Function} - Constructor.\r\n * @param instance {*}\r\n * @instance {*}\r\n * @returns {Boolean}\r\n */\r\n instanceOf = curry((instanceConstructor, instance) =>\r\n instance instanceof instanceConstructor),\r\n\r\n /**\r\n * @function module:object.hasOwnProperty\r\n * @param propName {*}\r\n * @param typeInstance {*}\r\n * @returns {Boolean}\r\n * @deprecated - Use property directly instead.\r\n */\r\n hasOwnProperty = fPureTakesOne('hasOwnProperty'),\r\n\r\n /**\r\n * @function module:object.length\r\n * @param x {*}\r\n * @returns {Number}\r\n * @throws {Error} - Throws an error if value doesn't have a `length` property (\r\n * `null`, `undefined`, {Boolean}, Symbol, et. al.).\r\n */\r\n length = x => x.length,\r\n\r\n /**\r\n * Contains all the static functions from `Object` but curried and flipped;\r\n * @example\r\n * // E.g., `Object.defineProperties(obj, descriptor)` can now be used like\r\n * import {defineProperties} from 'fjl'\r\n * defineProperties(descriptor, someObj),\r\n * // Et. al.\r\n * @memberOf module:object\r\n * @type {{...Object}}\r\n */\r\n native = Object.getOwnPropertyNames(Object).reduce((agg, key) => {\r\n if (typeof Object[key] !== 'function') {\r\n return agg;\r\n }\r\n const operation = Object[key];\r\n switch (operation.length) {\r\n case 2:\r\n agg[key] = flip(operation);\r\n break;\r\n case 3:\r\n agg[key] = flip3(operation);\r\n break;\r\n case 4:\r\n agg[key] = flip4(operation);\r\n break;\r\n case 5:\r\n agg[key] = flip5(operation);\r\n break;\r\n default:\r\n agg[key] = Object[key];\r\n break;\r\n }\r\n return agg;\r\n }, {}),\r\n\r\n /**\r\n * Gets passed in object's own enumerable keys (same as `Object.keys`).\r\n * @function module:object.keys\r\n * @param obj {*}\r\n * @returns {Array}\r\n */\r\n {keys} = native,\r\n\r\n /**\r\n * Defined as `Object.assign` else is the same thing but shimmed.\r\n * @function module:object.assign\r\n * @param obj0 {Object}\r\n * @param objs {...{Object}}\r\n * @returns {Object}\r\n */\r\n assign = (() => Object.assign ?\r\n (obj0, ...objs) => Object.assign(obj0, ...objs) :\r\n curry2((obj0, ...objs) => objs.reduce((topAgg, obj) => {\r\n return Object.keys(obj).reduce((agg, key) => {\r\n agg[key] = obj[key];\r\n return agg;\r\n }, topAgg);\r\n }, obj0))\r\n )();\r\n","/**\r\n * Created by elyde on 12/18/2016.\r\n * @memberOf object\r\n */\r\nconst _Number = Number.name,\r\n _NaN = 'NaN',\r\n _Null = 'Null',\r\n _Undefined = 'Undefined';\r\n\r\n/**\r\n * Returns the constructor/class/type name of a value.\r\n * @note Returns 'NaN' if value is of type `Number` and value is `isNaN`.\r\n * @note Returns 'Undefined' if value is `undefined`\r\n * @note Returns 'Null' if value is `null`\r\n * For values that have no concrete constructors and/or casters\r\n * (null, NaN, and undefined) we returned normalized names for them ('Null', 'NaN', 'Number')\r\n * @function module:object.typeOf\r\n * @param value {*}\r\n * @returns {string} - Constructor's name or derived name (in the case of `null`, `undefined`, or `NaN` (whose\r\n * normalized names are 'Null', 'Undefined', 'NaN' respectively).\r\n */\r\nexport function typeOf (value) {\r\n let retVal;\r\n if (value === undefined) {\r\n retVal = _Undefined;\r\n }\r\n else if (value === null) {\r\n retVal = _Null;\r\n }\r\n else {\r\n let constructorName = (value).constructor.name;\r\n retVal = constructorName === _Number && isNaN(value) ?\r\n _NaN : constructorName;\r\n }\r\n return retVal;\r\n}\r\n","/**\r\n * Created by elyde on 12/18/2016.\r\n * @memberOf object\r\n */\r\n\r\nimport {typeOf} from './typeOf';\r\nimport {instanceOf, length, keys} from '../jsPlatform/object';\r\nimport {curry} from '../function/curry';\r\n\r\nlet _String = String.name,\r\n _Number = Number.name,\r\n _Object = Object.name,\r\n _Boolean = Boolean.name,\r\n _Function = Function.name,\r\n _Array = Array.name,\r\n _Symbol = 'Symbol',\r\n _Map = 'Map',\r\n _Set = 'Set',\r\n _WeakMap = 'WeakMap',\r\n _WeakSet = 'WeakSet',\r\n _Null = 'Null',\r\n _Undefined = 'Undefined',\r\n _NaN = 'NaN';\r\n\r\nexport const\r\n\r\n /**\r\n * Resolves/normalizes a type name from either a string or a constructor.\r\n * @function module:object.toTypeRef\r\n * @param type {Function|String} - String or function representing a type.\r\n * @returns {String}\r\n * @todo write tests for this function.\r\n */\r\n toTypeRef = type => {\r\n if (!type) {\r\n return typeOf(type);\r\n }\r\n else if (type.constructor === String || (type instanceof Function)) {\r\n return type;\r\n }\r\n return typeOf(type);\r\n },\r\n\r\n /**\r\n * Returns an array of type refs from possible type refs (converts null, undefined, NaN, and other values into\r\n * type refs (either constructor name or constructor name based on whether value(s) is a string, a constructor, or not).\r\n * @function module:object.toTypeRefs\r\n * @param types {...(TypeRef|*)}\r\n * @returns {Array}\r\n * @todo Ensure tests are written for this function.\r\n */\r\n toTypeRefs = (...types) => types.map(toTypeRef),\r\n\r\n /**\r\n * Returns possible Type's TypeRef name.\r\n * @function module:object.toTypeRefName\r\n * @param Type {(TypeRef|*)}\r\n * @returns {String}\r\n * @todo Ensure tests are written for this function.\r\n */\r\n toTypeRefName = Type => {\r\n const ref = toTypeRef(Type);\r\n return ref instanceof Function ? ref.name : ref;\r\n },\r\n\r\n /**\r\n * Returns possible Types' TypeRef names.\r\n * @function module:object.toTypeRefNames\r\n * @param types {...(TypeRef|*)}\r\n * @returns {String[]}\r\n * @todo Ensure tests are written for this function.\r\n */\r\n toTypeRefNames = (...types) => types.map(toTypeRefName),\r\n\r\n /**\r\n * Returns whether a value is a function or not.\r\n * @function module:object.isFunction\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isFunction = instanceOf(Function),\r\n\r\n /**\r\n * Strict type checker. Checks if given value is a direct instance of given type; E.g.,\r\n * @example\r\n * isType(String, 'abcdefg') === true // true\r\n * isType(String.name, 'abcdefg') === true\r\n * isType(Number, NaN) === false\r\n * isType(Number, 99) === true\r\n * isType('Null', 99) === false // though, for `null` and `undefined` checks\r\n * // @see `isset`, in this module, instead\r\n * isType('Undefined', undefined) === true // true\r\n *\r\n * @note Useful where absolute types, or some semblance thereof, are required.\r\n * @function module:object.isType\r\n * @param type {Function|ObjectConstructor|String} - Constructor or constructor name\r\n * @param obj {*}\r\n * @return {Boolean}\r\n */\r\n isType = curry((type, obj) => typeOf(obj) === toTypeRefName(type)),\r\n\r\n /**\r\n * Loose type checker; E.g., If `type` is not a constructor, but a constructor name, does a type check on\r\n * constructor names, else if first check fails and `type` is a constructor, performs an `instanceof` check\r\n * on value with constructor.\r\n * @note Use care when checking for `Array` and/or `Object` since the both are considered objects by `instanceof` checker.\r\n * @note For `null` and `undefined` their class cased names can be used for type checks\r\n * `isOfType('Null', null) === true (passes strict type check)` (or better yet `isset` can be used).\r\n * @throwsafe - Doesn't throw on `null` or `undefined` `obj` values.\r\n * @example\r\n * isOfType(Number, 99) === true // true (passes strict type check (numbers are not instances of `Number`\r\n * // constructor)\r\n * isOfType('Number', 99) === true // true (passes strict type check)\r\n * isOfType(Number, NaN) === true // true. (passes instance of check)\r\n * // If you want \"true\" strict type checking use `isType`\r\n * isOfType(Object, []) === true // true (passes instance of check)\r\n * isOfType(Array, []) === true // true (passes instance of check)\r\n * isOfType(Object, {}) === true // true (passes instance of check)\r\n * isOfType(Object.name, {}) === true // true (Passes strict type check)\r\n * class Abc extends String {}\r\n * isOfType(String, new Abc('abcd')) // true (passes instanceof check)\r\n *\r\n * @function module:object.isOfType\r\n * @param type {Function|String} - Type reference (constructor or `constructor.name`).\r\n * @param x {*} - Value to check.\r\n * @returns {Boolean}\r\n */\r\n isOfType = curry((type, x) => isType(type, x) || instanceOf(type, x)),\r\n\r\n /**\r\n * Checks if `value` is an es2015 `class`.\r\n * @function module:object.isClass\r\n * @param x {*}\r\n * @returns {boolean}\r\n */\r\n isClass = x => x && /^\\s{0,3}class\\s{1,3}/.test((x + '').substr(0, 10)),\r\n\r\n /**\r\n * Returns a boolean depicting whether a value is callable or not.\r\n * @function module:object.isCallable\r\n * @tentative\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isCallable = x => isFunction(x) && !isClass(x),\r\n\r\n /**\r\n * Checks if value is an array (same as `Array.isArray`).\r\n * @function module:object.isArray\r\n * @param value {*}\r\n * @returns {boolean}\r\n */\r\n {isArray} = Array,\r\n\r\n /**\r\n * Checks whether value is an object or not.\r\n * @function module:object.isObject\r\n * @param value\r\n * @returns {Boolean}\r\n */\r\n isObject = isType(_Object),\r\n\r\n /**\r\n * Checks if value is a boolean.\r\n * @function module:object.isBoolean\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isBoolean = isType(_Boolean),\r\n\r\n /**\r\n * Checks if value is a valid number (also checks if isNaN so that you don't have to).\r\n * @function module:object.isNumber\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isNumber = isType(_Number),\r\n\r\n /**\r\n * Checks whether value is a string or not.\r\n * @function module:object.isString\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isString = isType(_String),\r\n\r\n /**\r\n * Checks whether value is of `Map` or not.\r\n * @function module:object.isMap\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isMap = isType(_Map),\r\n\r\n /**\r\n * Checks whether value is of `Set` or not.\r\n * @function module:object.isSet\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isSet = isType(_Set),\r\n\r\n /**\r\n * Checks whether value is of `WeakMap` or not.\r\n * @function module:object.isWeakMap\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isWeakMap =isType(_WeakMap),\r\n\r\n /**\r\n * Checks whether value is of `WeakSet` or not.\r\n * @function module:object.isWeakSet\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isWeakSet = isType(_WeakSet),\r\n\r\n /**\r\n * Checks if value is undefined.\r\n * @function module:object.isUndefined\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isUndefined = isType(_Undefined),\r\n\r\n /**\r\n * Checks if value is null.\r\n * @function module:object.isNull\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isNull = isType(_Null),\r\n\r\n /**\r\n * Checks if value is a `Symbol`.\r\n * @function module:object.isSymbol\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isSymbol = isType(_Symbol),\r\n\r\n /**\r\n * Checks if given `x` is set and of one of\r\n * [String, Boolean, Number, Symbol] (null and undefined are immutable\r\n * but are not \"usable\" (usually not what we want to operate on).\r\n * @function module:object.isUsableImmutablePrimitive\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isUsableImmutablePrimitive = x => {\r\n const typeOfX = typeOf(x);\r\n return isset(x) &&\r\n [_String, _Number, _Boolean, _Symbol]\r\n .some(Type => Type === typeOfX);\r\n },\r\n\r\n /**\r\n * Checks if !length.\r\n * @function module:object.isEmptyList\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isEmptyList = x => !length(x),\r\n\r\n /**\r\n * Checks if object has own properties/enumerable-props or not.\r\n * @function module:object.isEmptyObject\r\n * @param obj {*}\r\n * @returns {Boolean}\r\n */\r\n isEmptyObject = obj => isEmptyList(keys(obj)),\r\n\r\n /**\r\n * Checks if collection is empty or not (Map, WeakMap, WeakSet, Set etc.).\r\n * @function module:object.isEmptyCollection\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isEmptyCollection = x => x.size === 0,\r\n\r\n /**\r\n * Checks to see if passed in value is empty; I.e.,\r\n * check for one of '', 0, `null`, `undefined`, `false`, empty array, empty object, empty function (zero arity),\r\n * or empty collection (es6 Map, Set, WeakMap, or WeakSet etc. (`!value.size`);\r\n * @function module:object.isEmpty\r\n * @param value {*} - Value to check.\r\n * @returns {Boolean}\r\n */\r\n isEmpty = value => {\r\n if (!value) { // if '', 0, `null`, `undefined`, or `false` then is empty\r\n return true;\r\n }\r\n switch (typeOf(value)) {\r\n case _Array:\r\n case _Function:\r\n return !value.length;\r\n case _Number: // zero and NaN checks happened above so `if number` then it's 'not-an-empty-number' (lol)\r\n return false;\r\n case _Object:\r\n return !keys(value).length;\r\n case _Map:\r\n case _Set:\r\n case _WeakSet:\r\n case _WeakMap:\r\n return !value.size;\r\n case _NaN:\r\n return true;\r\n default:\r\n return !value;\r\n }\r\n },\r\n\r\n /**\r\n * Returns whether passed in values is defined and not null or not.\r\n * @function module:object.isset\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isset = x => x !== null && x !== undefined,\r\n\r\n /**\r\n * Checks to see if `x` is of one of the given type refs.\r\n * @function object.isOneOf\r\n * @param x {*}\r\n * @param types {...(TypeRef|*)}\r\n * @returns {boolean}\r\n * @todo write tests for this function.\r\n */\r\n isOneOf = (x, ...types) => {\r\n const typeName = typeOf(x);\r\n return toTypeRefNames(types).some(name => typeName === name);\r\n },\r\n\r\n isFunctor = x => x && x.map && instanceOf(Function, x.map)\r\n\r\n;\r\n","/**\r\n * @memberOf object\r\n */\r\n\r\nimport {isset} from './is';\r\nimport {curry} from '../function/curry';\r\n\r\n/**\r\n * Looks up property and returns it's value; Else `undefined`.\r\n * Method is null safe (will not throw on `null` or `undefined`).\r\n * @function module:object.lookup\r\n * @param key {String} - Key to search on `obj`\r\n * @param obj {Object} - Object to search `name` on.\r\n * @returns {*}\r\n */\r\nexport const lookup = curry((key, obj) => isset(obj) ? obj[key] : undefined);\r\n","import {isFunction, isset, isUsableImmutablePrimitive} from './is';\r\nimport {apply} from '../jsPlatform/function';\r\n\r\n/**\r\n * Creates a value `of` given type; Checks for one of the following construction strategies (in order listed):\r\n * @example\r\n * // - If exists `(value).constructor.of` uses this.\r\n * // - If value is of one String, Boolean, Symbol, or Number types calls it's\r\n * // constructor as a function (in cast form; E.g., `constructor(...args)` )\r\n * // - Else if constructor is a function, thus far, then calls constructor using\r\n * // the `new` keyword (with any passed in args).\r\n\r\n * @function module:object.of\r\n * @param x {*} - Value to derive returned value's type from.\r\n * @param [args] {...*} - Any args to pass in to matched construction strategy.\r\n * @returns {*|undefined} - New value of given value's type else `undefined`.\r\n */\r\nexport const of = (x, ...args) => {\r\n if (!isset(x)) { return undefined; }\r\n const constructor = x.constructor;\r\n if (constructor.hasOwnProperty('of')) {\r\n return apply(constructor.of, args);\r\n }\r\n else if (isUsableImmutablePrimitive(x)) {\r\n return apply(constructor, args);\r\n }\r\n else if (isFunction(constructor)) {\r\n return new constructor(...args);\r\n }\r\n return undefined;\r\n};\r\n","import {typeOf} from './typeOf';\r\nimport {of} from './of';\r\n\r\nexport const\r\n\r\n /**\r\n * Make a copy of a value or optionally copy incoming value onto an outgoing value (second parameter).\r\n * @note If incoming thing is an immmutable primitive (string, number, symbol, null, undefined, boolean)\r\n * it is returned as is.\r\n * @function module:object.copy\r\n * @param x {*} - Thing to copy.\r\n * @param [out = undefined] {*} - Optional value to copy on to. Not required.\r\n * @returns {*} - Copied thing or optionally outgoing value copied onto.\r\n */\r\n copy = (x, out) => {\r\n // if `null`, `undefined`, `''`, `0`, `false` return\r\n if (!x) { return x; }\r\n switch (typeOf(x)) {\r\n case Array.name:\r\n return !out ? x.slice(0) : Object.assign(out, x);\r\n\r\n // If immutable primitive, return it\r\n case Symbol.name:\r\n case Boolean.name:\r\n case String.name:\r\n case Number.name:\r\n case Promise.name:\r\n case Function.name:\r\n case 'NaN':\r\n case 'Null':\r\n case 'Undefined':\r\n return x;\r\n\r\n case 'Map':\r\n case 'Set':\r\n case 'WeakMap':\r\n case 'WeakSet':\r\n return new x.constructor(Array.from(x));\r\n\r\n // Else make copy\r\n default:\r\n return Object.assign(!out ? of(x) : out, x);\r\n }\r\n }\r\n;\r\n\r\nexport default copy;\r\n","import {isset} from './is';\r\nimport {curry} from '../function/curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Gives you value at key/namespace-key within `obj`; E.g.,\r\n * searchObj('all.your.base', {all: {your: {base: 99}}}) === 99 // `true`\r\n * @note If key is unreachable (undefined) returns `undefined`.\r\n * Useful in cases where we do not want to check each key along the way before getting/checking value; E.g.,\r\n * @example\r\n * ```\r\n * if (obj && obj.all && obj.all.your && obj.all.your.base) {\r\n * // Thing we want to do\r\n * }\r\n *\r\n * // So with our function becomes\r\n * if (searchObj('all.your.base', obj)) {\r\n * // Thing we want to do\r\n * }\r\n * ```\r\n * @function module:object.searchObj\r\n * @param nsString {String}\r\n * @param obj {*}\r\n * @returns {*}\r\n */\r\n searchObj = curry((nsString, obj) => {\r\n if (!obj) { return obj; }\r\n if (nsString.indexOf('.') === -1) {\r\n return obj[nsString];\r\n }\r\n const parts = nsString.split('.'),\r\n limit = parts.length;\r\n let ind = 0,\r\n parent = obj;\r\n for (; ind < limit; ind += 1) {\r\n const node = parent[parts[ind]];\r\n if (!isset(node)) {\r\n return node;\r\n }\r\n parent = node;\r\n }\r\n return parent;\r\n })\r\n;\r\n","\r\nimport {isObject} from './is';\r\nimport {keys} from '../jsPlatform/object';\r\nimport {curry2} from '../function/curry';\r\n\r\nexport const\r\n /**\r\n * Merges all objects down into one (takes two or more args).\r\n * @function module:object.assignDeep\r\n * @param obj0 {Object}\r\n * @param [objs] {...{Object}} - One or more objects to merge onto `obj0`.\r\n * @returns {Object}\r\n */\r\n assignDeep = curry2((obj0, ...objs) =>\r\n !obj0 ? obj0 : objs.reduce((topAgg, obj) =>\r\n !obj ? topAgg : keys(obj).reduce((agg, key) => {\r\n let propDescription = Object.getOwnPropertyDescriptor(agg, key);\r\n // If property is not writable move to next item in collection\r\n if (agg.hasOwnProperty(key) && propDescription &&\r\n !(propDescription.get && propDescription.set) &&\r\n !propDescription.writable) {\r\n return agg;\r\n }\r\n if (isObject(agg[key]) && isObject(obj[key])) {\r\n assignDeep(agg[key], obj[key]);\r\n }\r\n else { agg[key] = obj[key]; }\r\n return agg;\r\n }, topAgg)\r\n , obj0));\r\n","/**\r\n * List operations that overlap (apart from globally overlapping props and functions like `length`)\r\n * on both strings and arrays.\r\n * @memberOf list\r\n */\r\n\r\nimport {fPureTakesOne, fPureTakes2, fPureTakesOneOrMore} from '../utils';\r\n\r\nexport const\r\n\r\n /**\r\n * Concats/appends all functors onto the end of first functor.\r\n * Note: functors passed in after the first one must be of the same type.\r\n * @function module:list.concat\r\n * @param functor {Array|Object|*}\r\n * @param ...functor {Array|Object|*}\r\n * @return {*|Array|Object} - The type passed.\r\n * @throws {Error} - When passed in object doesn't have an `every` method.\r\n */\r\n concat = fPureTakesOneOrMore('concat'),\r\n\r\n /**\r\n * Same as Array.prototype.slice\r\n * @function module:list.slice\r\n * @param separator {String|RegExp}\r\n * @param arr{Array}\r\n * @returns {Array}\r\n */\r\n slice = fPureTakes2('slice'),\r\n\r\n /**\r\n * `Array.prototype.includes` or shim.\r\n * @function module:list.includes\r\n * @param value {*}\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n includes = (() => 'includes' in Array.prototype ?\r\n fPureTakesOne('includes') :\r\n (value, xs) => xs.indexOf(value) > -1)(),\r\n\r\n /**\r\n * Searches list/list-like for given element `x`.\r\n * @function module:list.indexOf\r\n * @param x {*} - Element to search for.\r\n * @param xs {Array|String|*} - list or list like to look in.\r\n * @returns {Number} - `-1` if element not found else index at which it is found.\r\n */\r\n indexOf = fPureTakesOne('indexOf'),\r\n\r\n /**\r\n * Last index of (`Array.prototype.lastIndexOf`).\r\n * @function module:list.lastIndexOf\r\n * @param x {*} - Element to search for.\r\n * @param xs {Array|String|*} - list or list like to look in.\r\n * @returns {Number} - `-1` if element not found else index at which it is found.\r\n */\r\n lastIndexOf = fPureTakesOne('lastIndexOf')\r\n\r\n;\r\n","/**\r\n * @module boolean\r\n * @description Contains functional version of 'always-true', 'always-false', 'is-truthy', and 'is-falsy'.\r\n */\r\nimport {curry, curry2} from './function/curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns whether `value` is 'truthy' or not\r\n * @function module:boolean.isTruthy\r\n * @param value\r\n * @returns {Boolean}\r\n */\r\n isTruthy = value => !!value,\r\n\r\n /**\r\n * Returns whether `value` is 'falsy' or not\r\n * @function module:boolean.isFalsy\r\n * @param value\r\n * @returns {Boolean}\r\n */\r\n isFalsy = value => !value,\r\n\r\n /**\r\n * Returns `true`.\r\n * @function module:boolean.alwaysTrue\r\n * @returns {Boolean}\r\n */\r\n alwaysTrue = () => true,\r\n\r\n /**\r\n * Returns `false`.\r\n * @function module:boolean.alwaysFalse\r\n * @returns {Boolean}\r\n */\r\n alwaysFalse = () => false,\r\n\r\n /**\r\n * Equality operator.\r\n * @function module:boolean.equal\r\n * @param a {*}\r\n * @param b {*}\r\n * @returns {boolean}\r\n */\r\n equal = curry((a, b) => a === b),\r\n\r\n /**\r\n * Equality operator for all.\r\n * @function module:boolean.equalAll\r\n * @param a {*} - Item `0`.\r\n * @param args {...*} - Others\r\n * @returns {boolean}\r\n */\r\n equalAll = curry2((a, ...args) => args.every(b => equal(a, b)))\r\n\r\n;\r\n","import {length} from '../jsPlatform/object';\r\nimport {curry} from '../function/curry';\r\nimport {typeOf} from '../object/typeOf';\r\nimport {of} from '../object/of';\r\nimport {isFunctor, isset} from '../object/is';\r\n\r\n/**\r\n * Maps a function onto a List (string or array) or a functor (value containing a map method).\r\n * @function module:list.map\r\n * @param fn {Function} - Function to map on given value.\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\nconst map = curry((fn, xs) => {\r\n if (!isset(xs)) { return xs; }\r\n let out = of(xs),\r\n limit,\r\n i = 0;\r\n switch (typeOf(xs)) {\r\n case 'Array':\r\n limit = length(xs);\r\n if (!limit) { return out; }\r\n for (; i < limit; i += 1) {\r\n out.push(fn(xs[i], i, xs));\r\n }\r\n return out;\r\n case 'String':\r\n limit = length(xs);\r\n if (!xs) { return out; }\r\n for (; i < limit; i += 1) {\r\n out += fn(xs[i], i, xs);\r\n }\r\n return out;\r\n default:\r\n if (isFunctor(xs)) { return xs.map(fn); }\r\n\r\n // Other objects\r\n return Object.keys(xs).reduce((agg, key) => {\r\n out[key] = fn(xs[key], key, xs);\r\n return out;\r\n }, out);\r\n }\r\n});\r\n\r\nexport default map;\r\n","\r\nexport const\r\n\r\n /**\r\n * Pushes incoming `item` onto given array and returns said array.\r\n * @private\r\n * @param agg {Array}\r\n * @param item {*}\r\n * @returns {Array}\r\n */\r\n aggregateArray = (agg, item) => {\r\n agg.push(item);\r\n return agg;\r\n }\r\n\r\n;\r\n","/**\r\n * List operator utils module.\r\n * @module listUtils\r\n */\r\nimport {apply} from '../jsPlatform/function'; // un-curried version\r\nimport {slice} from '../jsPlatform/list'; // un-curried version good for both strings and arrays\r\nimport {length} from '../jsPlatform/object';\r\nimport {alwaysFalse} from '../boolean';\r\nimport map from './map';\r\nimport {curry, curry2} from '../function/curry';\r\n\r\nexport * from './aggregation';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns a slice of the given list from `startInd` to the end of the list.\r\n * @function module:listUtils.sliceFrom\r\n * @param startInd {Number}\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n sliceFrom = curry((startInd, xs) => slice(startInd, undefined, xs)),\r\n\r\n /**\r\n * Slices from index `0` to given index.\r\n * @function module:listUtils.sliceTo\r\n * @param toInd {Number}\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n sliceTo = curry((toInd, xs) => slice(0, toInd, xs)),\r\n\r\n /**\r\n * Slices a copy of list.\r\n * @function listUtils.sliceCopy\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n sliceCopy = sliceFrom(0),\r\n\r\n /**\r\n * Generic 'ascending order' ordering function (use by the likes of `list.sort` etc.)\r\n * @function module:listUtils.genericAscOrdering\r\n * @param a {*}\r\n * @param b {*}\r\n * @returns {number}\r\n */\r\n genericAscOrdering = curry((a, b) => {\r\n if (a > b) { return 1; }\r\n else if (a < b) { return -1; }\r\n return 0;\r\n }),\r\n\r\n /**\r\n * Returns length of all passed lists in list.\r\n * @function module:listUtils.lengths\r\n * @param lists ...{Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n lengths = curry2((...lists) => map(length, lists)),\r\n\r\n /**\r\n * Returns a list of lists trimmed to the shortest length in given list of lists. @background This method is used by the `zip*` functions to achieve their\r\n * 'slice to smallest' functionality.\r\n * @function module:listUtils.toShortest\r\n * @param lists {...(Array|String|*)}\r\n * @returns {Array|String|*}\r\n */\r\n toShortest = curry2((...lists) => {\r\n const listLengths = apply(lengths, lists),\r\n smallLen = Math.min.apply(Math, listLengths);\r\n return map((list, ind) => listLengths[ind] > smallLen ?\r\n sliceTo(smallLen, list) : sliceCopy(list), lists);\r\n }),\r\n\r\n /**\r\n * Reduces until predicate.\r\n * @function module:listUtils.reduceUntil\r\n * @param pred {Function} - `(item, index, list) => Boolean(...)`\r\n * @param op {Function} - Operation - `(agg, item, index, list) => agg`\r\n * @param agg {*} - Zero value.\r\n * @param xs {Array|String|*} - List.\r\n * @returns {*}\r\n */\r\n reduceUntil = curry((pred, op, agg, xs) => {\r\n const limit = length(xs);\r\n if (!limit) { return agg; }\r\n let ind = 0,\r\n result = agg;\r\n for (; ind < limit; ind++) {\r\n if (pred(xs[ind], ind, xs)) { break; }\r\n result = op(result, xs[ind], ind, xs);\r\n }\r\n return result;\r\n }),\r\n\r\n /**\r\n * Reduces until predicate (from right to left).\r\n * @function module:listUtils.reduceUntilRight\r\n * @param pred {Function} - `(item, index, list) => Boolean(...)`\r\n * @param op {Function} - Operation - `(agg, item, index, list) => agg`\r\n * @param agg {*} - Zero value.\r\n * @param xs {Array|String|*} - List.\r\n * @returns {*}\r\n */\r\n reduceUntilRight = curry((pred, op, agg, arr) => {\r\n const limit = length(arr);\r\n if (!limit) { return agg; }\r\n let ind = limit - 1,\r\n result = agg;\r\n for (; ind >= 0; ind--) {\r\n if (pred(arr[ind], ind, arr)) { break; }\r\n result = op(result, arr[ind], ind, arr);\r\n }\r\n return result;\r\n }),\r\n\r\n /**\r\n * Reduces a list with given operation (`op`) function.\r\n * @function module:listUtils.reduce\r\n * @param op {Function} - Operation - `(agg, item, index, list) => agg`\r\n * @param agg {*} - Zero value.\r\n * @param xs {Array|String|*} - List.\r\n * @returns {*}\r\n */\r\n reduce = reduceUntil(alwaysFalse),\r\n\r\n /**\r\n * Reduces a list with given operation (`op`) function (from right-to-left).\r\n * @function module:listUtils.reduceRight\r\n * @param op {Function} - Operation - `(agg, item, index, list) => agg`\r\n * @param agg {*} - Zero value.\r\n * @param xs {Array|String|*} - List.\r\n * @returns {*}\r\n */\r\n reduceRight = reduceUntilRight(alwaysFalse),\r\n\r\n /**\r\n * Gets last index of a list/list-like (Array|String|Function etc.).\r\n * @function module:listUtils.lastIndex\r\n * @param x {Array|String|*} - list like or list.\r\n * @returns {Number} - `-1` if no element found.\r\n */\r\n lastIndex = x => { const len = length(x); return len ? len - 1 : 0; },\r\n\r\n /**\r\n * Finds index in string or list.\r\n * @function module:listUtils.findIndexWhere\r\n * @param pred {Function} - Predicate.\r\n * @param arr {Array|String}\r\n * @returns {Number} - `-1` if predicate not matched else `index` found\r\n */\r\n findIndexWhere = curry((pred, arr) => {\r\n let ind = 0;\r\n const limit = length(arr);\r\n for (; ind < limit; ind += 1) {\r\n const predicateFulfilled = !!pred(arr[ind], ind, arr);\r\n if (predicateFulfilled) {\r\n return ind;\r\n }\r\n }\r\n return -1;\r\n }),\r\n\r\n /**\r\n * Finds index in list from right to left.\r\n * @function module:listUtils.findIndexWhereRight\r\n * @param pred {Function} - Predicate.\r\n * @param arr {Array|String}\r\n * @returns {Number} - `-1` if predicate not matched else `index` found\r\n */\r\n findIndexWhereRight = curry((pred, arr) => {\r\n let ind = length(arr) - 1;\r\n for (; ind >= 0; ind -= 1) {\r\n const predicateFulfilled = !!pred(arr[ind], ind, arr);\r\n if (predicateFulfilled) {\r\n return ind;\r\n }\r\n }\r\n return -1;\r\n }),\r\n\r\n /**\r\n * @function module:listUtils.findIndicesWhere\r\n * @param pred {Function}\r\n * @param xs {Array|String|*} - list or list like.\r\n * @returns {Array|undefined}\r\n */\r\n findIndicesWhere = curry((pred, xs) => {\r\n const limit = length(xs);\r\n let ind = 0,\r\n out = [];\r\n for (; ind < limit; ind++) {\r\n if (pred(xs[ind], ind, xs)) { out.push(ind); }\r\n }\r\n return out.length ? out : undefined;\r\n }),\r\n\r\n /**\r\n * @function module:listUtils.findWhere\r\n * @param pred {Function}\r\n * @param xs {Array|String|*} - list or list like.\r\n * @returns {*}\r\n */\r\n findWhere = curry((pred, xs) => {\r\n let ind = 0,\r\n limit = length(xs);\r\n if (!limit) { return; }\r\n for (; ind < limit; ind++) {\r\n let elm = xs[ind];\r\n if (pred(elm, ind, xs)) { return elm; }\r\n }\r\n })\r\n\r\n;\r\n","import {assignDeep} from './assignDeep';\r\nimport {keys} from '../jsPlatform/object';\r\nimport {reduce} from '../list/utils';\r\nimport {curry, curry2} from '../function/curry';\r\n\r\nexport const\r\n\r\n objUnion = curry((obj1, obj2) => assignDeep(obj1, obj2)),\r\n\r\n objIntersect = curry((obj1, obj2) => reduce((agg, key) => {\r\n if (obj2.hasOwnProperty(key)) {\r\n agg[key] = obj2[key];\r\n }\r\n return agg;\r\n }, {}, keys(obj1))),\r\n\r\n objDifference = curry((obj1, obj2) => reduce((agg, key) => {\r\n if (!obj2.hasOwnProperty(key)) {\r\n agg[key] = obj1[key];\r\n }\r\n return agg;\r\n }, {}, keys(obj1))),\r\n\r\n objComplement = curry2((obj0, ...objs) => reduce((agg, obj) =>\r\n assignDeep(agg, objDifference(obj, obj0)), {}, objs));\r\n","/**\r\n * @module console\r\n * @description Console exports.\r\n */\r\nexport const\r\n\r\n /**\r\n * `Console.log` method.\r\n * @function module:console.log\r\n * @params args {...*}\r\n * @returns {void}\r\n */\r\n log = console.log.bind(console),\r\n\r\n /**\r\n * `Console.error` method.\r\n * @function module:console.error\r\n * @params args {...*}\r\n * @returns {void}\r\n */\r\n error = console.error.bind(console),\r\n\r\n /**\r\n * Peeks (console.log) at incoming value(s) and returns the last value.\r\n * @function module:console.peek\r\n * @param args {...*}\r\n * @returns {*} Last given value (if one or more values) else first value.\r\n */\r\n peek = (...args) => (log(...args), args.pop())\r\n\r\n;\r\n","export const\r\n\r\n /**\r\n * Clones and object or array using `JSON.parse(JSON.stringify(...))` pattern.\r\n * @function module:object.jsonClone\r\n * @param x {*}\r\n * @returns {*}\r\n */\r\n jsonClone = x => JSON.parse(JSON.stringify(x))\r\n\r\n;\r\n","import {isArray, isType} from './is';\r\nimport {keys} from '../jsPlatform/object';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns an associated list from given object.\r\n * @note Useful for working with plain javascript objects.\r\n * @function module:object.toAssocList\r\n * @param obj {(Object|Array|*)}\r\n * @returns {Array.<*, *>}\r\n */\r\n toAssocList = obj => keys(obj).map(key => [key, obj[key]]),\r\n\r\n /**\r\n * Returns an associated list from given object (deeply (on incoming object's type)).\r\n * @note Does deep conversion on all values of passed in type's type.\r\n * @function module:object.toAssocListDeep\r\n * @param obj {*}\r\n * @param [TypeConstraint = Object] {(Constructor|Function)} - Type constraint to convert on.\r\n * @returns {*}\r\n */\r\n toAssocListDeep = (obj, TypeConstraint = Object) => keys(obj).map(key =>\r\n TypeConstraint && isType(TypeConstraint, obj[key]) ?\r\n [key, toAssocListDeep(obj[key], TypeConstraint)] :\r\n [key, obj[key]]\r\n ),\r\n\r\n /**\r\n * From associated list to object.\r\n * @function module:object.fromAssocList\r\n * @param xs {Array.} - Associated list.\r\n * @param [OutType = Object] {Constructor|Function} - Output type. Default `Object`.\r\n * @returns {*} - Default is `Object`\r\n */\r\n fromAssocList = (xs, OutType = Object) => xs.reduce((agg, [key, value]) => {\r\n agg[key] = value;\r\n return agg;\r\n }, new OutType()),\r\n\r\n /**\r\n * From associated list to object (deep conversion on associative lists (array of 2 value arrays)).\r\n * @note Considers array of arrays associated lists.\r\n * @function module:object.fromAssocListDeep\r\n * @param xs {Array.} - Associated list.\r\n * @param [OutType = Object] {Constructor|Function} - Output type. Default `Object`.\r\n * @returns {*} - Default is `Object`\r\n */\r\n fromAssocListDeep = (xs, OutType = Object) => xs.reduce((agg, [key, value]) => {\r\n if (isArray(value) && isArray(value[0]) && value[0].length === 2) {\r\n agg[key] = fromAssocListDeep(value, OutType);\r\n return agg;\r\n }\r\n agg[key] = value;\r\n return agg;\r\n }, new OutType())\r\n;\r\n","import {typeOf} from './typeOf';\r\nimport {toAssocList} from './assocList';\r\n\r\nexport const\r\n\r\n /**\r\n * Converts incoming value to an array.\r\n * @note For `WeakMap`, `WeakSet`, `Map` and `Set` result is the same as calling `Array.from` on such.\r\n * @note For `null`, `undefined`, `NaN`, `Number{}`, `Symbol{}`, `Boolean{}` returns an empty array.\r\n * @note Method does a shallow conversion;\r\n * @function module:object.toArray\r\n * @param x {*} - Thing to convert from.\r\n * @returns {Array}\r\n */\r\n toArray = x => {\r\n switch (typeOf(x)) {\r\n case 'Null':\r\n case 'Undefined':\r\n return [];\r\n case String.name:\r\n case Array.name:\r\n case 'WeakMap':\r\n case 'WeakSet':\r\n case 'Map':\r\n case 'Set':\r\n return Array.from(x);\r\n case Object.name:\r\n default:\r\n return toAssocList(x);\r\n }\r\n }\r\n\r\n;\r\n","/**\r\n * @module object\r\n * @description Object operations/combinators.\r\n */\r\n\r\nexport * from './jsPlatform/object';\r\nexport * from './object/lookup';\r\nexport * from './object/typeOf';\r\nexport * from './object/copy';\r\nexport * from './object/is';\r\nexport * from './object/of';\r\nexport * from './object/searchObj';\r\nexport * from './object/assignDeep';\r\nexport * from './object/setTheory';\r\nexport * from './object/console';\r\nexport * from './object/jsonClone';\r\nexport * from './object/toArray';\r\nexport * from './object/assocList';\r\n","import {reduceRight} from '../jsPlatform/array';\r\n\r\n/**\r\n * Composes all functions passed in from right to left passing each functions return value to\r\n * the function on the left of itself.\r\n * @function module:function.compose\r\n * @type {Function}\r\n * @param args {...{Function}}\r\n * @returns {Function}\r\n */\r\nexport const compose = (...args) =>\r\n arg0 => reduceRight((value, fn) => fn(value), arg0, args);\r\n","/**\r\n * @memberOf function\r\n */\r\n\r\n/**\r\n * Returns passed in parameter.\r\n * @haskellType `id :: a -> a`\r\n * @function module:function.id\r\n * @param x {*}\r\n * @returns {*}\r\n */\r\nexport const id = x => x;\r\n","/**\r\n * @memberOf function\r\n */\r\n\r\nimport {apply} from '../jsPlatform/function';\r\nimport {curry, curry2} from './curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Negates a function that takes one/no argument.\r\n * @function module:function.negateF\r\n * @param fn {Function}\r\n * @returns {function(*=): boolean}\r\n */\r\n negateF = fn => x => !fn(x),\r\n\r\n /**\r\n * Takes a function that takes two parameters and returns a negated version of given\r\n * function.\r\n * @function module:_negate.negateF2\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n negateF2 = fn => curry((a, b) => !fn(a, b)),\r\n\r\n /**\r\n * Takes a function that takes three parameters and returns a\r\n * negated version of given function.\r\n * @function module:_negate.negateF3\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n negateF3 = fn => curry((a, b, c) => !fn(a, b, c)),\r\n\r\n /**\r\n * Returns a negated version of given function.\r\n * Returned function is variadiac (takes one or more arguments).\r\n * @note function returned is uncurried.\r\n * @uncurried\r\n * @function module:function.negateFN\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n negateFN = fn => curry2((...args) => !apply(fn, args));\r\n","import {curry} from './curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Run `operation` until predicate returns `true` (like a functional\r\n * version of a while loop).\r\n * @function module:function.until\r\n * @param predicate {Function} :: a -> Boolean\r\n * @param operation {Function} :: a -> a\r\n * @param typeInstance {*} :: * - A monoidal zero or some starting point.\r\n * @returns {*} - What ever type `typeInstance` is\r\n */\r\n until = curry((predicate, operation, typeInstance) => {\r\n let result = typeInstance;\r\n while (!predicate(result)) {\r\n result = operation(result);\r\n }\r\n return result;\r\n });\r\n","import {typeOf} from '../object/typeOf';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns a function or throws an error if given `f` is not a function.\r\n * @function module:function.fnOrError\r\n * @param symbolName {String} - Error message prefix.\r\n * @param f {Function|*} - Expected function.\r\n * @returns {Function}\r\n * @throws {Error} - Error if `f` is not of `function`\r\n */\r\n fnOrError = (symbolName, f) => {\r\n if (!f || !(f instanceof Function)) {\r\n throw new Error(`${symbolName} should be a function. ` +\r\n `Type received: ${typeOf(f)}; Value received: ${f}.`);\r\n }\r\n return f;\r\n }\r\n\r\n;\r\n","/**\r\n * No-op ('op' as in 'operation') - Performs no operation 'always' (good for places where\r\n * a value should always be a function etc.).\r\n * @function module:function.noop\r\n * @returns {undefined}\r\n */\r\nexport const noop = () => undefined;\r\n","/**\r\n * @module function\r\n */\r\nexport * from './jsPlatform/function';\r\nexport * from './function/compose';\r\nexport * from './function/curry';\r\nexport * from './function/flip';\r\nexport * from './function/id';\r\nexport * from './function/negate';\r\nexport * from './function/until';\r\nexport * from './function/fnOrError';\r\nexport * from './function/noop';\r\n","/**\r\n * @module object\r\n */\r\nimport {curry} from '../function/curry';\r\n\r\n/**\r\n * Normalizes step for `from` and `to` combination.\r\n * @function module:list.normalizeStep\r\n * @param from {Number}\r\n * @param to {Number}\r\n * @param [step = 1] {Number}\r\n * @returns {Number}\r\n * @private\r\n */\r\nconst normalizeStep = (from, to, step) => {\r\n if (from > to) {\r\n return step > 0 ? -step : step; // make step negative\r\n }\r\n return step < 0 ? -1 * step : step; // make step positive\r\n};\r\n\r\nexport const\r\n\r\n /**\r\n * Range function - gives you an array contain numbers in given range.\r\n * @note normalizes `step` to be valid if range numbers given are invalid\r\n * (forces `step` to be negative if range required is in the negative direction\r\n * and forces `step` to be positive if range required is in the other direction).\r\n * @function module:list.range\r\n * @param from {Number}\r\n * @param to {Number}\r\n * @param [step = 1] {Number}\r\n * @returns {Array.}\r\n */\r\n range = curry((from, to, step = 1) => {\r\n let i = from;\r\n const out = [];\r\n step = normalizeStep(from, to, step);\r\n if (step === 0 || from === to) { return [from]; }\r\n for (; (to - i) * step >= 0; i += step) { out.push(i); }\r\n return out;\r\n })\r\n;\r\n","/**\r\n * Created by elydelacruz on 9/6/2017.\r\n */\r\n\r\nimport {fPureTakesOne} from '../utils';\r\n\r\n/**\r\n * Functional version of `String.prototype.split`.\r\n * @function module:_string.split\r\n * @param separator {String|RegExp}\r\n * @param str {String}\r\n * @returns {Array}\r\n */\r\nexport const split = fPureTakesOne('split');\r\n","/**\r\n * @module jsPlatform_\r\n * @private\r\n */\r\nexport * from './jsPlatform/object';\r\nexport * from './jsPlatform/array';\r\nexport * from './jsPlatform/list';\r\nexport * from './jsPlatform/string';\r\nexport * from './jsPlatform/function';\r\n","/**\r\n * List operations module.\r\n * @module list\r\n */\r\nimport {concat as listAppend, indexOf, slice, includes} from './jsPlatform/list';\r\nimport {apply} from './jsPlatform/function';\r\nimport {length} from './jsPlatform/object';\r\nimport {negateF3, negateF2} from './function/negate';\r\nimport {curry, curry2, curry3} from './function/curry';\r\nimport {isTruthy, isFalsy} from './boolean';\r\nimport {lookup} from './object/lookup';\r\nimport {of} from './object/of';\r\nimport {isset, isString} from './object/is';\r\nimport {typeOf} from './object/typeOf';\r\nimport map from './list/map';\r\n\r\nimport {\r\n sliceFrom, sliceTo, lengths,\r\n toShortest, aggregateArray,\r\n reduceUntil, reduce, reduceRight, lastIndex,\r\n findIndexWhere, findIndexWhereRight, findIndicesWhere,\r\n findWhere, sliceCopy, genericAscOrdering\r\n}\r\n from './list/utils';\r\n\r\nexport * from './list/range';\r\n\r\nexport * from './list/utils';\r\n\r\nexport {map};\r\n\r\nexport {slice, includes, indexOf, lastIndexOf, push} from './jsPlatform';\r\n\r\nexport const\r\n\r\n /**\r\n * Append two, or more, lists, i.e.,\r\n * @example\r\n * expectEqual(append(take(13, alphabetString), drop(13, alphabetString)), alphabetString); // true\r\n *\r\n * // Another example\r\n * const result = append(\r\n * alphabetStr.split(''),\r\n * alphabetStr.split('')\r\n * ),\r\n * expected = repeat(2, alphabetStr).split('');\r\n *\r\n * shallowEquals(result, expected) === true // `true`\r\n *\r\n * @function module:list.append\r\n * @param [args] {...(Array|String|*)} - One or more lists or list likes (strings etc.).\r\n * @returns {(Array|String|*)} - Same type as list like passed in.\r\n */\r\n append = curry2((...args) => apply(listAppend, args)),\r\n\r\n /**\r\n * Returns head of list (first item of list).\r\n * @haskellType `head :: [a] -> a`\r\n * @function module:list.head\r\n * @param x {Array|String}\r\n * @returns {*} - First item from list\r\n */\r\n head = x => x[0],\r\n\r\n /**\r\n * Returns last item of list.\r\n * @haskellType `last :: [a] -> a`\r\n * @function module:list.last\r\n * @param xs {Array|String}\r\n * @returns {*}\r\n */\r\n last = xs => xs[lastIndex(xs)],\r\n\r\n /**\r\n * Returns tail part of list (everything after the first item as new list).\r\n * @haskelType `tail :: [a] -> [a]`\r\n * @function module:list.tail\r\n * @param xs {Array|String}\r\n * @returns {Array|String}\r\n */\r\n tail = xs => sliceFrom(1, xs),\r\n\r\n /**\r\n * Returns everything except last item of list as new list.\r\n * @haskellType `init :: [a] -> [a]`\r\n * @function module:list.init\r\n * @param xs {Array|String}\r\n * @returns {Array|String}\r\n */\r\n init = xs => sliceTo(lastIndex(xs), xs),\r\n\r\n /**\r\n * Returns `head` and `tail` of passed in list/string in a tuple.\r\n * @haskellType `uncons :: [a] -> Maybe (a, [a])`\r\n * @function module:list.uncons\r\n * @param xs {Array|String}\r\n * @returns {Array|undefined}\r\n */\r\n uncons = xs => !xs || length(xs) === 0 ? undefined : [head(xs), tail(xs)],\r\n\r\n /**\r\n * Returns `tail` and `head` of passed in list/string in a tuple.\r\n * @haskellType `unconsr :: [a] -> Maybe ([a], a)`\r\n * @function module:list.unconsr\r\n * @param xs {Array|String}\r\n * @returns {Array|String|*|undefined}\r\n */\r\n unconsr = xs => !xs || length(xs) === 0 ? undefined : [init(xs), last(xs)],\r\n\r\n /**\r\n * Concatenates all the elements of a container of lists.\r\n * @haskellType `concat :: Foldable t => t [a] -> [a]`\r\n * @function module:list.concat\r\n * @param xs {Array}\r\n * @returns {Array}\r\n */\r\n concat = xs => {\r\n switch (length(xs)) {\r\n case undefined:\r\n case 0:\r\n return [];\r\n case 1:\r\n const item0 = xs[0];\r\n return item0 && item0.slice ? sliceCopy(item0) : item0;\r\n case 2:\r\n default:\r\n return apply(append, xs);\r\n }\r\n },\r\n\r\n /**\r\n * Map a function over all the elements of a container and concatenate the resulting lists.\r\n * @haskellType `concatMap :: Foldable t => (a -> [b]) -> t a -> [b]`\r\n * @function module:list.concatMap\r\n * @param fn {Function}\r\n * @param foldableOfA {Array}\r\n * @returns {Array}\r\n */\r\n concatMap = curry((fn, foldableOfA) => concat(map(fn, foldableOfA))),\r\n\r\n /**\r\n * Returns a copy of the passed in list reverses.\r\n * @haskellType `reverse :: [a] -> [a]`\r\n * @function module:list.reverse\r\n * @param xs {Array|String}\r\n * @returns {Array|String}\r\n */\r\n reverse = xs => {\r\n if (!isset(xs) || !xs.length) {\r\n return xs;\r\n }\r\n let out = of(xs),\r\n i = xs.length - 1;\r\n switch (typeOf(xs)) {\r\n case 'String':\r\n for (; i >= 0; i -= 1) {\r\n out += xs[i];\r\n }\r\n return out;\r\n default:\r\n for (; i >= 0; i -= 1) {\r\n out.push(xs[i]);\r\n }\r\n return out;\r\n }\r\n },\r\n\r\n /**\r\n * Takes an element and a list and `intersperses' that element between the\r\n * elements of the list.\r\n * @function module:list.intersperse\r\n * @note In our version of the function javascript is loosely typed so,\r\n * so is our function (to much overhead to make it typed) so `between` can be any value.\r\n * @param between {*} - Should be of the same type of elements contained in list.\r\n * @param arr {Array|String} - List.\r\n * @returns {Array|String}\r\n */\r\n intersperse = curry((between, xs) => {\r\n if (!xs || !xs.length) {\r\n return xs;\r\n }\r\n const limit = xs.length,\r\n lastInd = limit - 1;\r\n let out = of(xs),\r\n i = 0;\r\n if (isString(xs)) {\r\n for (; i < limit; i += 1) {\r\n out += i === lastInd ?\r\n xs[i] : xs[i] + between;\r\n }\r\n return out;\r\n }\r\n for (; i < limit; i += 1) {\r\n if (i === lastInd) {\r\n out.push(xs[i]);\r\n } else {\r\n out.push(xs[i], between);\r\n }\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * `intercalate xs xss` is equivalent to (concat (intersperse xs xss)). It inserts the list xs in between the lists in xss and concatenates the result.\r\n * @haskellType `intercalate :: [a] -> [[a]] -> [a]`\r\n * @function module:list.intercalate\r\n * @param xs {Array|String}\r\n * @param xss {Array|String}\r\n * @returns {Array|String}\r\n */\r\n intercalate = curry((xs, xss) => {\r\n if (isString(xss)) {\r\n return intersperse(xs, xss);\r\n }\r\n return concat(intersperse(xs, xss));\r\n }),\r\n\r\n /**\r\n * Transposes rows and columns into lists by index; E.g.,\r\n * Haskell example:\r\n * ```\r\n * transpose [[1,2,3],[4,5,6]] == [[1,4],[2,5],[3,6]]\r\n *\r\n * -- Notice the shorter arrays are ignored after their last index is copied over:\r\n * transpose [[10,11],[20],[],[30,31,32]] == [[10,20,30],[11,31],[32]]\r\n * ```\r\n * @note from columns to rows.\r\n * @note Empty lists are ignored.\r\n * @haskellType `transpose :: [[a]] -> [[a]]`\r\n * @function module:list.transpose\r\n * @param xss {Array}\r\n * @returns {Array}\r\n */\r\n transpose = xss => {\r\n let numLists = length(xss),\r\n ind = 0, ind2;\r\n if (!numLists) {\r\n return [];\r\n }\r\n const listLengths = apply(lengths, xss),\r\n longestListLen = maximum(listLengths),\r\n outLists = [];\r\n for (; ind < longestListLen; ind += 1) {\r\n const outList = [];\r\n for (ind2 = 0; ind2 < numLists; ind2 += 1) {\r\n if (listLengths[ind2] < ind + 1) {\r\n continue;\r\n }\r\n outList.push(xss[ind2][ind]);\r\n }\r\n outLists.push(outList);\r\n }\r\n return filter(x => length(x) > 0, outLists);\r\n },\r\n\r\n /**\r\n * Generates 2^n sub-sequences for passed in sequence (string/list) (`n` is\r\n * the length of the passed in sequence so: 2^length(xs)).\r\n * Note: The return value doubles per index/character passed in so use with caution!\r\n * Also note that for 2^16 (or for a sequence of 16 characters) this algorithm\r\n * will generate 65536 sub-sequences! So caution should be taken to not\r\n * use this with sequences above a certain length on certain platform (the browser thread in specific).\r\n * @function module:list.subsequences\r\n * @jsperftest https://jsperf.com/subsequences\r\n * @param xs {Array|String}\r\n * @returns {Array.}\r\n */\r\n subsequences = xs => {\r\n const listLen = length(xs),\r\n len = Math.pow(2, listLen),\r\n out = [];\r\n for (let i = 0; i < len; i += 1) {\r\n let entry = [];\r\n for (let j = 0; j < listLen; j += 1) {\r\n if (i & (1 << j)) {\r\n entry.push(xs[j]);\r\n }\r\n }\r\n out.push(entry);\r\n }\r\n return out;\r\n },\r\n\r\n /**\r\n * Returns an array with the given indices swapped.\r\n * @function module:list.swapped\r\n * @param ind1 {Number}\r\n * @param ind2 {Number}\r\n * @param list {Array}\r\n * @returns {Array} - Copy of incoming with swapped values at indices.\r\n */\r\n swapped = curry((ind1, ind2, list) => {\r\n const out = sliceCopy(list),\r\n tmp = out[ind1];\r\n out[ind1] = out[ind2];\r\n out[ind2] = tmp;\r\n return out;\r\n }),\r\n\r\n /**\r\n * Returns a list of permutations for passed in list.\r\n * Use caution with lists above a length of 15 (will take long due to nature of\r\n * algorithm).\r\n * @function module:list.permutations\r\n * @param xs {Array} - List.\r\n * @returns {Array} - Array of permutations.\r\n */\r\n permutations = xs => {\r\n const limit = length(xs);\r\n\r\n if (!limit || limit === 1) {\r\n return [xs];\r\n }\r\n\r\n let list = sliceCopy(xs),\r\n c = repeat(limit, 0),\r\n i = 0;\r\n\r\n const out = [list];\r\n\r\n for (; i < limit; i++) {\r\n if (c[i] < i) {\r\n list = swapped(i % 2 === 0 ? 0 : c[i], i, list);\r\n out.push(list);\r\n c[i] += 1;\r\n i = 0;\r\n continue;\r\n }\r\n c[i] = 0;\r\n }\r\n\r\n return out;\r\n },\r\n\r\n /**\r\n * Left associative fold. Reduces a container of elements down by the given operation (same as [].reduce).\r\n * @function module:list.foldl\r\n * @param fn {Function}\r\n * @param zero {*} - Aggregator.\r\n * @param functor {Array}\r\n * @returns {*} - Whatever type is lastly returned from `fn`.\r\n */\r\n foldl = reduce,\r\n\r\n /**\r\n * Right associative fold. Reduces a container of elements down by the given operation (same as [].reduceRight).\r\n * @function module:list.foldr\r\n * @param fn {Function}\r\n * @param zero {*} - Aggregator.\r\n * @param functor {Array}\r\n * @returns {*} - Whatever type is lastly returned from `fn`.\r\n */\r\n foldr = reduceRight,\r\n\r\n /**\r\n * A variant of `foldl` except that this one doesn't require the starting point. The starting point/value will be pulled\r\n * out from a copy of the container.\r\n * @function module:list.foldl1\r\n * @param op {Function}\r\n * @param xs {Array}\r\n * @returns {*} - Whatever type is lastly returned from `op`.\r\n */\r\n foldl1 = curry((op, xs) => {\r\n const parts = uncons(xs);\r\n return !parts ? [] : reduce(op, parts[0], parts[1]);\r\n }),\r\n\r\n /**\r\n * A variant of `foldr` except that this one doesn't require the starting point/value. The starting point/value will be pulled\r\n * out from a copy of the container.\r\n * @function module:list.foldr1\r\n * @param op {Function}\r\n * @param xs {Array}\r\n * @returns {*} - Whatever type is lastly returned from `op`.\r\n */\r\n foldr1 = curry((op, xs) => {\r\n const parts = unconsr(xs);\r\n return !parts ? [] : reduceRight(op, parts[1], parts[0]);\r\n }),\r\n\r\n /**\r\n * Performs a map then a reduce all in one (from left-to-right). Returns a tuple\r\n * containing the aggregated value and the result of mapping the passed in function on passed in list.\r\n * @function module:list.mapAccumL\r\n * @param op {Function} - Function : [aggregated, mapResult]\r\n * @param zero {*} - An instance of the passed in list type used to aggregateArray on.\r\n * @param xs {Array} - list type.\r\n * @return {Array} - [aggregated, list]\r\n */\r\n mapAccumL = curry((op, zero, xs) => {\r\n const list = sliceCopy(xs),\r\n limit = length(xs);\r\n if (!limit) {\r\n return [zero, list];\r\n }\r\n let ind = 0,\r\n agg = zero,\r\n mapped = [],\r\n tuple;\r\n for (; ind < limit; ind++) {\r\n tuple = op(agg, list[ind], ind);\r\n agg = tuple[0];\r\n mapped = tuple[1];\r\n }\r\n return [agg, mapped];\r\n }),\r\n\r\n /**\r\n * Performs a map and a reduce all in one (from right-to-left). Returns a tuple\r\n * containing the aggregated value and the result of mapping the passed in function on passed in list.\r\n * @function module:list.mapAccumR\r\n * @param op {Function} - Function : [aggregated, mapResult]\r\n * @param zero {*} - An instance of the passed in list type used to aggregateArray on.\r\n * @param xs {Array} - list type.\r\n * @return {Array} - [aggregated, list]\r\n */\r\n mapAccumR = curry((op, zero, xs) => {\r\n const list = sliceCopy(xs),\r\n limit = length(xs);\r\n if (!limit) {\r\n return [zero, list];\r\n }\r\n let ind = limit - 1,\r\n agg = zero,\r\n mapped = [],\r\n tuple;\r\n for (; ind >= 0; ind--) {\r\n tuple = op(agg, list[ind], ind);\r\n agg = tuple[0];\r\n mapped = tuple[1];\r\n }\r\n return [agg, mapped];\r\n }),\r\n\r\n /**\r\n * iterate f x returns an infinite list of repeated applications of f to x.\r\n * @function module:list.iterate\r\n * @example `iterate(5, f, x) == [x, f(x), f(f(x)), ...]`\r\n * @param limit {Number}\r\n * @param op {Function} - Operation.\r\n * @param x {*} - Starting point.\r\n * @returns {*}\r\n */\r\n iterate = curry((limit, op, x) => {\r\n let ind = 0,\r\n out = [],\r\n lastX = x;\r\n for (; ind < limit; ind += 1) {\r\n out.push(lastX);\r\n lastX = op(lastX, ind);\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Repeats `x` `limit` number of times.\r\n * @function module:list.repeat\r\n * @param limit {Number}\r\n * @param x {*}\r\n * @return {Array}\r\n */\r\n repeat = curry((limit, x) => iterate(limit, a => a, x)),\r\n\r\n /**\r\n * Same as `repeat` due to the nature of javascript (see haskell version for usage).\r\n * @function module:list.replicate\r\n * @param limit {Number}\r\n * @param x {*}\r\n * @return {Array}\r\n */\r\n replicate = repeat,\r\n\r\n /**\r\n * Replicates a list `limit` number of times and appends the results (concat)\r\n * @function module:list.cycle\r\n * @param limit {Number}\r\n * @param xs {Array}\r\n * @returns {Array}\r\n */\r\n cycle = curry((limit, xs) => concat(replicate(limit, xs))),\r\n\r\n /**\r\n * Unfolds a value into a list of somethings.\r\n * @haskellType `unfoldr :: (b -> Maybe (a, b)) -> b -> [a]`\r\n * @function module:list.unfoldr\r\n * @param op {Function} - Operation to perform (should return a two component tuple (item to aggregateArray and item to unfold in next iteration).\r\n * @param x {*} - Starting parameter to unfold from.\r\n * @returns {Array} - An array of whatever you return from `op` yielded.\r\n */\r\n unfoldr = curry((op, x) => {\r\n let ind = 0,\r\n out = [],\r\n resultTuple = op(x, ind, out);\r\n while (resultTuple) {\r\n out.push(resultTuple[0]);\r\n resultTuple = op(resultTuple[1], ++ind, out);\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Finds index in string or list (alias for `findIndex`).\r\n * @function module:list.findIndex\r\n * @param pred {Function} - Predicate.\r\n * @param arr {Array|String}\r\n * @returns {Number} - `-1` if predicate not matched else `index` found\r\n */\r\n findIndex = findIndexWhere,\r\n\r\n /**\r\n * @function module:list.findIndices\r\n * @param pred {Function}\r\n * @param xs {Array} - list or list like.\r\n * @returns {Array|undefined}\r\n */\r\n findIndices = findIndicesWhere,\r\n\r\n /**\r\n * @function module:list.elemIndex\r\n * @param x {*} - Element to search for.\r\n * @param xs {Array} - list or list like.\r\n * @returns {*}\r\n */\r\n elemIndex = curry((x, xs) => {\r\n const foundInd = indexOf(x, xs);\r\n return foundInd !== -1 ? foundInd : undefined;\r\n }),\r\n\r\n /**\r\n * @function module:list.elemIndices\r\n * @param value {*} - Element to search for.\r\n * @param xs {Array} - list or list like.\r\n * @returns {*}\r\n */\r\n elemIndices = curry((value, xs) => findIndices(x => x === value, xs)),\r\n\r\n /**\r\n * Takes `n` items from start of list to `limit` (exclusive).\r\n * @function module:list.take\r\n * @param list {Array|String}\r\n * @param limit {Number}\r\n * @returns {String|Array} - Passed in type's type\r\n */\r\n take = sliceTo,\r\n\r\n /**\r\n * Drops `n` items from start of list to `count` (exclusive).\r\n * @function module:list.drop\r\n * @param list {Array|String}\r\n * @param count {Number}\r\n * @returns {String|Array} - Passed in type's type\r\n */\r\n drop = sliceFrom,\r\n\r\n /**\r\n * Splits `x` in two at given `index` (exclusive (includes element/character at\r\n * given index in second part of returned list)).\r\n * @function module:list.splitAt\r\n * @param ind {Number} - Index to split at.\r\n * @param list {Array|String} - functor (list or string) to split.\r\n * @returns {Array|String} - List like type passed\r\n */\r\n splitAt = (ind, list) => [sliceTo(ind, list), sliceFrom(ind, list)],\r\n\r\n /**\r\n * Gives an list with passed elements while predicate was true.\r\n * @function module:list.takeWhile\r\n * @param pred {Function} - Predicate<*, index, list|string>\r\n * @param list {Array|String}\r\n * @returns {Array}\r\n */\r\n takeWhile = curry((pred, list) =>\r\n reduceUntil(\r\n negateF3(pred), // predicate\r\n isString(list) ?\r\n (agg, x) => agg + x :\r\n aggregateArray, // operation\r\n of(list), // aggregate\r\n list\r\n )),\r\n\r\n /**\r\n * Returns an list without elements that match predicate.\r\n * @function module:list.dropWhile\r\n * @param pred {Function} - Predicate<*, index, list|string>\r\n * @param list {Array|String}\r\n * @refactor\r\n * @returns {Array|String}\r\n */\r\n dropWhile = curry((pred, list) => {\r\n const limit = length(list),\r\n splitPoint =\r\n findIndexWhere(\r\n (x, i, xs) => !pred(x, i, xs),\r\n list\r\n );\r\n\r\n return splitPoint === -1 ?\r\n sliceFrom(limit, list) :\r\n slice(splitPoint, limit, list);\r\n }),\r\n\r\n /**\r\n * @function module:list.dropWhileEnd\r\n * @param pred {Function} - Predicate<*, index, list|string>\r\n * @param list {Array|String}\r\n * @refactor\r\n * @returns {Array|String}\r\n */\r\n dropWhileEnd = curry((pred, list) => {\r\n const splitPoint =\r\n findIndexWhereRight(\r\n (x, i, xs) => !pred(x, i, xs),\r\n list\r\n );\r\n if (splitPoint === -1) {\r\n return of(list);\r\n }\r\n return sliceTo(splitPoint + 1, list);\r\n }),\r\n\r\n /**\r\n * Gives you the `span` of items matching predicate\r\n * and items not matching predicate; E.g., Gives an\r\n * array of arrays; E.g., [[matching-items], [non-matching-items]]\r\n * @function list.span\r\n * @param pred {Function} - List predicate (`(x, i, list) => bool`)\r\n * @param list {Array|String}\r\n * @returns {(Array>|Array)}\r\n * @type {Function}\r\n */\r\n span = curry((pred, list) => {\r\n const splitPoint = findIndexWhere(negateF3(pred), list);\r\n return splitPoint === -1 ?\r\n [sliceFrom(0, list), of(list)] :\r\n splitAt(splitPoint, list);\r\n }),\r\n\r\n /**\r\n * breakOnList, applied to a predicate p and a list xs, returns a tuple\r\n * where first element is longest prefix (possibly empty) of xs of elements\r\n * that do not satisfy p and second element is the remainder of the list:\r\n * @haskellExample\r\n * Replace `break` with `breakOnList` for our version.\r\n * ```\r\n * breakOnList (> 3) [1,2,3,4,1,2,3,4] == ([1,2,3],[4,1,2,3,4])\r\n * breakOnList (< 9) [1,2,3] == ([],[1,2,3])\r\n * breakOnList (> 9) [1,2,3] == ([1,2,3],[])\r\n * ```\r\n * @function module:list.breakOnList\r\n * @param pred {Function}\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n breakOnList = curry((pred, list) => {\r\n const splitPoint = findIndexWhere(negateF3(pred), list);\r\n return splitPoint === -1 ?\r\n [of(list), sliceFrom(0, list)] : reverse(splitAt(splitPoint, list));\r\n }),\r\n\r\n /**\r\n * Gets item at index.\r\n * @function module:list.at\r\n * @param ind {Number} - Index.\r\n * @param xs {Array} - list or list like.\r\n * @returns {*|undefined} - Item or `undefined`.\r\n */\r\n at = lookup,\r\n\r\n /**\r\n * Find an item in structure of elements based on given predicate (`pred`).\r\n * @function module:list.find\r\n * @param pred {Function}\r\n * @param xs {Array} - list or list like.\r\n * @returns {*} - Found item.\r\n */\r\n find = findWhere,\r\n\r\n /**\r\n * For each function (same as `[].forEach` except in functional format).\r\n * @function module:list.forEach\r\n * @param fn {Function} - Operation (`(element, index, list) => {...}`, etc.)\r\n * @param xs {(Array|String)}\r\n * @returns {void}\r\n */\r\n forEach = curry((fn, list) => {\r\n const limit = length(list);\r\n if (!limit) {\r\n return;\r\n }\r\n let ind = 0;\r\n for (; ind < limit; ind += 1) {\r\n fn(list[ind], ind, list);\r\n }\r\n }),\r\n\r\n /**\r\n * Filters a structure of elements using given predicate (`pred`) (same as `[].filter`).\r\n * @function module:list.filter\r\n * @param pred {Function}\r\n * @param xs {Array} - list or list like.\r\n * @returns {Array} - Structure of filtered elements.\r\n */\r\n filter = curry((pred, xs) => {\r\n let ind = 0,\r\n limit = length(xs),\r\n out = [];\r\n if (!limit) {\r\n return out;\r\n }\r\n for (; ind < limit; ind++) {\r\n if (pred(xs[ind], ind, xs)) {\r\n out.push(xs[ind]);\r\n }\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Partitions a list on a predicate; Items that match predicate are in first list in tuple; Items that\r\n * do not match the tuple are in second list in the returned tuple.\r\n * Essentially `[filter(p, xs), filter(negateF3(p), xs)]`.\r\n * @function module:list.partition\r\n * @param pred {Function} - Predicate\r\n * @param list {Array}\r\n * @returns {Array|String} - Tuple of arrays or strings (depends on incoming list (of type list or string)).\r\n */\r\n partition = curry((pred, list) =>\r\n !length(list) ?\r\n [[], []] :\r\n [filter(pred, list), filter(negateF3(pred), list)]),\r\n\r\n /**\r\n * Returns a boolean indicating whether an element exists in given structure of elements.\r\n * @function module:list.elem\r\n * @param element {*}\r\n * @param xs {Array}\r\n * @returns {Boolean}\r\n */\r\n elem = includes,\r\n\r\n /**\r\n * The opposite of `elem` - Returns a boolean indicating whether an element exists in given list.\r\n * @function module:list.notElem\r\n * @param element {*}\r\n * @param xs {Array}\r\n * @returns {Boolean}\r\n */\r\n notElem = negateF2(includes),\r\n\r\n /**\r\n * Checks if list `xs1` is a prefix of list `xs2`\r\n * @function module:list.isPrefixOf\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {boolean}\r\n */\r\n isPrefixOf = curry((xs1, xs2) => {\r\n const limit1 = length(xs1),\r\n limit2 = length(xs2);\r\n if (limit2 < limit1 || !limit1 || !limit2 || indexOf(xs1[0], xs2) === -1) {\r\n return false;\r\n }\r\n let ind = 0;\r\n for (; ind < limit1; ind++) {\r\n if (xs1[ind] !== xs2[ind]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }),\r\n\r\n /**\r\n * Checks if list `xs1` is a suffix of list `xs2`\r\n * @function module:list.isSuffixOf\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {boolean}\r\n */\r\n isSuffixOf = curry((xs1, xs2) => {\r\n const limit1 = length(xs1),\r\n limit2 = length(xs2);\r\n if (limit2 < limit1 || !limit1 || !limit2 || indexOf(xs1[0], xs2) === -1) {\r\n return false;\r\n }\r\n let ind1 = limit1 - 1,\r\n ind2 = limit2 - 1;\r\n for (; ind1 >= 0; ind1--) {\r\n if (xs1[ind1] !== xs2[ind2]) {\r\n return false;\r\n }\r\n ind2 -= 1;\r\n }\r\n return true;\r\n }),\r\n\r\n /**\r\n * Checks if list `xs1` is an infix of list `xs2`\r\n * @function module:list.isInfixOf\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {boolean}\r\n */\r\n isInfixOf = curry((xs1, xs2) => {\r\n const limit1 = length(xs1),\r\n limit2 = length(xs2);\r\n if (limit2 < limit1 || !limit1 || !limit2) {\r\n return false;\r\n }\r\n let ind1,\r\n foundLen,\r\n ind = 0;\r\n for (; ind < limit2; ind += 1) {\r\n foundLen = 0;\r\n for (ind1 = 0; ind1 < limit1; ind1 += 1) {\r\n if (xs2[ind1 + ind] === xs1[ind1]) {\r\n foundLen += 1;\r\n }\r\n if (foundLen === limit1) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }),\r\n\r\n /**\r\n * Checks if list `xs1` is a sub-sequence of list `xs2`\r\n * @function module:list.isSubsequenceOf\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {boolean}\r\n */\r\n isSubsequenceOf = curry((xs1, xs2) => {\r\n const len = Math.pow(2, length(xs2)),\r\n lenXs1 = length(xs1);\r\n let foundLen,\r\n i;\r\n for (i = 0; i < len; i += 1) {\r\n foundLen = 0;\r\n for (let j = 0; j < len; j += 1) {\r\n if (i & (1 << j) && indexOf(xs2[j], xs1) > -1) {\r\n foundLen += 1;\r\n }\r\n if (foundLen === lenXs1) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }),\r\n\r\n /**\r\n * The group function takes a list and returns a list of lists such that\r\n * the concatenation of the result is equal to the argument. Moreover, each\r\n * sublist in the result contains only equal elements. For example,\r\n * `group \"Mississippi\" = [\"M\",\"i\",\"ss\",\"i\",\"ss\",\"i\",\"pp\",\"i\"]`\r\n * It is a special case of groupBy, which allows the programmer to supply\r\n * their own equality test.\r\n * @haskellType `group :: Eq a => [a] -> [[a]]`\r\n * @function module:list.group\r\n * @param xs {Array|String}\r\n * @returns {Array|*}\r\n */\r\n group = xs => groupBy((a, b) => a === b, xs),\r\n\r\n /**\r\n * Allows you to group items in a list based on your supplied equality check.\r\n * @note Sames `group` but allows you to specify equality operation.\r\n * @haskellType `groupBy :: (a -> a -> Bool) -> [a] -> [[a]]`\r\n * @function module:list.groupBy\r\n * @param equalityOp {Function}\r\n * @param xs {Array}\r\n * @returns {*}\r\n */\r\n groupBy = curry((equalityOp, xs) => {\r\n const limit = length(xs);\r\n if (!limit) {\r\n return sliceCopy(xs);\r\n }\r\n let ind = 0,\r\n prevItem,\r\n item,\r\n predOp = x => {\r\n if (equalityOp(x, prevItem)) {\r\n ind++;\r\n }\r\n if (equalityOp(x, item)) {\r\n prevItem = x;\r\n return true;\r\n }\r\n return false;\r\n },\r\n agg = [];\r\n for (; ind < limit; ind += 1) {\r\n item = xs[ind];\r\n agg.push(takeWhile(predOp, slice(ind, limit, xs)));\r\n }\r\n return agg;\r\n }),\r\n\r\n /**\r\n * The inits function returns all initial segments of the argument, shortest first. For example,\r\n * ```\r\n * shallowEquals(inits('abc'), ['','a','ab','abc'])\r\n * ```\r\n * @function module:list.inits\r\n * @haskellType `inits :: [a] -> [[a]]`\r\n * @param xs {Array}\r\n * @returns {Array}\r\n */\r\n inits = xs => {\r\n let limit = length(xs),\r\n ind = 0,\r\n agg = [];\r\n if (!limit) {\r\n return [];\r\n }\r\n for (; ind <= limit; ind += 1) {\r\n agg.push(sliceTo(ind, xs));\r\n }\r\n return agg;\r\n }, //map(list => init(list), xs),\r\n\r\n /**\r\n * The inits function returns all initial segments of the argument, shortest first. For example,\r\n * ```\r\n * shallowEquals(tails('abc'), ['abc', 'bc', 'c',''])\r\n * ```\r\n * @function module:list.tails\r\n * @haskellType `tails :: [a] -> [[a]]`\r\n * @param xs {Array}\r\n * @returns {Array}\r\n */\r\n tails = xs => {\r\n let limit = length(xs),\r\n ind = 0,\r\n agg = [];\r\n if (!limit) {\r\n return [];\r\n }\r\n for (; ind <= limit; ind += 1) {\r\n agg.push(slice(ind, limit, xs));\r\n }\r\n return agg;\r\n }, //map(list => tail(list), xs),\r\n\r\n /**\r\n * Strips prefix list from given list\r\n * @function module:list.stripPrefix\r\n * @param prefix {Array|String|*}\r\n * @param list {Array|string|*}\r\n * @returns {Array|*}\r\n */\r\n stripPrefix = curry((prefix, list) =>\r\n isPrefixOf(prefix, list) ?\r\n splitAt(length(prefix), list)[1] :\r\n sliceCopy(list)),\r\n\r\n /**\r\n * zip takes two lists and returns a list of corresponding pairs.\r\n * If one input list is short, excess elements of the longer list are discarded.\r\n * @haskellType `zip :: [a] -> [b] -> [(a, b)]`\r\n * @function module:list.zip\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @returns {Array>}\r\n */\r\n zip = curry((arr1, arr2) => {\r\n if (!length(arr1) || !length(arr2)) {\r\n return [];\r\n }\r\n const [a1, a2] = toShortest(arr1, arr2);\r\n return reduce((agg, item, ind) =>\r\n aggregateArray(agg, [item, a2[ind]]),\r\n [], a1);\r\n }),\r\n\r\n /**\r\n * zipN takes one or more lists and returns a list containing lists of all indices\r\n * at a given index, index by index.\r\n * If one input list is short, excess elements of the longer list are discarded.\r\n * @function module:list.zipN\r\n * @param lists {Array|String} - One ore more lists of the same type.\r\n * @returns {Array}\r\n */\r\n zipN = curry2((...lists) => {\r\n const trimmedLists = apply(toShortest, lists);\r\n return reduce((agg, item, ind) =>\r\n aggregateArray(agg, map(xs => xs[ind], trimmedLists)),\r\n [], trimmedLists[0]);\r\n }),\r\n\r\n /**\r\n * @haskellType `zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]`\r\n * @function module:list.zip3\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @param arr3 {Array}\r\n * @returns {Array>}\r\n */\r\n zip3 = curry((arr1, arr2, arr3) => zipN(arr1, arr2, arr3)),\r\n\r\n /**\r\n * @haskellType `zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]`\r\n * @function module:list.zip4\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @param arr3 {Array}\r\n * @param arr4 {Array}\r\n * @returns {Array>}\r\n */\r\n zip4 = curry((arr1, arr2, arr3, arr4) => zipN(arr1, arr2, arr3, arr4)),\r\n\r\n /**\r\n * @haskellType `zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]`\r\n * @function module:list.zip5\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @param arr3 {Array}\r\n * @param arr4 {Array}\r\n * @param arr5 {Array}\r\n * @returns {Array>}\r\n */\r\n zip5 = curry((arr1, arr2, arr3, arr4, arr5) => zipN(arr1, arr2, arr3, arr4, arr5)),\r\n\r\n /**\r\n * zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]\r\n * zipWith generalises zip by zipping with the function given as the\r\n * first argument, instead of a function tupling function (function that returns a tuple). For example,\r\n * zipWith (+) is applied to two lists to produce the list of corresponding sums.\r\n * @note `_|_` means bottom or perpetual (@see\r\n * - https://wiki.haskell.org/Bottom\r\n * - https://stackoverflow.com/questions/19794681/what-does-this-syntax-mean-in-haskell-or\r\n * )\r\n * @example\r\n * ```\r\n * zipWith f [] _|_ = []\r\n * ```\r\n * @haskellType `zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]`\r\n * @function module:list.zipWith\r\n * @param op {Function} - Takes two parts of a tuple and returns a tuple.\r\n * E.g., ` op :: a -> b -> (a, b)`\r\n * @param xs1 {Array}\r\n * @param xs2 {Array}\r\n * @returns {Array>}\r\n */\r\n zipWith = curry((op, xs1, xs2) => {\r\n if (!length(xs1) || !length(xs2)) {\r\n return [];\r\n }\r\n const [a1, a2] = toShortest(xs1, xs2);\r\n return reduce((agg, item, ind) =>\r\n aggregateArray(agg, op(item, a2[ind])),\r\n [], a1);\r\n }),\r\n\r\n /**\r\n * Zips all given lists with tupling function. Note: Haskell types do not have\r\n * a way (that I know of) to show one or more for params in a function so `@haskellType` below\r\n * is left there for general purpose not for exactness as is told by aforementioned.\r\n * @haskellType `zipWithN :: (a -> b -> c) -> [a] -> [b] -> [c]` - Where `N` is the number\r\n * of lists to zip.\r\n * @function module:list.zipWithN\r\n * @param op {Function} - Takes expected number of parts for tuple and returns a tuple\r\n * of said parts:\r\n * E.g., ` op :: a -> b -> c -> (a, b, c)`\r\n * @param lists ...{Array}\r\n * @returns {Array>}\r\n */\r\n zipWithN = curry3((op, ...lists) => {\r\n const trimmedLists = apply(toShortest, lists),\r\n lenOfTrimmed = length(trimmedLists);\r\n if (!lenOfTrimmed) {\r\n return [];\r\n }\r\n else if (lenOfTrimmed === 1) {\r\n return sliceTo(length(trimmedLists[0]), trimmedLists[0]);\r\n }\r\n return reduce((agg, item, ind) =>\r\n aggregateArray(agg, apply(op, map(xs => xs[ind], trimmedLists))),\r\n [], trimmedLists[0]);\r\n }),\r\n\r\n /**\r\n * Zips 3 lists with tupling function.\r\n * @haskellType `zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]`\r\n * @function module:list.zipWith3\r\n * @param op {Function} - Takes expected number of parts for tuple and returns a tuple\r\n * of said parts:\r\n * E.g., ` op :: a -> b -> c -> (a, b, c)`\r\n * @param xs1 {Array}\r\n * @param xs2 {Array}\r\n * @param xs3 {Array}\r\n * @returns {Array>}\r\n */\r\n zipWith3 = curry((op, xs1, xs2, xs3) => zipWithN(op, xs1, xs2, xs3)),\r\n\r\n /**\r\n * Zips 4 lists with tupling function.\r\n * @haskellType `zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]`\r\n * @function module:list.zipWith4\r\n * @param op {Function} - Takes expected number of parts for tuple and returns a tuple\r\n * of said parts:\r\n * E.g., ` op :: a -> b -> c -> d -> (a, b, c, d)`\r\n * @param xs1 {Array}\r\n * @param xs2 {Array}\r\n * @param xs3 {Array}\r\n * @param xs4 {Array}\r\n * @returns {Array>}\r\n */\r\n zipWith4 = curry((op, xs1, xs2, xs3, xs4) => zipWithN(op, xs1, xs2, xs3, xs4)),\r\n\r\n /**\r\n * Zips 5 lists.\r\n * @haskellType `zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]`\r\n * @function module:list.zipWith5\r\n * @param op {Function} - Takes expected number of parts for tuple and returns a tuple\r\n * of said parts:\r\n * E.g., ` op :: a -> b -> c -> d -> e -> (a, b, c, d, e)`\r\n * @param xs1 {Array}\r\n * @param xs2 {Array}\r\n * @param xs3 {Array}\r\n * @param xs4 {Array}\r\n * @param xs5 {Array}\r\n * @returns {Array>}\r\n */\r\n zipWith5 = curry((op, xs1, xs2, xs3, xs4, xs5) => zipWithN(op, xs1, xs2, xs3, xs4, xs5)),\r\n\r\n /**\r\n * unzip transforms a list of pairs into a list of first components and a list of second components.\r\n * @haskellType `unzip :: [(a, b)] -> ([a], [b])`\r\n * @function module:list.unzip\r\n * @param arr {Array|*}\r\n * @returns {Array|*}\r\n */\r\n unzip = foldl((agg, item) => {\r\n agg[0].push(item[0]);\r\n agg[1].push(item[1]);\r\n return agg;\r\n }, [[], []]),\r\n\r\n /**\r\n * unzip transforms a list of pairs into a list of first components and a list of second components.\r\n * @sudoHaskellType `unzipN :: [(a, b, ...x)] -> ([a], [b], ...[x])`\r\n * @function module:list.unzipN\r\n * @param list {Array|*} - List of tuples (lists).\r\n * @returns {Array|*}\r\n */\r\n unzipN = list => {\r\n if (!length(list)) {\r\n return [];\r\n }\r\n const lenItem0 = length(list[0]);\r\n let zero = lenItem0 ?\r\n unfoldr(numLists => numLists-- ? [[], numLists] : undefined, lenItem0) :\r\n [];\r\n return foldl((agg, item) => {\r\n agg.forEach((outList, ind) => outList.push(item[ind]));\r\n return agg;\r\n }, zero, list);\r\n },\r\n\r\n /**\r\n * Returns true if any item in container passes predicate `p`.\r\n * @function module:list.any\r\n * @param p {Function} - Predicate.\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n any = curry((p, xs) => {\r\n let ind = 0,\r\n limit = length(xs);\r\n if (!limit) {\r\n return false;\r\n }\r\n for (; ind < limit; ind += 1) {\r\n if (p(xs[ind])) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }),\r\n\r\n /**\r\n * Returns true if all items in container pass predicate `p`.\r\n * @function module:list.all\r\n * @param p {Function} - Predicate.\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n all = curry((p, xs) => {\r\n const limit = length(xs);\r\n let ind = 0;\r\n if (!limit) {\r\n return false;\r\n }\r\n for (; ind < limit; ind++) {\r\n if (!p(xs[ind], ind, xs)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }),\r\n\r\n /**\r\n * Conjuction of container of bools (or truthy and/or falsy values); Returns\r\n * `true` if all in container are 'truthy' else returns `false`\r\n * @function module:list.and\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n and = xs => all(isTruthy, xs),\r\n\r\n /**\r\n * Returns a boolean indicating whether any item in container is 'truthy' or not.\r\n * **Note** The haskell type for this function only takes two items, but here\r\n * we allow the passing of more than one item (may change later to adhere to the haskell type).\r\n * @function module:list.or\r\n * @haskellType `or :: Bool -> Bool -> Bool`\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n or = xs => any(isTruthy, xs),\r\n\r\n /**\r\n * Returns a boolean indicating whether all items in container are 'falsy' or not.\r\n * **Note** The haskell type for this function only takes two items, but here\r\n * we allow the passing of more than one item (may change later to adhere to the haskell type).\r\n * @function module:list.not\r\n * @haskellType `not :: Bool -> Bool`\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n not = xs => all(isFalsy, xs),\r\n\r\n /**\r\n * Computes the sum of the numbers of a structure.\r\n * @function module:list.sum\r\n * @haskellType `sum :: (List t, Num a) => t a -> a`\r\n * @param list {Array|String}\r\n * @returns {Number}\r\n */\r\n sum = list => foldl((agg, x) => agg + x, 0, list),\r\n\r\n /**\r\n * Computes the product of the numbers of a structure.\r\n * @function module:list.product\r\n * @haskellType `product :: (List t, Num a) => t a -> a`\r\n * @param list {Array|String}\r\n * @returns {Number}\r\n */\r\n product = list => foldl((agg, x) => agg * x, 1, list),\r\n\r\n /**\r\n * Returns the largest element in a non-empty structure of elements.\r\n * @function module:list.maximum\r\n * @haskellType `maximum :: forall a . Ord a => t a -> a`\r\n * @param list {Array|String}\r\n * @returns {*} - Whatever type the array is made of (if any).\r\n */\r\n maximum = list => last(sortBy(genericAscOrdering, list)),\r\n\r\n /**\r\n * Returns the smallest element in a non-empty structure of elements.\r\n * @function module:list.minimum\r\n * @haskellType `minimum :: forall a . Ord a => t a -> a`\r\n * @param list {Array|String}\r\n * @returns {*} - Whatever type the array is made of (if any).\r\n */\r\n minimum = list => head(sortBy(genericAscOrdering, list)),\r\n\r\n /**\r\n * scanl is similar to foldl, but returns a list of successive reduced values from the left:\r\n * ```\r\n * scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]\r\n * ```\r\n * Also note that:\r\n * ```\r\n * last (scanl f z xs) == foldl f z xs.\r\n * ```\r\n * @function module:list.scanl\r\n * @param fn {Function}\r\n * @param zero {*}\r\n * @param xs {Array}\r\n * @returns {Array|*}\r\n */\r\n scanl = curry((fn, zero, xs) => {\r\n if (!xs || !length(xs)) {\r\n return [];\r\n }\r\n const limit = length(xs);\r\n let ind = 0,\r\n result = zero,\r\n out = [];\r\n while (ind < limit) {\r\n result = fn(result, xs[ind], ind, xs);\r\n out.push(result);\r\n ind++;\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * `scanl1` is a variant of `scanl` that has no starting value argument:\r\n * `shallowCompare(scanl1(fn, [x1, x2, ...]), [x1, fn(x1, x2), ...]) // true`\r\n * @function module:list.scanl1\r\n * @param fn {Function}\r\n * @param xs {Array}\r\n * @returns {Array|*}\r\n */\r\n scanl1 = curry((fn, xs) => {\r\n if (!xs || !xs.length) {\r\n return [];\r\n }\r\n return scanl(fn, head(xs), tail(xs));\r\n }),\r\n\r\n /**\r\n * Same as `scanl` but from the right (similiar to `foldr`'s relationship to 'foldl').\r\n * Note also `scanr`'s relationship ot `foldr`:\r\n * `head (scanr(fn, z, xs)) === foldr(fn, z, xs).\r\n * @function module:list.scanr\r\n * @param fn {Function}\r\n * @param zero {*}\r\n * @param xs {Array}\r\n * @returns {Array|*}\r\n */\r\n scanr = curry((fn, zero, xs) => {\r\n if (!xs || !length(xs)) {\r\n return [];\r\n }\r\n const limit = length(xs);\r\n let ind = limit - 1,\r\n result = xs[0],\r\n out = [];\r\n while (ind > -1) {\r\n result = fn(result, xs[ind], ind, xs);\r\n out.push(result);\r\n ind--;\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Same as `scanr` but takes no zero/accumulator value.\r\n * @function module:list.scanr1\r\n * @param fn {Function}\r\n * @param xs {Array}\r\n * @returns {Array|*}\r\n */\r\n scanr1 = curry((fn, xs) => {\r\n if (!xs || !xs.length) {\r\n return [];\r\n }\r\n return scanr(fn, last(xs), init(xs));\r\n }),\r\n\r\n /**\r\n * The nub function removes duplicate elements from a list.\r\n * In particular, it keeps only the first occurrence of each element.\r\n * (The name nub means `essence'.) It is a special case of nubBy, which\r\n * allows the programmer to supply their own equality test.\r\n * ```shallowCompare( nub ([1,2,3,4,3,2,1,2,4,3,5]), [1,2,3,4,5] )```\r\n * @function module:list.nub\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n nub = list => nubBy((a, b) => a === b, list),\r\n\r\n /**\r\n * `remove(x, xs)` removes the first occurrence of `x` from `xs`.\r\n * For example, `remove('a', 'banana') === 'bnana';`\r\n * @function module:list.remove\r\n * @param x {*}\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n remove = curry((x, list) => removeBy((a, b) => a === b, x, list)),\r\n\r\n /**\r\n * The sort function implements a stable sorting algorithm.\r\n * It is a special case of sortBy, which allows the programmer\r\n * to supply their own comparison function.\r\n * ```shallowCompare(sort ([1,6,4,3,2,5]), [1,2,3,4,5,6]) // true```\r\n * @function module:list.sort\r\n * @param xs {Array|String|*}\r\n * @returns {Array}\r\n */\r\n sort = xs => sortBy(genericAscOrdering, xs),\r\n\r\n /**\r\n * Sort a list by comparing the results of a key function applied to each\r\n * element. sortOn f is equivalent to sortBy (comparing f), but has the\r\n * performance advantage of only evaluating f once for each element in the\r\n * input list. This is called the decorate-sort-undecorate paradigm, or\r\n * Schwartzian transform.\r\n *\r\n * Elements are arranged from from lowest to highest, keeping duplicates\r\n * in the order they appeared in the input.\r\n *\r\n * Ex:\r\n * ```\r\n * shallowEquals(\r\n * sortOn (head, [[2, \"world\"], [4, \"!\"], [1, \"Hello\"]]),\r\n * [[1,\"Hello\"],[2,\"world\"],[4,\"!\"]]\r\n * ) // true\r\n * ```\r\n * @function module:list.sortOn\r\n * @param valueFn {Function}\r\n * @param xs {Array|String|*}\r\n * @returns {Array}\r\n */\r\n sortOn = curry((valueFn, xs) =>\r\n\r\n // Un-decorate\r\n map(decorated => decorated[1],\r\n\r\n // Decorate and sort\r\n sortBy(\r\n // Ordering\r\n ([a0], [b0]) => genericAscOrdering(a0, b0),\r\n\r\n // Decorate\r\n map(item => [valueFn(item), item], xs)\r\n )\r\n )\r\n ),\r\n\r\n /**\r\n * The sortBy function is the non-overloaded (in haskell terms) version of sort.\r\n * @haskellExample ```\r\n * >>> sortBy (\\(a,_) (b,_) -> compare a b) [(2, \"world\"), (4, \"!\"), (1, \"Hello\")]\r\n * [(1,\"Hello\"),(2,\"world\"),(4,\"!\")]\r\n * ```\r\n * @function module:list.sortBy\r\n * @param orderingFn {Function}\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n sortBy = curry((orderingFn, xs) => sliceCopy(xs).sort(orderingFn || genericAscOrdering)),\r\n\r\n /**\r\n * The insert function takes an element and a list and inserts the element\r\n * into the list at the first position where it is less than or equal to the\r\n * next element. In particular, if the list is sorted before the call, the\r\n * result will also be sorted. It is a special case of insertBy, which allows\r\n * the programmer to supply their own comparison function.\r\n * @function module:list.insert\r\n * @param x {*}\r\n * @param xs {Array|*}\r\n * @returns {Array}\r\n */\r\n insert = curry((x, xs) => {\r\n if (!xs.length) {\r\n return of(xs, x);\r\n }\r\n const foundIndex = findIndex(item => x <= item, xs);\r\n return foundIndex === -1 ? concat([xs, of(xs, x)]) :\r\n concat(intersperse(of(xs, x), splitAt(foundIndex, xs)));\r\n }),\r\n\r\n /**\r\n * A version of `insert` that allows you to specify the ordering of the inserted\r\n * item; Before/at, or after\r\n * @function module:list.insertBy\r\n * @haskellType `insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]`\r\n * @note `Ordering` means 'something that is order-able'\r\n * operated on by this functions logic.\r\n * @param orderingFn {Function} - A function that returns `-1`, `0`, or 1`.\r\n * @param x {*} - Value to insert.\r\n * @param xs {Array} - List to insert into (note new list is returned)\r\n * @returns {Array} - New list.\r\n */\r\n insertBy = curry((orderingFn, x, xs) => {\r\n const limit = length(xs);\r\n if (!limit) {\r\n return [x];\r\n }\r\n let ind = 0;\r\n for (; ind < limit; ind += 1) {\r\n if (orderingFn(x, xs[ind]) <= 0) {\r\n const parts = splitAt(ind, xs);\r\n return concat([parts[0], [x], parts[1]]);\r\n }\r\n }\r\n return aggregateArray(sliceCopy(xs), x);\r\n }),\r\n\r\n /**\r\n * The nubBy function behaves just like nub, except it uses a user-supplied equality predicate.\r\n * @function module:list.nubBy\r\n * @param pred {Function}\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n nubBy = curry((pred, list) => {\r\n if (!length(list)) {\r\n return [];\r\n }\r\n const limit = length(list);\r\n let ind = 0,\r\n currItem,\r\n out = [],\r\n anyOp = storedItem => pred(currItem, storedItem);\r\n for (; ind < limit; ind += 1) {\r\n currItem = list[ind];\r\n if (any(anyOp, out)) {\r\n continue;\r\n }\r\n out.push(currItem);\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Behaves the same as `remove`, but takes a user-supplied equality predicate.\r\n * @function module:list.removeBy\r\n * @param pred {Function} - Equality predicate `(a, b) => bool`\r\n * @param x {*}\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n removeBy = curry((pred, x, list) => {\r\n const foundIndex = findIndex(item => pred(x, item), list);\r\n if (foundIndex > -1) {\r\n const parts = splitAt(foundIndex, list);\r\n return append(parts[0], tail(parts[1]));\r\n }\r\n return sliceCopy(list);\r\n }),\r\n\r\n /**\r\n * The `removeFirstsBy` function takes a predicate and two lists and returns the first list with the first\r\n * occurrence of each element of the second list removed.\r\n * @function module:list.removeFirstBy\r\n * @param pred {Function}\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {Array}\r\n */\r\n removeFirstsBy = curry((pred, xs1, xs2) =>\r\n foldl((agg, x) => removeBy(pred, x, agg), xs1, xs2)),\r\n\r\n /**\r\n * Returns the union on elements matching boolean check passed in.\r\n * @function module:list.unionBy\r\n * @param pred {Function} - `pred :: a -> a -> Bool`\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @returns {Array}\r\n */\r\n unionBy = curry((pred, arr1, arr2) =>\r\n foldl((agg, b) => {\r\n const alreadyAdded = any(a => pred(a, b), agg);\r\n return !alreadyAdded ? (agg.push(b), agg) : agg;\r\n }, sliceCopy(arr1), arr2\r\n )),\r\n\r\n /**\r\n * Creates a union on matching elements from array1.\r\n * @function module:list.union\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @returns {Array}\r\n */\r\n union = curry((arr1, arr2) =>\r\n append(arr1,\r\n filter(elm => !includes(elm, arr1), arr2))),\r\n\r\n /**\r\n * Performs an intersection on list 1 with elements from list 2.\r\n * @function module:list.intersect\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @returns {Array}\r\n */\r\n intersect = curry((arr1, arr2) =>\r\n !arr1 || !arr2 || (!arr1 && !arr2) ? [] :\r\n filter(elm => includes(elm, arr2), arr1)),\r\n\r\n /**\r\n * Returns an intersection by predicate.\r\n * @function module:list.intersectBy\r\n * @param pred {Function} - `pred :: a -> b -> Bool`\r\n * @param list1 {Array}\r\n * @param list2 {Array}\r\n * @return {Array}\r\n */\r\n intersectBy = curry((pred, list1, list2) =>\r\n foldl((agg, a) =>\r\n any(b => pred(a, b), list2) ? (agg.push(a), agg) : agg\r\n , [], list1)),\r\n\r\n /**\r\n * Returns the difference of list 1 from list 2.\r\n * @note The `difference` operation here is non-associative; E.g., `a - b` is not equal to `b - a`;\r\n * @function module:list.difference\r\n * @param array1 {Array}\r\n * @param array2 {Array}\r\n * @returns {Array}\r\n */\r\n difference = curry((array1, array2) => { // augment this with max length and min length ordering on op\r\n if (array1 && !array2) {\r\n return sliceCopy(array1);\r\n }\r\n else if (!array1 && array2 || (!array1 && !array2)) {\r\n return [];\r\n }\r\n return reduce((agg, elm) =>\r\n !includes(elm, array2) ? (agg.push(elm), agg) : agg\r\n , [], array1);\r\n }),\r\n\r\n /**\r\n * Returns the complement of list 0 and the reset of the passed in arrays.\r\n * @function module:list.complement\r\n * @param arr0 {Array}\r\n * @param arrays {...Array}\r\n * @returns {Array}\r\n */\r\n complement = curry2((arr0, ...arrays) =>\r\n reduce((agg, arr) => append(agg, difference(arr, arr0)), [], arrays));\r\n","/**\r\n * @module errorThrowing\r\n * @description Contains error throwing facilities for when a value doesn't match a type.\r\n */\r\nimport {typeOf} from './object/typeOf';\r\nimport {isArray, toTypeRef, toTypeRefName, isOfType} from './object/is';\r\nimport {curry} from './function/curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Pretty prints an array of types/type-strings for use by error messages;\r\n * Outputs \"`SomeTypeName`, ...\" from [SomeType, 'SomeTypeName', etc...]\r\n * @function module:errorThrowing.typeRefsToStringOrError\r\n * @param types {Array|TypesArray}\r\n * @return {String}\r\n * @private\r\n */\r\n typeRefsToStringOrError = types => types.length ?\r\n types.map(type => `\\`${toTypeRefName(type)}\\``).join(', ') : '',\r\n\r\n /**\r\n * Prints a message from an object. Object signature:\r\n * {contextName, valueName, value, expectedTypeName, foundTypeName, messageSuffix}\r\n * @function module:errorThrowing.defaultErrorMessageCall\r\n * @param tmplContext {Object|TemplateContext} - Object to use in error template.\r\n * @returns {string}\r\n * @private\r\n */\r\n defaultErrorMessageCall = tmplContext => {\r\n const {\r\n contextName, valueName, value, expectedTypeName,\r\n foundTypeName, messageSuffix\r\n } = tmplContext,\r\n isMultiTypeNames = isArray(expectedTypeName),\r\n typesCopy = isMultiTypeNames ? 'of type' : 'of one of the types',\r\n typesToMatchCopy = isMultiTypeNames ? typeRefsToStringOrError(expectedTypeName) : expectedTypeName;\r\n return (contextName ? `\\`${contextName}.` : '`') +\r\n `${valueName}\\` is not ${typesCopy}: ${typesToMatchCopy}. ` +\r\n `Type received: ${foundTypeName}. Value: ${value};` +\r\n `${messageSuffix ? ' ' + messageSuffix + ';' : ''}`;\r\n },\r\n\r\n /**\r\n * Gets the error message thrower seeded with passed in errorMessage template call.\r\n * @function module:errorThrowing.getErrorIfNotTypeThrower$\r\n * @param errorMessageCall {Function|ErrorMessageCall}\r\n * @param typeChecker {Function|TypeChecker} - Function:Boolean\r\n * @returns {Function|ErrorIfNotType}\r\n * @private\r\n */\r\n _getErrorIfNotTypeThrower = (errorMessageCall, typeChecker = isOfType) =>\r\n (ValueType, contextName, valueName, value, messageSuffix = null) => {\r\n const expectedTypeName = toTypeRef(ValueType),\r\n foundTypeName = typeOf(value);\r\n if (typeChecker(ValueType, value)) { return value; } // Value matches type\r\n throw new Error(errorMessageCall(\r\n {contextName, valueName, value, expectedTypeName, foundTypeName, messageSuffix}\r\n ));\r\n },\r\n\r\n /**\r\n * Gets the error message thrower seeded with passed in errorMessage template call.\r\n * @function module:errorThrowing.getErrorIfNotTypesThrower$\r\n * @param errorMessageCall {Function|ErrorMessageCall}\r\n * @param typeChecker {Function|TypeChecker} - Function:Boolean\r\n * @returns {Function|ErrorIfNotTypes}\r\n * @private\r\n */\r\n _getErrorIfNotTypesThrower = (errorMessageCall, typeChecker = isOfType) =>\r\n (valueTypes, contextName, valueName, value, messageSuffix = null) => {\r\n const expectedTypeNames = valueTypes.map(toTypeRef),\r\n matchFound = valueTypes.some(ValueType => typeChecker(ValueType, value)),\r\n foundTypeName = typeOf(value);\r\n if (matchFound) { return value; }\r\n throw new Error(\r\n errorMessageCall({\r\n contextName, valueName, value,\r\n expectedTypeName: expectedTypeNames, foundTypeName,\r\n messageSuffix\r\n })\r\n );\r\n },\r\n\r\n /**\r\n * Checks that passed in `value` is of given `type`. Throws an error if value\r\n * is not of given `type`. This is the un-curried version. For the curried version\r\n * see `module:errorThrowing.errorIfNotType`.\r\n * @function module:errorThrowing.errorIfNotType$\r\n * @param type {String|Function} - Type's name or type itself.\r\n * @param contextName {String} - Name of context to attribute errors if thrown.\r\n * @param valueName {String} - String rep of value.\r\n * @param value {*}\r\n * @param [messageSuffix=null] {String} - Optional.\r\n * @returns {*} - Given `value` if `value` matches passed in type.\r\n * @private\r\n */\r\n _errorIfNotType = _getErrorIfNotTypeThrower(defaultErrorMessageCall),\r\n\r\n /**\r\n * Checks that passed in `value` is of one of the given `types`. Throws an error if value\r\n * is not of one of the given `types`. This is the un-curried version. For the curried version\r\n * see `module:errorThrowing.errorIfNotTypes`.\r\n * @type {Function|module:errorThrowing.errorIfNotTypes}\r\n * @function module:errorThrowing.errorIfNotTypes$\r\n * @param types {Array} - Array of one or more types or type names themselves.\r\n * @param contextName {String} - Name of context to attribute errors if thrown.\r\n * @param valueName {String} - String rep of value.\r\n * @param value {*}\r\n * @returns {*} - Given `value` if `value` matches passed in type.\r\n * @private\r\n */\r\n _errorIfNotTypes = _getErrorIfNotTypesThrower(defaultErrorMessageCall),\r\n\r\n /**\r\n * Returns a function that can be used to ensure that values are of a given type.\r\n * Also throws informative error messages containing the value types, names, expected type names,\r\n * etc.\r\n * @function module:errorThrowing.getErrorIfNotTypeThrower\r\n * @param errorMessageCall {Function|ErrorMessageCall} - Template function (takes an info-object and returns a printed string).\r\n * @returns {Function|ErrorIfNotType} - Returns a function with the same signature as `errorIfNotType` though curried.\r\n */\r\n getErrorIfNotTypeThrower = errorMessageCall => curry(_getErrorIfNotTypeThrower(errorMessageCall)),\r\n\r\n /**\r\n * Returns a function that can be used to ensure that a value is of one or more given types.\r\n * The returned function is used in cases where informative error messages\r\n * containing the value types, names, expected type names, are-required/should-be-used etc.\r\n * @function module:errorThrowing.getErrorIfNotTypesThrower\r\n * @param errorMessageCall {Function|ErrorMessageCall} - Template function (takes an info-object and returns a printed string).\r\n * @returns {Function|ErrorIfNotTypes} - Returns a function with the same signature as `errorIfNotTypes` though curried.\r\n */\r\n getErrorIfNotTypesThrower = errorMessageCall => curry(_getErrorIfNotTypesThrower(errorMessageCall)),\r\n\r\n /**\r\n * Checks that passed in `value` is of given `type`. Throws an error if value\r\n * is not of given `type`. Curried.\r\n * @function module:errorThrowing.errorIfNotType\r\n * @param type {String|Function} - Type's name or type itself.\r\n * @param contextName {String} - Name of context to attribute errors if thrown.\r\n * @param valueName {String} - String rep of value.\r\n * @param value {*}\r\n * @param [messageSuffix=null] {String} - Optional.\r\n * @returns {*} - Given `value` if `value` matches passed in type.\r\n * @curried\r\n */\r\n errorIfNotType = curry(_errorIfNotType),\r\n\r\n /**\r\n * Checks that passed in `value` is of one of the given `types`. Throws an error if value\r\n * is not of one of the given `types`. Curried.\r\n * @function module:errorThrowing.errorIfNotTypes\r\n * @param types {Array} - Array of one or more types or type names themselves.\r\n * @param contextName {String} - Name of context to attribute errors if thrown.\r\n * @param valueName {String} - String rep of value.\r\n * @param value {*}\r\n * @returns {*} - Given `value` if `value` matches passed in type.\r\n * @curried\r\n */\r\n errorIfNotTypes = curry(_errorIfNotTypes)\r\n;\r\n\r\n/**\r\n * @typedef {*} Any - Synonym for 'any value'.\r\n */\r\n\r\n/**\r\n * @typedef {String|Function} TypeRef\r\n * @description Type reference. Type itself or Type's name; E.g., `Type.name`;\r\n */\r\n\r\n/**\r\n * @typedef {Object} TemplateContext\r\n * @description Template context used for error message renderers (functions that take a context obj and return a string).\r\n * @property value {*}\r\n * @property valueName {String}\r\n * @property expectedTypeName {String} - Expected name of constructor of `value`; E.g., usually `SomeConstructor.name`;\r\n * @property foundTypeName {String} - Found types name; E.g., `FoundConstructor.name`;\r\n * @property [messageSuffix=null] {*} - Message suffix (sometimes an extra hint or instructions for\r\n * directing user to fix where his/her error has occurred). Optional.\r\n */\r\n\r\n/**\r\n * @typedef {Array<(String|Function)>} TypesArray\r\n */\r\n\r\n/**\r\n * @typedef {Function} TypeChecker\r\n * @description Checks whether a value is of given type.\r\n * @param Type {TypeRef} - a Type or it's name; E.g., `Type.name`.\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n\r\n/**\r\n * @typedef {Function} ErrorMessageCall\r\n * @description Error message template function.\r\n * @param tmplContext {TemplateContext}\r\n * @returns {String}\r\n */\r\n\r\n/**\r\n * @typedef {Function} ErrorIfNotType\r\n * @description Used to ensure value matches passed in type.\r\n * @param type {TypeRef} - Constructor name or constructor.\r\n * @param contextName {String}\r\n * @param valueName {String}\r\n * @param value {*}\r\n * @throws {Error} - If value doesn't match type.\r\n * @returns {*} - What ever value is.\r\n */\r\n\r\n/**\r\n * @typedef {Function} ErrorIfNotTypes\r\n * @description Used to ensure a value matches one of one or more types passed in.\r\n * @param valueTypes {TypesArray} - Array of constructor names or constructors.\r\n * @param contextName {String}\r\n * @param valueName {String}\r\n * @param value {*}\r\n * @throws {Error} - If value doesn't match type.\r\n * @returns {*} - Whatever value is.\r\n */\r\n","/**\r\n * @module string\r\n * @description Contains functions for strings.\r\n */\r\nimport {intercalate, map, filter} from './list';\r\nimport {split} from './jsPlatform/string';\r\nimport {compose} from './function/compose';\r\nimport {join} from './jsPlatform/array';\r\nimport {_errorIfNotType} from './errorThrowing';\r\n\r\nexport {split};\r\n\r\nexport const\r\n\r\n /**\r\n * Splits a string on all '\\n', '\\r', '\\n\\r', or '\\r\\n' characters.\r\n * @function module:string.lines\r\n * @param str {String}\r\n * @returns {Array}\r\n */\r\n lines = split(/[\\n\\r]/gm),\r\n\r\n /**\r\n * Splits a string on all '\\s' and/or all '\\t' characters.\r\n * @function module:string.words\r\n * @param str{String}\r\n * @returns {Array}\r\n */\r\n words = split(/[\\s\\t]/gm),\r\n\r\n /**\r\n * Intersperse an array of strings with '\\s' and then concats them.\r\n * @function module:string.unwords\r\n * @param arr {String}\r\n * @returns {Array}\r\n */\r\n unwords = intercalate(' '),\r\n\r\n /**\r\n * Intersperses a '\\n' character into a list of strings and then concats it.\r\n * @function module:string.unlines\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n unlines = intercalate('\\n'),\r\n\r\n /**\r\n * Lower cases first character of a non-empty string.\r\n * @function module:string.lcaseFirst\r\n * @param xs {String}\r\n * @returns {string}\r\n * @throws {Error} - Throws error if receiving anything that is not a string.\r\n */\r\n lcaseFirst = xs => {\r\n _errorIfNotType(String, 'lcaseFirst', 'xs', xs);\r\n return xs[0].toLowerCase() + xs.substring(1);\r\n },\r\n\r\n /**\r\n * Upper cases first character of a non-empty string.\r\n * @function module:string.ucaseFirst\r\n * @param xs {String}\r\n * @returns {string}\r\n * @throws {Error} - Throws error if receiving anything that is not a string.\r\n */\r\n ucaseFirst = xs => {\r\n _errorIfNotType(String, 'ucaseFirst', 'xs', xs);\r\n return xs[0].toUpperCase() + xs.substring(1);\r\n },\r\n\r\n /**\r\n * Camel cases (class case) a string.\r\n * @function module:string.camelCase\r\n * @param xs {String}\r\n * @param [pattern=/[^a-z\\d/i]/] {RegExp} - Pattern to split on. Optional.\r\n * @throws {Error} - Throws error if param `xs` is not a string.\r\n * @returns {string}\r\n * @curried\r\n */\r\n camelCase = (xs, pattern = /[^a-z\\d]/i) => compose(\r\n join(''),\r\n map(str => ucaseFirst(str.toLowerCase())),\r\n filter(x => !!x),\r\n split(pattern)\r\n )(_errorIfNotType(String, 'camelCase', 'xs', xs)),\r\n\r\n /**\r\n * Class cases a string. Uses pattern /[^a-z\\d/i]/ to split on.\r\n * If you require a different pattern use `string.camelCase(str, pattern)`\r\n * and then upper case first character (`ucaseFirst`).\r\n * @function module:string.classCase\r\n * @param xs {String}\r\n * @returns {string}\r\n * @throws {Error} - Throws error if `xs` is not a string (via `camelCase` call).\r\n */\r\n classCase = compose(ucaseFirst, camelCase)\r\n\r\n;\r\n\r\n/**\r\n * Functional version of `String.prototype.split`.\r\n * @function module:string.split\r\n * @param separator {String|RegExp}\r\n * @param str {String}\r\n * @returns {Array}\r\n */\r\n","/**\r\n * @module fjl\r\n * @description Exports all module methods (object, list, string modules etc.).\r\n * @goal to include everything from haskell's Prelude where it makes sense in order to create\r\n * a subset of functions which can make the javascript developer more efficient and make his/her\r\n * code more concise (and functional).\r\n * @motivation preludejs, lodash/fp, RamdaJs, Haskell.\r\n * @see http://hackage.haskell.org/package/base-4.10.0.0/docs/Prelude.html\r\n * @see http://hackage.haskell.org/package/base-4.10.0.0/docs/Data-List.html\r\n */\r\nexport * from './object';\r\nexport * from './boolean';\r\nexport * from './function';\r\nexport * from './list';\r\nexport * from './string';\r\nexport * from './utils';\r\nexport * from './errorThrowing';\r\n"],"names":["returnCurried","executeArity","unmetArityNum","fn","argsToCurry","func","x","executeAsCurriedFunc","Array","from","arguments","a","b","c","d","e","args","unmetArity","concatedArgs","concat","canBeCalled","length","newExpectedArity","curryN","Function","Error","curry","curry2","curry3","curry4","curry5","fPureTakesOne","name","arg","f","fPureTakes2","arg1","arg2","fPureTakes3","arg3","fPureTakes4","arg4","fPureTakes5","arg5","fPureTakesOneOrMore","defineReverse","prototype","reverse","reduceRight","agg","item","push","map","filter","reduce","forEach","some","every","join","apply","call","flipN","flip","flip3","flip4","flip5","instanceOf","instanceConstructor","instance","hasOwnProperty","native","Object","getOwnPropertyNames","key","operation","keys","assign","obj0","objs","topAgg","obj","_Number","Number","_NaN","_Null","_Undefined","typeOf","value","retVal","undefined","constructorName","constructor","isNaN","_String","String","_Object","_Boolean","Boolean","_Function","_Array","_Symbol","_Map","_Set","_WeakMap","_WeakSet","toTypeRef","type","toTypeRefs","types","toTypeRefName","Type","ref","toTypeRefNames","isFunction","isType","isOfType","isClass","test","substr","isCallable","isArray","isObject","isBoolean","isNumber","isString","isMap","isSet","isWeakMap","isWeakSet","isUndefined","isNull","isSymbol","isUsableImmutablePrimitive","typeOfX","isset","isEmptyList","isEmptyObject","isEmptyCollection","size","isEmpty","isOneOf","typeName","isFunctor","lookup","of","copy","out","slice","Symbol","Promise","searchObj","nsString","indexOf","parts","split","limit","ind","parent","node","assignDeep","propDescription","getOwnPropertyDescriptor","get","set","writable","includes","xs","lastIndexOf","isTruthy","isFalsy","alwaysTrue","alwaysFalse","equal","equalAll","i","aggregateArray","sliceFrom","startInd","sliceTo","toInd","sliceCopy","genericAscOrdering","lengths","lists","toShortest","listLengths","smallLen","Math","min","list","reduceUntil","pred","op","result","reduceUntilRight","arr","lastIndex","len","findIndexWhere","predicateFulfilled","findIndexWhereRight","findIndicesWhere","findWhere","elm","objUnion","obj1","obj2","objIntersect","objDifference","objComplement","log","console","bind","error","peek","pop","jsonClone","JSON","parse","stringify","toAssocList","toAssocListDeep","TypeConstraint","fromAssocList","OutType","fromAssocListDeep","toArray","compose","arg0","id","negateF","negateF2","negateF3","negateFN","until","predicate","typeInstance","fnOrError","symbolName","noop","normalizeStep","to","step","range","append","listAppend","head","last","tail","init","uncons","unconsr","item0","concatMap","foldableOfA","intersperse","between","lastInd","intercalate","xss","transpose","numLists","ind2","longestListLen","maximum","outLists","outList","subsequences","listLen","pow","entry","j","swapped","ind1","tmp","permutations","repeat","foldl","foldr","foldl1","foldr1","mapAccumL","zero","mapped","tuple","mapAccumR","iterate","lastX","replicate","cycle","unfoldr","resultTuple","findIndex","findIndices","elemIndex","foundInd","elemIndices","take","drop","splitAt","takeWhile","dropWhile","splitPoint","dropWhileEnd","span","breakOnList","at","find","partition","elem","notElem","isPrefixOf","xs1","xs2","limit1","limit2","isSuffixOf","isInfixOf","foundLen","isSubsequenceOf","lenXs1","group","groupBy","equalityOp","prevItem","predOp","inits","tails","stripPrefix","prefix","zip","arr1","arr2","a1","a2","zipN","trimmedLists","zip3","arr3","zip4","arr4","zip5","arr5","zipWith","zipWithN","lenOfTrimmed","zipWith3","xs3","zipWith4","xs4","zipWith5","xs5","unzip","unzipN","lenItem0","any","p","all","and","or","not","sum","product","sortBy","minimum","scanl","scanl1","scanr","scanr1","nub","nubBy","remove","removeBy","sort","sortOn","valueFn","decorated","a0","b0","orderingFn","insert","foundIndex","insertBy","currItem","anyOp","storedItem","removeFirstsBy","unionBy","alreadyAdded","union","intersect","intersectBy","list1","list2","difference","array1","array2","complement","arr0","arrays","typeRefsToStringOrError","defaultErrorMessageCall","tmplContext","contextName","valueName","expectedTypeName","foundTypeName","messageSuffix","isMultiTypeNames","typesCopy","typesToMatchCopy","_getErrorIfNotTypeThrower","errorMessageCall","typeChecker","ValueType","_getErrorIfNotTypesThrower","valueTypes","expectedTypeNames","matchFound","_errorIfNotType","_errorIfNotTypes","getErrorIfNotTypeThrower","getErrorIfNotTypesThrower","errorIfNotType","errorIfNotTypes","lines","words","unwords","unlines","lcaseFirst","toLowerCase","substring","ucaseFirst","toUpperCase","camelCase","pattern","str","classCase"],"mappings":";;;;;;;;;;;;;;;;;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,CAAd;GAAJ,CAFuC,EAG1CzX,QAAM,CAAC,UAAA/C,CAAC;WAAI,CAAC,CAACA,CAAN;GAAF,CAHoC,EAI1CoJ,KAAK,CAACyR,OAAD,CAJqC,CAAP,CAKrChB,eAAe,CAACrU,MAAD,EAAS,WAAT,EAAsB,IAAtB,EAA4BwE,EAA5B,CALsB,CAA/B;CAnET;IAmFH+Q,SAAS,GAAGlN,OAAO,CAAC6M,UAAD,EAAaE,SAAb,CAnFhB;;;;;;;;;ACZP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"fjl.js","sources":["../../src/function/curry.js","../../src/utils.js","../../src/jsPlatform/array.js","../../src/jsPlatform/function.js","../../src/function/flip.js","../../src/jsPlatform/object.js","../../src/object/typeOf.js","../../src/object/is.js","../../src/object/lookup.js","../../src/object/of.js","../../src/object/copy.js","../../src/object/searchObj.js","../../src/object/assignDeep.js","../../src/jsPlatform/list.js","../../src/boolean.js","../../src/list/map.js","../../src/list/aggregation.js","../../src/list/utils.js","../../src/object/setTheory.js","../../src/object/console.js","../../src/object/jsonClone.js","../../src/object/assocList.js","../../src/object/toArray.js","../../src/object.js","../../src/function/compose.js","../../src/function/id.js","../../src/function/negate.js","../../src/function/until.js","../../src/function/fnOrError.js","../../src/function/noop.js","../../src/function.js","../../src/list/range.js","../../src/jsPlatform/string.js","../../src/jsPlatform.js","../../src/list.js","../../src/errorThrowing.js","../../src/string.js","../../src/fjl.js"],"sourcesContent":["/**\r\n * @author elydelacruz\r\n * @created 12/6/2016.\r\n * @memberOf function\r\n * @description \"Curry strict\" and \"curry arbitrarily\" functions (`curry`, `curryN`).\r\n */\r\n\r\n/**\r\n * @private\r\n * @type {string}\r\n */\r\nconst\r\n\r\n /**\r\n * Returns curried function.\r\n * @private\r\n * @param executeArity {Number}\r\n * @param unmetArityNum {Number}\r\n * @param fn {Function}\r\n * @param argsToCurry {...*}\r\n * @returns {Function} - Curried function.\r\n */\r\n returnCurried = (executeArity, unmetArityNum, fn, argsToCurry) => {\r\n switch (unmetArityNum) {\r\n case 1:\r\n /* eslint-disable */\r\n return function func(x) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n case 2:\r\n /* eslint-disable */\r\n return function func(a, b) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n case 3:\r\n /* eslint-disable */\r\n return function func(a, b, c) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n case 4:\r\n /* eslint-disable */\r\n return function func(a, b, c, d) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n case 5:\r\n /* eslint-disable */\r\n return function func(a, b, c, d, e) {\r\n /* eslint-enable */\r\n return executeAsCurriedFunc(fn, executeArity, unmetArityNum, Array.from(arguments), argsToCurry);\r\n };\r\n default:\r\n return (...args) => executeAsCurriedFunc(fn, executeArity, unmetArityNum, args, argsToCurry);\r\n }\r\n },\r\n\r\n /**\r\n * Returns curried function if unmetArity is not met else returns result of executing\r\n * final function.\r\n * @private\r\n * @param fn {Function}\r\n * @param executeArity {Number}\r\n * @param unmetArity {Number}\r\n * @param args {Array<*>}\r\n * @param argsToCurry {Array<*>}\r\n * @returns {Function|*} - Curried function or result of 'finally' executed function.\r\n */\r\n executeAsCurriedFunc = (fn, executeArity, unmetArity, args, argsToCurry) => {\r\n let concatedArgs = argsToCurry.concat(args),\r\n canBeCalled = (concatedArgs.length >= executeArity) || !executeArity,\r\n newExpectedArity = executeArity - concatedArgs.length;\r\n return !canBeCalled ?\r\n returnCurried(executeArity, newExpectedArity, fn, concatedArgs) :\r\n fn(...concatedArgs);\r\n }\r\n;\r\n\r\nexport const\r\n\r\n /**\r\n * Curries a function up to a given arity.\r\n * @function module:function.curryN\r\n * @param executeArity {Number}\r\n * @param fn {Function}\r\n * @param argsToCurry {...*}\r\n * @returns {Function}\r\n * @throws {Error} - When `fn` is not a function.\r\n */\r\n curryN = (executeArity, fn, ...argsToCurry) => {\r\n if (!fn || !(fn instanceof Function)) {\r\n throw new Error(`\\`curry*\\` functions expect first parameter to be of type \\`Function\\` though received ${fn}?`);\r\n }\r\n return returnCurried(executeArity, executeArity - argsToCurry.length, fn, argsToCurry);\r\n },\r\n\r\n /**\r\n * Curries a function based on it's defined arity (note: rest args param (`...rest`) are not counted in arity).\r\n * @function module:function.curry\r\n * @param fn {Function}\r\n * @param argsToCurry {...*}\r\n * @returns {Function}\r\n */\r\n curry = (fn, ...argsToCurry) => curryN((fn || {}).length, fn, ...argsToCurry),\r\n\r\n /**\r\n * Curries a function up to an arity of 2 (won't call function until 2 or more args).\r\n * @function module:function.curry2\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n curry2 = fn => curryN(2, fn),\r\n\r\n /**\r\n * Curries a function up to an arity of 3 (won't call function until 3 or more args).\r\n * @function module:function.curry3\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n curry3 = fn => curryN(3, fn),\r\n\r\n /**\r\n * Curries a function up to an arity of 4 (won't call function until 4 or more args).\r\n * @function module:function.curry4\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n curry4 = fn => curryN(4, fn),\r\n\r\n /**\r\n * Curries a function up to an arity of 5 (won't call function until 5 or more args).\r\n * @function module:function.curry5\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n curry5 = fn => curryN(5, fn);\r\n","/**\r\n * @module utils\r\n */\r\nimport {curry, curry2} from './function/curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns a function that takes an argument and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakesOne\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakesOne = name => curry((arg, f) => f[name](arg)),\r\n\r\n /**\r\n * Returns a function that takes 2 arguments and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakes2\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakes2 = name => curry((arg1, arg2, f) => f[name](arg1, arg2)),\r\n\r\n /**\r\n * Returns a function that takes 3 arguments and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakes3\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakes3 = name => curry((arg1, arg2, arg3, f) => f[name](arg1, arg2, arg3)),\r\n\r\n /**\r\n * Returns a function that takes 4 arguments and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakes4\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakes4 = name => curry((arg1, arg2, arg3, arg4, f) => f[name](arg1, arg2, arg3, arg4)),\r\n\r\n /**\r\n * Returns a function that takes 5 arguments and an object on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakes5\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakes5 = name => curry((arg1, arg2, arg3, arg4, arg5, f) => f[name](arg1, arg2, arg3, arg4, arg5)),\r\n\r\n /**\r\n * Returns a function that takes an object and one or more arguments on which to execute 'method name'\r\n * with said parameters.\r\n * @function module:utils.fPureTakesOneOrMore\r\n * @param name {String}\r\n * @returns {Function}\r\n */\r\n fPureTakesOneOrMore = name => curry2((f, ...args) => f[name](...args))\r\n\r\n;\r\n","/**\r\n * Created by elyde on 7/20/2017.\r\n * Functional versions of common array methods (`map`, `filter`, etc.) (un-curried);\r\n * @module _jsPlatform_arrayOps\r\n * @private\r\n */\r\n\r\nimport {fPureTakesOne, fPureTakes2, fPureTakesOneOrMore} from '../utils';\r\n\r\nexport const\r\n\r\n /**\r\n * Array.prototype.reverse generator (generates a function that calls the prototype version or a\r\n * shimmed version if it doesn't exist).\r\n * @returns {Function}\r\n */\r\n defineReverse = () =>\r\n Array.prototype.reverse ? x => x.reverse() :\r\n x => x.reduceRight((agg, item) => {\r\n agg.push(item);\r\n return agg;\r\n }, []),\r\n\r\n /**\r\n * Maps a function to functor (list etc.).\r\n * @function module:_jsPlatform_array.map\r\n * @param fn {Function}\r\n * @param functor {Array|{map: {Function}}}\r\n * @returns {Array|{map: {Function}}}\r\n */\r\n map = fPureTakesOne('map'),\r\n\r\n /**\r\n * Filters a functor (list etc.) with passed in function.\r\n * @function module:_jsPlatform_array.filter\r\n * @param fn {Function}\r\n * @param functor {Array|{filter: {Function}}}\r\n * @returns {Array|{filter: {Function}}}\r\n */\r\n filter = fPureTakesOne('filter'),\r\n\r\n /**\r\n * Reduces a foldable (list etc.) with passed in function.\r\n * @function module:_jsPlatform_array.reduce\r\n * @param fn {Function}\r\n * @param functor {Array|{reduce: {Function}}}\r\n * @returns {Array|{reduce: {Function}}}\r\n */\r\n reduce = fPureTakes2('reduce'),\r\n\r\n /**\r\n * Reduces a foldable (list etc.) from the right with passed in function.\r\n * @function module:_jsPlatform_array.reduceRight\r\n * @param fn {Function}\r\n * @param functor {Array|{reduceRight: {Function}}}\r\n * @returns {Array|{reduceRight: {Function}}}\r\n */\r\n reduceRight = fPureTakes2('reduceRight'),\r\n\r\n /**\r\n * For each on functor (Array|Object|etc.).\r\n * @param fn {Function}\r\n * @param functor {Array|Object|*}\r\n * @return {*|Array|Object} - The type of object you pass in unless it doesn't have a `forEach` method.\r\n * @throws {Error} - When passed in functor doesn't have a `forEach` method.\r\n */\r\n forEach = fPureTakesOne('forEach'),\r\n\r\n /**\r\n * Returns `true` if `fn` (predicate) returns true for at least one item\r\n * in functor else returns `false`.\r\n * @param fn {Function} - Predicate.\r\n * @param functor {Array|Object|*}\r\n * @return {*|Array|Object} - The type passed.\r\n * @throws {Error} - When passed in object doesn't have a `some` method.\r\n */\r\n some = fPureTakesOne('some'),\r\n\r\n /**\r\n * Returns `true` if `fn` (predicate) returns true for all items in functor else returns `false`.\r\n * @param fn {Function} - Predicate.\r\n * @param functor {Array|Object|*}\r\n * @return {*|Array|Object} - The type passed.\r\n * @throws {Error} - When passed in object doesn't have an `every` method.\r\n */\r\n every = fPureTakesOne('every'),\r\n\r\n /**\r\n * Array.prototype.join\r\n * @function module:listPrelude.join\r\n * @param separator {String|RegExp}\r\n * @param arr {Array}\r\n * @returns {String}\r\n */\r\n join = fPureTakesOne('join'),\r\n\r\n /**\r\n * Same as Array.prototype.push\r\n * @param item {*}\r\n * @param arr {Array}\r\n * @returns {Number}\r\n */\r\n push = fPureTakesOneOrMore('push'),\r\n\r\n /**\r\n * Reverses an list (shimmed if not exists).\r\n * @function module:listPrelude.reverse\r\n * @return {Array}\r\n */\r\n reverse = defineReverse();\r\n","import {curry, curry2} from '../function/curry';\r\n\r\n/**\r\n * Created by elydelacruz on 9/7/2017.\r\n * @memberOf function\r\n */\r\nexport const\r\n\r\n /**\r\n * Functional `apply` function (takes no context).\r\n * @function module:function.apply\r\n * @param fn {Function}\r\n * @param args {Array|*}\r\n * @returns {*}\r\n */\r\n apply = curry((fn, args) => fn.apply(null, args)),\r\n\r\n /**\r\n * Functional `call` function (takes no context).\r\n * @function module:function.call\r\n * @param fn {Function}\r\n * @param args {...*}\r\n * @returns {*}\r\n */\r\n call = curry2((fn, ...args) => fn.call(null, ...args));\r\n","import {reverse} from '../jsPlatform/array';\r\nimport {apply, call} from '../jsPlatform/function';\r\nimport {curry, curry2} from './curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns a curried function requiring given functions arguments in reverse\r\n * (returned function expects 2 or more variables (curried at 2 or more args)).\r\n * @function module:function.flipN\r\n * @param fn {Function}\r\n * @returns {Function}\r\n * @curried\r\n */\r\n flipN = fn => curry2((...args) => apply(fn, reverse(args))),\r\n\r\n /**\r\n * Flips a function's first and second arguments and and returns a new function requiring said arguments in reverse.\r\n * @function module:function.flip\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n flip = fn => curry((b, a) => call(fn, a, b)),\r\n\r\n /**\r\n * Same as `flip` except returns a flipped function of arity 3.\r\n * @function module:function.flip3\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n flip3 = fn => curry((c, b, a) => call(fn, a, b, c)),\r\n\r\n /**\r\n * Same as `flip` except returns a flipped function of arity 4.\r\n * @function module:function.flip4\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n flip4 = fn => curry((d, c, b, a) => call(fn, a, b, c, d)),\r\n\r\n /**\r\n * Same as `flip` except returns a flipped function of arity 5.\r\n * @function module:function.flip5\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n flip5 = fn => curry((e, d, c, b, a) => call(fn, a, b, c, d, e));\r\n","/**\r\n * @memberOf object\r\n * @description Defines some of the platform methods for objects (the ones used within `fjl`).\r\n */\r\n\r\nimport {fPureTakesOne} from '../utils';\r\nimport {curry, curry2} from '../function/curry';\r\nimport {flip, flip3, flip4, flip5} from '../function/flip';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns whether constructor has derived object.\r\n * @function module:object.instanceOf\r\n * @param instanceConstructor {Function} - Constructor.\r\n * @param instance {*}\r\n * @instance {*}\r\n * @returns {Boolean}\r\n */\r\n instanceOf = curry((instanceConstructor, instance) =>\r\n instance instanceof instanceConstructor),\r\n\r\n /**\r\n * @function module:object.hasOwnProperty\r\n * @param propName {*}\r\n * @param typeInstance {*}\r\n * @returns {Boolean}\r\n * @deprecated - Use property directly instead.\r\n */\r\n hasOwnProperty = fPureTakesOne('hasOwnProperty'),\r\n\r\n /**\r\n * @function module:object.length\r\n * @param x {*}\r\n * @returns {Number}\r\n * @throws {Error} - Throws an error if value doesn't have a `length` property (\r\n * `null`, `undefined`, {Boolean}, Symbol, et. al.).\r\n */\r\n length = x => x.length,\r\n\r\n /**\r\n * Contains all the static functions from `Object` but curried and flipped;\r\n * @example\r\n * // E.g., `Object.defineProperties(obj, descriptor)` can now be used like\r\n * import {defineProperties} from 'fjl'\r\n * defineProperties(descriptor, someObj),\r\n * // Et. al.\r\n * @memberOf module:object\r\n * @type {{...Object}}\r\n */\r\n native = Object.getOwnPropertyNames(Object).reduce((agg, key) => {\r\n if (typeof Object[key] !== 'function') {\r\n return agg;\r\n }\r\n const operation = Object[key];\r\n switch (operation.length) {\r\n case 2:\r\n agg[key] = flip(operation);\r\n break;\r\n case 3:\r\n agg[key] = flip3(operation);\r\n break;\r\n case 4:\r\n agg[key] = flip4(operation);\r\n break;\r\n case 5:\r\n agg[key] = flip5(operation);\r\n break;\r\n default:\r\n agg[key] = Object[key];\r\n break;\r\n }\r\n return agg;\r\n }, {}),\r\n\r\n /**\r\n * Gets passed in object's own enumerable keys (same as `Object.keys`).\r\n * @function module:object.keys\r\n * @param obj {*}\r\n * @returns {Array}\r\n */\r\n {keys} = native,\r\n\r\n /**\r\n * Defined as `Object.assign` else is the same thing but shimmed.\r\n * @function module:object.assign\r\n * @param obj0 {Object}\r\n * @param objs {...{Object}}\r\n * @returns {Object}\r\n */\r\n assign = (() => Object.assign ?\r\n (obj0, ...objs) => Object.assign(obj0, ...objs) :\r\n curry2((obj0, ...objs) => objs.reduce((topAgg, obj) => {\r\n return Object.keys(obj).reduce((agg, key) => {\r\n agg[key] = obj[key];\r\n return agg;\r\n }, topAgg);\r\n }, obj0))\r\n )();\r\n","/**\r\n * Created by elyde on 12/18/2016.\r\n * @memberOf object\r\n */\r\nconst _Number = Number.name,\r\n _NaN = 'NaN',\r\n _Null = 'Null',\r\n _Undefined = 'Undefined';\r\n\r\n/**\r\n * Returns the constructor/class/type name of a value.\r\n * @note Returns 'NaN' if value is of type `Number` and value is `isNaN`.\r\n * @note Returns 'Undefined' if value is `undefined`\r\n * @note Returns 'Null' if value is `null`\r\n * For values that have no concrete constructors and/or casters\r\n * (null, NaN, and undefined) we returned normalized names for them ('Null', 'NaN', 'Number')\r\n * @function module:object.typeOf\r\n * @param value {*}\r\n * @returns {string} - Constructor's name or derived name (in the case of `null`, `undefined`, or `NaN` (whose\r\n * normalized names are 'Null', 'Undefined', 'NaN' respectively).\r\n */\r\nexport function typeOf (value) {\r\n let retVal;\r\n if (value === undefined) {\r\n retVal = _Undefined;\r\n }\r\n else if (value === null) {\r\n retVal = _Null;\r\n }\r\n else {\r\n let constructorName = (value).constructor.name;\r\n retVal = constructorName === _Number && isNaN(value) ?\r\n _NaN : constructorName;\r\n }\r\n return retVal;\r\n}\r\n","/**\r\n * Created by elyde on 12/18/2016.\r\n * @memberOf object\r\n */\r\n\r\nimport {typeOf} from './typeOf';\r\nimport {instanceOf, length, keys} from '../jsPlatform/object';\r\nimport {curry} from '../function/curry';\r\n\r\nlet _String = String.name,\r\n _Number = Number.name,\r\n _Object = Object.name,\r\n _Boolean = Boolean.name,\r\n _Function = Function.name,\r\n _Array = Array.name,\r\n _Symbol = 'Symbol',\r\n _Map = 'Map',\r\n _Set = 'Set',\r\n _WeakMap = 'WeakMap',\r\n _WeakSet = 'WeakSet',\r\n _Null = 'Null',\r\n _Undefined = 'Undefined',\r\n _NaN = 'NaN';\r\n\r\nexport const\r\n\r\n /**\r\n * Resolves/normalizes a type name from either a string or a constructor.\r\n * @function module:object.toTypeRef\r\n * @param type {Function|String} - String or function representing a type.\r\n * @returns {String}\r\n * @todo write tests for this function.\r\n */\r\n toTypeRef = type => {\r\n if (!type) {\r\n return typeOf(type);\r\n }\r\n else if (type.constructor === String || (type instanceof Function)) {\r\n return type;\r\n }\r\n return typeOf(type);\r\n },\r\n\r\n /**\r\n * Returns an array of type refs from possible type refs (converts null, undefined, NaN, and other values into\r\n * type refs (either constructor name or constructor name based on whether value(s) is a string, a constructor, or not).\r\n * @function module:object.toTypeRefs\r\n * @param types {...(TypeRef|*)}\r\n * @returns {Array}\r\n * @todo Ensure tests are written for this function.\r\n */\r\n toTypeRefs = (...types) => types.map(toTypeRef),\r\n\r\n /**\r\n * Returns possible Type's TypeRef name.\r\n * @function module:object.toTypeRefName\r\n * @param Type {(TypeRef|*)}\r\n * @returns {String}\r\n * @todo Ensure tests are written for this function.\r\n */\r\n toTypeRefName = Type => {\r\n const ref = toTypeRef(Type);\r\n return ref instanceof Function ? ref.name : ref;\r\n },\r\n\r\n /**\r\n * Returns possible Types' TypeRef names.\r\n * @function module:object.toTypeRefNames\r\n * @param types {...(TypeRef|*)}\r\n * @returns {String[]}\r\n * @todo Ensure tests are written for this function.\r\n */\r\n toTypeRefNames = (...types) => types.map(toTypeRefName),\r\n\r\n /**\r\n * Returns whether a value is a function or not.\r\n * @function module:object.isFunction\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isFunction = instanceOf(Function),\r\n\r\n /**\r\n * Strict type checker. Checks if given value is a direct instance of given type; E.g.,\r\n * @example\r\n * isType(String, 'abcdefg') === true // true\r\n * isType(String.name, 'abcdefg') === true\r\n * isType(Number, NaN) === false\r\n * isType(Number, 99) === true\r\n * isType('Null', 99) === false // though, for `null` and `undefined` checks\r\n * // @see `isset`, in this module, instead\r\n * isType('Undefined', undefined) === true // true\r\n *\r\n * @note Useful where absolute types, or some semblance thereof, are required.\r\n * @function module:object.isType\r\n * @param type {Function|ObjectConstructor|String} - Constructor or constructor name\r\n * @param obj {*}\r\n * @return {Boolean}\r\n */\r\n isType = curry((type, obj) => typeOf(obj) === toTypeRefName(type)),\r\n\r\n /**\r\n * Loose type checker; E.g., If `type` is not a constructor, but a constructor name, does a type check on\r\n * constructor names, else if first check fails and `type` is a constructor, performs an `instanceof` check\r\n * on value with constructor.\r\n * @note Use care when checking for `Array` and/or `Object` since the both are considered objects by `instanceof` checker.\r\n * @note For `null` and `undefined` their class cased names can be used for type checks\r\n * `isOfType('Null', null) === true (passes strict type check)` (or better yet `isset` can be used).\r\n * @throwsafe - Doesn't throw on `null` or `undefined` `obj` values.\r\n * @example\r\n * isOfType(Number, 99) === true // true (passes strict type check (numbers are not instances of `Number`\r\n * // constructor)\r\n * isOfType('Number', 99) === true // true (passes strict type check)\r\n * isOfType(Number, NaN) === true // true. (passes instance of check)\r\n * // If you want \"true\" strict type checking use `isType`\r\n * isOfType(Object, []) === true // true (passes instance of check)\r\n * isOfType(Array, []) === true // true (passes instance of check)\r\n * isOfType(Object, {}) === true // true (passes instance of check)\r\n * isOfType(Object.name, {}) === true // true (Passes strict type check)\r\n * class Abc extends String {}\r\n * isOfType(String, new Abc('abcd')) // true (passes instanceof check)\r\n *\r\n * @function module:object.isOfType\r\n * @param type {Function|String} - Type reference (constructor or `constructor.name`).\r\n * @param x {*} - Value to check.\r\n * @returns {Boolean}\r\n */\r\n isOfType = curry((type, x) => isType(type, x) || instanceOf(type, x)),\r\n\r\n /**\r\n * Checks if `value` is an es2015 `class`.\r\n * @function module:object.isClass\r\n * @param x {*}\r\n * @returns {boolean}\r\n */\r\n isClass = x => x && /^\\s{0,3}class\\s{1,3}/.test((x + '').substr(0, 10)),\r\n\r\n /**\r\n * Returns a boolean depicting whether a value is callable or not.\r\n * @function module:object.isCallable\r\n * @tentative\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isCallable = x => isFunction(x) && !isClass(x),\r\n\r\n /**\r\n * Checks if value is an array (same as `Array.isArray`).\r\n * @function module:object.isArray\r\n * @param value {*}\r\n * @returns {boolean}\r\n */\r\n {isArray} = Array,\r\n\r\n /**\r\n * Checks whether value is an object or not.\r\n * @function module:object.isObject\r\n * @param value\r\n * @returns {Boolean}\r\n */\r\n isObject = isType(_Object),\r\n\r\n /**\r\n * Checks if value is a boolean.\r\n * @function module:object.isBoolean\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isBoolean = isType(_Boolean),\r\n\r\n /**\r\n * Checks if value is a valid number (also checks if isNaN so that you don't have to).\r\n * @function module:object.isNumber\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isNumber = isType(_Number),\r\n\r\n /**\r\n * Checks whether value is a string or not.\r\n * @function module:object.isString\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isString = isType(_String),\r\n\r\n /**\r\n * Checks whether value is of `Map` or not.\r\n * @function module:object.isMap\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isMap = isType(_Map),\r\n\r\n /**\r\n * Checks whether value is of `Set` or not.\r\n * @function module:object.isSet\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isSet = isType(_Set),\r\n\r\n /**\r\n * Checks whether value is of `WeakMap` or not.\r\n * @function module:object.isWeakMap\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isWeakMap =isType(_WeakMap),\r\n\r\n /**\r\n * Checks whether value is of `WeakSet` or not.\r\n * @function module:object.isWeakSet\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isWeakSet = isType(_WeakSet),\r\n\r\n /**\r\n * Checks if value is undefined.\r\n * @function module:object.isUndefined\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isUndefined = isType(_Undefined),\r\n\r\n /**\r\n * Checks if value is null.\r\n * @function module:object.isNull\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isNull = isType(_Null),\r\n\r\n /**\r\n * Checks if value is a `Symbol`.\r\n * @function module:object.isSymbol\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n isSymbol = isType(_Symbol),\r\n\r\n /**\r\n * Checks if given `x` is set and of one of\r\n * [String, Boolean, Number, Symbol] (null and undefined are immutable\r\n * but are not \"usable\" (usually not what we want to operate on).\r\n * @function module:object.isUsableImmutablePrimitive\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isUsableImmutablePrimitive = x => {\r\n const typeOfX = typeOf(x);\r\n return isset(x) &&\r\n [_String, _Number, _Boolean, _Symbol]\r\n .some(Type => Type === typeOfX);\r\n },\r\n\r\n /**\r\n * Checks if !length.\r\n * @function module:object.isEmptyList\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isEmptyList = x => !length(x),\r\n\r\n /**\r\n * Checks if object has own properties/enumerable-props or not.\r\n * @function module:object.isEmptyObject\r\n * @param obj {*}\r\n * @returns {Boolean}\r\n */\r\n isEmptyObject = obj => isEmptyList(keys(obj)),\r\n\r\n /**\r\n * Checks if collection is empty or not (Map, WeakMap, WeakSet, Set etc.).\r\n * @function module:object.isEmptyCollection\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isEmptyCollection = x => x.size === 0,\r\n\r\n /**\r\n * Checks to see if passed in value is empty; I.e.,\r\n * check for one of '', 0, `null`, `undefined`, `false`, empty array, empty object, empty function (zero arity),\r\n * or empty collection (es6 Map, Set, WeakMap, or WeakSet etc. (`!value.size`);\r\n * @function module:object.isEmpty\r\n * @param value {*} - Value to check.\r\n * @returns {Boolean}\r\n */\r\n isEmpty = value => {\r\n if (!value) { // if '', 0, `null`, `undefined`, or `false` then is empty\r\n return true;\r\n }\r\n switch (typeOf(value)) {\r\n case _Array:\r\n case _Function:\r\n return !value.length;\r\n case _Number: // zero and NaN checks happened above so `if number` then it's 'not-an-empty-number' (lol)\r\n return false;\r\n case _Object:\r\n return !keys(value).length;\r\n case _Map:\r\n case _Set:\r\n case _WeakSet:\r\n case _WeakMap:\r\n return !value.size;\r\n case _NaN:\r\n return true;\r\n default:\r\n return !value;\r\n }\r\n },\r\n\r\n /**\r\n * Returns whether passed in values is defined and not null or not.\r\n * @function module:object.isset\r\n * @param x {*}\r\n * @returns {Boolean}\r\n */\r\n isset = x => x !== null && x !== undefined,\r\n\r\n /**\r\n * Checks to see if `x` is of one of the given type refs.\r\n * @function object.isOneOf\r\n * @param x {*}\r\n * @param types {...(TypeRef|*)}\r\n * @returns {boolean}\r\n * @todo write tests for this function.\r\n */\r\n isOneOf = (x, ...types) => {\r\n const typeName = typeOf(x);\r\n return toTypeRefNames(types).some(name => typeName === name);\r\n },\r\n\r\n isFunctor = x => x && x.map && instanceOf(Function, x.map)\r\n\r\n;\r\n","/**\r\n * @memberOf object\r\n */\r\n\r\nimport {isset} from './is';\r\nimport {curry} from '../function/curry';\r\n\r\n/**\r\n * Looks up property and returns it's value; Else `undefined`.\r\n * Method is null safe (will not throw on `null` or `undefined`).\r\n * @function module:object.lookup\r\n * @param key {String} - Key to search on `obj`\r\n * @param obj {Object} - Object to search `name` on.\r\n * @returns {*}\r\n */\r\nexport const lookup = curry((key, obj) => isset(obj) ? obj[key] : undefined);\r\n","import {isFunction, isset, isUsableImmutablePrimitive} from './is';\r\nimport {apply} from '../jsPlatform/function';\r\n\r\n/**\r\n * Creates a value `of` given type; Checks for one of the following construction strategies (in order listed):\r\n * @example\r\n * // - If exists `(value).constructor.of` uses this.\r\n * // - If value is of one String, Boolean, Symbol, or Number types calls it's\r\n * // constructor as a function (in cast form; E.g., `constructor(...args)` )\r\n * // - Else if constructor is a function, thus far, then calls constructor using\r\n * // the `new` keyword (with any passed in args).\r\n\r\n * @function module:object.of\r\n * @param x {*} - Value to derive returned value's type from.\r\n * @param [args] {...*} - Any args to pass in to matched construction strategy.\r\n * @returns {*|undefined} - New value of given value's type else `undefined`.\r\n */\r\nexport const of = (x, ...args) => {\r\n if (!isset(x)) { return undefined; }\r\n const constructor = x.constructor;\r\n if (constructor.hasOwnProperty('of')) {\r\n return apply(constructor.of, args);\r\n }\r\n else if (isUsableImmutablePrimitive(x)) {\r\n return apply(constructor, args);\r\n }\r\n else if (isFunction(constructor)) {\r\n return new constructor(...args);\r\n }\r\n return undefined;\r\n};\r\n","import {typeOf} from './typeOf';\r\nimport {of} from './of';\r\n\r\nexport const\r\n\r\n /**\r\n * Make a copy of a value or optionally copy incoming value onto an outgoing value (second parameter).\r\n * @note If incoming thing is an immmutable primitive (string, number, symbol, null, undefined, boolean)\r\n * it is returned as is.\r\n * @function module:object.copy\r\n * @param x {*} - Thing to copy.\r\n * @param [out = undefined] {*} - Optional value to copy on to. Not required.\r\n * @returns {*} - Copied thing or optionally outgoing value copied onto.\r\n */\r\n copy = (x, out) => {\r\n // if `null`, `undefined`, `''`, `0`, `false` return\r\n if (!x) { return x; }\r\n switch (typeOf(x)) {\r\n case Array.name:\r\n return !out ? x.slice(0) : Object.assign(out, x);\r\n\r\n // If immutable primitive, return it\r\n case Symbol.name:\r\n case Boolean.name:\r\n case String.name:\r\n case Number.name:\r\n case Promise.name:\r\n case Function.name:\r\n case 'NaN':\r\n case 'Null':\r\n case 'Undefined':\r\n return x;\r\n\r\n case 'Map':\r\n case 'Set':\r\n case 'WeakMap':\r\n case 'WeakSet':\r\n return new x.constructor(Array.from(x));\r\n\r\n // Else make copy\r\n default:\r\n return Object.assign(!out ? of(x) : out, x);\r\n }\r\n }\r\n;\r\n\r\nexport default copy;\r\n","import {isset} from './is';\r\nimport {curry} from '../function/curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Gives you value at key/namespace-key within `obj`; E.g.,\r\n * searchObj('all.your.base', {all: {your: {base: 99}}}) === 99 // `true`\r\n * @note If key is unreachable (undefined) returns `undefined`.\r\n * Useful in cases where we do not want to check each key along the way before getting/checking value; E.g.,\r\n * @example\r\n * ```\r\n * if (obj && obj.all && obj.all.your && obj.all.your.base) {\r\n * // Thing we want to do\r\n * }\r\n *\r\n * // So with our function becomes\r\n * if (searchObj('all.your.base', obj)) {\r\n * // Thing we want to do\r\n * }\r\n * ```\r\n * @function module:object.searchObj\r\n * @param nsString {String}\r\n * @param obj {*}\r\n * @returns {*}\r\n */\r\n searchObj = curry((nsString, obj) => {\r\n if (!obj) { return obj; }\r\n if (nsString.indexOf('.') === -1) {\r\n return obj[nsString];\r\n }\r\n const parts = nsString.split('.'),\r\n limit = parts.length;\r\n let ind = 0,\r\n parent = obj;\r\n for (; ind < limit; ind += 1) {\r\n const node = parent[parts[ind]];\r\n if (!isset(node)) {\r\n return node;\r\n }\r\n parent = node;\r\n }\r\n return parent;\r\n })\r\n;\r\n","\r\nimport {isObject} from './is';\r\nimport {keys} from '../jsPlatform/object';\r\nimport {curry2} from '../function/curry';\r\n\r\nexport const\r\n /**\r\n * Merges all objects down into one (takes two or more args).\r\n * @function module:object.assignDeep\r\n * @param obj0 {Object}\r\n * @param [objs] {...{Object}} - One or more objects to merge onto `obj0`.\r\n * @returns {Object}\r\n */\r\n assignDeep = curry2((obj0, ...objs) =>\r\n !obj0 ? obj0 : objs.reduce((topAgg, obj) =>\r\n !obj ? topAgg : keys(obj).reduce((agg, key) => {\r\n let propDescription = Object.getOwnPropertyDescriptor(agg, key);\r\n // If property is not writable move to next item in collection\r\n if (agg.hasOwnProperty(key) && propDescription &&\r\n !(propDescription.get && propDescription.set) &&\r\n !propDescription.writable) {\r\n return agg;\r\n }\r\n if (isObject(agg[key]) && isObject(obj[key])) {\r\n assignDeep(agg[key], obj[key]);\r\n }\r\n else { agg[key] = obj[key]; }\r\n return agg;\r\n }, topAgg)\r\n , obj0));\r\n","/**\r\n * List operations that overlap (apart from globally overlapping props and functions like `length`)\r\n * on both strings and arrays.\r\n * @memberOf list\r\n */\r\n\r\nimport {fPureTakesOne, fPureTakes2, fPureTakesOneOrMore} from '../utils';\r\n\r\nexport const\r\n\r\n /**\r\n * Concats/appends all functors onto the end of first functor.\r\n * Note: functors passed in after the first one must be of the same type.\r\n * @function module:list.concat\r\n * @param functor {Array|Object|*}\r\n * @param ...functor {Array|Object|*}\r\n * @return {*|Array|Object} - The type passed.\r\n * @throws {Error} - When passed in object doesn't have an `every` method.\r\n */\r\n concat = fPureTakesOneOrMore('concat'),\r\n\r\n /**\r\n * Same as Array.prototype.slice\r\n * @function module:list.slice\r\n * @param separator {String|RegExp}\r\n * @param arr{Array}\r\n * @returns {Array}\r\n */\r\n slice = fPureTakes2('slice'),\r\n\r\n /**\r\n * `Array.prototype.includes` or shim.\r\n * @function module:list.includes\r\n * @param value {*}\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n includes = (() => 'includes' in Array.prototype ?\r\n fPureTakesOne('includes') :\r\n (value, xs) => xs.indexOf(value) > -1)(),\r\n\r\n /**\r\n * Searches list/list-like for given element `x`.\r\n * @function module:list.indexOf\r\n * @param x {*} - Element to search for.\r\n * @param xs {Array|String|*} - list or list like to look in.\r\n * @returns {Number} - `-1` if element not found else index at which it is found.\r\n */\r\n indexOf = fPureTakesOne('indexOf'),\r\n\r\n /**\r\n * Last index of (`Array.prototype.lastIndexOf`).\r\n * @function module:list.lastIndexOf\r\n * @param x {*} - Element to search for.\r\n * @param xs {Array|String|*} - list or list like to look in.\r\n * @returns {Number} - `-1` if element not found else index at which it is found.\r\n */\r\n lastIndexOf = fPureTakesOne('lastIndexOf')\r\n\r\n;\r\n","/**\r\n * @module boolean\r\n * @description Contains functional version of 'always-true', 'always-false', 'is-truthy', and 'is-falsy'.\r\n */\r\nimport {curry, curry2} from './function/curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns whether `value` is 'truthy' or not\r\n * @function module:boolean.isTruthy\r\n * @param value\r\n * @returns {Boolean}\r\n */\r\n isTruthy = value => !!value,\r\n\r\n /**\r\n * Returns whether `value` is 'falsy' or not\r\n * @function module:boolean.isFalsy\r\n * @param value\r\n * @returns {Boolean}\r\n */\r\n isFalsy = value => !value,\r\n\r\n /**\r\n * Returns `true`.\r\n * @function module:boolean.alwaysTrue\r\n * @returns {Boolean}\r\n */\r\n alwaysTrue = () => true,\r\n\r\n /**\r\n * Returns `false`.\r\n * @function module:boolean.alwaysFalse\r\n * @returns {Boolean}\r\n */\r\n alwaysFalse = () => false,\r\n\r\n /**\r\n * Equality operator.\r\n * @function module:boolean.equal\r\n * @param a {*}\r\n * @param b {*}\r\n * @returns {boolean}\r\n */\r\n equal = curry((a, b) => a === b),\r\n\r\n /**\r\n * Equality operator for all.\r\n * @function module:boolean.equalAll\r\n * @param a {*} - Item `0`.\r\n * @param args {...*} - Others\r\n * @returns {boolean}\r\n */\r\n equalAll = curry2((a, ...args) => args.every(b => equal(a, b)))\r\n\r\n;\r\n","import {length} from '../jsPlatform/object';\r\nimport {curry} from '../function/curry';\r\nimport {typeOf} from '../object/typeOf';\r\nimport {of} from '../object/of';\r\nimport {isFunctor, isset} from '../object/is';\r\n\r\n/**\r\n * Maps a function onto a List (string or array) or a functor (value containing a map method).\r\n * @function module:list.map\r\n * @param fn {Function} - Function to map on given value.\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\nconst map = curry((fn, xs) => {\r\n if (!isset(xs)) { return xs; }\r\n let out = of(xs),\r\n limit,\r\n i = 0;\r\n switch (typeOf(xs)) {\r\n case 'Array':\r\n limit = length(xs);\r\n if (!limit) { return out; }\r\n for (; i < limit; i += 1) {\r\n out.push(fn(xs[i], i, xs));\r\n }\r\n return out;\r\n case 'String':\r\n limit = length(xs);\r\n if (!xs) { return out; }\r\n for (; i < limit; i += 1) {\r\n out += fn(xs[i], i, xs);\r\n }\r\n return out;\r\n default:\r\n if (isFunctor(xs)) { return xs.map(fn); }\r\n\r\n // Other objects\r\n return Object.keys(xs).reduce((agg, key) => {\r\n out[key] = fn(xs[key], key, xs);\r\n return out;\r\n }, out);\r\n }\r\n});\r\n\r\nexport default map;\r\n","\r\nexport const\r\n\r\n /**\r\n * Pushes incoming `item` onto given array and returns said array.\r\n * @private\r\n * @param agg {Array}\r\n * @param item {*}\r\n * @returns {Array}\r\n */\r\n aggregateArray = (agg, item) => {\r\n agg.push(item);\r\n return agg;\r\n }\r\n\r\n;\r\n","/**\r\n * List operator utils module.\r\n * @module listUtils\r\n */\r\nimport {apply} from '../jsPlatform/function'; // un-curried version\r\nimport {slice} from '../jsPlatform/list'; // un-curried version good for both strings and arrays\r\nimport {length} from '../jsPlatform/object';\r\nimport {alwaysFalse} from '../boolean';\r\nimport map from './map';\r\nimport {curry, curry2} from '../function/curry';\r\n\r\nexport * from './aggregation';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns a slice of the given list from `startInd` to the end of the list.\r\n * @function module:listUtils.sliceFrom\r\n * @param startInd {Number}\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n sliceFrom = curry((startInd, xs) => slice(startInd, undefined, xs)),\r\n\r\n /**\r\n * Slices from index `0` to given index.\r\n * @function module:listUtils.sliceTo\r\n * @param toInd {Number}\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n sliceTo = curry((toInd, xs) => slice(0, toInd, xs)),\r\n\r\n /**\r\n * Slices a copy of list.\r\n * @function listUtils.sliceCopy\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n sliceCopy = sliceFrom(0),\r\n\r\n /**\r\n * Generic 'ascending order' ordering function (use by the likes of `list.sort` etc.)\r\n * @function module:listUtils.genericAscOrdering\r\n * @param a {*}\r\n * @param b {*}\r\n * @returns {number}\r\n */\r\n genericAscOrdering = curry((a, b) => {\r\n if (a > b) { return 1; }\r\n else if (a < b) { return -1; }\r\n return 0;\r\n }),\r\n\r\n /**\r\n * Returns length of all passed lists in list.\r\n * @function module:listUtils.lengths\r\n * @param lists ...{Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n lengths = curry2((...lists) => map(length, lists)),\r\n\r\n /**\r\n * Returns a list of lists trimmed to the shortest length in given list of lists. @background This method is used by the `zip*` functions to achieve their\r\n * 'slice to smallest' functionality.\r\n * @function module:listUtils.toShortest\r\n * @param lists {...(Array|String|*)}\r\n * @returns {Array|String|*}\r\n */\r\n toShortest = curry2((...lists) => {\r\n const listLengths = apply(lengths, lists),\r\n smallLen = Math.min.apply(Math, listLengths);\r\n return map((list, ind) => listLengths[ind] > smallLen ?\r\n sliceTo(smallLen, list) : sliceCopy(list), lists);\r\n }),\r\n\r\n /**\r\n * Reduces until predicate.\r\n * @function module:listUtils.reduceUntil\r\n * @param pred {Function} - `(item, index, list) => Boolean(...)`\r\n * @param op {Function} - Operation - `(agg, item, index, list) => agg`\r\n * @param agg {*} - Zero value.\r\n * @param xs {Array|String|*} - List.\r\n * @returns {*}\r\n */\r\n reduceUntil = curry((pred, op, agg, xs) => {\r\n const limit = length(xs);\r\n if (!limit) { return agg; }\r\n let ind = 0,\r\n result = agg;\r\n for (; ind < limit; ind++) {\r\n if (pred(xs[ind], ind, xs)) { break; }\r\n result = op(result, xs[ind], ind, xs);\r\n }\r\n return result;\r\n }),\r\n\r\n /**\r\n * Reduces until predicate (from right to left).\r\n * @function module:listUtils.reduceUntilRight\r\n * @param pred {Function} - `(item, index, list) => Boolean(...)`\r\n * @param op {Function} - Operation - `(agg, item, index, list) => agg`\r\n * @param agg {*} - Zero value.\r\n * @param xs {Array|String|*} - List.\r\n * @returns {*}\r\n */\r\n reduceUntilRight = curry((pred, op, agg, arr) => {\r\n const limit = length(arr);\r\n if (!limit) { return agg; }\r\n let ind = limit - 1,\r\n result = agg;\r\n for (; ind >= 0; ind--) {\r\n if (pred(arr[ind], ind, arr)) { break; }\r\n result = op(result, arr[ind], ind, arr);\r\n }\r\n return result;\r\n }),\r\n\r\n /**\r\n * Reduces a list with given operation (`op`) function.\r\n * @function module:listUtils.reduce\r\n * @param op {Function} - Operation - `(agg, item, index, list) => agg`\r\n * @param agg {*} - Zero value.\r\n * @param xs {Array|String|*} - List.\r\n * @returns {*}\r\n */\r\n reduce = reduceUntil(alwaysFalse),\r\n\r\n /**\r\n * Reduces a list with given operation (`op`) function (from right-to-left).\r\n * @function module:listUtils.reduceRight\r\n * @param op {Function} - Operation - `(agg, item, index, list) => agg`\r\n * @param agg {*} - Zero value.\r\n * @param xs {Array|String|*} - List.\r\n * @returns {*}\r\n */\r\n reduceRight = reduceUntilRight(alwaysFalse),\r\n\r\n /**\r\n * Gets last index of a list/list-like (Array|String|Function etc.).\r\n * @function module:listUtils.lastIndex\r\n * @param x {Array|String|*} - list like or list.\r\n * @returns {Number} - `-1` if no element found.\r\n */\r\n lastIndex = x => { const len = length(x); return len ? len - 1 : 0; },\r\n\r\n /**\r\n * Finds index in string or list.\r\n * @function module:listUtils.findIndexWhere\r\n * @param pred {Function} - Predicate.\r\n * @param arr {Array|String}\r\n * @returns {Number} - `-1` if predicate not matched else `index` found\r\n */\r\n findIndexWhere = curry((pred, arr) => {\r\n let ind = 0;\r\n const limit = length(arr);\r\n for (; ind < limit; ind += 1) {\r\n const predicateFulfilled = !!pred(arr[ind], ind, arr);\r\n if (predicateFulfilled) {\r\n return ind;\r\n }\r\n }\r\n return -1;\r\n }),\r\n\r\n /**\r\n * Finds index in list from right to left.\r\n * @function module:listUtils.findIndexWhereRight\r\n * @param pred {Function} - Predicate.\r\n * @param arr {Array|String}\r\n * @returns {Number} - `-1` if predicate not matched else `index` found\r\n */\r\n findIndexWhereRight = curry((pred, arr) => {\r\n let ind = length(arr) - 1;\r\n for (; ind >= 0; ind -= 1) {\r\n const predicateFulfilled = !!pred(arr[ind], ind, arr);\r\n if (predicateFulfilled) {\r\n return ind;\r\n }\r\n }\r\n return -1;\r\n }),\r\n\r\n /**\r\n * @function module:listUtils.findIndicesWhere\r\n * @param pred {Function}\r\n * @param xs {Array|String|*} - list or list like.\r\n * @returns {Array|undefined}\r\n */\r\n findIndicesWhere = curry((pred, xs) => {\r\n const limit = length(xs);\r\n let ind = 0,\r\n out = [];\r\n for (; ind < limit; ind++) {\r\n if (pred(xs[ind], ind, xs)) { out.push(ind); }\r\n }\r\n return out.length ? out : undefined;\r\n }),\r\n\r\n /**\r\n * @function module:listUtils.findWhere\r\n * @param pred {Function}\r\n * @param xs {Array|String|*} - list or list like.\r\n * @returns {*}\r\n */\r\n findWhere = curry((pred, xs) => {\r\n let ind = 0,\r\n limit = length(xs);\r\n if (!limit) { return; }\r\n for (; ind < limit; ind++) {\r\n let elm = xs[ind];\r\n if (pred(elm, ind, xs)) { return elm; }\r\n }\r\n })\r\n\r\n;\r\n","import {assignDeep} from './assignDeep';\r\nimport {keys} from '../jsPlatform/object';\r\nimport {reduce} from '../list/utils';\r\nimport {curry, curry2} from '../function/curry';\r\n\r\nexport const\r\n\r\n objUnion = curry((obj1, obj2) => assignDeep(obj1, obj2)),\r\n\r\n objIntersect = curry((obj1, obj2) => reduce((agg, key) => {\r\n if (obj2.hasOwnProperty(key)) {\r\n agg[key] = obj2[key];\r\n }\r\n return agg;\r\n }, {}, keys(obj1))),\r\n\r\n objDifference = curry((obj1, obj2) => reduce((agg, key) => {\r\n if (!obj2.hasOwnProperty(key)) {\r\n agg[key] = obj1[key];\r\n }\r\n return agg;\r\n }, {}, keys(obj1))),\r\n\r\n objComplement = curry2((obj0, ...objs) => reduce((agg, obj) =>\r\n assignDeep(agg, objDifference(obj, obj0)), {}, objs));\r\n","/**\r\n * @module console\r\n * @description Console exports.\r\n */\r\nexport const\r\n\r\n /**\r\n * `Console.log` method.\r\n * @function module:console.log\r\n * @params args {...*}\r\n * @returns {void}\r\n */\r\n log = console.log.bind(console),\r\n\r\n /**\r\n * `Console.error` method.\r\n * @function module:console.error\r\n * @params args {...*}\r\n * @returns {void}\r\n */\r\n error = console.error.bind(console),\r\n\r\n /**\r\n * Peeks (console.log) at incoming value(s) and returns the last value.\r\n * @function module:console.peek\r\n * @param args {...*}\r\n * @returns {*} Last given value (if one or more values) else first value.\r\n */\r\n peek = (...args) => (log(...args), args.pop())\r\n\r\n;\r\n","export const\r\n\r\n /**\r\n * Clones and object or array using `JSON.parse(JSON.stringify(...))` pattern.\r\n * @function module:object.jsonClone\r\n * @param x {*}\r\n * @returns {*}\r\n */\r\n jsonClone = x => JSON.parse(JSON.stringify(x))\r\n\r\n;\r\n","import {isArray, isType} from './is';\r\nimport {keys} from '../jsPlatform/object';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns an associated list from given object.\r\n * @note Useful for working with plain javascript objects.\r\n * @function module:object.toAssocList\r\n * @param obj {(Object|Array|*)}\r\n * @returns {Array.<*, *>}\r\n */\r\n toAssocList = obj => keys(obj).map(key => [key, obj[key]]),\r\n\r\n /**\r\n * Returns an associated list from given object (deeply (on incoming object's type)).\r\n * @note Does deep conversion on all values of passed in type's type.\r\n * @function module:object.toAssocListDeep\r\n * @param obj {*}\r\n * @param [TypeConstraint = Object] {(Constructor|Function)} - Type constraint to convert on.\r\n * @returns {*}\r\n */\r\n toAssocListDeep = (obj, TypeConstraint = Object) => keys(obj).map(key =>\r\n TypeConstraint && isType(TypeConstraint, obj[key]) ?\r\n [key, toAssocListDeep(obj[key], TypeConstraint)] :\r\n [key, obj[key]]\r\n ),\r\n\r\n /**\r\n * From associated list to object.\r\n * @function module:object.fromAssocList\r\n * @param xs {Array.} - Associated list.\r\n * @param [OutType = Object] {Constructor|Function} - Output type. Default `Object`.\r\n * @returns {*} - Default is `Object`\r\n */\r\n fromAssocList = (xs, OutType = Object) => xs.reduce((agg, [key, value]) => {\r\n agg[key] = value;\r\n return agg;\r\n }, new OutType()),\r\n\r\n /**\r\n * From associated list to object (deep conversion on associative lists (array of 2 value arrays)).\r\n * @note Considers array of arrays associated lists.\r\n * @function module:object.fromAssocListDeep\r\n * @param xs {Array.} - Associated list.\r\n * @param [OutType = Object] {Constructor|Function} - Output type. Default `Object`.\r\n * @returns {*} - Default is `Object`\r\n */\r\n fromAssocListDeep = (xs, OutType = Object) => xs.reduce((agg, [key, value]) => {\r\n if (isArray(value) && isArray(value[0]) && value[0].length === 2) {\r\n agg[key] = fromAssocListDeep(value, OutType);\r\n return agg;\r\n }\r\n agg[key] = value;\r\n return agg;\r\n }, new OutType())\r\n;\r\n","import {typeOf} from './typeOf';\r\nimport {toAssocList} from './assocList';\r\n\r\nexport const\r\n\r\n /**\r\n * Converts incoming value to an array.\r\n * @note For `WeakMap`, `WeakSet`, `Map` and `Set` result is the same as calling `Array.from` on such.\r\n * @note For `null`, `undefined`, `NaN`, `Number{}`, `Symbol{}`, `Boolean{}` returns an empty array.\r\n * @note Method does a shallow conversion;\r\n * @function module:object.toArray\r\n * @param x {*} - Thing to convert from.\r\n * @returns {Array}\r\n */\r\n toArray = x => {\r\n switch (typeOf(x)) {\r\n case 'Null':\r\n case 'Undefined':\r\n return [];\r\n case String.name:\r\n case Array.name:\r\n case 'WeakMap':\r\n case 'WeakSet':\r\n case 'Map':\r\n case 'Set':\r\n return Array.from(x);\r\n case Object.name:\r\n default:\r\n return toAssocList(x);\r\n }\r\n }\r\n\r\n;\r\n","/**\r\n * @module object\r\n * @description Object operations/combinators.\r\n */\r\n\r\nexport * from './jsPlatform/object';\r\nexport * from './object/lookup';\r\nexport * from './object/typeOf';\r\nexport * from './object/copy';\r\nexport * from './object/is';\r\nexport * from './object/of';\r\nexport * from './object/searchObj';\r\nexport * from './object/assignDeep';\r\nexport * from './object/setTheory';\r\nexport * from './object/console';\r\nexport * from './object/jsonClone';\r\nexport * from './object/toArray';\r\nexport * from './object/assocList';\r\n","import {reduceRight} from '../jsPlatform/array';\r\n\r\n/**\r\n * Composes all functions passed in from right to left passing each functions return value to\r\n * the function on the left of itself.\r\n * @function module:function.compose\r\n * @type {Function}\r\n * @param args {...{Function}}\r\n * @returns {Function}\r\n */\r\nexport const compose = (...args) =>\r\n arg0 => reduceRight((value, fn) => fn(value), arg0, args);\r\n","/**\r\n * @memberOf function\r\n */\r\n\r\n/**\r\n * Returns passed in parameter.\r\n * @haskellType `id :: a -> a`\r\n * @function module:function.id\r\n * @param x {*}\r\n * @returns {*}\r\n */\r\nexport const id = x => x;\r\n","/**\r\n * @memberOf function\r\n */\r\n\r\nimport {apply} from '../jsPlatform/function';\r\nimport {curry, curry2} from './curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Negates a function that takes one/no argument.\r\n * @function module:function.negateF\r\n * @param fn {Function}\r\n * @returns {function(*=): boolean}\r\n */\r\n negateF = fn => x => !fn(x),\r\n\r\n /**\r\n * Takes a function that takes two parameters and returns a negated version of given\r\n * function.\r\n * @function module:_negate.negateF2\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n negateF2 = fn => curry((a, b) => !fn(a, b)),\r\n\r\n /**\r\n * Takes a function that takes three parameters and returns a\r\n * negated version of given function.\r\n * @function module:_negate.negateF3\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n negateF3 = fn => curry((a, b, c) => !fn(a, b, c)),\r\n\r\n /**\r\n * Returns a negated version of given function.\r\n * Returned function is variadiac (takes one or more arguments).\r\n * @note function returned is uncurried.\r\n * @uncurried\r\n * @function module:function.negateFN\r\n * @param fn {Function}\r\n * @returns {Function}\r\n */\r\n negateFN = fn => curry2((...args) => !apply(fn, args));\r\n","import {curry} from './curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Run `operation` until predicate returns `true` (like a functional\r\n * version of a while loop).\r\n * @function module:function.until\r\n * @param predicate {Function} :: a -> Boolean\r\n * @param operation {Function} :: a -> a\r\n * @param typeInstance {*} :: * - A monoidal zero or some starting point.\r\n * @returns {*} - What ever type `typeInstance` is\r\n */\r\n until = curry((predicate, operation, typeInstance) => {\r\n let result = typeInstance;\r\n while (!predicate(result)) {\r\n result = operation(result);\r\n }\r\n return result;\r\n });\r\n","import {typeOf} from '../object/typeOf';\r\n\r\nexport const\r\n\r\n /**\r\n * Returns a function or throws an error if given `f` is not a function.\r\n * @function module:function.fnOrError\r\n * @param symbolName {String} - Error message prefix.\r\n * @param f {Function|*} - Expected function.\r\n * @returns {Function}\r\n * @throws {Error} - Error if `f` is not of `function`\r\n */\r\n fnOrError = (symbolName, f) => {\r\n if (!f || !(f instanceof Function)) {\r\n throw new Error(`${symbolName} should be a function. ` +\r\n `Type received: ${typeOf(f)}; Value received: ${f}.`);\r\n }\r\n return f;\r\n }\r\n\r\n;\r\n","/**\r\n * No-op ('op' as in 'operation') - Performs no operation 'always' (good for places where\r\n * a value should always be a function etc.).\r\n * @function module:function.noop\r\n * @returns {undefined}\r\n */\r\nexport const noop = () => undefined;\r\n","/**\r\n * @module function\r\n */\r\nexport * from './jsPlatform/function';\r\nexport * from './function/compose';\r\nexport * from './function/curry';\r\nexport * from './function/flip';\r\nexport * from './function/id';\r\nexport * from './function/negate';\r\nexport * from './function/until';\r\nexport * from './function/fnOrError';\r\nexport * from './function/noop';\r\n","/**\r\n * @module object\r\n */\r\nimport {curry} from '../function/curry';\r\n\r\n/**\r\n * Normalizes step for `from` and `to` combination.\r\n * @function module:list.normalizeStep\r\n * @param from {Number}\r\n * @param to {Number}\r\n * @param [step = 1] {Number}\r\n * @returns {Number}\r\n * @private\r\n */\r\nconst normalizeStep = (from, to, step) => {\r\n if (from > to) {\r\n return step > 0 ? -step : step; // make step negative\r\n }\r\n return step < 0 ? -1 * step : step; // make step positive\r\n};\r\n\r\nexport const\r\n\r\n /**\r\n * Range function - gives you an array contain numbers in given range.\r\n * @note normalizes `step` to be valid if range numbers given are invalid\r\n * (forces `step` to be negative if range required is in the negative direction\r\n * and forces `step` to be positive if range required is in the other direction).\r\n * @function module:list.range\r\n * @param from {Number}\r\n * @param to {Number}\r\n * @param [step = 1] {Number}\r\n * @returns {Array.}\r\n */\r\n range = curry((from, to, step = 1) => {\r\n let i = from;\r\n const out = [];\r\n step = normalizeStep(from, to, step);\r\n if (step === 0 || from === to) { return [from]; }\r\n for (; (to - i) * step >= 0; i += step) { out.push(i); }\r\n return out;\r\n })\r\n;\r\n","/**\r\n * Created by elydelacruz on 9/6/2017.\r\n */\r\n\r\nimport {fPureTakesOne} from '../utils';\r\n\r\n/**\r\n * Functional version of `String.prototype.split`.\r\n * @function module:_string.split\r\n * @param separator {String|RegExp}\r\n * @param str {String}\r\n * @returns {Array}\r\n */\r\nexport const split = fPureTakesOne('split');\r\n","/**\r\n * @module jsPlatform_\r\n * @private\r\n */\r\nexport * from './jsPlatform/object';\r\nexport * from './jsPlatform/array';\r\nexport * from './jsPlatform/list';\r\nexport * from './jsPlatform/string';\r\nexport * from './jsPlatform/function';\r\n","/**\r\n * List operations module.\r\n * @module list\r\n */\r\nimport {concat as listAppend, indexOf, slice, includes} from './jsPlatform/list';\r\nimport {apply} from './jsPlatform/function';\r\nimport {length} from './jsPlatform/object';\r\nimport {negateF3, negateF2} from './function/negate';\r\nimport {curry, curry2, curry3} from './function/curry';\r\nimport {isTruthy, isFalsy} from './boolean';\r\nimport {lookup} from './object/lookup';\r\nimport {of} from './object/of';\r\nimport {isset, isString} from './object/is';\r\nimport {typeOf} from './object/typeOf';\r\nimport map from './list/map';\r\n\r\nimport {\r\n sliceFrom, sliceTo, lengths,\r\n toShortest, aggregateArray,\r\n reduceUntil, reduce, reduceRight, lastIndex,\r\n findIndexWhere, findIndexWhereRight, findIndicesWhere,\r\n findWhere, sliceCopy, genericAscOrdering\r\n}\r\n from './list/utils';\r\n\r\nexport * from './list/range';\r\n\r\nexport * from './list/utils';\r\n\r\nexport {map};\r\n\r\nexport {slice, includes, indexOf, lastIndexOf, push} from './jsPlatform';\r\n\r\nexport const\r\n\r\n /**\r\n * Append two, or more, lists, i.e.,\r\n * @example\r\n * expectEqual(append(take(13, alphabetString), drop(13, alphabetString)), alphabetString); // true\r\n *\r\n * // Another example\r\n * const result = append(\r\n * alphabetStr.split(''),\r\n * alphabetStr.split('')\r\n * ),\r\n * expected = repeat(2, alphabetStr).split('');\r\n *\r\n * shallowEquals(result, expected) === true // `true`\r\n *\r\n * @function module:list.append\r\n * @param [args] {...(Array|String|*)} - One or more lists or list likes (strings etc.).\r\n * @returns {(Array|String|*)} - Same type as list like passed in.\r\n */\r\n append = curry2((...args) => apply(listAppend, args)),\r\n\r\n /**\r\n * Returns head of list (first item of list).\r\n * @haskellType `head :: [a] -> a`\r\n * @function module:list.head\r\n * @param x {Array|String}\r\n * @returns {*} - First item from list\r\n */\r\n head = x => x[0],\r\n\r\n /**\r\n * Returns last item of list.\r\n * @haskellType `last :: [a] -> a`\r\n * @function module:list.last\r\n * @param xs {Array|String}\r\n * @returns {*}\r\n */\r\n last = xs => xs[lastIndex(xs)],\r\n\r\n /**\r\n * Returns tail part of list (everything after the first item as new list).\r\n * @haskelType `tail :: [a] -> [a]`\r\n * @function module:list.tail\r\n * @param xs {Array|String}\r\n * @returns {Array|String}\r\n */\r\n tail = xs => sliceFrom(1, xs),\r\n\r\n /**\r\n * Returns everything except last item of list as new list.\r\n * @haskellType `init :: [a] -> [a]`\r\n * @function module:list.init\r\n * @param xs {Array|String}\r\n * @returns {Array|String}\r\n */\r\n init = xs => sliceTo(lastIndex(xs), xs),\r\n\r\n /**\r\n * Returns `head` and `tail` of passed in list/string in a tuple.\r\n * @haskellType `uncons :: [a] -> Maybe (a, [a])`\r\n * @function module:list.uncons\r\n * @param xs {Array|String}\r\n * @returns {Array|undefined}\r\n */\r\n uncons = xs => !xs || length(xs) === 0 ? undefined : [head(xs), tail(xs)],\r\n\r\n /**\r\n * Returns `tail` and `head` of passed in list/string in a tuple.\r\n * @haskellType `unconsr :: [a] -> Maybe ([a], a)`\r\n * @function module:list.unconsr\r\n * @param xs {Array|String}\r\n * @returns {Array|String|*|undefined}\r\n */\r\n unconsr = xs => !xs || length(xs) === 0 ? undefined : [init(xs), last(xs)],\r\n\r\n /**\r\n * Concatenates all the elements of a container of lists.\r\n * @haskellType `concat :: Foldable t => t [a] -> [a]`\r\n * @function module:list.concat\r\n * @param xs {Array}\r\n * @returns {Array}\r\n */\r\n concat = xs => {\r\n switch (length(xs)) {\r\n case undefined:\r\n case 0:\r\n return [];\r\n case 1:\r\n const item0 = xs[0];\r\n return item0 && item0.slice ? sliceCopy(item0) : item0;\r\n case 2:\r\n default:\r\n return apply(append, xs);\r\n }\r\n },\r\n\r\n /**\r\n * Map a function over all the elements of a container and concatenate the resulting lists.\r\n * @haskellType `concatMap :: Foldable t => (a -> [b]) -> t a -> [b]`\r\n * @function module:list.concatMap\r\n * @param fn {Function}\r\n * @param foldableOfA {Array}\r\n * @returns {Array}\r\n */\r\n concatMap = curry((fn, foldableOfA) => concat(map(fn, foldableOfA))),\r\n\r\n /**\r\n * Returns a copy of the passed in list reverses.\r\n * @haskellType `reverse :: [a] -> [a]`\r\n * @function module:list.reverse\r\n * @param xs {Array|String}\r\n * @returns {Array|String}\r\n */\r\n reverse = xs => {\r\n if (!isset(xs) || !xs.length) {\r\n return xs;\r\n }\r\n let out = of(xs),\r\n i = xs.length - 1;\r\n switch (typeOf(xs)) {\r\n case 'String':\r\n for (; i >= 0; i -= 1) {\r\n out += xs[i];\r\n }\r\n return out;\r\n default:\r\n for (; i >= 0; i -= 1) {\r\n out.push(xs[i]);\r\n }\r\n return out;\r\n }\r\n },\r\n\r\n /**\r\n * Takes an element and a list and `intersperses' that element between the\r\n * elements of the list.\r\n * @function module:list.intersperse\r\n * @note In our version of the function javascript is loosely typed so,\r\n * so is our function (to much overhead to make it typed) so `between` can be any value.\r\n * @param between {*} - Should be of the same type of elements contained in list.\r\n * @param arr {Array|String} - List.\r\n * @returns {Array|String}\r\n */\r\n intersperse = curry((between, xs) => {\r\n if (!xs || !xs.length) {\r\n return xs;\r\n }\r\n const limit = xs.length,\r\n lastInd = limit - 1;\r\n let out = of(xs),\r\n i = 0;\r\n if (isString(xs)) {\r\n for (; i < limit; i += 1) {\r\n out += i === lastInd ?\r\n xs[i] : xs[i] + between;\r\n }\r\n return out;\r\n }\r\n for (; i < limit; i += 1) {\r\n if (i === lastInd) {\r\n out.push(xs[i]);\r\n } else {\r\n out.push(xs[i], between);\r\n }\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * `intercalate xs xss` is equivalent to (concat (intersperse xs xss)). It inserts the list xs in between the lists in xss and concatenates the result.\r\n * @haskellType `intercalate :: [a] -> [[a]] -> [a]`\r\n * @function module:list.intercalate\r\n * @param xs {Array|String}\r\n * @param xss {Array|String}\r\n * @returns {Array|String}\r\n */\r\n intercalate = curry((xs, xss) => {\r\n if (isString(xss)) {\r\n return intersperse(xs, xss);\r\n }\r\n return concat(intersperse(xs, xss));\r\n }),\r\n\r\n /**\r\n * Transposes rows and columns into lists by index; E.g.,\r\n * Haskell example:\r\n * ```\r\n * transpose [[1,2,3],[4,5,6]] == [[1,4],[2,5],[3,6]]\r\n *\r\n * -- Notice the shorter arrays are ignored after their last index is copied over:\r\n * transpose [[10,11],[20],[],[30,31,32]] == [[10,20,30],[11,31],[32]]\r\n * ```\r\n * @note from columns to rows.\r\n * @note Empty lists are ignored.\r\n * @haskellType `transpose :: [[a]] -> [[a]]`\r\n * @function module:list.transpose\r\n * @param xss {Array}\r\n * @returns {Array}\r\n */\r\n transpose = xss => {\r\n let numLists = length(xss),\r\n ind = 0, ind2;\r\n if (!numLists) {\r\n return [];\r\n }\r\n const listLengths = apply(lengths, xss),\r\n longestListLen = maximum(listLengths),\r\n outLists = [];\r\n for (; ind < longestListLen; ind += 1) {\r\n const outList = [];\r\n for (ind2 = 0; ind2 < numLists; ind2 += 1) {\r\n if (listLengths[ind2] < ind + 1) {\r\n continue;\r\n }\r\n outList.push(xss[ind2][ind]);\r\n }\r\n outLists.push(outList);\r\n }\r\n return filter(x => length(x) > 0, outLists);\r\n },\r\n\r\n /**\r\n * Generates 2^n sub-sequences for passed in sequence (string/list) (`n` is\r\n * the length of the passed in sequence so: 2^length(xs)).\r\n * Note: The return value doubles per index/character passed in so use with caution!\r\n * Also note that for 2^16 (or for a sequence of 16 characters) this algorithm\r\n * will generate 65536 sub-sequences! So caution should be taken to not\r\n * use this with sequences above a certain length on certain platform (the browser thread in specific).\r\n * @function module:list.subsequences\r\n * @jsperftest https://jsperf.com/subsequences\r\n * @param xs {Array|String}\r\n * @returns {Array.}\r\n */\r\n subsequences = xs => {\r\n const listLen = length(xs),\r\n len = Math.pow(2, listLen),\r\n out = [];\r\n for (let i = 0; i < len; i += 1) {\r\n let entry = [];\r\n for (let j = 0; j < listLen; j += 1) {\r\n if (i & (1 << j)) {\r\n entry.push(xs[j]);\r\n }\r\n }\r\n out.push(entry);\r\n }\r\n return out;\r\n },\r\n\r\n /**\r\n * Returns an array with the given indices swapped.\r\n * @function module:list.swapped\r\n * @param ind1 {Number}\r\n * @param ind2 {Number}\r\n * @param list {Array}\r\n * @returns {Array} - Copy of incoming with swapped values at indices.\r\n */\r\n swapped = curry((ind1, ind2, list) => {\r\n const out = sliceCopy(list),\r\n tmp = out[ind1];\r\n out[ind1] = out[ind2];\r\n out[ind2] = tmp;\r\n return out;\r\n }),\r\n\r\n /**\r\n * Returns a list of permutations for passed in list.\r\n * Use caution with lists above a length of 15 (will take long due to nature of\r\n * algorithm).\r\n * @function module:list.permutations\r\n * @param xs {Array} - List.\r\n * @returns {Array} - Array of permutations.\r\n */\r\n permutations = xs => {\r\n const limit = length(xs);\r\n\r\n if (!limit || limit === 1) {\r\n return [xs];\r\n }\r\n\r\n let list = sliceCopy(xs),\r\n c = repeat(limit, 0),\r\n i = 0;\r\n\r\n const out = [list];\r\n\r\n for (; i < limit; i++) {\r\n if (c[i] < i) {\r\n list = swapped(i % 2 === 0 ? 0 : c[i], i, list);\r\n out.push(list);\r\n c[i] += 1;\r\n i = 0;\r\n continue;\r\n }\r\n c[i] = 0;\r\n }\r\n\r\n return out;\r\n },\r\n\r\n /**\r\n * Left associative fold. Reduces a container of elements down by the given operation (same as [].reduce).\r\n * @function module:list.foldl\r\n * @param fn {Function}\r\n * @param zero {*} - Aggregator.\r\n * @param functor {Array}\r\n * @returns {*} - Whatever type is lastly returned from `fn`.\r\n */\r\n foldl = reduce,\r\n\r\n /**\r\n * Right associative fold. Reduces a container of elements down by the given operation (same as [].reduceRight).\r\n * @function module:list.foldr\r\n * @param fn {Function}\r\n * @param zero {*} - Aggregator.\r\n * @param functor {Array}\r\n * @returns {*} - Whatever type is lastly returned from `fn`.\r\n */\r\n foldr = reduceRight,\r\n\r\n /**\r\n * A variant of `foldl` except that this one doesn't require the starting point. The starting point/value will be pulled\r\n * out from a copy of the container.\r\n * @function module:list.foldl1\r\n * @param op {Function}\r\n * @param xs {Array}\r\n * @returns {*} - Whatever type is lastly returned from `op`.\r\n */\r\n foldl1 = curry((op, xs) => {\r\n const parts = uncons(xs);\r\n return !parts ? [] : reduce(op, parts[0], parts[1]);\r\n }),\r\n\r\n /**\r\n * A variant of `foldr` except that this one doesn't require the starting point/value. The starting point/value will be pulled\r\n * out from a copy of the container.\r\n * @function module:list.foldr1\r\n * @param op {Function}\r\n * @param xs {Array}\r\n * @returns {*} - Whatever type is lastly returned from `op`.\r\n */\r\n foldr1 = curry((op, xs) => {\r\n const parts = unconsr(xs);\r\n return !parts ? [] : reduceRight(op, parts[1], parts[0]);\r\n }),\r\n\r\n /**\r\n * Performs a map then a reduce all in one (from left-to-right). Returns a tuple\r\n * containing the aggregated value and the result of mapping the passed in function on passed in list.\r\n * @function module:list.mapAccumL\r\n * @param op {Function} - Function : [aggregated, mapResult]\r\n * @param zero {*} - An instance of the passed in list type used to aggregateArray on.\r\n * @param xs {Array} - list type.\r\n * @return {Array} - [aggregated, list]\r\n */\r\n mapAccumL = curry((op, zero, xs) => {\r\n const list = sliceCopy(xs),\r\n limit = length(xs);\r\n if (!limit) {\r\n return [zero, list];\r\n }\r\n let ind = 0,\r\n agg = zero,\r\n mapped = [],\r\n tuple;\r\n for (; ind < limit; ind++) {\r\n tuple = op(agg, list[ind], ind);\r\n agg = tuple[0];\r\n mapped = tuple[1];\r\n }\r\n return [agg, mapped];\r\n }),\r\n\r\n /**\r\n * Performs a map and a reduce all in one (from right-to-left). Returns a tuple\r\n * containing the aggregated value and the result of mapping the passed in function on passed in list.\r\n * @function module:list.mapAccumR\r\n * @param op {Function} - Function : [aggregated, mapResult]\r\n * @param zero {*} - An instance of the passed in list type used to aggregateArray on.\r\n * @param xs {Array} - list type.\r\n * @return {Array} - [aggregated, list]\r\n */\r\n mapAccumR = curry((op, zero, xs) => {\r\n const list = sliceCopy(xs),\r\n limit = length(xs);\r\n if (!limit) {\r\n return [zero, list];\r\n }\r\n let ind = limit - 1,\r\n agg = zero,\r\n mapped = [],\r\n tuple;\r\n for (; ind >= 0; ind--) {\r\n tuple = op(agg, list[ind], ind);\r\n agg = tuple[0];\r\n mapped = tuple[1];\r\n }\r\n return [agg, mapped];\r\n }),\r\n\r\n /**\r\n * iterate f x returns an infinite list of repeated applications of f to x.\r\n * @function module:list.iterate\r\n * @example `iterate(5, f, x) == [x, f(x), f(f(x)), ...]`\r\n * @param limit {Number}\r\n * @param op {Function} - Operation.\r\n * @param x {*} - Starting point.\r\n * @returns {*}\r\n */\r\n iterate = curry((limit, op, x) => {\r\n let ind = 0,\r\n out = [],\r\n lastX = x;\r\n for (; ind < limit; ind += 1) {\r\n out.push(lastX);\r\n lastX = op(lastX, ind);\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Repeats `x` `limit` number of times.\r\n * @function module:list.repeat\r\n * @param limit {Number}\r\n * @param x {*}\r\n * @return {Array}\r\n */\r\n repeat = curry((limit, x) => iterate(limit, a => a, x)),\r\n\r\n /**\r\n * Same as `repeat` due to the nature of javascript (see haskell version for usage).\r\n * @function module:list.replicate\r\n * @param limit {Number}\r\n * @param x {*}\r\n * @return {Array}\r\n */\r\n replicate = repeat,\r\n\r\n /**\r\n * Replicates a list `limit` number of times and appends the results (concat)\r\n * @function module:list.cycle\r\n * @param limit {Number}\r\n * @param xs {Array}\r\n * @returns {Array}\r\n */\r\n cycle = curry((limit, xs) => concat(replicate(limit, xs))),\r\n\r\n /**\r\n * Unfolds a value into a list of somethings.\r\n * @haskellType `unfoldr :: (b -> Maybe (a, b)) -> b -> [a]`\r\n * @function module:list.unfoldr\r\n * @param op {Function} - Operation to perform (should return a two component tuple (item to aggregateArray and item to unfold in next iteration).\r\n * @param x {*} - Starting parameter to unfold from.\r\n * @returns {Array} - An array of whatever you return from `op` yielded.\r\n */\r\n unfoldr = curry((op, x) => {\r\n let ind = 0,\r\n out = [],\r\n resultTuple = op(x, ind, out);\r\n while (resultTuple) {\r\n out.push(resultTuple[0]);\r\n resultTuple = op(resultTuple[1], ++ind, out);\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Finds index in string or list (alias for `findIndex`).\r\n * @function module:list.findIndex\r\n * @param pred {Function} - Predicate.\r\n * @param arr {Array|String}\r\n * @returns {Number} - `-1` if predicate not matched else `index` found\r\n */\r\n findIndex = findIndexWhere,\r\n\r\n /**\r\n * @function module:list.findIndices\r\n * @param pred {Function}\r\n * @param xs {Array} - list or list like.\r\n * @returns {Array|undefined}\r\n */\r\n findIndices = findIndicesWhere,\r\n\r\n /**\r\n * @function module:list.elemIndex\r\n * @param x {*} - Element to search for.\r\n * @param xs {Array} - list or list like.\r\n * @returns {*}\r\n */\r\n elemIndex = curry((x, xs) => {\r\n const foundInd = indexOf(x, xs);\r\n return foundInd !== -1 ? foundInd : undefined;\r\n }),\r\n\r\n /**\r\n * @function module:list.elemIndices\r\n * @param value {*} - Element to search for.\r\n * @param xs {Array} - list or list like.\r\n * @returns {*}\r\n */\r\n elemIndices = curry((value, xs) => findIndices(x => x === value, xs)),\r\n\r\n /**\r\n * Takes `n` items from start of list to `limit` (exclusive).\r\n * @function module:list.take\r\n * @param list {Array|String}\r\n * @param limit {Number}\r\n * @returns {String|Array} - Passed in type's type\r\n */\r\n take = sliceTo,\r\n\r\n /**\r\n * Drops `n` items from start of list to `count` (exclusive).\r\n * @function module:list.drop\r\n * @param list {Array|String}\r\n * @param count {Number}\r\n * @returns {String|Array} - Passed in type's type\r\n */\r\n drop = sliceFrom,\r\n\r\n /**\r\n * Splits `x` in two at given `index` (exclusive (includes element/character at\r\n * given index in second part of returned list)).\r\n * @function module:list.splitAt\r\n * @param ind {Number} - Index to split at.\r\n * @param list {Array|String} - functor (list or string) to split.\r\n * @returns {Array|String} - List like type passed\r\n */\r\n splitAt = (ind, list) => [sliceTo(ind, list), sliceFrom(ind, list)],\r\n\r\n /**\r\n * Gives an list with passed elements while predicate was true.\r\n * @function module:list.takeWhile\r\n * @param pred {Function} - Predicate<*, index, list|string>\r\n * @param list {Array|String}\r\n * @returns {Array}\r\n */\r\n takeWhile = curry((pred, list) =>\r\n reduceUntil(\r\n negateF3(pred), // predicate\r\n isString(list) ?\r\n (agg, x) => agg + x :\r\n aggregateArray, // operation\r\n of(list), // aggregate\r\n list\r\n )),\r\n\r\n /**\r\n * Returns an list without elements that match predicate.\r\n * @function module:list.dropWhile\r\n * @param pred {Function} - Predicate<*, index, list|string>\r\n * @param list {Array|String}\r\n * @refactor\r\n * @returns {Array|String}\r\n */\r\n dropWhile = curry((pred, list) => {\r\n const limit = length(list),\r\n splitPoint =\r\n findIndexWhere(\r\n (x, i, xs) => !pred(x, i, xs),\r\n list\r\n );\r\n\r\n return splitPoint === -1 ?\r\n sliceFrom(limit, list) :\r\n slice(splitPoint, limit, list);\r\n }),\r\n\r\n /**\r\n * @function module:list.dropWhileEnd\r\n * @param pred {Function} - Predicate<*, index, list|string>\r\n * @param list {Array|String}\r\n * @refactor\r\n * @returns {Array|String}\r\n */\r\n dropWhileEnd = curry((pred, list) => {\r\n const splitPoint =\r\n findIndexWhereRight(\r\n (x, i, xs) => !pred(x, i, xs),\r\n list\r\n );\r\n if (splitPoint === -1) {\r\n return of(list);\r\n }\r\n return sliceTo(splitPoint + 1, list);\r\n }),\r\n\r\n /**\r\n * Gives you the `span` of items matching predicate\r\n * and items not matching predicate; E.g., Gives an\r\n * array of arrays; E.g., [[matching-items], [non-matching-items]]\r\n * @function list.span\r\n * @param pred {Function} - List predicate (`(x, i, list) => bool`)\r\n * @param list {Array|String}\r\n * @returns {(Array>|Array)}\r\n * @type {Function}\r\n */\r\n span = curry((pred, list) => {\r\n const splitPoint = findIndexWhere(negateF3(pred), list);\r\n return splitPoint === -1 ?\r\n [sliceFrom(0, list), of(list)] :\r\n splitAt(splitPoint, list);\r\n }),\r\n\r\n /**\r\n * breakOnList, applied to a predicate p and a list xs, returns a tuple\r\n * where first element is longest prefix (possibly empty) of xs of elements\r\n * that do not satisfy p and second element is the remainder of the list:\r\n * @haskellExample\r\n * Replace `break` with `breakOnList` for our version.\r\n * ```\r\n * breakOnList (> 3) [1,2,3,4,1,2,3,4] == ([1,2,3],[4,1,2,3,4])\r\n * breakOnList (< 9) [1,2,3] == ([],[1,2,3])\r\n * breakOnList (> 9) [1,2,3] == ([1,2,3],[])\r\n * ```\r\n * @function module:list.breakOnList\r\n * @param pred {Function}\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n breakOnList = curry((pred, list) => {\r\n const splitPoint = findIndexWhere(negateF3(pred), list);\r\n return splitPoint === -1 ?\r\n [of(list), sliceFrom(0, list)] : reverse(splitAt(splitPoint, list));\r\n }),\r\n\r\n /**\r\n * Gets item at index.\r\n * @function module:list.at\r\n * @param ind {Number} - Index.\r\n * @param xs {Array} - list or list like.\r\n * @returns {*|undefined} - Item or `undefined`.\r\n */\r\n at = lookup,\r\n\r\n /**\r\n * Find an item in structure of elements based on given predicate (`pred`).\r\n * @function module:list.find\r\n * @param pred {Function}\r\n * @param xs {Array} - list or list like.\r\n * @returns {*} - Found item.\r\n */\r\n find = findWhere,\r\n\r\n /**\r\n * For each function (same as `[].forEach` except in functional format).\r\n * @function module:list.forEach\r\n * @param fn {Function} - Operation (`(element, index, list) => {...}`, etc.)\r\n * @param xs {(Array|String)}\r\n * @returns {void}\r\n */\r\n forEach = curry((fn, list) => {\r\n const limit = length(list);\r\n if (!limit) {\r\n return;\r\n }\r\n let ind = 0;\r\n for (; ind < limit; ind += 1) {\r\n fn(list[ind], ind, list);\r\n }\r\n }),\r\n\r\n /**\r\n * Filters a structure of elements using given predicate (`pred`) (same as `[].filter`).\r\n * @function module:list.filter\r\n * @param pred {Function}\r\n * @param xs {Array} - list or list like.\r\n * @returns {Array} - Structure of filtered elements.\r\n */\r\n filter = curry((pred, xs) => {\r\n let ind = 0,\r\n limit = length(xs),\r\n out = [];\r\n if (!limit) {\r\n return out;\r\n }\r\n for (; ind < limit; ind++) {\r\n if (pred(xs[ind], ind, xs)) {\r\n out.push(xs[ind]);\r\n }\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Partitions a list on a predicate; Items that match predicate are in first list in tuple; Items that\r\n * do not match the tuple are in second list in the returned tuple.\r\n * Essentially `[filter(p, xs), filter(negateF3(p), xs)]`.\r\n * @function module:list.partition\r\n * @param pred {Function} - Predicate\r\n * @param list {Array}\r\n * @returns {Array|String} - Tuple of arrays or strings (depends on incoming list (of type list or string)).\r\n */\r\n partition = curry((pred, list) =>\r\n !length(list) ?\r\n [[], []] :\r\n [filter(pred, list), filter(negateF3(pred), list)]),\r\n\r\n /**\r\n * Returns a boolean indicating whether an element exists in given structure of elements.\r\n * @function module:list.elem\r\n * @param element {*}\r\n * @param xs {Array}\r\n * @returns {Boolean}\r\n */\r\n elem = includes,\r\n\r\n /**\r\n * The opposite of `elem` - Returns a boolean indicating whether an element exists in given list.\r\n * @function module:list.notElem\r\n * @param element {*}\r\n * @param xs {Array}\r\n * @returns {Boolean}\r\n */\r\n notElem = negateF2(includes),\r\n\r\n /**\r\n * Checks if list `xs1` is a prefix of list `xs2`\r\n * @function module:list.isPrefixOf\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {boolean}\r\n */\r\n isPrefixOf = curry((xs1, xs2) => {\r\n const limit1 = length(xs1),\r\n limit2 = length(xs2);\r\n if (limit2 < limit1 || !limit1 || !limit2 || indexOf(xs1[0], xs2) === -1) {\r\n return false;\r\n }\r\n let ind = 0;\r\n for (; ind < limit1; ind++) {\r\n if (xs1[ind] !== xs2[ind]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }),\r\n\r\n /**\r\n * Checks if list `xs1` is a suffix of list `xs2`\r\n * @function module:list.isSuffixOf\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {boolean}\r\n */\r\n isSuffixOf = curry((xs1, xs2) => {\r\n const limit1 = length(xs1),\r\n limit2 = length(xs2);\r\n if (limit2 < limit1 || !limit1 || !limit2 || indexOf(xs1[0], xs2) === -1) {\r\n return false;\r\n }\r\n let ind1 = limit1 - 1,\r\n ind2 = limit2 - 1;\r\n for (; ind1 >= 0; ind1--) {\r\n if (xs1[ind1] !== xs2[ind2]) {\r\n return false;\r\n }\r\n ind2 -= 1;\r\n }\r\n return true;\r\n }),\r\n\r\n /**\r\n * Checks if list `xs1` is an infix of list `xs2`\r\n * @function module:list.isInfixOf\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {boolean}\r\n */\r\n isInfixOf = curry((xs1, xs2) => {\r\n const limit1 = length(xs1),\r\n limit2 = length(xs2);\r\n if (limit2 < limit1 || !limit1 || !limit2) {\r\n return false;\r\n }\r\n let ind1,\r\n foundLen,\r\n ind = 0;\r\n for (; ind < limit2; ind += 1) {\r\n foundLen = 0;\r\n for (ind1 = 0; ind1 < limit1; ind1 += 1) {\r\n if (xs2[ind1 + ind] === xs1[ind1]) {\r\n foundLen += 1;\r\n }\r\n if (foundLen === limit1) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }),\r\n\r\n /**\r\n * Checks if list `xs1` is a sub-sequence of list `xs2`\r\n * @function module:list.isSubsequenceOf\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {boolean}\r\n */\r\n isSubsequenceOf = curry((xs1, xs2) => {\r\n const len = Math.pow(2, length(xs2)),\r\n lenXs1 = length(xs1);\r\n let foundLen,\r\n i;\r\n for (i = 0; i < len; i += 1) {\r\n foundLen = 0;\r\n for (let j = 0; j < len; j += 1) {\r\n if (i & (1 << j) && indexOf(xs2[j], xs1) > -1) {\r\n foundLen += 1;\r\n }\r\n if (foundLen === lenXs1) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }),\r\n\r\n /**\r\n * The group function takes a list and returns a list of lists such that\r\n * the concatenation of the result is equal to the argument. Moreover, each\r\n * sublist in the result contains only equal elements. For example,\r\n * `group \"Mississippi\" = [\"M\",\"i\",\"ss\",\"i\",\"ss\",\"i\",\"pp\",\"i\"]`\r\n * It is a special case of groupBy, which allows the programmer to supply\r\n * their own equality test.\r\n * @haskellType `group :: Eq a => [a] -> [[a]]`\r\n * @function module:list.group\r\n * @param xs {Array|String}\r\n * @returns {Array|*}\r\n */\r\n group = xs => groupBy((a, b) => a === b, xs),\r\n\r\n /**\r\n * Allows you to group items in a list based on your supplied equality check.\r\n * @note Sames `group` but allows you to specify equality operation.\r\n * @haskellType `groupBy :: (a -> a -> Bool) -> [a] -> [[a]]`\r\n * @function module:list.groupBy\r\n * @param equalityOp {Function}\r\n * @param xs {Array}\r\n * @returns {*}\r\n */\r\n groupBy = curry((equalityOp, xs) => {\r\n const limit = length(xs);\r\n if (!limit) {\r\n return sliceCopy(xs);\r\n }\r\n let ind = 0,\r\n prevItem,\r\n item,\r\n predOp = x => {\r\n if (equalityOp(x, prevItem)) {\r\n ind++;\r\n }\r\n if (equalityOp(x, item)) {\r\n prevItem = x;\r\n return true;\r\n }\r\n return false;\r\n },\r\n agg = [];\r\n for (; ind < limit; ind += 1) {\r\n item = xs[ind];\r\n agg.push(takeWhile(predOp, slice(ind, limit, xs)));\r\n }\r\n return agg;\r\n }),\r\n\r\n /**\r\n * The inits function returns all initial segments of the argument, shortest first. For example,\r\n * ```\r\n * shallowEquals(inits('abc'), ['','a','ab','abc'])\r\n * ```\r\n * @function module:list.inits\r\n * @haskellType `inits :: [a] -> [[a]]`\r\n * @param xs {Array}\r\n * @returns {Array}\r\n */\r\n inits = xs => {\r\n let limit = length(xs),\r\n ind = 0,\r\n agg = [];\r\n if (!limit) {\r\n return [];\r\n }\r\n for (; ind <= limit; ind += 1) {\r\n agg.push(sliceTo(ind, xs));\r\n }\r\n return agg;\r\n }, //map(list => init(list), xs),\r\n\r\n /**\r\n * The inits function returns all initial segments of the argument, shortest first. For example,\r\n * ```\r\n * shallowEquals(tails('abc'), ['abc', 'bc', 'c',''])\r\n * ```\r\n * @function module:list.tails\r\n * @haskellType `tails :: [a] -> [[a]]`\r\n * @param xs {Array}\r\n * @returns {Array}\r\n */\r\n tails = xs => {\r\n let limit = length(xs),\r\n ind = 0,\r\n agg = [];\r\n if (!limit) {\r\n return [];\r\n }\r\n for (; ind <= limit; ind += 1) {\r\n agg.push(slice(ind, limit, xs));\r\n }\r\n return agg;\r\n }, //map(list => tail(list), xs),\r\n\r\n /**\r\n * Strips prefix list from given list\r\n * @function module:list.stripPrefix\r\n * @param prefix {Array|String|*}\r\n * @param list {Array|string|*}\r\n * @returns {Array|*}\r\n */\r\n stripPrefix = curry((prefix, list) =>\r\n isPrefixOf(prefix, list) ?\r\n splitAt(length(prefix), list)[1] :\r\n sliceCopy(list)),\r\n\r\n /**\r\n * zip takes two lists and returns a list of corresponding pairs.\r\n * If one input list is short, excess elements of the longer list are discarded.\r\n * @haskellType `zip :: [a] -> [b] -> [(a, b)]`\r\n * @function module:list.zip\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @returns {Array>}\r\n */\r\n zip = curry((arr1, arr2) => {\r\n if (!length(arr1) || !length(arr2)) {\r\n return [];\r\n }\r\n const [a1, a2] = toShortest(arr1, arr2);\r\n return reduce((agg, item, ind) =>\r\n aggregateArray(agg, [item, a2[ind]]),\r\n [], a1);\r\n }),\r\n\r\n /**\r\n * zipN takes one or more lists and returns a list containing lists of all indices\r\n * at a given index, index by index.\r\n * If one input list is short, excess elements of the longer list are discarded.\r\n * @function module:list.zipN\r\n * @param lists {Array|String} - One ore more lists of the same type.\r\n * @returns {Array}\r\n */\r\n zipN = curry2((...lists) => {\r\n const trimmedLists = apply(toShortest, lists);\r\n return reduce((agg, item, ind) =>\r\n aggregateArray(agg, map(xs => xs[ind], trimmedLists)),\r\n [], trimmedLists[0]);\r\n }),\r\n\r\n /**\r\n * @haskellType `zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]`\r\n * @function module:list.zip3\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @param arr3 {Array}\r\n * @returns {Array>}\r\n */\r\n zip3 = curry((arr1, arr2, arr3) => zipN(arr1, arr2, arr3)),\r\n\r\n /**\r\n * @haskellType `zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]`\r\n * @function module:list.zip4\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @param arr3 {Array}\r\n * @param arr4 {Array}\r\n * @returns {Array>}\r\n */\r\n zip4 = curry((arr1, arr2, arr3, arr4) => zipN(arr1, arr2, arr3, arr4)),\r\n\r\n /**\r\n * @haskellType `zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]`\r\n * @function module:list.zip5\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @param arr3 {Array}\r\n * @param arr4 {Array}\r\n * @param arr5 {Array}\r\n * @returns {Array>}\r\n */\r\n zip5 = curry((arr1, arr2, arr3, arr4, arr5) => zipN(arr1, arr2, arr3, arr4, arr5)),\r\n\r\n /**\r\n * zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]\r\n * zipWith generalises zip by zipping with the function given as the\r\n * first argument, instead of a function tupling function (function that returns a tuple). For example,\r\n * zipWith (+) is applied to two lists to produce the list of corresponding sums.\r\n * @note `_|_` means bottom or perpetual (@see\r\n * - https://wiki.haskell.org/Bottom\r\n * - https://stackoverflow.com/questions/19794681/what-does-this-syntax-mean-in-haskell-or\r\n * )\r\n * @example\r\n * ```\r\n * zipWith f [] _|_ = []\r\n * ```\r\n * @haskellType `zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]`\r\n * @function module:list.zipWith\r\n * @param op {Function} - Takes two parts of a tuple and returns a tuple.\r\n * E.g., ` op :: a -> b -> (a, b)`\r\n * @param xs1 {Array}\r\n * @param xs2 {Array}\r\n * @returns {Array>}\r\n */\r\n zipWith = curry((op, xs1, xs2) => {\r\n if (!length(xs1) || !length(xs2)) {\r\n return [];\r\n }\r\n const [a1, a2] = toShortest(xs1, xs2);\r\n return reduce((agg, item, ind) =>\r\n aggregateArray(agg, op(item, a2[ind])),\r\n [], a1);\r\n }),\r\n\r\n /**\r\n * Zips all given lists with tupling function. Note: Haskell types do not have\r\n * a way (that I know of) to show one or more for params in a function so `@haskellType` below\r\n * is left there for general purpose not for exactness as is told by aforementioned.\r\n * @haskellType `zipWithN :: (a -> b -> c) -> [a] -> [b] -> [c]` - Where `N` is the number\r\n * of lists to zip.\r\n * @function module:list.zipWithN\r\n * @param op {Function} - Takes expected number of parts for tuple and returns a tuple\r\n * of said parts:\r\n * E.g., ` op :: a -> b -> c -> (a, b, c)`\r\n * @param lists ...{Array}\r\n * @returns {Array>}\r\n */\r\n zipWithN = curry3((op, ...lists) => {\r\n const trimmedLists = apply(toShortest, lists),\r\n lenOfTrimmed = length(trimmedLists);\r\n if (!lenOfTrimmed) {\r\n return [];\r\n }\r\n else if (lenOfTrimmed === 1) {\r\n return sliceTo(length(trimmedLists[0]), trimmedLists[0]);\r\n }\r\n return reduce((agg, item, ind) =>\r\n aggregateArray(agg, apply(op, map(xs => xs[ind], trimmedLists))),\r\n [], trimmedLists[0]);\r\n }),\r\n\r\n /**\r\n * Zips 3 lists with tupling function.\r\n * @haskellType `zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]`\r\n * @function module:list.zipWith3\r\n * @param op {Function} - Takes expected number of parts for tuple and returns a tuple\r\n * of said parts:\r\n * E.g., ` op :: a -> b -> c -> (a, b, c)`\r\n * @param xs1 {Array}\r\n * @param xs2 {Array}\r\n * @param xs3 {Array}\r\n * @returns {Array>}\r\n */\r\n zipWith3 = curry((op, xs1, xs2, xs3) => zipWithN(op, xs1, xs2, xs3)),\r\n\r\n /**\r\n * Zips 4 lists with tupling function.\r\n * @haskellType `zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]`\r\n * @function module:list.zipWith4\r\n * @param op {Function} - Takes expected number of parts for tuple and returns a tuple\r\n * of said parts:\r\n * E.g., ` op :: a -> b -> c -> d -> (a, b, c, d)`\r\n * @param xs1 {Array}\r\n * @param xs2 {Array}\r\n * @param xs3 {Array}\r\n * @param xs4 {Array}\r\n * @returns {Array>}\r\n */\r\n zipWith4 = curry((op, xs1, xs2, xs3, xs4) => zipWithN(op, xs1, xs2, xs3, xs4)),\r\n\r\n /**\r\n * Zips 5 lists.\r\n * @haskellType `zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]`\r\n * @function module:list.zipWith5\r\n * @param op {Function} - Takes expected number of parts for tuple and returns a tuple\r\n * of said parts:\r\n * E.g., ` op :: a -> b -> c -> d -> e -> (a, b, c, d, e)`\r\n * @param xs1 {Array}\r\n * @param xs2 {Array}\r\n * @param xs3 {Array}\r\n * @param xs4 {Array}\r\n * @param xs5 {Array}\r\n * @returns {Array>}\r\n */\r\n zipWith5 = curry((op, xs1, xs2, xs3, xs4, xs5) => zipWithN(op, xs1, xs2, xs3, xs4, xs5)),\r\n\r\n /**\r\n * unzip transforms a list of pairs into a list of first components and a list of second components.\r\n * @haskellType `unzip :: [(a, b)] -> ([a], [b])`\r\n * @function module:list.unzip\r\n * @param arr {Array|*}\r\n * @returns {Array|*}\r\n */\r\n unzip = foldl((agg, item) => {\r\n agg[0].push(item[0]);\r\n agg[1].push(item[1]);\r\n return agg;\r\n }, [[], []]),\r\n\r\n /**\r\n * unzip transforms a list of pairs into a list of first components and a list of second components.\r\n * @sudoHaskellType `unzipN :: [(a, b, ...x)] -> ([a], [b], ...[x])`\r\n * @function module:list.unzipN\r\n * @param list {Array|*} - List of tuples (lists).\r\n * @returns {Array|*}\r\n */\r\n unzipN = list => {\r\n if (!length(list)) {\r\n return [];\r\n }\r\n const lenItem0 = length(list[0]);\r\n let zero = lenItem0 ?\r\n unfoldr(numLists => numLists-- ? [[], numLists] : undefined, lenItem0) :\r\n [];\r\n return foldl((agg, item) => {\r\n agg.forEach((outList, ind) => outList.push(item[ind]));\r\n return agg;\r\n }, zero, list);\r\n },\r\n\r\n /**\r\n * Returns true if any item in container passes predicate `p`.\r\n * @function module:list.any\r\n * @param p {Function} - Predicate.\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n any = curry((p, xs) => {\r\n let ind = 0,\r\n limit = length(xs);\r\n if (!limit) {\r\n return false;\r\n }\r\n for (; ind < limit; ind += 1) {\r\n if (p(xs[ind])) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }),\r\n\r\n /**\r\n * Returns true if all items in container pass predicate `p`.\r\n * @function module:list.all\r\n * @param p {Function} - Predicate.\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n all = curry((p, xs) => {\r\n const limit = length(xs);\r\n let ind = 0;\r\n if (!limit) {\r\n return false;\r\n }\r\n for (; ind < limit; ind++) {\r\n if (!p(xs[ind], ind, xs)) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }),\r\n\r\n /**\r\n * Conjuction of container of bools (or truthy and/or falsy values); Returns\r\n * `true` if all in container are 'truthy' else returns `false`\r\n * @function module:list.and\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n and = xs => all(isTruthy, xs),\r\n\r\n /**\r\n * Returns a boolean indicating whether any item in container is 'truthy' or not.\r\n * **Note** The haskell type for this function only takes two items, but here\r\n * we allow the passing of more than one item (may change later to adhere to the haskell type).\r\n * @function module:list.or\r\n * @haskellType `or :: Bool -> Bool -> Bool`\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n or = xs => any(isTruthy, xs),\r\n\r\n /**\r\n * Returns a boolean indicating whether all items in container are 'falsy' or not.\r\n * **Note** The haskell type for this function only takes two items, but here\r\n * we allow the passing of more than one item (may change later to adhere to the haskell type).\r\n * @function module:list.not\r\n * @haskellType `not :: Bool -> Bool`\r\n * @param xs {Array|String}\r\n * @returns {Boolean}\r\n */\r\n not = xs => all(isFalsy, xs),\r\n\r\n /**\r\n * Computes the sum of the numbers of a structure.\r\n * @function module:list.sum\r\n * @haskellType `sum :: (List t, Num a) => t a -> a`\r\n * @param list {Array|String}\r\n * @returns {Number}\r\n */\r\n sum = list => foldl((agg, x) => agg + x, 0, list),\r\n\r\n /**\r\n * Computes the product of the numbers of a structure.\r\n * @function module:list.product\r\n * @haskellType `product :: (List t, Num a) => t a -> a`\r\n * @param list {Array|String}\r\n * @returns {Number}\r\n */\r\n product = list => foldl((agg, x) => agg * x, 1, list),\r\n\r\n /**\r\n * Returns the largest element in a non-empty structure of elements.\r\n * @function module:list.maximum\r\n * @haskellType `maximum :: forall a . Ord a => t a -> a`\r\n * @param list {Array|String}\r\n * @returns {*} - Whatever type the array is made of (if any).\r\n */\r\n maximum = list => last(sortBy(genericAscOrdering, list)),\r\n\r\n /**\r\n * Returns the smallest element in a non-empty structure of elements.\r\n * @function module:list.minimum\r\n * @haskellType `minimum :: forall a . Ord a => t a -> a`\r\n * @param list {Array|String}\r\n * @returns {*} - Whatever type the array is made of (if any).\r\n */\r\n minimum = list => head(sortBy(genericAscOrdering, list)),\r\n\r\n /**\r\n * scanl is similar to foldl, but returns a list of successive reduced values from the left:\r\n * ```\r\n * scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]\r\n * ```\r\n * Also note that:\r\n * ```\r\n * last (scanl f z xs) == foldl f z xs.\r\n * ```\r\n * @function module:list.scanl\r\n * @param fn {Function}\r\n * @param zero {*}\r\n * @param xs {Array}\r\n * @returns {Array|*}\r\n */\r\n scanl = curry((fn, zero, xs) => {\r\n if (!xs || !length(xs)) {\r\n return [];\r\n }\r\n const limit = length(xs);\r\n let ind = 0,\r\n result = zero,\r\n out = [];\r\n while (ind < limit) {\r\n result = fn(result, xs[ind], ind, xs);\r\n out.push(result);\r\n ind++;\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * `scanl1` is a variant of `scanl` that has no starting value argument:\r\n * `shallowCompare(scanl1(fn, [x1, x2, ...]), [x1, fn(x1, x2), ...]) // true`\r\n * @function module:list.scanl1\r\n * @param fn {Function}\r\n * @param xs {Array}\r\n * @returns {Array|*}\r\n */\r\n scanl1 = curry((fn, xs) => {\r\n if (!xs || !xs.length) {\r\n return [];\r\n }\r\n return scanl(fn, head(xs), tail(xs));\r\n }),\r\n\r\n /**\r\n * Same as `scanl` but from the right (similiar to `foldr`'s relationship to 'foldl').\r\n * Note also `scanr`'s relationship ot `foldr`:\r\n * `head (scanr(fn, z, xs)) === foldr(fn, z, xs).\r\n * @function module:list.scanr\r\n * @param fn {Function}\r\n * @param zero {*}\r\n * @param xs {Array}\r\n * @returns {Array|*}\r\n */\r\n scanr = curry((fn, zero, xs) => {\r\n if (!xs || !length(xs)) {\r\n return [];\r\n }\r\n const limit = length(xs);\r\n let ind = limit - 1,\r\n result = xs[0],\r\n out = [];\r\n while (ind > -1) {\r\n result = fn(result, xs[ind], ind, xs);\r\n out.push(result);\r\n ind--;\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Same as `scanr` but takes no zero/accumulator value.\r\n * @function module:list.scanr1\r\n * @param fn {Function}\r\n * @param xs {Array}\r\n * @returns {Array|*}\r\n */\r\n scanr1 = curry((fn, xs) => {\r\n if (!xs || !xs.length) {\r\n return [];\r\n }\r\n return scanr(fn, last(xs), init(xs));\r\n }),\r\n\r\n /**\r\n * The nub function removes duplicate elements from a list.\r\n * In particular, it keeps only the first occurrence of each element.\r\n * (The name nub means `essence'.) It is a special case of nubBy, which\r\n * allows the programmer to supply their own equality test.\r\n * ```shallowCompare( nub ([1,2,3,4,3,2,1,2,4,3,5]), [1,2,3,4,5] )```\r\n * @function module:list.nub\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n nub = list => nubBy((a, b) => a === b, list),\r\n\r\n /**\r\n * `remove(x, xs)` removes the first occurrence of `x` from `xs`.\r\n * For example, `remove('a', 'banana') === 'bnana';`\r\n * @function module:list.remove\r\n * @param x {*}\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n remove = curry((x, list) => removeBy((a, b) => a === b, x, list)),\r\n\r\n /**\r\n * The sort function implements a stable sorting algorithm.\r\n * It is a special case of sortBy, which allows the programmer\r\n * to supply their own comparison function.\r\n * ```shallowCompare(sort ([1,6,4,3,2,5]), [1,2,3,4,5,6]) // true```\r\n * @function module:list.sort\r\n * @param xs {Array|String|*}\r\n * @returns {Array}\r\n */\r\n sort = xs => sortBy(genericAscOrdering, xs),\r\n\r\n /**\r\n * Sort a list by comparing the results of a key function applied to each\r\n * element. sortOn f is equivalent to sortBy (comparing f), but has the\r\n * performance advantage of only evaluating f once for each element in the\r\n * input list. This is called the decorate-sort-undecorate paradigm, or\r\n * Schwartzian transform.\r\n *\r\n * Elements are arranged from from lowest to highest, keeping duplicates\r\n * in the order they appeared in the input.\r\n *\r\n * Ex:\r\n * ```\r\n * shallowEquals(\r\n * sortOn (head, [[2, \"world\"], [4, \"!\"], [1, \"Hello\"]]),\r\n * [[1,\"Hello\"],[2,\"world\"],[4,\"!\"]]\r\n * ) // true\r\n * ```\r\n * @function module:list.sortOn\r\n * @param valueFn {Function}\r\n * @param xs {Array|String|*}\r\n * @returns {Array}\r\n */\r\n sortOn = curry((valueFn, xs) =>\r\n\r\n // Un-decorate\r\n map(decorated => decorated[1],\r\n\r\n // Decorate and sort\r\n sortBy(\r\n // Ordering\r\n ([a0], [b0]) => genericAscOrdering(a0, b0),\r\n\r\n // Decorate\r\n map(item => [valueFn(item), item], xs)\r\n )\r\n )\r\n ),\r\n\r\n /**\r\n * The sortBy function is the non-overloaded (in haskell terms) version of sort.\r\n * @haskellExample ```\r\n * >>> sortBy (\\(a,_) (b,_) -> compare a b) [(2, \"world\"), (4, \"!\"), (1, \"Hello\")]\r\n * [(1,\"Hello\"),(2,\"world\"),(4,\"!\")]\r\n * ```\r\n * @function module:list.sortBy\r\n * @param orderingFn {Function}\r\n * @param xs {Array|String|*}\r\n * @returns {Array|String|*}\r\n */\r\n sortBy = curry((orderingFn, xs) => sliceCopy(xs).sort(orderingFn || genericAscOrdering)),\r\n\r\n /**\r\n * The insert function takes an element and a list and inserts the element\r\n * into the list at the first position where it is less than or equal to the\r\n * next element. In particular, if the list is sorted before the call, the\r\n * result will also be sorted. It is a special case of insertBy, which allows\r\n * the programmer to supply their own comparison function.\r\n * @function module:list.insert\r\n * @param x {*}\r\n * @param xs {Array|*}\r\n * @returns {Array}\r\n */\r\n insert = curry((x, xs) => {\r\n if (!xs.length) {\r\n return of(xs, x);\r\n }\r\n const foundIndex = findIndex(item => x <= item, xs);\r\n return foundIndex === -1 ? concat([xs, of(xs, x)]) :\r\n concat(intersperse(of(xs, x), splitAt(foundIndex, xs)));\r\n }),\r\n\r\n /**\r\n * A version of `insert` that allows you to specify the ordering of the inserted\r\n * item; Before/at, or after\r\n * @function module:list.insertBy\r\n * @haskellType `insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]`\r\n * @note `Ordering` means 'something that is order-able'\r\n * operated on by this functions logic.\r\n * @param orderingFn {Function} - A function that returns `-1`, `0`, or 1`.\r\n * @param x {*} - Value to insert.\r\n * @param xs {Array} - List to insert into (note new list is returned)\r\n * @returns {Array} - New list.\r\n */\r\n insertBy = curry((orderingFn, x, xs) => {\r\n const limit = length(xs);\r\n if (!limit) {\r\n return [x];\r\n }\r\n let ind = 0;\r\n for (; ind < limit; ind += 1) {\r\n if (orderingFn(x, xs[ind]) <= 0) {\r\n const parts = splitAt(ind, xs);\r\n return concat([parts[0], [x], parts[1]]);\r\n }\r\n }\r\n return aggregateArray(sliceCopy(xs), x);\r\n }),\r\n\r\n /**\r\n * The nubBy function behaves just like nub, except it uses a user-supplied equality predicate.\r\n * @function module:list.nubBy\r\n * @param pred {Function}\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n nubBy = curry((pred, list) => {\r\n if (!length(list)) {\r\n return [];\r\n }\r\n const limit = length(list);\r\n let ind = 0,\r\n currItem,\r\n out = [],\r\n anyOp = storedItem => pred(currItem, storedItem);\r\n for (; ind < limit; ind += 1) {\r\n currItem = list[ind];\r\n if (any(anyOp, out)) {\r\n continue;\r\n }\r\n out.push(currItem);\r\n }\r\n return out;\r\n }),\r\n\r\n /**\r\n * Behaves the same as `remove`, but takes a user-supplied equality predicate.\r\n * @function module:list.removeBy\r\n * @param pred {Function} - Equality predicate `(a, b) => bool`\r\n * @param x {*}\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n removeBy = curry((pred, x, list) => {\r\n const foundIndex = findIndex(item => pred(x, item), list);\r\n if (foundIndex > -1) {\r\n const parts = splitAt(foundIndex, list);\r\n return append(parts[0], tail(parts[1]));\r\n }\r\n return sliceCopy(list);\r\n }),\r\n\r\n /**\r\n * The `removeFirstsBy` function takes a predicate and two lists and returns the first list with the first\r\n * occurrence of each element of the second list removed.\r\n * @function module:list.removeFirstBy\r\n * @param pred {Function}\r\n * @param xs1 {Array|String|*}\r\n * @param xs2 {Array|String|*}\r\n * @returns {Array}\r\n */\r\n removeFirstsBy = curry((pred, xs1, xs2) =>\r\n foldl((agg, x) => removeBy(pred, x, agg), xs1, xs2)),\r\n\r\n /**\r\n * Returns the union on elements matching boolean check passed in.\r\n * @function module:list.unionBy\r\n * @param pred {Function} - `pred :: a -> a -> Bool`\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @returns {Array}\r\n */\r\n unionBy = curry((pred, arr1, arr2) =>\r\n foldl((agg, b) => {\r\n const alreadyAdded = any(a => pred(a, b), agg);\r\n return !alreadyAdded ? (agg.push(b), agg) : agg;\r\n }, sliceCopy(arr1), arr2\r\n )),\r\n\r\n /**\r\n * Creates a union on matching elements from array1.\r\n * @function module:list.union\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @returns {Array}\r\n */\r\n union = curry((arr1, arr2) =>\r\n append(arr1,\r\n filter(elm => !includes(elm, arr1), arr2))),\r\n\r\n /**\r\n * Performs an intersection on list 1 with elements from list 2.\r\n * @function module:list.intersect\r\n * @param arr1 {Array}\r\n * @param arr2 {Array}\r\n * @returns {Array}\r\n */\r\n intersect = curry((arr1, arr2) =>\r\n !arr1 || !arr2 || (!arr1 && !arr2) ? [] :\r\n filter(elm => includes(elm, arr2), arr1)),\r\n\r\n /**\r\n * Returns an intersection by predicate.\r\n * @function module:list.intersectBy\r\n * @param pred {Function} - `pred :: a -> b -> Bool`\r\n * @param list1 {Array}\r\n * @param list2 {Array}\r\n * @return {Array}\r\n */\r\n intersectBy = curry((pred, list1, list2) =>\r\n foldl((agg, a) =>\r\n any(b => pred(a, b), list2) ? (agg.push(a), agg) : agg\r\n , [], list1)),\r\n\r\n /**\r\n * Returns the difference of list 1 from list 2.\r\n * @note The `difference` operation here is non-associative; E.g., `a - b` is not equal to `b - a`;\r\n * @function module:list.difference\r\n * @param array1 {Array}\r\n * @param array2 {Array}\r\n * @returns {Array}\r\n */\r\n difference = curry((array1, array2) => { // augment this with max length and min length ordering on op\r\n if (array1 && !array2) {\r\n return sliceCopy(array1);\r\n }\r\n else if (!array1 && array2 || (!array1 && !array2)) {\r\n return [];\r\n }\r\n return reduce((agg, elm) =>\r\n !includes(elm, array2) ? (agg.push(elm), agg) : agg\r\n , [], array1);\r\n }),\r\n\r\n /**\r\n * Returns the complement of list 0 and the reset of the passed in arrays.\r\n * @function module:list.complement\r\n * @param arr0 {Array}\r\n * @param arrays {...Array}\r\n * @returns {Array}\r\n */\r\n complement = curry2((arr0, ...arrays) =>\r\n reduce((agg, arr) => append(agg, difference(arr, arr0)), [], arrays));\r\n","/**\r\n * @module errorThrowing\r\n * @description Contains error throwing facilities for when a value doesn't match a type.\r\n */\r\nimport {typeOf} from './object/typeOf';\r\nimport {isArray, toTypeRef, toTypeRefName, isOfType} from './object/is';\r\nimport {curry} from './function/curry';\r\n\r\nexport const\r\n\r\n /**\r\n * Pretty prints an array of types/type-strings for use by error messages;\r\n * Outputs \"`SomeTypeName`, ...\" from [SomeType, 'SomeTypeName', etc...]\r\n * @function module:errorThrowing.typeRefsToStringOrError\r\n * @param types {Array|TypesArray}\r\n * @return {String}\r\n * @private\r\n */\r\n typeRefsToStringOrError = types => types.length ?\r\n types.map(type => `\\`${toTypeRefName(type)}\\``).join(', ') : '',\r\n\r\n /**\r\n * Prints a message from an object. Object signature:\r\n * {contextName, valueName, value, expectedTypeName, foundTypeName, messageSuffix}\r\n * @function module:errorThrowing.defaultErrorMessageCall\r\n * @param tmplContext {Object|TemplateContext} - Object to use in error template.\r\n * @returns {string}\r\n * @private\r\n */\r\n defaultErrorMessageCall = tmplContext => {\r\n const {\r\n contextName, valueName, value, expectedTypeName,\r\n foundTypeName, messageSuffix\r\n } = tmplContext,\r\n isMultiTypeNames = isArray(expectedTypeName),\r\n typesCopy = isMultiTypeNames ? 'of type' : 'of one of the types',\r\n typesToMatchCopy = isMultiTypeNames ? typeRefsToStringOrError(expectedTypeName) : expectedTypeName;\r\n return (contextName ? `\\`${contextName}.` : '`') +\r\n `${valueName}\\` is not ${typesCopy}: ${typesToMatchCopy}. ` +\r\n `Type received: ${foundTypeName}. Value: ${value};` +\r\n `${messageSuffix ? ' ' + messageSuffix + ';' : ''}`;\r\n },\r\n\r\n /**\r\n * Gets the error message thrower seeded with passed in errorMessage template call.\r\n * @function module:errorThrowing.getErrorIfNotTypeThrower$\r\n * @param errorMessageCall {Function|ErrorMessageCall}\r\n * @param typeChecker {Function|TypeChecker} - Function:Boolean\r\n * @returns {Function|ErrorIfNotType}\r\n * @private\r\n */\r\n _getErrorIfNotTypeThrower = (errorMessageCall, typeChecker = isOfType) =>\r\n (ValueType, contextName, valueName, value, messageSuffix = null) => {\r\n const expectedTypeName = toTypeRef(ValueType),\r\n foundTypeName = typeOf(value);\r\n if (typeChecker(ValueType, value)) { return value; } // Value matches type\r\n throw new Error(errorMessageCall(\r\n {contextName, valueName, value, expectedTypeName, foundTypeName, messageSuffix}\r\n ));\r\n },\r\n\r\n /**\r\n * Gets the error message thrower seeded with passed in errorMessage template call.\r\n * @function module:errorThrowing.getErrorIfNotTypesThrower$\r\n * @param errorMessageCall {Function|ErrorMessageCall}\r\n * @param typeChecker {Function|TypeChecker} - Function:Boolean\r\n * @returns {Function|ErrorIfNotTypes}\r\n * @private\r\n */\r\n _getErrorIfNotTypesThrower = (errorMessageCall, typeChecker = isOfType) =>\r\n (valueTypes, contextName, valueName, value, messageSuffix = null) => {\r\n const expectedTypeNames = valueTypes.map(toTypeRef),\r\n matchFound = valueTypes.some(ValueType => typeChecker(ValueType, value)),\r\n foundTypeName = typeOf(value);\r\n if (matchFound) { return value; }\r\n throw new Error(\r\n errorMessageCall({\r\n contextName, valueName, value,\r\n expectedTypeName: expectedTypeNames, foundTypeName,\r\n messageSuffix\r\n })\r\n );\r\n },\r\n\r\n /**\r\n * Checks that passed in `value` is of given `type`. Throws an error if value\r\n * is not of given `type`. This is the un-curried version. For the curried version\r\n * see `module:errorThrowing.errorIfNotType`.\r\n * @function module:errorThrowing.errorIfNotType$\r\n * @param type {String|Function} - Type's name or type itself.\r\n * @param contextName {String} - Name of context to attribute errors if thrown.\r\n * @param valueName {String} - String rep of value.\r\n * @param value {*}\r\n * @param [messageSuffix=null] {String} - Optional.\r\n * @returns {*} - Given `value` if `value` matches passed in type.\r\n * @private\r\n */\r\n _errorIfNotType = _getErrorIfNotTypeThrower(defaultErrorMessageCall),\r\n\r\n /**\r\n * Checks that passed in `value` is of one of the given `types`. Throws an error if value\r\n * is not of one of the given `types`. This is the un-curried version. For the curried version\r\n * see `module:errorThrowing.errorIfNotTypes`.\r\n * @type {Function|module:errorThrowing.errorIfNotTypes}\r\n * @function module:errorThrowing.errorIfNotTypes$\r\n * @param types {Array} - Array of one or more types or type names themselves.\r\n * @param contextName {String} - Name of context to attribute errors if thrown.\r\n * @param valueName {String} - String rep of value.\r\n * @param value {*}\r\n * @returns {*} - Given `value` if `value` matches passed in type.\r\n * @private\r\n */\r\n _errorIfNotTypes = _getErrorIfNotTypesThrower(defaultErrorMessageCall),\r\n\r\n /**\r\n * Returns a function that can be used to ensure that values are of a given type.\r\n * Also throws informative error messages containing the value types, names, expected type names,\r\n * etc.\r\n * @function module:errorThrowing.getErrorIfNotTypeThrower\r\n * @param errorMessageCall {Function|ErrorMessageCall} - Template function (takes an info-object and returns a printed string).\r\n * @returns {Function|ErrorIfNotType} - Returns a function with the same signature as `errorIfNotType` though curried.\r\n */\r\n getErrorIfNotTypeThrower = errorMessageCall => curry(_getErrorIfNotTypeThrower(errorMessageCall)),\r\n\r\n /**\r\n * Returns a function that can be used to ensure that a value is of one or more given types.\r\n * The returned function is used in cases where informative error messages\r\n * containing the value types, names, expected type names, are-required/should-be-used etc.\r\n * @function module:errorThrowing.getErrorIfNotTypesThrower\r\n * @param errorMessageCall {Function|ErrorMessageCall} - Template function (takes an info-object and returns a printed string).\r\n * @returns {Function|ErrorIfNotTypes} - Returns a function with the same signature as `errorIfNotTypes` though curried.\r\n */\r\n getErrorIfNotTypesThrower = errorMessageCall => curry(_getErrorIfNotTypesThrower(errorMessageCall)),\r\n\r\n /**\r\n * Checks that passed in `value` is of given `type`. Throws an error if value\r\n * is not of given `type`. Curried.\r\n * @function module:errorThrowing.errorIfNotType\r\n * @param type {String|Function} - Type's name or type itself.\r\n * @param contextName {String} - Name of context to attribute errors if thrown.\r\n * @param valueName {String} - String rep of value.\r\n * @param value {*}\r\n * @param [messageSuffix=null] {String} - Optional.\r\n * @returns {*} - Given `value` if `value` matches passed in type.\r\n * @curried\r\n */\r\n errorIfNotType = curry(_errorIfNotType),\r\n\r\n /**\r\n * Checks that passed in `value` is of one of the given `types`. Throws an error if value\r\n * is not of one of the given `types`. Curried.\r\n * @function module:errorThrowing.errorIfNotTypes\r\n * @param types {Array} - Array of one or more types or type names themselves.\r\n * @param contextName {String} - Name of context to attribute errors if thrown.\r\n * @param valueName {String} - String rep of value.\r\n * @param value {*}\r\n * @returns {*} - Given `value` if `value` matches passed in type.\r\n * @curried\r\n */\r\n errorIfNotTypes = curry(_errorIfNotTypes)\r\n;\r\n\r\n/**\r\n * @typedef {*} Any - Synonym for 'any value'.\r\n */\r\n\r\n/**\r\n * @typedef {String|Function} TypeRef\r\n * @description Type reference. Type itself or Type's name; E.g., `Type.name`;\r\n */\r\n\r\n/**\r\n * @typedef {Object} TemplateContext\r\n * @description Template context used for error message renderers (functions that take a context obj and return a string).\r\n * @property value {*}\r\n * @property valueName {String}\r\n * @property expectedTypeName {String} - Expected name of constructor of `value`; E.g., usually `SomeConstructor.name`;\r\n * @property foundTypeName {String} - Found types name; E.g., `FoundConstructor.name`;\r\n * @property [messageSuffix=null] {*} - Message suffix (sometimes an extra hint or instructions for\r\n * directing user to fix where his/her error has occurred). Optional.\r\n */\r\n\r\n/**\r\n * @typedef {Array<(String|Function)>} TypesArray\r\n */\r\n\r\n/**\r\n * @typedef {Function} TypeChecker\r\n * @description Checks whether a value is of given type.\r\n * @param Type {TypeRef} - a Type or it's name; E.g., `Type.name`.\r\n * @param value {*}\r\n * @returns {Boolean}\r\n */\r\n\r\n/**\r\n * @typedef {Function} ErrorMessageCall\r\n * @description Error message template function.\r\n * @param tmplContext {TemplateContext}\r\n * @returns {String}\r\n */\r\n\r\n/**\r\n * @typedef {Function} ErrorIfNotType\r\n * @description Used to ensure value matches passed in type.\r\n * @param type {TypeRef} - Constructor name or constructor.\r\n * @param contextName {String}\r\n * @param valueName {String}\r\n * @param value {*}\r\n * @throws {Error} - If value doesn't match type.\r\n * @returns {*} - What ever value is.\r\n */\r\n\r\n/**\r\n * @typedef {Function} ErrorIfNotTypes\r\n * @description Used to ensure a value matches one of one or more types passed in.\r\n * @param valueTypes {TypesArray} - Array of constructor names or constructors.\r\n * @param contextName {String}\r\n * @param valueName {String}\r\n * @param value {*}\r\n * @throws {Error} - If value doesn't match type.\r\n * @returns {*} - Whatever value is.\r\n */\r\n","/**\r\n * @module string\r\n * @description Contains functions for strings.\r\n */\r\nimport {intercalate, map, filter} from './list';\r\nimport {split} from './jsPlatform/string';\r\nimport {compose} from './function/compose';\r\nimport {join} from './jsPlatform/array';\r\nimport {_errorIfNotType} from './errorThrowing';\r\n\r\nexport {split};\r\n\r\nexport const\r\n\r\n /**\r\n * Splits a string on all '\\n', '\\r', '\\n\\r', or '\\r\\n' characters.\r\n * @function module:string.lines\r\n * @param str {String}\r\n * @returns {Array}\r\n */\r\n lines = split(/[\\n\\r]/gm),\r\n\r\n /**\r\n * Splits a string on all '\\s' and/or all '\\t' characters.\r\n * @function module:string.words\r\n * @param str{String}\r\n * @returns {Array}\r\n */\r\n words = split(/[\\s\\t]/gm),\r\n\r\n /**\r\n * Intersperse an array of strings with '\\s' and then concats them.\r\n * @function module:string.unwords\r\n * @param arr {String}\r\n * @returns {Array}\r\n */\r\n unwords = intercalate(' '),\r\n\r\n /**\r\n * Intersperses a '\\n' character into a list of strings and then concats it.\r\n * @function module:string.unlines\r\n * @param list {Array|String|*}\r\n * @returns {Array}\r\n */\r\n unlines = intercalate('\\n'),\r\n\r\n /**\r\n * Lower cases first character of a non-empty string.\r\n * @function module:string.lcaseFirst\r\n * @param xs {String}\r\n * @returns {string}\r\n * @throws {Error} - Throws error if receiving anything that is not a string.\r\n */\r\n lcaseFirst = xs => {\r\n _errorIfNotType(String, 'lcaseFirst', 'xs', xs);\r\n return xs[0].toLowerCase() + xs.substring(1);\r\n },\r\n\r\n /**\r\n * Upper cases first character of a non-empty string.\r\n * @function module:string.ucaseFirst\r\n * @param xs {String}\r\n * @returns {string}\r\n * @throws {Error} - Throws error if receiving anything that is not a string.\r\n */\r\n ucaseFirst = xs => {\r\n _errorIfNotType(String, 'ucaseFirst', 'xs', xs);\r\n return xs[0].toUpperCase() + xs.substring(1);\r\n },\r\n\r\n /**\r\n * Camel cases (class case) a string.\r\n * @function module:string.camelCase\r\n * @param xs {String}\r\n * @param [pattern=/[^a-z\\d/i]/] {RegExp} - Pattern to split on. Optional.\r\n * @throws {Error} - Throws error if param `xs` is not a string.\r\n * @returns {string}\r\n * @curried\r\n */\r\n camelCase = (xs, pattern = /[^a-z\\d]/i) => compose(\r\n join(''),\r\n map(str => ucaseFirst(str.toLowerCase())),\r\n filter(x => !!x),\r\n split(pattern)\r\n )(_errorIfNotType(String, 'camelCase', 'xs', xs)),\r\n\r\n /**\r\n * Class cases a string. Uses pattern /[^a-z\\d/i]/ to split on.\r\n * If you require a different pattern use `string.camelCase(str, pattern)`\r\n * and then upper case first character (`ucaseFirst`).\r\n * @function module:string.classCase\r\n * @param xs {String}\r\n * @returns {string}\r\n * @throws {Error} - Throws error if `xs` is not a string (via `camelCase` call).\r\n */\r\n classCase = compose(ucaseFirst, camelCase)\r\n\r\n;\r\n\r\n/**\r\n * Functional version of `String.prototype.split`.\r\n * @function module:string.split\r\n * @param separator {String|RegExp}\r\n * @param str {String}\r\n * @returns {Array}\r\n */\r\n","/**\r\n * @module fjl\r\n * @description Exports all module methods (object, list, string modules etc.).\r\n * @goal to include everything from haskell's Prelude where it makes sense in order to create\r\n * a subset of functions which can make the javascript developer more efficient and make his/her\r\n * code more concise (and functional).\r\n * @motivation preludejs, lodash/fp, RamdaJs, Haskell.\r\n * @see http://hackage.haskell.org/package/base-4.10.0.0/docs/Prelude.html\r\n * @see http://hackage.haskell.org/package/base-4.10.0.0/docs/Data-List.html\r\n */\r\nexport * from './object';\r\nexport * from './boolean';\r\nexport * from './function';\r\nexport * from './list';\r\nexport * from './string';\r\nexport * from './utils';\r\nexport * from './errorThrowing';\r\n\r\n/**\r\n * @typedef {String|Function|ArrayBufferConstructor|ArrayConstructor|BooleanConstructor|MapConstructor|NumberConstructor|SetConstructor|WeakMapConstructor|WeakSetConstructor} TypeRef\r\n * @description Type reference. Either actual type or type's name; E.g., `Type.name`\r\n * Also note: Class cased names are use for values that do not have `name` properties; Namely: 'Null', 'NaN' and 'Undefined' (for their respective values respectively).\r\n */\r\n"],"names":["returnCurried","executeArity","unmetArityNum","fn","argsToCurry","func","x","executeAsCurriedFunc","Array","from","arguments","a","b","c","d","e","args","unmetArity","concatedArgs","concat","canBeCalled","length","newExpectedArity","curryN","Function","Error","curry","curry2","curry3","curry4","curry5","fPureTakesOne","name","arg","f","fPureTakes2","arg1","arg2","fPureTakes3","arg3","fPureTakes4","arg4","fPureTakes5","arg5","fPureTakesOneOrMore","defineReverse","prototype","reverse","reduceRight","agg","item","push","map","filter","reduce","forEach","some","every","join","apply","call","flipN","flip","flip3","flip4","flip5","instanceOf","instanceConstructor","instance","hasOwnProperty","native","Object","getOwnPropertyNames","key","operation","keys","assign","obj0","objs","topAgg","obj","_Number","Number","_NaN","_Null","_Undefined","typeOf","value","retVal","undefined","constructorName","constructor","isNaN","_String","String","_Object","_Boolean","Boolean","_Function","_Array","_Symbol","_Map","_Set","_WeakMap","_WeakSet","toTypeRef","type","toTypeRefs","types","toTypeRefName","Type","ref","toTypeRefNames","isFunction","isType","isOfType","isClass","test","substr","isCallable","isArray","isObject","isBoolean","isNumber","isString","isMap","isSet","isWeakMap","isWeakSet","isUndefined","isNull","isSymbol","isUsableImmutablePrimitive","typeOfX","isset","isEmptyList","isEmptyObject","isEmptyCollection","size","isEmpty","isOneOf","typeName","isFunctor","lookup","of","copy","out","slice","Symbol","Promise","searchObj","nsString","indexOf","parts","split","limit","ind","parent","node","assignDeep","propDescription","getOwnPropertyDescriptor","get","set","writable","includes","xs","lastIndexOf","isTruthy","isFalsy","alwaysTrue","alwaysFalse","equal","equalAll","i","aggregateArray","sliceFrom","startInd","sliceTo","toInd","sliceCopy","genericAscOrdering","lengths","lists","toShortest","listLengths","smallLen","Math","min","list","reduceUntil","pred","op","result","reduceUntilRight","arr","lastIndex","len","findIndexWhere","predicateFulfilled","findIndexWhereRight","findIndicesWhere","findWhere","elm","objUnion","obj1","obj2","objIntersect","objDifference","objComplement","log","console","bind","error","peek","pop","jsonClone","JSON","parse","stringify","toAssocList","toAssocListDeep","TypeConstraint","fromAssocList","OutType","fromAssocListDeep","toArray","compose","arg0","id","negateF","negateF2","negateF3","negateFN","until","predicate","typeInstance","fnOrError","symbolName","noop","normalizeStep","to","step","range","append","listAppend","head","last","tail","init","uncons","unconsr","item0","concatMap","foldableOfA","intersperse","between","lastInd","intercalate","xss","transpose","numLists","ind2","longestListLen","maximum","outLists","outList","subsequences","listLen","pow","entry","j","swapped","ind1","tmp","permutations","repeat","foldl","foldr","foldl1","foldr1","mapAccumL","zero","mapped","tuple","mapAccumR","iterate","lastX","replicate","cycle","unfoldr","resultTuple","findIndex","findIndices","elemIndex","foundInd","elemIndices","take","drop","splitAt","takeWhile","dropWhile","splitPoint","dropWhileEnd","span","breakOnList","at","find","partition","elem","notElem","isPrefixOf","xs1","xs2","limit1","limit2","isSuffixOf","isInfixOf","foundLen","isSubsequenceOf","lenXs1","group","groupBy","equalityOp","prevItem","predOp","inits","tails","stripPrefix","prefix","zip","arr1","arr2","a1","a2","zipN","trimmedLists","zip3","arr3","zip4","arr4","zip5","arr5","zipWith","zipWithN","lenOfTrimmed","zipWith3","xs3","zipWith4","xs4","zipWith5","xs5","unzip","unzipN","lenItem0","any","p","all","and","or","not","sum","product","sortBy","minimum","scanl","scanl1","scanr","scanr1","nub","nubBy","remove","removeBy","sort","sortOn","valueFn","decorated","a0","b0","orderingFn","insert","foundIndex","insertBy","currItem","anyOp","storedItem","removeFirstsBy","unionBy","alreadyAdded","union","intersect","intersectBy","list1","list2","difference","array1","array2","complement","arr0","arrays","typeRefsToStringOrError","defaultErrorMessageCall","tmplContext","contextName","valueName","expectedTypeName","foundTypeName","messageSuffix","isMultiTypeNames","typesCopy","typesToMatchCopy","_getErrorIfNotTypeThrower","errorMessageCall","typeChecker","ValueType","_getErrorIfNotTypesThrower","valueTypes","expectedTypeNames","matchFound","_errorIfNotType","_errorIfNotTypes","getErrorIfNotTypeThrower","getErrorIfNotTypesThrower","errorIfNotType","errorIfNotTypes","lines","words","unwords","unlines","lcaseFirst","toLowerCase","substring","ucaseFirst","toUpperCase","camelCase","pattern","str","classCase"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;AAWA,IAWIA,aAAa,GAAG,SAAhBA,aAAgB,CAACC,YAAD,EAAeC,aAAf,EAA8BC,EAA9B,EAAkCC,WAAlC,EAAkD;UACtDF,aAAR;SACS,CAAL;;aAEW,SAASG,IAAT,CAAcC,CAAd,EAAiB;;eAEbC,oBAAoB,CAACJ,EAAD,EAAKF,YAAL,EAAmBC,aAAnB,EAAkCM,KAAK,CAACC,IAAN,CAAWC,SAAX,CAAlC,EAAyDN,WAAzD,CA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/dist/iife/fjl.min.js b/dist/iife/fjl.min.js index a88d611c..1ad9fc70 100644 --- a/dist/iife/fjl.min.js +++ b/dist/iife/fjl.min.js @@ -1 +1 @@ -/**! fjl.js 1.7.0 | License: BSD-3-Clause | Built-on: Sat Nov 10 2018 11:42:45 GMT-0500 (Eastern Standard Time) **/var fjl=function(n){"use strict";function r(n){this.wrapped=n}function t(n){function t(n,r){return new Promise(function(t,u){var c={key:n,arg:r,resolve:t,reject:u,next:null};i?i=i.next=c:(o=i=c,e(n,r))})}function e(t,o){try{var i=n[t](o),c=i.value,f=c instanceof r;Promise.resolve(f?c.wrapped:c).then(function(n){if(f)return void e("next",n);u(i.done?"return":"normal",n)},function(n){e("throw",n)})}catch(n){u("throw",n)}}function u(n,r){switch(n){case"return":o.resolve({value:r,done:!0});break;case"throw":o.reject(r);break;default:o.resolve({value:r,done:!1})}o=o.next,o?e(o.key,o.arg):i=null}var o,i;this._invoke=t,"function"!=typeof n.return&&(this.return=void 0)}function e(n,r){return(e=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n})(n,r)}function u(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(n){return!1}}function o(n,r,t){return o=u()?Reflect.construct:function(n,r,t){var u=[null];u.push.apply(u,r);var o=Function.bind.apply(n,u),i=new o;return t&&e(i,t.prototype),i},o.apply(null,arguments)}function i(n,r){return a(n)||l(n,r)||v()}function c(n){return f(n)||s(n)||p()}function f(n){if(Array.isArray(n)){for(var r=0,t=new Array(n.length);r=r||!r,f=r-o.length;return i?n.apply(void 0,c(o)):h(r,f,n,o)},m=function(n,r){if(!(r&&r instanceof Function))throw new Error("`curry*` functions expect first parameter to be of type `Function` though received ".concat(r,"?"));for(var t=arguments.length,e=new Array(t>2?t-2:0),u=2;u1?r-1:0),e=1;e1?t-1:0),u=1;u1?r-1:0),e=1;e1?r-1:0),e=1;e1?r-1:0),e=1;e1?t-1:0),u=1;u1?t-1:0),u=1;u1?r-1:0),e=1;e-1}}(),Un=N("indexOf"),Ln=N("lastIndexOf"),Dn=function(n){return!!n},qn=function(n){return!n},Jn=function(){return!0},Vn=function(){return!1},Gn=g(function(n,r){return n===r}),Hn=w(function(n){for(var r=arguments.length,t=new Array(r>1?r-1:0),e=1;er?1:nu?Yn(u,n):Zn(n)},r)}),tr=g(function(n,r,t,e){var u=D(e);if(!u)return t;for(var o=0,i=t;o=0&&!n(e[o],o,e);o--)i=r(i,e[o],o,e);return i}),ur=tr(Vn),or=er(Vn),ir=function(n){var r=D(n);return r?r-1:0},cr=g(function(n,r){for(var t=0,e=D(r);t=0;t-=1){if(!!n(r[t],t,r))return t}return-1}),ar=g(function(n,r){for(var t=D(r),e=0,u=[];e1?r-1:0),e=1;e1&&void 0!==arguments[1]?arguments[1]:Object;return J(r).map(function(e){return t&&fn(t,r[e])?[e,n(r[e],t)]:[e,r[e]]})},Ar=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object;return n.reduce(function(n,r){var t=i(r,2),e=t[0],u=t[1];return n[e]=u,n},new r)},Or=function n(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object;return r.reduce(function(r,e){var u=i(e,2),o=u[0],c=u[1];return pn(c)&&pn(c[0])&&2===c[0].length?(r[o]=n(c,t),r):(r[o]=c,r)},new t)},Nr=function(n){switch(y(n)){case"Null":case"Undefined":return[];case String.name:case Array.name:case"WeakMap":case"WeakSet":case"Map":case"Set":return Array.from(n);case Object.name:default:return wr(n)}},Sr=function(){for(var n=arguments.length,r=new Array(n),t=0;tr?t>0?-t:t:t<0?-1*t:t},Mr=g(function(n,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,e=n,u=[];if(0===(t=Wr(n,r,t))||n===r)return[n];for(;(r-e)*t>=0;e+=t)u.push(e);return u}),Rr=N("split"),zr=w(function(){for(var n=arguments.length,r=new Array(n),t=0;t=0;t-=1)r+=n[t];return r;default:for(;t>=0;t-=1)r.push(n[t]);return r}},Gr=g(function(n,r){if(!r||!r.length)return r;var t=r.length,e=t-1,u=Wn(r),o=0;if(dn(r)){for(;o0},i)},Qr=function(n){for(var r=D(n),t=Math.pow(2,r),e=[],u=0;u=0;i--)o=n(c,e[i],i),c=o[0],f=o[1];return[c,f]}),ut=g(function(n,r,t){for(var e=0,u=[],o=t;e=0;u--){if(n[u]!==r[o])return!1;o-=1}return!0}),Ft=g(function(n,r){var t=D(n),e=D(r);if(e-1&&(t+=1),t===o)return!0}return!1}),Pt=function(n){return Wt(function(n,r){return n===r},n)},Wt=g(function(n,r){var t=D(r);if(!t)return Zn(r);for(var e,u,o=0,i=function(r){return n(r,e)&&o++,!!n(r,u)&&(e=r,!0)},c=[];o1?r-1:0),e=1;e-1;)o=n(o,t[u],u,t),i.push(o),u--;return i}),ce=g(function(n,r){return r&&r.length?ie(n,_r(r),Ur(r)):[]}),fe=function(n){return he(function(n,r){return n===r},n)},ae=g(function(n,r){return de(function(n,r){return n===r},n,r)}),se=function(n){return pe($n,n)},le=g(function(n,r){return Kn(function(n){return n[1]},pe(function(n,r){var t=i(n,1),e=t[0],u=i(r,1),o=u[0];return $n(e,o)},Kn(function(r){return[n(r),r]},r)))}),pe=g(function(n,r){return Zn(r).sort(n||$n)}),ve=g(function(n,r){if(!r.length)return Wn(r,n);var t=at(function(r){return n<=r},r);return qr(-1===t?[r,Wn(r,n)]:Gr(Wn(r,n),ht(t,r)))}),ye=g(function(n,r,t){var e=D(t);if(!e)return[r];for(var u=0;u-1){var u=ht(e,t);return zr(u[0],Br(u[1]))}return Zn(t)}),me=g(function(n,r,t){return Zr(function(r,t){return de(n,t,r)},r,t)}),ge=g(function(n,r,t){return Zr(function(r,t){return Qt(function(r){return n(r,t)},r)?r:(r.push(t),r)},Zn(r),t)}),we=g(function(n,r){return zr(n,St(function(r){return!Bn(r,n)},r))}),be=g(function(n,r){return n&&r&&(n||r)?St(function(n){return Bn(n,r)},n):[]}),Ae=g(function(n,r,t){return Zr(function(r,e){return Qt(function(r){return n(e,r)},t)?(r.push(e),r):r},[],r)}),Oe=g(function(n,r){return n&&!r?Zn(n):!n&&r||!n&&!r?[]:ur(function(n,t){return Bn(t,r)?n:(n.push(t),n)},[],n)}),Ne=w(function(n){for(var r=arguments.length,t=new Array(r>1?r-1:0),e=1;e1&&void 0!==arguments[1]?arguments[1]:an;return function(t,e,u,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,c=tn(t),f=y(o);if(r(t,o))return o;throw new Error(n({contextName:e,valueName:u,value:o,expectedTypeName:c,foundTypeName:f,messageSuffix:i}))}},xe=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:an;return function(t,e,u,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,c=t.map(tn),f=t.some(function(n){return r(n,o)}),a=y(o);if(f)return o;throw new Error(n({contextName:e,valueName:u,value:o,expectedTypeName:c,foundTypeName:a,messageSuffix:i}))}},je=ke(Te),Ie=xe(Te),Fe=function(n){return g(ke(n))},Ee=function(n){return g(xe(n))},Pe=g(je),We=g(Ie),Me=Rr(/[\n\r]/gm),Re=Rr(/[\s\t]/gm),ze=Hr(" "),Ce=Hr("\n"),_e=function(n){return je(String,"lcaseFirst","xs",n),n[0].toLowerCase()+n.substring(1)},Be=function(n){return je(String,"ucaseFirst","xs",n),n[0].toUpperCase()+n.substring(1)},Ue=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:/[^a-z\d]/i;return Sr(F(""),Kn(function(n){return Be(n.toLowerCase())}),St(function(n){return!!n}),Rr(r))(je(String,"camelCase","xs",n))},Le=Sr(Be,Ue);return n.instanceOf=U,n.hasOwnProperty=L,n.length=D,n.native=q,n.assign=V,n.keys=J,n.lookup=Pn,n.typeOf=y,n.copy=Mn,n.toTypeRef=tn,n.toTypeRefs=en,n.toTypeRefName=un,n.toTypeRefNames=on,n.isFunction=cn,n.isType=fn,n.isOfType=an,n.isClass=sn,n.isCallable=ln,n.isObject=vn,n.isBoolean=yn,n.isNumber=hn,n.isString=dn,n.isMap=mn,n.isSet=gn,n.isWeakMap=wn,n.isWeakSet=bn,n.isUndefined=An,n.isNull=On,n.isSymbol=Nn,n.isUsableImmutablePrimitive=Sn,n.isEmptyList=Tn,n.isEmptyObject=kn,n.isEmptyCollection=xn,n.isEmpty=jn,n.isset=In,n.isOneOf=Fn,n.isFunctor=En,n.isArray=pn,n.of=Wn,n.searchObj=Rn,n.assignDeep=zn,n.objUnion=lr,n.objIntersect=pr,n.objDifference=vr,n.objComplement=yr,n.log=hr,n.error=dr,n.peek=mr,n.jsonClone=gr,n.toArray=Nr,n.toAssocList=wr,n.toAssocListDeep=br,n.fromAssocList=Ar,n.fromAssocListDeep=Or,n.isTruthy=Dn,n.isFalsy=qn,n.alwaysTrue=Jn,n.alwaysFalse=Vn,n.equal=Gn,n.equalAll=Hn,n.apply=W,n.call=M,n.compose=Sr,n.curryN=m,n.curry=g,n.curry2=w,n.curry3=b,n.curry4=A,n.curry5=O,n.flipN=R,n.flip=z,n.flip3=C,n.flip4=_,n.flip5=B,n.id=Tr,n.negateF=kr,n.negateF2=xr,n.negateF3=jr,n.negateFN=Ir,n.until=Fr,n.fnOrError=Er,n.noop=Pr,n.map=Kn,n.append=zr,n.head=Cr,n.last=_r,n.tail=Br,n.init=Ur,n.uncons=Lr,n.unconsr=Dr,n.concat=qr,n.concatMap=Jr,n.reverse=Vr,n.intersperse=Gr,n.intercalate=Hr,n.transpose=Kr,n.subsequences=Qr,n.swapped=Xr,n.permutations=Yr,n.foldl=Zr,n.foldr=$r,n.foldl1=nt,n.foldr1=rt,n.mapAccumL=tt,n.mapAccumR=et,n.iterate=ut,n.repeat=ot,n.replicate=it,n.cycle=ct,n.unfoldr=ft,n.findIndex=at,n.findIndices=st,n.elemIndex=lt,n.elemIndices=pt,n.take=vt,n.drop=yt,n.splitAt=ht,n.takeWhile=dt,n.dropWhile=mt,n.dropWhileEnd=gt,n.span=wt,n.breakOnList=bt,n.at=At,n.find=Ot,n.forEach=Nt,n.filter=St,n.partition=Tt,n.elem=kt,n.notElem=xt,n.isPrefixOf=jt,n.isSuffixOf=It,n.isInfixOf=Ft,n.isSubsequenceOf=Et,n.group=Pt,n.groupBy=Wt,n.inits=Mt,n.tails=Rt,n.stripPrefix=zt,n.zip=Ct,n.zipN=_t,n.zip3=Bt,n.zip4=Ut,n.zip5=Lt,n.zipWith=Dt,n.zipWithN=qt,n.zipWith3=Jt,n.zipWith4=Vt,n.zipWith5=Gt,n.unzip=Ht,n.unzipN=Kt,n.any=Qt,n.all=Xt,n.and=Yt,n.or=Zt,n.not=$t,n.sum=ne,n.product=re,n.maximum=te,n.minimum=ee,n.scanl=ue,n.scanl1=oe,n.scanr=ie,n.scanr1=ce,n.nub=fe,n.remove=ae,n.sort=se,n.sortOn=le,n.sortBy=pe,n.insert=ve,n.insertBy=ye,n.nubBy=he,n.removeBy=de,n.removeFirstsBy=me,n.unionBy=ge,n.union=we,n.intersect=be,n.intersectBy=Ae,n.difference=Oe,n.complement=Ne,n.slice=_n,n.includes=Bn,n.indexOf=Un,n.lastIndexOf=Ln,n.push=E,n.range=Mr,n.sliceFrom=Xn,n.sliceTo=Yn,n.sliceCopy=Zn,n.genericAscOrdering=$n,n.lengths=nr,n.toShortest=rr,n.reduceUntil=tr,n.reduceUntilRight=er,n.reduce=ur,n.reduceRight=or,n.lastIndex=ir,n.findIndexWhere=cr,n.findIndexWhereRight=fr,n.findIndicesWhere=ar,n.findWhere=sr,n.aggregateArray=Qn,n.split=Rr,n.lines=Me,n.words=Re,n.unwords=ze,n.unlines=Ce,n.lcaseFirst=_e,n.ucaseFirst=Be,n.camelCase=Ue,n.classCase=Le,n.fPureTakesOne=N,n.fPureTakes2=S,n.fPureTakes3=T,n.fPureTakes4=k,n.fPureTakes5=x,n.fPureTakesOneOrMore=j,n.typeRefsToStringOrError=Se,n.defaultErrorMessageCall=Te,n._getErrorIfNotTypeThrower=ke,n._getErrorIfNotTypesThrower=xe,n._errorIfNotType=je,n._errorIfNotTypes=Ie,n.getErrorIfNotTypeThrower=Fe,n.getErrorIfNotTypesThrower=Ee,n.errorIfNotType=Pe,n.errorIfNotTypes=We,n}({}); \ No newline at end of file +/**! fjl.js 1.7.0 | License: BSD-3-Clause | Built-on: Sat Nov 10 2018 12:36:13 GMT-0500 (Eastern Standard Time) **/var fjl=function(n){"use strict";function r(n){this.wrapped=n}function t(n){function t(n,r){return new Promise(function(t,u){var c={key:n,arg:r,resolve:t,reject:u,next:null};i?i=i.next=c:(o=i=c,e(n,r))})}function e(t,o){try{var i=n[t](o),c=i.value,f=c instanceof r;Promise.resolve(f?c.wrapped:c).then(function(n){if(f)return void e("next",n);u(i.done?"return":"normal",n)},function(n){e("throw",n)})}catch(n){u("throw",n)}}function u(n,r){switch(n){case"return":o.resolve({value:r,done:!0});break;case"throw":o.reject(r);break;default:o.resolve({value:r,done:!1})}o=o.next,o?e(o.key,o.arg):i=null}var o,i;this._invoke=t,"function"!=typeof n.return&&(this.return=void 0)}function e(n,r){return(e=Object.setPrototypeOf||function(n,r){return n.__proto__=r,n})(n,r)}function u(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(n){return!1}}function o(n,r,t){return o=u()?Reflect.construct:function(n,r,t){var u=[null];u.push.apply(u,r);var o=Function.bind.apply(n,u),i=new o;return t&&e(i,t.prototype),i},o.apply(null,arguments)}function i(n,r){return a(n)||l(n,r)||v()}function c(n){return f(n)||s(n)||p()}function f(n){if(Array.isArray(n)){for(var r=0,t=new Array(n.length);r=r||!r,f=r-o.length;return i?n.apply(void 0,c(o)):h(r,f,n,o)},m=function(n,r){if(!(r&&r instanceof Function))throw new Error("`curry*` functions expect first parameter to be of type `Function` though received ".concat(r,"?"));for(var t=arguments.length,e=new Array(t>2?t-2:0),u=2;u1?r-1:0),e=1;e1?t-1:0),u=1;u1?r-1:0),e=1;e1?r-1:0),e=1;e1?r-1:0),e=1;e1?t-1:0),u=1;u1?t-1:0),u=1;u1?r-1:0),e=1;e-1}}(),Un=N("indexOf"),Ln=N("lastIndexOf"),Dn=function(n){return!!n},qn=function(n){return!n},Jn=function(){return!0},Vn=function(){return!1},Gn=g(function(n,r){return n===r}),Hn=w(function(n){for(var r=arguments.length,t=new Array(r>1?r-1:0),e=1;er?1:nu?Yn(u,n):Zn(n)},r)}),tr=g(function(n,r,t,e){var u=D(e);if(!u)return t;for(var o=0,i=t;o=0&&!n(e[o],o,e);o--)i=r(i,e[o],o,e);return i}),ur=tr(Vn),or=er(Vn),ir=function(n){var r=D(n);return r?r-1:0},cr=g(function(n,r){for(var t=0,e=D(r);t=0;t-=1){if(!!n(r[t],t,r))return t}return-1}),ar=g(function(n,r){for(var t=D(r),e=0,u=[];e1?r-1:0),e=1;e1&&void 0!==arguments[1]?arguments[1]:Object;return J(r).map(function(e){return t&&fn(t,r[e])?[e,n(r[e],t)]:[e,r[e]]})},Ar=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object;return n.reduce(function(n,r){var t=i(r,2),e=t[0],u=t[1];return n[e]=u,n},new r)},Or=function n(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object;return r.reduce(function(r,e){var u=i(e,2),o=u[0],c=u[1];return pn(c)&&pn(c[0])&&2===c[0].length?(r[o]=n(c,t),r):(r[o]=c,r)},new t)},Nr=function(n){switch(y(n)){case"Null":case"Undefined":return[];case String.name:case Array.name:case"WeakMap":case"WeakSet":case"Map":case"Set":return Array.from(n);case Object.name:default:return wr(n)}},Sr=function(){for(var n=arguments.length,r=new Array(n),t=0;tr?t>0?-t:t:t<0?-1*t:t},Mr=g(function(n,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,e=n,u=[];if(0===(t=Wr(n,r,t))||n===r)return[n];for(;(r-e)*t>=0;e+=t)u.push(e);return u}),Rr=N("split"),zr=w(function(){for(var n=arguments.length,r=new Array(n),t=0;t=0;t-=1)r+=n[t];return r;default:for(;t>=0;t-=1)r.push(n[t]);return r}},Gr=g(function(n,r){if(!r||!r.length)return r;var t=r.length,e=t-1,u=Wn(r),o=0;if(dn(r)){for(;o0},i)},Qr=function(n){for(var r=D(n),t=Math.pow(2,r),e=[],u=0;u=0;i--)o=n(c,e[i],i),c=o[0],f=o[1];return[c,f]}),ut=g(function(n,r,t){for(var e=0,u=[],o=t;e=0;u--){if(n[u]!==r[o])return!1;o-=1}return!0}),Ft=g(function(n,r){var t=D(n),e=D(r);if(e-1&&(t+=1),t===o)return!0}return!1}),Pt=function(n){return Wt(function(n,r){return n===r},n)},Wt=g(function(n,r){var t=D(r);if(!t)return Zn(r);for(var e,u,o=0,i=function(r){return n(r,e)&&o++,!!n(r,u)&&(e=r,!0)},c=[];o1?r-1:0),e=1;e-1;)o=n(o,t[u],u,t),i.push(o),u--;return i}),ce=g(function(n,r){return r&&r.length?ie(n,_r(r),Ur(r)):[]}),fe=function(n){return he(function(n,r){return n===r},n)},ae=g(function(n,r){return de(function(n,r){return n===r},n,r)}),se=function(n){return pe($n,n)},le=g(function(n,r){return Kn(function(n){return n[1]},pe(function(n,r){var t=i(n,1),e=t[0],u=i(r,1),o=u[0];return $n(e,o)},Kn(function(r){return[n(r),r]},r)))}),pe=g(function(n,r){return Zn(r).sort(n||$n)}),ve=g(function(n,r){if(!r.length)return Wn(r,n);var t=at(function(r){return n<=r},r);return qr(-1===t?[r,Wn(r,n)]:Gr(Wn(r,n),ht(t,r)))}),ye=g(function(n,r,t){var e=D(t);if(!e)return[r];for(var u=0;u-1){var u=ht(e,t);return zr(u[0],Br(u[1]))}return Zn(t)}),me=g(function(n,r,t){return Zr(function(r,t){return de(n,t,r)},r,t)}),ge=g(function(n,r,t){return Zr(function(r,t){return Qt(function(r){return n(r,t)},r)?r:(r.push(t),r)},Zn(r),t)}),we=g(function(n,r){return zr(n,St(function(r){return!Bn(r,n)},r))}),be=g(function(n,r){return n&&r&&(n||r)?St(function(n){return Bn(n,r)},n):[]}),Ae=g(function(n,r,t){return Zr(function(r,e){return Qt(function(r){return n(e,r)},t)?(r.push(e),r):r},[],r)}),Oe=g(function(n,r){return n&&!r?Zn(n):!n&&r||!n&&!r?[]:ur(function(n,t){return Bn(t,r)?n:(n.push(t),n)},[],n)}),Ne=w(function(n){for(var r=arguments.length,t=new Array(r>1?r-1:0),e=1;e1&&void 0!==arguments[1]?arguments[1]:an;return function(t,e,u,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,c=tn(t),f=y(o);if(r(t,o))return o;throw new Error(n({contextName:e,valueName:u,value:o,expectedTypeName:c,foundTypeName:f,messageSuffix:i}))}},xe=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:an;return function(t,e,u,o){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null,c=t.map(tn),f=t.some(function(n){return r(n,o)}),a=y(o);if(f)return o;throw new Error(n({contextName:e,valueName:u,value:o,expectedTypeName:c,foundTypeName:a,messageSuffix:i}))}},je=ke(Te),Ie=xe(Te),Fe=function(n){return g(ke(n))},Ee=function(n){return g(xe(n))},Pe=g(je),We=g(Ie),Me=Rr(/[\n\r]/gm),Re=Rr(/[\s\t]/gm),ze=Hr(" "),Ce=Hr("\n"),_e=function(n){return je(String,"lcaseFirst","xs",n),n[0].toLowerCase()+n.substring(1)},Be=function(n){return je(String,"ucaseFirst","xs",n),n[0].toUpperCase()+n.substring(1)},Ue=function(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:/[^a-z\d]/i;return Sr(F(""),Kn(function(n){return Be(n.toLowerCase())}),St(function(n){return!!n}),Rr(r))(je(String,"camelCase","xs",n))},Le=Sr(Be,Ue);return n.instanceOf=U,n.hasOwnProperty=L,n.length=D,n.native=q,n.assign=V,n.keys=J,n.lookup=Pn,n.typeOf=y,n.copy=Mn,n.toTypeRef=tn,n.toTypeRefs=en,n.toTypeRefName=un,n.toTypeRefNames=on,n.isFunction=cn,n.isType=fn,n.isOfType=an,n.isClass=sn,n.isCallable=ln,n.isObject=vn,n.isBoolean=yn,n.isNumber=hn,n.isString=dn,n.isMap=mn,n.isSet=gn,n.isWeakMap=wn,n.isWeakSet=bn,n.isUndefined=An,n.isNull=On,n.isSymbol=Nn,n.isUsableImmutablePrimitive=Sn,n.isEmptyList=Tn,n.isEmptyObject=kn,n.isEmptyCollection=xn,n.isEmpty=jn,n.isset=In,n.isOneOf=Fn,n.isFunctor=En,n.isArray=pn,n.of=Wn,n.searchObj=Rn,n.assignDeep=zn,n.objUnion=lr,n.objIntersect=pr,n.objDifference=vr,n.objComplement=yr,n.log=hr,n.error=dr,n.peek=mr,n.jsonClone=gr,n.toArray=Nr,n.toAssocList=wr,n.toAssocListDeep=br,n.fromAssocList=Ar,n.fromAssocListDeep=Or,n.isTruthy=Dn,n.isFalsy=qn,n.alwaysTrue=Jn,n.alwaysFalse=Vn,n.equal=Gn,n.equalAll=Hn,n.apply=W,n.call=M,n.compose=Sr,n.curryN=m,n.curry=g,n.curry2=w,n.curry3=b,n.curry4=A,n.curry5=O,n.flipN=R,n.flip=z,n.flip3=C,n.flip4=_,n.flip5=B,n.id=Tr,n.negateF=kr,n.negateF2=xr,n.negateF3=jr,n.negateFN=Ir,n.until=Fr,n.fnOrError=Er,n.noop=Pr,n.map=Kn,n.append=zr,n.head=Cr,n.last=_r,n.tail=Br,n.init=Ur,n.uncons=Lr,n.unconsr=Dr,n.concat=qr,n.concatMap=Jr,n.reverse=Vr,n.intersperse=Gr,n.intercalate=Hr,n.transpose=Kr,n.subsequences=Qr,n.swapped=Xr,n.permutations=Yr,n.foldl=Zr,n.foldr=$r,n.foldl1=nt,n.foldr1=rt,n.mapAccumL=tt,n.mapAccumR=et,n.iterate=ut,n.repeat=ot,n.replicate=it,n.cycle=ct,n.unfoldr=ft,n.findIndex=at,n.findIndices=st,n.elemIndex=lt,n.elemIndices=pt,n.take=vt,n.drop=yt,n.splitAt=ht,n.takeWhile=dt,n.dropWhile=mt,n.dropWhileEnd=gt,n.span=wt,n.breakOnList=bt,n.at=At,n.find=Ot,n.forEach=Nt,n.filter=St,n.partition=Tt,n.elem=kt,n.notElem=xt,n.isPrefixOf=jt,n.isSuffixOf=It,n.isInfixOf=Ft,n.isSubsequenceOf=Et,n.group=Pt,n.groupBy=Wt,n.inits=Mt,n.tails=Rt,n.stripPrefix=zt,n.zip=Ct,n.zipN=_t,n.zip3=Bt,n.zip4=Ut,n.zip5=Lt,n.zipWith=Dt,n.zipWithN=qt,n.zipWith3=Jt,n.zipWith4=Vt,n.zipWith5=Gt,n.unzip=Ht,n.unzipN=Kt,n.any=Qt,n.all=Xt,n.and=Yt,n.or=Zt,n.not=$t,n.sum=ne,n.product=re,n.maximum=te,n.minimum=ee,n.scanl=ue,n.scanl1=oe,n.scanr=ie,n.scanr1=ce,n.nub=fe,n.remove=ae,n.sort=se,n.sortOn=le,n.sortBy=pe,n.insert=ve,n.insertBy=ye,n.nubBy=he,n.removeBy=de,n.removeFirstsBy=me,n.unionBy=ge,n.union=we,n.intersect=be,n.intersectBy=Ae,n.difference=Oe,n.complement=Ne,n.slice=_n,n.includes=Bn,n.indexOf=Un,n.lastIndexOf=Ln,n.push=E,n.range=Mr,n.sliceFrom=Xn,n.sliceTo=Yn,n.sliceCopy=Zn,n.genericAscOrdering=$n,n.lengths=nr,n.toShortest=rr,n.reduceUntil=tr,n.reduceUntilRight=er,n.reduce=ur,n.reduceRight=or,n.lastIndex=ir,n.findIndexWhere=cr,n.findIndexWhereRight=fr,n.findIndicesWhere=ar,n.findWhere=sr,n.aggregateArray=Qn,n.split=Rr,n.lines=Me,n.words=Re,n.unwords=ze,n.unlines=Ce,n.lcaseFirst=_e,n.ucaseFirst=Be,n.camelCase=Ue,n.classCase=Le,n.fPureTakesOne=N,n.fPureTakes2=S,n.fPureTakes3=T,n.fPureTakes4=k,n.fPureTakes5=x,n.fPureTakesOneOrMore=j,n.typeRefsToStringOrError=Se,n.defaultErrorMessageCall=Te,n._getErrorIfNotTypeThrower=ke,n._getErrorIfNotTypesThrower=xe,n._errorIfNotType=je,n._errorIfNotTypes=Ie,n.getErrorIfNotTypeThrower=Fe,n.getErrorIfNotTypesThrower=Ee,n.errorIfNotType=Pe,n.errorIfNotTypes=We,n}({}); \ No newline at end of file diff --git a/dist/umd/object/defineProp.js b/dist/umd/object/defineProp.js new file mode 100644 index 00000000..491a4316 --- /dev/null +++ b/dist/umd/object/defineProp.js @@ -0,0 +1,214 @@ +(function (global, factory) { + if (typeof define === "function" && define.amd) { + define(["exports", "../function/curry", "../jsPlatform/function", "../errorThrowing", "./is"], factory); + } else if (typeof exports !== "undefined") { + factory(exports, require("../function/curry"), require("../jsPlatform/function"), require("../errorThrowing"), require("./is")); + } else { + var mod = { + exports: {} + }; + factory(mod.exports, global.curry, global._function, global.errorThrowing, global.is); + global.defineProp = mod.exports; + } +})(this, function (_exports, _curry, _function, _errorThrowing, _is) { + "use strict"; + + Object.defineProperty(_exports, "__esModule", { + value: true + }); + _exports.defineProps = _exports.defineEnumProps = _exports.defineEnumProp = _exports.defineProp = _exports.toTargetDescriptorTuple = _exports.toEnumerableDescriptor = _exports.createTypedDescriptor = void 0; + + function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } + + function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } + + function _iterableToArrayLimit(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } + + function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } + + /** + * Creates `defineProps` and `defineEnumProps` methods based on `{enumerable}` param. + * @param {{enumerable: Boolean}} + * @returns {function(*, *)|PropsDefinerCall} + * @private + */ + function createDefinePropsMethod(_ref) { + var enumerable = _ref.enumerable; + var operation = enumerable ? defineEnumProp : defineProp; + return function (argTuples, target) { + argTuples.forEach(function (argTuple) { + var _argTuple = _slicedToArray(argTuple, 3), + TypeRef = _argTuple[0], + propName = _argTuple[1], + defaultValue = _argTuple[2]; + + (0, _function.apply)(operation, [TypeRef, target, propName, defaultValue]); + }); + return target; + }; + } + + var + /** + * Creates a descriptor for a property which is settable but throws + * errors when the `Type` is disobeyed. + * @function module:object.createTypedDescriptor + * @param Type {TypeRef} - {String|Function} + * @param target {*} + * @param propName {String} + * @returns {Descriptor} - Property descriptor with just getter and setter. + */ + createTypedDescriptor = function createTypedDescriptor(Type, target, propName) { + var _value; + + return { + get: function get() { + return _value; + }, + set: function set(value) { + _value = (0, _errorThrowing.errorIfNotType)(Type, propName, target, value); + } + }; + }, + + /** + * Returns a target-descriptor tuple whose 'descriptor' will be set to + * enumerable (`enumerable: true`). + * @function module:object.toEnumerableDescriptor + * @param {TargetDescriptorTuple} - [target, descriptor] tuple. + * @returns {TargetDescriptorTuple} - Array of target and descriptor. + */ + toEnumerableDescriptor = function toEnumerableDescriptor(_ref2) { + var _ref3 = _slicedToArray(_ref2, 2), + target = _ref3[0], + descriptor = _ref3[1]; + + descriptor.enumerable = true; + return [target, descriptor]; + }, + + /** + * Returns an target and descriptor tuple from given. + * @function module:object.toTargetDescriptorTuple + * @param targetOrTargetDescriptorTuple {(*|Array<*, *>)} - Target object or tuple of target and descriptor. + * @returns {(Array<*>|Array<*,*>)} + */ + toTargetDescriptorTuple = function toTargetDescriptorTuple(targetOrTargetDescriptorTuple) { + return (0, _is.isType)('Array', targetOrTargetDescriptorTuple) ? // Strict type check for array + targetOrTargetDescriptorTuple : [targetOrTargetDescriptorTuple]; + }, + + /** + * Allows you to define a "typed" property on given `target`. + * @function module:object.defineProp + * @param Type {TypeRef} - {String|Function} + * @param target {TargetDescriptorTuple} - Target or array of target and descriptor ([target, descriptor]). + * @param propName {String} + * @param [defaultValue=undefined] {*} + * @returns {TargetDescriptorTuple} + */ + defineProp = function defineProp(Type, target, propName) { + var defaultValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined; + + var _toTargetDescriptorTu = toTargetDescriptorTuple(target), + _toTargetDescriptorTu2 = _slicedToArray(_toTargetDescriptorTu, 2), + _target = _toTargetDescriptorTu2[0], + _descriptor = _toTargetDescriptorTu2[1], + descriptor = _descriptor || createTypedDescriptor(Type, _target, propName); + + Object.defineProperty(_target, propName, descriptor); + + if (!(0, _is.isUndefined)(defaultValue)) { + _target[propName] = defaultValue; + } + + return [_target, descriptor]; + }, + + /** + * Allows you to define a "typed", enumerated property on `target`. + * @function module:object.defineEnumProp + * @param Type {TypeRef} - {String|Function} + * @param target {TargetDescriptorTuple} - Target or array of target and descriptor ([target, descriptor]). + * @param propName {String} + * @param [defaultValue=undefined] {*} + * @returns {TargetDescriptorTuple} + */ + defineEnumProp = function defineEnumProp(Type, target, propName) { + var defaultValue = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined; + + var _toTargetDescriptorTu3 = toTargetDescriptorTuple(target), + _toTargetDescriptorTu4 = _slicedToArray(_toTargetDescriptorTu3, 2), + _target = _toTargetDescriptorTu4[0], + _descriptor = _toTargetDescriptorTu4[1], + descriptor = _descriptor || createTypedDescriptor(Type, _target, propName); + + return defineProp(Type, toEnumerableDescriptor([_target, descriptor]), propName, defaultValue); + }, + + /** + * Allows you to define multiple enum props at once on target. + * @function module:object.defineEnumProps + * @param argsTuple {Array.} - Array of argArrays for `defineEnumProp`. + * @param [target = undefined] {Target} - Target to use in internal calls if one is not provided but encountered 'argArray'. + * @returns {Array.} - Results of each call to `defineEnumProp`. + */ + defineEnumProps = (0, _curry.curry)(createDefinePropsMethod({ + enumerable: true + })), + + /** + * Allows you to define multiple props at once on target. + * @function module:object.defineProps + * @param argsTuple {Array.} - Array of argArrays for `defineProp`. + * @param [target = undefined] {Target} - Target to use in internal calls if one is not provided but encountered 'argArray'. + * @returns {Array.} - Results of each call to `defineProp`. + * @curried + */ + defineProps = (0, _curry.curry)(createDefinePropsMethod({ + enumerable: false + })); + /** ============================================================= */ + + /** Type definitions: */ + + /** ============================================================= */ + + /** + * @typedef {*} Target + */ + + /** + * @typedef {Object} Descriptor + */ + + /** + * @typedef {Array} TargetDescriptorTuple + */ + + /** + * @typedef {Array.} DefinePropArgsTuple + * @description Arguments list for `defineProp` and/or `defineEnumProp` (note: some + * parts of array/tuple are options (namely the last two args)); E.g., + * ``` + * [String, [someTarget], 'somePropName', 'someDefaultValue] // ... + * ``` + */ + + /** + * @typedef {Function} PropsDefinerCall + * @description Same type as `defineProp` and `defineEnumProp` + * @param argsTuple {DefinePropArgsTuple} + * @param target {Target} + * @returns {Array.} + */ + + + _exports.defineProps = defineProps; + _exports.defineEnumProps = defineEnumProps; + _exports.defineEnumProp = defineEnumProp; + _exports.defineProp = defineProp; + _exports.toTargetDescriptorTuple = toTargetDescriptorTuple; + _exports.toEnumerableDescriptor = toEnumerableDescriptor; + _exports.createTypedDescriptor = createTypedDescriptor; +}); \ No newline at end of file diff --git a/docs/boolean.js.html b/docs/boolean.js.html index 84b7c1e4..09972930 100644 --- a/docs/boolean.js.html +++ b/docs/boolean.js.html @@ -36,7 +36,7 @@

Source: boolean.js

    - +
    diff --git a/docs/data_Functor.js.html b/docs/data_Functor.js.html index df739cfb..3ae705a1 100644 --- a/docs/data_Functor.js.html +++ b/docs/data_Functor.js.html @@ -36,7 +36,7 @@

    Source: data/Functor.js

      - +
      diff --git a/docs/errorThrowing.js.html b/docs/errorThrowing.js.html index eb77c557..bed71a2b 100644 --- a/docs/errorThrowing.js.html +++ b/docs/errorThrowing.js.html @@ -36,7 +36,7 @@

      Source: errorThrowing.js

        - +
        diff --git a/docs/fjl.js.html b/docs/fjl.js.html index 6dba69f3..3edf7d62 100644 --- a/docs/fjl.js.html +++ b/docs/fjl.js.html @@ -36,7 +36,7 @@

        Source: fjl.js

          - +
          @@ -65,6 +65,12 @@

          Source: fjl.js

          export * from './string'; export * from './utils'; export * from './errorThrowing'; + +/** + * @typedef {String|Function|ArrayBufferConstructor|ArrayConstructor|BooleanConstructor|MapConstructor|NumberConstructor|SetConstructor|WeakMapConstructor|WeakSetConstructor} TypeRef + * @description Type reference. Either actual type or type's name; E.g., `Type.name` + * Also note: Class cased names are use for values that do not have `name` properties; Namely: 'Null', 'NaN' and 'Undefined' (for their respective values respectively). + */ diff --git a/docs/function.js.html b/docs/function.js.html index dd2118bb..9825662e 100644 --- a/docs/function.js.html +++ b/docs/function.js.html @@ -36,7 +36,7 @@

          Source: function.js

            - +
            diff --git a/docs/function_compose.js.html b/docs/function_compose.js.html index 22e7ea63..225842d3 100644 --- a/docs/function_compose.js.html +++ b/docs/function_compose.js.html @@ -36,7 +36,7 @@

            Source: function/compose.js

              - +
              diff --git a/docs/function_curry.js.html b/docs/function_curry.js.html index d56e2f5b..415c75ec 100644 --- a/docs/function_curry.js.html +++ b/docs/function_curry.js.html @@ -36,7 +36,7 @@

              Source: function/curry.js

                - +
                diff --git a/docs/function_flip.js.html b/docs/function_flip.js.html index 305b1f9e..e7fdab15 100644 --- a/docs/function_flip.js.html +++ b/docs/function_flip.js.html @@ -36,7 +36,7 @@

                Source: function/flip.js

                  - +
                  diff --git a/docs/function_fnOrError.js.html b/docs/function_fnOrError.js.html index 93ba9cba..73f6abcd 100644 --- a/docs/function_fnOrError.js.html +++ b/docs/function_fnOrError.js.html @@ -36,7 +36,7 @@

                  Source: function/fnOrError.js

                    - +
                    diff --git a/docs/function_id.js.html b/docs/function_id.js.html index 218cf4c1..8ffcd8b6 100644 --- a/docs/function_id.js.html +++ b/docs/function_id.js.html @@ -36,7 +36,7 @@

                    Source: function/id.js

                      - +
                      diff --git a/docs/function_negate.js.html b/docs/function_negate.js.html index 68eba5b4..7af9fc55 100644 --- a/docs/function_negate.js.html +++ b/docs/function_negate.js.html @@ -36,7 +36,7 @@

                      Source: function/negate.js

                        - +
                        diff --git a/docs/function_noop.js.html b/docs/function_noop.js.html index 443255a1..9d1d663c 100644 --- a/docs/function_noop.js.html +++ b/docs/function_noop.js.html @@ -36,7 +36,7 @@

                        Source: function/noop.js

                          - +
                          diff --git a/docs/function_trampoline.js.html b/docs/function_trampoline.js.html index 553fe995..5a69fc82 100644 --- a/docs/function_trampoline.js.html +++ b/docs/function_trampoline.js.html @@ -36,7 +36,7 @@

                          Source: function/trampoline.js

                            - +
                            diff --git a/docs/function_until.js.html b/docs/function_until.js.html index 692f7fd4..c68c575d 100644 --- a/docs/function_until.js.html +++ b/docs/function_until.js.html @@ -36,7 +36,7 @@

                            Source: function/until.js

                              - +
                              diff --git a/docs/global.html b/docs/global.html index 5d08c571..99e2e6be 100644 --- a/docs/global.html +++ b/docs/global.html @@ -34,7 +34,7 @@

                              Global

                                - +
                                @@ -135,6 +135,160 @@
                                Type:
                                + + + + + + + + + + + + + + + + + + + + + +
                                +

                                + DefinePropArgsTuple + + + +

                                + + +
                                +
                                + +
                                + Arguments list for `defineProp` and/or `defineEnumProp` (note: some parts of array/tuple are options (namely the last two args)); E.g., ``` [String, [someTarget], 'somePropName', 'someDefaultValue] // ... ``` +
                                + + + + + + + +
                                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                + + + + + +
                                + + + + +
                                +

                                + Descriptor + + + +

                                + + +
                                +
                                + + + + + + + +
                                + + + + + + + + + + + + + + + + + + + + @@ -831,47 +985,41 @@
                                Returns:
                                -

                                - TemplateContext - - -

                                - +

                                + + PropsDefinerCall(argsTuple, target) → {Array.<TargetDescriptorTuple>} + + + + +

                                + +
                                +
                                - Template context used for error message renderers (functions that take a context obj and return a string). + Same type as `defineProp` and `defineEnumProp`
                                - - -
                                Properties:
                                - - - +
                                +
                                Parameters:
                                + +
                                @@ -881,12 +1029,8 @@
                                Properties:
                                - - - - @@ -897,31 +1041,21 @@
                                Properties:
                                - + - - - - @@ -930,83 +1064,434 @@
                                Properties:
                                - + - - - - + +
                                TypeAttributesDefaultDescription
                                valueargsTuple -* +DefinePropArgsTuple - - - - - -
                                valueNametarget -String +Target - - - - - -
                                - - - expectedTypeName - + + - - - -String + + - - + - - - + - - - + - - + +
                                +
                                Returns:
                                + - - - Expected name of constructor of `value`; E.g., usually `SomeConstructor.name`; - - - - - foundTypeName - +Array.<TargetDescriptorTuple> - - - -String - - + + + + + + +
                                + + + + + +
                                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                + + + + +
                                + + + + +
                                +

                                + Target + + + +

                                + + +
                                +
                                + + + + + + + +
                                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                + + + + + +
                                + + + + +
                                +

                                + TargetDescriptorTuple + + + +

                                + + +
                                +
                                + + + + + + + +
                                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                + + + + + +
                                + + + + +
                                +

                                + TemplateContext + + + +

                                + + +
                                +
                                + +
                                + Template context used for error message renderers (functions that take a context obj and return a string). +
                                + + + + + + + +
                                Properties:
                                + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - @@ -915,77 +911,69 @@
                                Parameters:
                                - + - - - - - + - + - + + + + + + + + + +String + + + - + + + + + @@ -1013,13 +1001,13 @@
                                Returns:
                                -* +Descriptor -- - Default is `Object` +- - Property descriptor with just getter and setter. @@ -1074,14 +1062,14 @@
                                Returns:
                                -

                                +

                                - static fromAssocListDeep(xs, OutTypeopt) → {*} + static defineEnumProp(Type, target, propName, defaultValueopt) → {TargetDescriptorTuple}

                                @@ -1093,7 +1081,7 @@

                                - From associated list to object (deep conversion on associative lists (array of 2 value arrays)). + Allows you to define a "typed", enumerated property on `target`.
                                @@ -1121,8 +1109,6 @@

                                Parameters:
                                -
                                - @@ -1133,13 +1119,13 @@
                                Parameters:
                                - + + + + + + + + + + + + + + - + + + - + + + + + + + + + + + + + + - + + + @@ -1231,13 +1266,11 @@
                                Returns:
                                -* - +TargetDescriptorTuple -- - Default is `Object` @@ -1292,14 +1325,14 @@
                                Returns:
                                -

                                +

                                - static hasOwnProperty(propName, typeInstance) → {Boolean} + static defineEnumProps(argsTuple, targetopt) → {Array.<TargetDescriptorTuple>}

                                @@ -1310,6 +1343,10 @@

                                +
                                + Allows you to define multiple enum props at once on target. +
                                + @@ -1331,6 +1368,8 @@
                                Parameters:

                                + + @@ -1343,46 +1382,64 @@
                                Parameters:
                                - + + + - + - + + + - + @@ -1410,11 +1467,13 @@
                                Returns:
                                -Boolean +Array.<TargetDescriptorTuple> + +- - Results of each call to `defineEnumProp`. @@ -1443,8 +1502,6 @@
                                Returns:
                                -
                                Deprecated:
                                • - Use property directly instead.
                                - @@ -1471,14 +1528,14 @@
                                Returns:
                                -

                                +

                                - static instanceOf(instanceConstructor, instance) → {Boolean} + static defineProp(Type, target, propName, defaultValueopt) → {TargetDescriptorTuple}

                                @@ -1490,7 +1547,7 @@

                                - Returns whether constructor has derived object. + Allows you to define a "typed" property on given `target`.
                                @@ -1514,6 +1571,8 @@

                                Parameters:
                                + + @@ -1526,74 +1585,154 @@
                                Parameters:
                                - + + + - + - + + + - + - -
                                NameTypeAttributesDefaultDescription
                                value + + +* + + + + + + + + + +
                                valueName + + +String + + + + + + + + + +
                                expectedTypeName + + +String + + + + + + + + + + Expected name of constructor of `value`; E.g., usually `SomeConstructor.name`;
                                foundTypeName + + +String + + + + @@ -1272,6 +1757,95 @@
                                Returns:
                                + + + + + + + + + + + + + + + + + + + + +
                                + +

                                + + TypeRef() + + +
                                + fjl.js, + line 19 +
                                + +

                                + + + +
                                +
                                + + +
                                + Type reference. Either actual type or type's name; E.g., `Type.name` Also note: Class cased names are use for values that do not have `name` properties; Namely: 'Null', 'NaN' and 'Undefined' (for their respective values respectively). +
                                + + + + + + + + + + + + + + + + + + + + + + + + + +
                                + + + + + + + + + + + + + + + + + + + + diff --git a/docs/index.html b/docs/index.html index 7a4db586..1be113b4 100644 --- a/docs/index.html +++ b/docs/index.html @@ -34,7 +34,7 @@

                                Home

                                  - +
                                  @@ -223,6 +223,8 @@

                                  New additions

                                  • Added native which includes all the static methods that live on Object though flipped and curried.
                                  • +
                                  • Added 'fjl-mutable' as part of source. All methods of 'fjl-mutable' now +live directly on 'fjl' and are defined in 'fjl/objects/defineProp' (or more directly in src at './src/objects/defineProp').

                                  Development changes.

                                  TypeAttributesDefaultDescription
                                  xsType -Array.<Array> +TypeRef - - - - - - - - Associated list.{String|Function}
                                  OutTypetarget -Constructor -| - -function +* - - <optional>
                                  - - + - -
                                  propName - - - Object - Output type. Default `Object`.
                                  DefaultDescription
                                  xsType -Array.<Array> +TypeRef @@ -1156,28 +1142,52 @@
                                  Parameters:
                                  -
                                  + + {String|Function}
                                  target + + +TargetDescriptorTuple + + + + + + + + Associated list.Target or array of target and descriptor ([target, descriptor]).
                                  OutTypepropName -Constructor -| - -function +String @@ -1186,8 +1196,6 @@
                                  Parameters:
                                  - <optional>
                                  - @@ -1196,14 +1204,41 @@
                                  Parameters:
                                  -
                                  + +
                                  defaultValue + - Object +* + + + + + + <optional>
                                  + + + +
                                  Output type. Default `Object`.
                                  TypeAttributes
                                  propNameargsTuple -* +Array.<DefinePropArgsTuple> + + + + + + Array of argArrays for `defineEnumProp`.
                                  typeInstancetarget -* +Target + + <optional>
                                  + + + + + +
                                  Target to use in internal calls if one is not provided but encountered 'argArray'.
                                  TypeAttributes
                                  instanceConstructorType -function +TypeRef + + + + + + Constructor.{String|Function}
                                  instancetarget -* +TargetDescriptorTuple + + + + + + Target or array of target and descriptor ([target, descriptor]).
                                  - - + + + propName + - + + + +String - - + + - + + + - + - -
                                  -
                                  Returns:
                                  - + + + + + -Boolean + + + + + defaultValue + + + + + +* + + + + + + + + + <optional>
                                  + + + + + + + + + + + + + + + + + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +TargetDescriptorTuple @@ -1652,14 +1791,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isArray(value) → {boolean} + static defineProps(argsTuple, targetopt) → {Array.<TargetDescriptorTuple>}

                                  @@ -1671,7 +1810,7 @@

                                  - Checks if value is an array (same as `Array.isArray`). + Allows you to define multiple props at once on target.
                                  @@ -1695,6 +1834,8 @@

                                  Parameters:
                                  Type + Attributes + @@ -1707,23 +1848,64 @@
                                  Parameters:
                                  - value + argsTuple -* +Array.<DefinePropArgsTuple> + + + + + + + + + + + + + + + + + + Array of argArrays for `defineProp`. + + + + + + + target + + + + + +Target + + + <optional>
                                  + + + + + - + + + Target to use in internal calls if one is not provided but encountered 'argArray'. @@ -1751,12 +1933,14 @@
                                  Returns:
                                  -boolean +Array.<TargetDescriptorTuple> +- - Results of each call to `defineProp`. + @@ -1810,14 +1994,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isBoolean(value) → {Boolean} + static fromAssocList(xs, OutTypeopt) → {*}

                                  @@ -1829,7 +2013,7 @@

                                  - Checks if value is a boolean. + From associated list to object.
                                  @@ -1853,8 +2037,12 @@

                                  Parameters:
                                  Type + Attributes + + Default + Description @@ -1865,23 +2053,77 @@
                                  Parameters:
                                  - value + xs -* +Array.<Array> + + + + + + - + + + + + + + Associated list. + + + + + + + OutType + + + + + +Constructor +| + +function + + + + + + + + + <optional>
                                  + + + + + + + + + + + + Object + + + + + Output type. Default `Object`. @@ -1909,11 +2151,13 @@
                                  Returns:
                                  -Boolean +* + +- - Default is `Object` @@ -1968,14 +2212,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isCallable(x) → {Boolean} + static fromAssocListDeep(xs, OutTypeopt) → {*}

                                  @@ -1987,7 +2231,7 @@

                                  - Returns a boolean depicting whether a value is callable or not. + From associated list to object (deep conversion on associative lists (array of 2 value arrays)).
                                  @@ -2011,8 +2255,12 @@

                                  Parameters:
                                  Type + Attributes + + Default + Description @@ -2023,23 +2271,77 @@
                                  Parameters:
                                  - x + xs -* +Array.<Array> + + + + + + + + + + + + - + Associated list. + + + + + + + OutType + + + + + +Constructor +| + +function + + + + + + + + + <optional>
                                  + + + + + + + + + + + + Object + + + + + Output type. Default `Object`. @@ -2067,11 +2369,13 @@
                                  Returns:
                                  -Boolean +* + +- - Default is `Object` @@ -2126,14 +2430,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isClass(x) → {boolean} + static hasOwnProperty(propName, typeInstance) → {Boolean}

                                  @@ -2144,10 +2448,6 @@

                                  -
                                  - Checks if `value` is an es2015 `class`. -
                                  - @@ -2181,7 +2481,30 @@
                                  Parameters:
                                  - x + propName + + + + + +* + + + + + + + + + + + + + + + + + typeInstance @@ -2225,7 +2548,7 @@
                                  Returns:
                                  -boolean +Boolean @@ -2258,6 +2581,8 @@
                                  Returns:
                                  +
                                  Deprecated:
                                  • - Use property directly instead.
                                  + @@ -2284,14 +2609,14 @@

                                  Returns:
                                  -

                                  +

                                  - static isEmpty(value) → {Boolean} + static instanceOf(instanceConstructor, instance) → {Boolean}

                                  @@ -2303,7 +2628,7 @@

                                  - Checks to see if passed in value is empty; I.e., check for one of '', 0, `null`, `undefined`, `false`, empty array, empty object, empty function (zero arity), or empty collection (es6 Map, Set, WeakMap, or WeakSet etc. (`!value.size`); + Returns whether constructor has derived object.
                                  @@ -2339,7 +2664,30 @@

                                  Parameters:
                                  - value + instanceConstructor + + + + + +function + + + + + + + + + + Constructor. + + + + + + + instance @@ -2355,7 +2703,7 @@
                                  Parameters:
                                  - Value to check. + @@ -2442,14 +2790,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isEmptyCollection(x) → {Boolean} + static isArray(value) → {boolean}

                                  @@ -2461,7 +2809,7 @@

                                  - Checks if collection is empty or not (Map, WeakMap, WeakSet, Set etc.). + Checks if value is an array (same as `Array.isArray`).
                                  @@ -2497,7 +2845,7 @@

                                  Parameters:
                                  - x + value @@ -2541,7 +2889,7 @@
                                  Returns:
                                  -Boolean +boolean @@ -2600,14 +2948,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isEmptyList(x) → {Boolean} + static isBoolean(value) → {Boolean}

                                  @@ -2619,7 +2967,7 @@

                                  - Checks if !length. + Checks if value is a boolean.
                                  @@ -2655,7 +3003,7 @@

                                  Parameters:
                                  - x + value @@ -2758,14 +3106,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isEmptyObject(obj) → {Boolean} + static isCallable(x) → {Boolean}

                                  @@ -2777,7 +3125,7 @@

                                  - Checks if object has own properties/enumerable-props or not. + Returns a boolean depicting whether a value is callable or not.
                                  @@ -2813,7 +3161,7 @@

                                  Parameters:
                                  - obj + x @@ -2916,14 +3264,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isFunction(value) → {Boolean} + static isClass(x) → {boolean}

                                  @@ -2935,7 +3283,7 @@

                                  - Returns whether a value is a function or not. + Checks if `value` is an es2015 `class`.
                                  @@ -2971,7 +3319,7 @@

                                  Parameters:
                                  - value + x @@ -3015,7 +3363,7 @@
                                  Returns:
                                  -Boolean +boolean @@ -3074,14 +3422,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isMap(value) → {Boolean} + static isEmpty(value) → {Boolean}

                                  @@ -3093,7 +3441,7 @@

                                  - Checks whether value is of `Map` or not. + Checks to see if passed in value is empty; I.e., check for one of '', 0, `null`, `undefined`, `false`, empty array, empty object, empty function (zero arity), or empty collection (es6 Map, Set, WeakMap, or WeakSet etc. (`!value.size`);
                                  @@ -3145,7 +3493,7 @@

                                  Parameters:
                                  - + Value to check. @@ -3232,14 +3580,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isNull(value) → {Boolean} + static isEmptyCollection(x) → {Boolean}

                                  @@ -3251,7 +3599,7 @@

                                  - Checks if value is null. + Checks if collection is empty or not (Map, WeakMap, WeakSet, Set etc.).
                                  @@ -3287,7 +3635,7 @@

                                  Parameters:
                                  - value + x @@ -3390,14 +3738,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isNumber(value) → {Boolean} + static isEmptyList(x) → {Boolean}

                                  @@ -3409,7 +3757,7 @@

                                  - Checks if value is a valid number (also checks if isNaN so that you don't have to). + Checks if !length.
                                  @@ -3445,7 +3793,7 @@

                                  Parameters:
                                  - value + x @@ -3548,14 +3896,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isObject(value) → {Boolean} + static isEmptyObject(obj) → {Boolean}

                                  @@ -3567,7 +3915,7 @@

                                  - Checks whether value is an object or not. + Checks if object has own properties/enumerable-props or not.
                                  @@ -3603,11 +3951,16 @@

                                  Parameters:
                                  - value + obj + +* + + + @@ -3701,14 +4054,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isOfType(type, x) → {Boolean} + static isFunction(value) → {Boolean}

                                  @@ -3720,7 +4073,7 @@

                                  - Loose type checker; E.g., If `type` is not a constructor, but a constructor name, does a type check on constructor names, else if first check fails and `type` is a constructor, performs an `instanceof` check on value with constructor. + Returns whether a value is a function or not.
                                  @@ -3756,33 +4109,7 @@

                                  Parameters:
                                  - type - - - - - -function -| - -String - - - - - - - - - - Type reference (constructor or `constructor.name`). - - - - - - - x + value @@ -3798,7 +4125,7 @@
                                  Parameters:
                                  - Value to check. + @@ -3877,11 +4204,6 @@
                                  Returns:
                                  -
                                  Example
                                  - -
                                  isOfType(Number, 99) === true        // true  (passes strict type check (numbers are not instances of `Number`
                                                                       //        constructor)
                                  isOfType('Number', 99) === true      // true  (passes strict type check)
                                  isOfType(Number, NaN) === true       // true. (passes instance of check)
                                                                       //        If you want "true" strict type checking use `isType`
                                  isOfType(Object, []) === true        // true  (passes instance of check)
                                  isOfType(Array, []) === true         // true  (passes instance of check)
                                  isOfType(Object, {}) === true        // true  (passes instance of check)
                                  isOfType(Object.name, {}) === true   // true  (Passes strict type check)
                                  class Abc extends String {}
                                  isOfType(String, new Abc('abcd')) // true (passes instanceof check)
                                  - -
                                  @@ -3890,14 +4212,14 @@
                                  Example
                                  -

                                  +

                                  - static isset(x) → {Boolean} + static isMap(value) → {Boolean}

                                  @@ -3909,7 +4231,7 @@

                                  - Returns whether passed in values is defined and not null or not. + Checks whether value is of `Map` or not.
                                  @@ -3945,7 +4267,7 @@

                                  Parameters:
                                  - x + value @@ -4048,14 +4370,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isSet(value) → {Boolean} + static isNull(value) → {Boolean}

                                  @@ -4067,7 +4389,7 @@

                                  - Checks whether value is of `Set` or not. + Checks if value is null.
                                  @@ -4206,14 +4528,14 @@

                                  Returns:
                                  -

                                  +

                                  - static isString(value) → {Boolean} + static isNumber(value) → {Boolean}

                                  @@ -4225,7 +4547,7 @@

                                  - Checks whether value is a string or not. + Checks if value is a valid number (also checks if isNaN so that you don't have to).
                                  @@ -4364,14 +4686,14 @@

                                  Returns:
                                  -

                                  +

                                  - static isSymbol(value) → {Boolean} + static isObject(value) → {Boolean}

                                  @@ -4383,7 +4705,7 @@

                                  - Checks if value is a `Symbol`. + Checks whether value is an object or not.
                                  @@ -4424,11 +4746,6 @@

                                  Parameters:
                                  - -* - - - @@ -4522,14 +4839,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isType(type, obj) → {Boolean} + static isOfType(type, x) → {Boolean}

                                  @@ -4541,7 +4858,7 @@

                                  - Strict type checker. Checks if given value is a direct instance of given type; E.g., + Loose type checker; E.g., If `type` is not a constructor, but a constructor name, does a type check on constructor names, else if first check fails and `type` is a constructor, performs an `instanceof` check on value with constructor.
                                  @@ -4586,9 +4903,6 @@

                                  Parameters:
                                  function | -ObjectConstructor -| - String @@ -4599,14 +4913,14 @@
                                  Parameters:
                                  - Constructor or constructor name + Type reference (constructor or `constructor.name`). - obj + x @@ -4622,7 +4936,7 @@
                                  Parameters:
                                  - + Value to check. @@ -4703,7 +5017,7 @@
                                  Returns:
                                  Example
                                  -
                                  isType(String, 'abcdefg')  === true // true
                                    isType(String.name, 'abcdefg') === true
                                    isType(Number, NaN) === false
                                    isType(Number, 99) === true
                                    isType('Null', 99) === false // though, for `null` and `undefined` checks
                                                                 // @see `isset`, in this module, instead
                                    isType('Undefined', undefined) === true // true
                                  +
                                  isOfType(Number, 99) === true        // true  (passes strict type check (numbers are not instances of `Number`
                                                                       //        constructor)
                                  isOfType('Number', 99) === true      // true  (passes strict type check)
                                  isOfType(Number, NaN) === true       // true. (passes instance of check)
                                                                       //        If you want "true" strict type checking use `isType`
                                  isOfType(Object, []) === true        // true  (passes instance of check)
                                  isOfType(Array, []) === true         // true  (passes instance of check)
                                  isOfType(Object, {}) === true        // true  (passes instance of check)
                                  isOfType(Object.name, {}) === true   // true  (Passes strict type check)
                                  class Abc extends String {}
                                  isOfType(String, new Abc('abcd')) // true (passes instanceof check)
                                  @@ -4714,14 +5028,14 @@
                                  Example
                                  -

                                  +

                                  - static isUndefined(value) → {Boolean} + static isSet(value) → {Boolean}

                                  @@ -4733,7 +5047,7 @@

                                  - Checks if value is undefined. + Checks whether value is of `Set` or not.
                                  @@ -4872,14 +5186,14 @@

                                  Returns:
                                  -

                                  +

                                  - static isUsableImmutablePrimitive(x) → {Boolean} + static isset(x) → {Boolean}

                                  @@ -4891,7 +5205,7 @@

                                  - Checks if given `x` is set and of one of [String, Boolean, Number, Symbol] (null and undefined are immutable but are not "usable" (usually not what we want to operate on). + Returns whether passed in values is defined and not null or not.
                                  @@ -5030,14 +5344,14 @@

                                  Returns:
                                  -

                                  +

                                  - static isWeakMap(value) → {Boolean} + static isString(value) → {Boolean}

                                  @@ -5049,7 +5363,7 @@

                                  - Checks whether value is of `WeakMap` or not. + Checks whether value is a string or not.
                                  @@ -5188,14 +5502,14 @@

                                  Returns:
                                  -

                                  +

                                  - static isWeakSet(value) → {Boolean} + static isSymbol(value) → {Boolean}

                                  @@ -5207,7 +5521,7 @@

                                  - Checks whether value is of `WeakSet` or not. + Checks if value is a `Symbol`.
                                  @@ -5346,14 +5660,14 @@

                                  Returns:
                                  -

                                  +

                                  - static jsonClone(x) → {*} + static isType(type, obj) → {Boolean}

                                  @@ -5365,7 +5679,7 @@

                                  - Clones and object or array using `JSON.parse(JSON.stringify(...))` pattern. + Strict type checker. Checks if given value is a direct instance of given type; E.g.,
                                  @@ -5401,7 +5715,36 @@

                                  Parameters:
                                  - x + type + + + + + +function +| + +ObjectConstructor +| + +String + + + + + + + + + + Constructor or constructor name + + + + + + + obj @@ -5445,7 +5788,7 @@
                                  Returns:
                                  -* +Boolean @@ -5496,6 +5839,11 @@
                                  Returns:
                                  +
                                  Example
                                  + +
                                  isType(String, 'abcdefg')  === true // true
                                    isType(String.name, 'abcdefg') === true
                                    isType(Number, NaN) === false
                                    isType(Number, 99) === true
                                    isType('Null', 99) === false // though, for `null` and `undefined` checks
                                                                 // @see `isset`, in this module, instead
                                    isType('Undefined', undefined) === true // true
                                  + + @@ -5504,14 +5852,14 @@
                                  Returns:
                                  -

                                  +

                                  - static keys(obj) → {Array.<String>} + static isUndefined(value) → {Boolean}

                                  @@ -5523,7 +5871,7 @@

                                  - Gets passed in object's own enumerable keys (same as `Object.keys`). + Checks if value is undefined.
                                  @@ -5559,7 +5907,7 @@

                                  Parameters:
                                  - obj + value @@ -5603,7 +5951,7 @@
                                  Returns:
                                  -Array.<String> +Boolean @@ -5662,14 +6010,14 @@
                                  Returns:
                                  -

                                  +

                                  - static length(x) → {Number} + static isUsableImmutablePrimitive(x) → {Boolean}

                                  @@ -5680,6 +6028,10 @@

                                  +
                                  + Checks if given `x` is set and of one of [String, Boolean, Number, Symbol] (null and undefined are immutable but are not "usable" (usually not what we want to operate on). +
                                  + @@ -5748,35 +6100,6 @@
                                  Parameters:
                                  -
                                  Throws:
                                  - - - -
                                  -
                                  -
                                  - - Throws an error if value doesn't have a `length` property ( `null`, `undefined`, {Boolean}, Symbol, et. al.). -
                                  -
                                  -
                                  -
                                  -
                                  -
                                  - Type -
                                  -
                                  - -Error - - -
                                  -
                                  -
                                  -
                                  -
                                  - - -
                                  @@ -5786,7 +6109,7 @@
                                  Returns:
                                  -Number +Boolean @@ -5845,14 +6168,14 @@
                                  Returns:
                                  -

                                  +

                                  - static lookup(key, obj) → {*} + static isWeakMap(value) → {Boolean}

                                  @@ -5864,7 +6187,7 @@

                                  - Looks up property and returns it's value; Else `undefined`. Method is null safe (will not throw on `null` or `undefined`). + Checks whether value is of `WeakMap` or not.
                                  @@ -5900,36 +6223,13 @@

                                  Parameters:
                                  - key - - - - - -String - - - - - - - - - - Key to search on `obj` - - - - - - - obj + value -Object +* @@ -5939,7 +6239,7 @@
                                  Parameters:
                                  - Object to search `name` on. + @@ -5967,7 +6267,7 @@
                                  Returns:
                                  -* +Boolean @@ -6026,14 +6326,14 @@
                                  Returns:
                                  -

                                  +

                                  - static of(x, …argsopt) → {*|undefined} + static isWeakSet(value) → {Boolean}

                                  @@ -6045,7 +6345,7 @@

                                  - Creates a value `of` given type; Checks for one of the following construction strategies (in order listed): + Checks whether value is of `WeakSet` or not.
                                  @@ -6069,8 +6369,6 @@

                                  Parameters:
                                  Type - Attributes - @@ -6083,38 +6381,7 @@
                                  Parameters:
                                  - x - - - - - -* - - - - - - - - - - - - - - - - - - Value to derive returned value's type from. - - - - - - - args + value @@ -6127,22 +6394,10 @@
                                  Parameters:
                                  - - - <optional>
                                  - - - - - - <repeatable>
                                  - - - - Any args to pass in to matched construction strategy. + @@ -6170,16 +6425,11 @@
                                  Returns:
                                  -* -| - -undefined - +Boolean -- - New value of given value's type else `undefined`. @@ -6226,11 +6476,6 @@
                                  Returns:
                                  -
                                  Example
                                  - -
                                  // - If exists `(value).constructor.of` uses this.
                                  // - If value is of one String, Boolean, Symbol, or Number types calls it's
                                  //      constructor as a function (in cast form;  E.g., `constructor(...args)` )
                                  // - Else if constructor is a function, thus far, then calls constructor using
                                  //      the `new` keyword (with any passed in args).
                                  - - @@ -6239,14 +6484,14 @@
                                  Example
                                  -

                                  +

                                  - static searchObj(nsString, obj) → {*} + static jsonClone(x) → {*}

                                  @@ -6258,7 +6503,7 @@

                                  - Gives you value at key/namespace-key within `obj`; E.g., searchObj('all.your.base', {all: {your: {base: 99}}}) === 99 // `true` + Clones and object or array using `JSON.parse(JSON.stringify(...))` pattern.
                                  @@ -6294,30 +6539,7 @@

                                  Parameters:
                                  - nsString - - - - - -String - - - - - - - - - - - - - - - - - obj + x @@ -6412,11 +6634,6 @@
                                  Returns:
                                  -
                                  Example
                                  - -
                                  ```
                                  if (obj && obj.all && obj.all.your && obj.all.your.base) {
                                    // Thing we want to do
                                  }
                                  
                                  // So with our function becomes
                                  if (searchObj('all.your.base', obj)) {
                                    // Thing we want to do
                                  }
                                  ```
                                  - - @@ -6425,14 +6642,14 @@
                                  Example
                                  -

                                  +

                                  - static toArray(x) → {Array} + static keys(obj) → {Array.<String>}

                                  @@ -6444,7 +6661,7 @@

                                  - Converts incoming value to an array. + Gets passed in object's own enumerable keys (same as `Object.keys`).
                                  @@ -6480,7 +6697,7 @@

                                  Parameters:
                                  - x + obj @@ -6496,7 +6713,7 @@
                                  Parameters:
                                  - Thing to convert from. + @@ -6524,7 +6741,7 @@
                                  Returns:
                                  -Array +Array.<String> @@ -6583,14 +6800,14 @@
                                  Returns:
                                  -

                                  +

                                  - static toAssocList(obj) → {Array.<*, *>} + static length(x) → {Number}

                                  @@ -6601,10 +6818,6 @@

                                  -
                                  - Returns an associated list from given object. -
                                  - @@ -6638,18 +6851,12 @@
                                  Parameters:
                                  - obj + x -Object -| - -Array -| - * @@ -6679,6 +6886,35 @@
                                  Parameters:
                                  +
                                  Throws:
                                  + + + +
                                  +
                                  +
                                  + - Throws an error if value doesn't have a `length` property ( `null`, `undefined`, {Boolean}, Symbol, et. al.). +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  + Type +
                                  +
                                  + +Error + + +
                                  +
                                  +
                                  +
                                  +
                                  + + +
                                  @@ -6688,7 +6924,7 @@
                                  Returns:
                                  -Array.<*, *> +Number @@ -6747,14 +6983,14 @@
                                  Returns:
                                  -

                                  +

                                  - static toAssocListDeep(obj, TypeConstraintopt) → {*} + static lookup(key, obj) → {*}

                                  @@ -6766,7 +7002,7 @@

                                  - Returns an associated list from given object (deeply (on incoming object's type)). + Looks up property and returns it's value; Else `undefined`. Method is null safe (will not throw on `null` or `undefined`).
                                  @@ -6790,12 +7026,8 @@

                                  Parameters:
                                  Type - Attributes - - Default - Description @@ -6806,77 +7038,46 @@
                                  Parameters:
                                  - obj + key -* +String - - - - - - - - - - - - - + Key to search on `obj` - TypeConstraint + obj -Constructor -| - -function +Object - - - <optional>
                                  - - - - - - - - - - Object - - - - Type constraint to convert on. + Object to search `name` on. @@ -6963,14 +7164,14 @@
                                  Returns:
                                  -

                                  +

                                  - static toTypeRef(type) → {String} + static of(x, …argsopt) → {*|undefined}

                                  @@ -6982,7 +7183,7 @@

                                  - Resolves/normalizes a type name from either a string or a constructor. + Creates a value `of` given type; Checks for one of the following construction strategies (in order listed):
                                  @@ -7006,6 +7207,8 @@

                                  Parameters:
                                  Type + Attributes + @@ -7018,26 +7221,66 @@
                                  Parameters:
                                  - type + x -function -| +* -String + + + + + + + + + + + + + + + + + Value to derive returned value's type from. + + + + + + + args + + + + + +* + + + <optional>
                                  + + + + + + <repeatable>
                                  + + + - String or function representing a type. + Any args to pass in to matched construction strategy. @@ -7065,11 +7308,16 @@
                                  Returns:
                                  -String +* +| + +undefined + +- - New value of given value's type else `undefined`. @@ -7111,18 +7359,16 @@
                                  Returns:
                                  - -
                                  To Do:
                                  -
                                  -
                                    -
                                  • write tests for this function.
                                  • -
                                  -
                                  +

                                  Example
                                  + +
                                  // - If exists `(value).constructor.of` uses this.
                                  // - If value is of one String, Boolean, Symbol, or Number types calls it's
                                  //      constructor as a function (in cast form;  E.g., `constructor(...args)` )
                                  // - Else if constructor is a function, thus far, then calls constructor using
                                  //      the `new` keyword (with any passed in args).
                                  + + @@ -7131,15 +7377,15 @@
                                  Returns:
                                  -

                                  +

                                  - static toTypeRefName(Type) → {String} + static searchObj(nsString, obj) → {*} + object/searchObj.js, + line 6 +

                                  @@ -7150,7 +7396,7 @@

                                  - Returns possible Type's TypeRef name. + Gives you value at key/namespace-key within `obj`; E.g., searchObj('all.your.base', {all: {your: {base: 99}}}) === 99 // `true`
                                  @@ -7186,15 +7432,35 @@

                                  Parameters:
                                  - Type + nsString -TypeRef -| +String + + + + + + + + + + + + + + + + obj + + + + + * @@ -7233,7 +7499,7 @@
                                  Returns:
                                  -String +* @@ -7279,18 +7545,16 @@
                                  Returns:
                                  - -
                                  To Do:
                                  -
                                  -
                                    -
                                  • Ensure tests are written for this function.
                                  • -
                                  -
                                  +

                                  Example
                                  + +
                                  ```
                                  if (obj && obj.all && obj.all.your && obj.all.your.base) {
                                    // Thing we want to do
                                  }
                                  
                                  // So with our function becomes
                                  if (searchObj('all.your.base', obj)) {
                                    // Thing we want to do
                                  }
                                  ```
                                  + + @@ -7299,14 +7563,14 @@
                                  Returns:
                                  -

                                  +

                                  - static toTypeRefNames(…types) → {Array.<String>} + static toArray(x) → {Array}

                                  @@ -7318,7 +7582,7 @@

                                  - Returns possible Types' TypeRef names. + Converts incoming value to an array.
                                  @@ -7342,8 +7606,6 @@

                                  Parameters:
                                  Type - Attributes - @@ -7356,15 +7618,12 @@
                                  Parameters:
                                  - types + x -TypeRef -| - * @@ -7372,20 +7631,10 @@
                                  Parameters:
                                  - - - - - - - <repeatable>
                                  - - - - + Thing to convert from. @@ -7413,7 +7662,7 @@
                                  Returns:
                                  -Array.<String> +Array @@ -7459,13 +7708,6 @@
                                  Returns:
                                  - -
                                  To Do:
                                  -
                                  -
                                    -
                                  • Ensure tests are written for this function.
                                  • -
                                  -
                                  @@ -7479,14 +7721,14 @@
                                  Returns:
                                  -

                                  +

                                  - static toTypeRefs(…types) → {Array.<TypeRef>} + static toAssocList(obj) → {Array.<*, *>}

                                  @@ -7498,7 +7740,7 @@

                                  - Returns an array of type refs from possible type refs (converts null, undefined, NaN, and other values into type refs (either constructor name or constructor name based on whether value(s) is a string, a constructor, or not). + Returns an associated list from given object.
                                  @@ -7522,8 +7764,6 @@

                                  Parameters:
                                  Type - Attributes - @@ -7536,13 +7776,16 @@
                                  Parameters:
                                  - types + obj -TypeRef +Object +| + +Array | * @@ -7552,16 +7795,6 @@
                                  Parameters:
                                  - - - - - - - <repeatable>
                                  - - - @@ -7593,7 +7826,7 @@
                                  Returns:
                                  -Array.<TypeRef> +Array.<*, *> @@ -7639,13 +7872,6 @@
                                  Returns:
                                  - -
                                  To Do:
                                  -
                                  -
                                    -
                                  • Ensure tests are written for this function.
                                  • -
                                  -
                                  @@ -7659,14 +7885,14 @@
                                  Returns:
                                  -

                                  +

                                  - static typeOf(value) → {string} + static toAssocListDeep(obj, TypeConstraintopt) → {*}

                                  @@ -7678,7 +7904,7 @@

                                  - Returns the constructor/class/type name of a value. + Returns an associated list from given object (deeply (on incoming object's type)).
                                  @@ -7702,8 +7928,12 @@

                                  Parameters:
                                  Type + Attributes + + Default + Description @@ -7714,7 +7944,7 @@
                                  Parameters:
                                  - value + obj @@ -7727,13 +7957,67 @@
                                  Parameters:
                                  + + + + + + + + + + + + + + + + TypeConstraint + + + + + +Constructor +| + +function + + + + + + + + + <optional>
                                  + + + + + + + + + + + + Object + + + + + Type constraint to convert on. + + + @@ -7758,13 +8042,11 @@
                                  Returns:
                                  -string - +* -- - Constructor's name or derived name (in the case of `null`, `undefined`, or `NaN` (whose normalized names are 'Null', 'Undefined', 'NaN' respectively). @@ -7814,49 +8096,32 @@
                                  Returns:
                                  - - - - - - - - - - - - - - - - -
                                  - -
                                  - -

                                  object

                                  - - - -
                                  + -
                                  +
                                  -
                                  - - - +

                                  + static toEnumerableDescriptor() → {TargetDescriptorTuple} + + + +

                                  -
                                  +
                                  - +
                                  + Returns a target-descriptor tuple whose 'descriptor' will be set to enumerable (`enumerable: true`). +
                                  @@ -7866,40 +8131,12071 @@

                                  object

                                  +
                                  +
                                  Parameters:
                                  + + + + + - + - + - + - + + + + - + + + + + + + + + + + + + + +
                                  TypeDescription
                                  + + +TargetDescriptorTuple + + + + [target, descriptor] tuple.
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +TargetDescriptorTuple + + + + + +- - Array of target and descriptor. + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static toTargetDescriptorTuple(targetOrTargetDescriptorTuple) → {Array.<*>|Array.<*, *>} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Returns an target and descriptor tuple from given. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  targetOrTargetDescriptorTuple + + +* +| + +Array.<*, *> + + + + Target object or tuple of target and descriptor.
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Array.<*> +| + +Array.<*, *> + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static toTypeRef(type) → {String} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Resolves/normalizes a type name from either a string or a constructor. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  type + + +function +| + +String + + + + String or function representing a type.
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +String + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  To Do:
                                  +
                                  +
                                    +
                                  • write tests for this function.
                                  • +
                                  +
                                  + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static toTypeRefName(Type) → {String} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Returns possible Type's TypeRef name. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  Type + + +TypeRef +| + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +String + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  To Do:
                                  +
                                  +
                                    +
                                  • Ensure tests are written for this function.
                                  • +
                                  +
                                  + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static toTypeRefNames(…types) → {Array.<String>} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Returns possible Types' TypeRef names. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeAttributesDescription
                                  types + + +TypeRef +| + +* + + + + + + + + + + <repeatable>
                                  + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Array.<String> + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  To Do:
                                  +
                                  +
                                    +
                                  • Ensure tests are written for this function.
                                  • +
                                  +
                                  + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static toTypeRefs(…types) → {Array.<TypeRef>} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Returns an array of type refs from possible type refs (converts null, undefined, NaN, and other values into type refs (either constructor name or constructor name based on whether value(s) is a string, a constructor, or not). +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeAttributesDescription
                                  types + + +TypeRef +| + +* + + + + + + + + + + <repeatable>
                                  + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Array.<TypeRef> + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  To Do:
                                  +
                                  +
                                    +
                                  • Ensure tests are written for this function.
                                  • +
                                  +
                                  + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static typeOf(value) → {string} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Returns the constructor/class/type name of a value. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  value + + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +string + + + + + +- - Constructor's name or derived name (in the case of `null`, `undefined`, or `NaN` (whose normalized names are 'Null', 'Undefined', 'NaN' respectively). + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + + + + +
                                  + +
                                  + + + + + + + +
                                  + +
                                  + +

                                  object

                                  + + + + +
                                  + +
                                  + +
                                  + + + + + + +
                                  + +
                                  +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + +
                                  + + + + + + + + + + + + + + + +

                                  Members

                                  + +
                                  + + +
                                  +

                                  + static, constant native :Object + + + +

                                  + + +
                                  +
                                  + +
                                  + Contains all the static functions from `Object` but curried and flipped; +
                                  + + + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + + +
                                  Example
                                  + +
                                  // E.g., `Object.defineProperties(obj, descriptor)` can now be used like
                                  import {defineProperties} from 'fjl'
                                  defineProperties(descriptor, someObj),
                                  // Et. al.
                                  + + +
                                  + +
                                  + + + +

                                  Methods

                                  + +
                                  + + +
                                  + +

                                  + + static assign(obj0, …objs) → {Object} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Defined as `Object.assign` else is the same thing but shimmed. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeAttributesDescription
                                  obj0 + + +Object + + + + + + + + + +
                                  objs + + +Object + + + + + + + + + + <repeatable>
                                  + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Object + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static assignDeep(obj0, …objsopt) → {Object} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Merges all objects down into one (takes two or more args). +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeAttributesDescription
                                  obj0 + + +Object + + + + + + + + + +
                                  objs + + +Object + + + + + + <optional>
                                  + + + + + + <repeatable>
                                  + +
                                  One or more objects to merge onto `obj0`.
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Object + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static copy(x, outopt) → {*} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Make a copy of a value or optionally copy incoming value onto an outgoing value (second parameter). +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeAttributesDescription
                                  x + + +* + + + + + + + + + + Thing to copy.
                                  out + + +* + + + + + + <optional>
                                  + + + + + +
                                  Optional value to copy on to. Not required.
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +* + + + + + +- - Copied thing or optionally outgoing value copied onto. + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static createTypedDescriptor(Type, target, propName) → {Descriptor} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Creates a descriptor for a property which is settable but throws errors when the `Type` is disobeyed. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  Type + + +TypeRef + + + + {String|Function}
                                  target + + +* + + + +
                                  propName + + +String + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Descriptor + + + + + +- - Property descriptor with just getter and setter. + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static defineEnumProp(Type, target, propName, defaultValueopt) → {TargetDescriptorTuple} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Allows you to define a "typed", enumerated property on `target`. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeAttributesDescription
                                  Type + + +TypeRef + + + + + + + + + + {String|Function}
                                  target + + +TargetDescriptorTuple + + + + + + + + + + Target or array of target and descriptor ([target, descriptor]).
                                  propName + + +String + + + + + + + + + +
                                  defaultValue + + +* + + + + + + <optional>
                                  + + + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +TargetDescriptorTuple + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static defineEnumProps(argsTuple, targetopt) → {Array.<TargetDescriptorTuple>} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Allows you to define multiple enum props at once on target. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeAttributesDescription
                                  argsTuple + + +Array.<DefinePropArgsTuple> + + + + + + + + + + Array of argArrays for `defineEnumProp`.
                                  target + + +Target + + + + + + <optional>
                                  + + + + + +
                                  Target to use in internal calls if one is not provided but encountered 'argArray'.
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Array.<TargetDescriptorTuple> + + + + + +- - Results of each call to `defineEnumProp`. + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static defineProp(Type, target, propName, defaultValueopt) → {TargetDescriptorTuple} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Allows you to define a "typed" property on given `target`. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeAttributesDescription
                                  Type + + +TypeRef + + + + + + + + + + {String|Function}
                                  target + + +TargetDescriptorTuple + + + + + + + + + + Target or array of target and descriptor ([target, descriptor]).
                                  propName + + +String + + + + + + + + + +
                                  defaultValue + + +* + + + + + + <optional>
                                  + + + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +TargetDescriptorTuple + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static defineProps(argsTuple, targetopt) → {Array.<TargetDescriptorTuple>} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Allows you to define multiple props at once on target. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeAttributesDescription
                                  argsTuple + + +Array.<DefinePropArgsTuple> + + + + + + + + + + Array of argArrays for `defineProp`.
                                  target + + +Target + + + + + + <optional>
                                  + + + + + +
                                  Target to use in internal calls if one is not provided but encountered 'argArray'.
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Array.<TargetDescriptorTuple> + + + + + +- - Results of each call to `defineProp`. + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static fromAssocList(xs, OutTypeopt) → {*} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + From associated list to object. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeAttributesDefaultDescription
                                  xs + + +Array.<Array> + + + + + + + + + + + + Associated list.
                                  OutType + + +Constructor +| + +function + + + + + + <optional>
                                  + + + + + +
                                  + + Object + + Output type. Default `Object`.
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +* + + + + + +- - Default is `Object` + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static fromAssocListDeep(xs, OutTypeopt) → {*} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + From associated list to object (deep conversion on associative lists (array of 2 value arrays)). +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeAttributesDefaultDescription
                                  xs + + +Array.<Array> + + + + + + + + + + + + Associated list.
                                  OutType + + +Constructor +| + +function + + + + + + <optional>
                                  + + + + + +
                                  + + Object + + Output type. Default `Object`.
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +* + + + + + +- - Default is `Object` + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static hasOwnProperty(propName, typeInstance) → {Boolean} + + + + +

                                  + + + +
                                  +
                                  + + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  propName + + +* + + + +
                                  typeInstance + + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Boolean + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + +
                                  Deprecated:
                                  • - Use property directly instead.
                                  + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static instanceOf(instanceConstructor, instance) → {Boolean} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Returns whether constructor has derived object. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  instanceConstructor + + +function + + + + Constructor.
                                  instance + + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Boolean + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static isArray(value) → {boolean} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Checks if value is an array (same as `Array.isArray`). +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  value + + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +boolean + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static isBoolean(value) → {Boolean} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Checks if value is a boolean. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  value + + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Boolean + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static isCallable(x) → {Boolean} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Returns a boolean depicting whether a value is callable or not. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  x + + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Boolean + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static isClass(x) → {boolean} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Checks if `value` is an es2015 `class`. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  x + + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +boolean + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static isEmpty(value) → {Boolean} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Checks to see if passed in value is empty; I.e., check for one of '', 0, `null`, `undefined`, `false`, empty array, empty object, empty function (zero arity), or empty collection (es6 Map, Set, WeakMap, or WeakSet etc. (`!value.size`); +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  value + + +* + + + + Value to check.
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Boolean + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static isEmptyCollection(x) → {Boolean} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Checks if collection is empty or not (Map, WeakMap, WeakSet, Set etc.). +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  x + + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Boolean + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static isEmptyList(x) → {Boolean} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Checks if !length. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  x + + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Boolean + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static isEmptyObject(obj) → {Boolean} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Checks if object has own properties/enumerable-props or not. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  obj + + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Boolean + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static isFunction(value) → {Boolean} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Returns whether a value is a function or not. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  value + + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Boolean + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static isMap(value) → {Boolean} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Checks whether value is of `Map` or not. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  value + + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Boolean + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static isNull(value) → {Boolean} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Checks if value is null. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  value + + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Boolean + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static isNumber(value) → {Boolean} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Checks if value is a valid number (also checks if isNaN so that you don't have to). +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  value + + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Boolean + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static isObject(value) → {Boolean} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Checks whether value is an object or not. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  value + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Boolean + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static isOfType(type, x) → {Boolean} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Loose type checker; E.g., If `type` is not a constructor, but a constructor name, does a type check on constructor names, else if first check fails and `type` is a constructor, performs an `instanceof` check on value with constructor. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  type + + +function +| + +String + + + + Type reference (constructor or `constructor.name`).
                                  x + + +* + + + + Value to check.
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Boolean + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + +
                                  Example
                                  + +
                                  isOfType(Number, 99) === true        // true  (passes strict type check (numbers are not instances of `Number`
                                                                       //        constructor)
                                  isOfType('Number', 99) === true      // true  (passes strict type check)
                                  isOfType(Number, NaN) === true       // true. (passes instance of check)
                                                                       //        If you want "true" strict type checking use `isType`
                                  isOfType(Object, []) === true        // true  (passes instance of check)
                                  isOfType(Array, []) === true         // true  (passes instance of check)
                                  isOfType(Object, {}) === true        // true  (passes instance of check)
                                  isOfType(Object.name, {}) === true   // true  (Passes strict type check)
                                  class Abc extends String {}
                                  isOfType(String, new Abc('abcd')) // true (passes instanceof check)
                                  + + + +
                                  + + + + +
                                  + +

                                  + + static isSet(value) → {Boolean} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Checks whether value is of `Set` or not. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  value + + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Boolean + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static isset(x) → {Boolean} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Returns whether passed in values is defined and not null or not. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  x + + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Boolean + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static isString(value) → {Boolean} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Checks whether value is a string or not. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  value + + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Boolean + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static isSymbol(value) → {Boolean} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Checks if value is a `Symbol`. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  value + + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Boolean + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static isType(type, obj) → {Boolean} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Strict type checker. Checks if given value is a direct instance of given type; E.g., +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  type + + +function +| + +ObjectConstructor +| + +String + + + + Constructor or constructor name
                                  obj + + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Boolean + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + +
                                  Example
                                  + +
                                  isType(String, 'abcdefg')  === true // true
                                    isType(String.name, 'abcdefg') === true
                                    isType(Number, NaN) === false
                                    isType(Number, 99) === true
                                    isType('Null', 99) === false // though, for `null` and `undefined` checks
                                                                 // @see `isset`, in this module, instead
                                    isType('Undefined', undefined) === true // true
                                  + + + +
                                  + + + + +
                                  + +

                                  + + static isUndefined(value) → {Boolean} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Checks if value is undefined. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  value + + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Boolean + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static isUsableImmutablePrimitive(x) → {Boolean} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Checks if given `x` is set and of one of [String, Boolean, Number, Symbol] (null and undefined are immutable but are not "usable" (usually not what we want to operate on). +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  x + + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Boolean + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static isWeakMap(value) → {Boolean} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Checks whether value is of `WeakMap` or not. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  value + + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Boolean + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static isWeakSet(value) → {Boolean} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Checks whether value is of `WeakSet` or not. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  value + + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Boolean + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static jsonClone(x) → {*} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Clones and object or array using `JSON.parse(JSON.stringify(...))` pattern. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  x + + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +* + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static keys(obj) → {Array.<String>} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Gets passed in object's own enumerable keys (same as `Object.keys`). +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  obj + + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Array.<String> + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static length(x) → {Number} + + + + +

                                  + + + +
                                  +
                                  + + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  x + + +* + + + +
                                  + +
                                  + + + + + + + + + + + +
                                  Throws:
                                  + + + +
                                  +
                                  +
                                  + - Throws an error if value doesn't have a `length` property ( `null`, `undefined`, {Boolean}, Symbol, et. al.). +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  + Type +
                                  +
                                  + +Error + + +
                                  +
                                  +
                                  +
                                  +
                                  + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Number + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static lookup(key, obj) → {*} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Looks up property and returns it's value; Else `undefined`. Method is null safe (will not throw on `null` or `undefined`). +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  key + + +String + + + + Key to search on `obj`
                                  obj + + +Object + + + + Object to search `name` on.
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +* + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static of(x, …argsopt) → {*|undefined} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Creates a value `of` given type; Checks for one of the following construction strategies (in order listed): +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeAttributesDescription
                                  x + + +* + + + + + + + + + + Value to derive returned value's type from.
                                  args + + +* + + + + + + <optional>
                                  + + + + + + <repeatable>
                                  + +
                                  Any args to pass in to matched construction strategy.
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +* +| + +undefined + + + + + +- - New value of given value's type else `undefined`. + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + +
                                  Example
                                  + +
                                  // - If exists `(value).constructor.of` uses this.
                                  // - If value is of one String, Boolean, Symbol, or Number types calls it's
                                  //      constructor as a function (in cast form;  E.g., `constructor(...args)` )
                                  // - Else if constructor is a function, thus far, then calls constructor using
                                  //      the `new` keyword (with any passed in args).
                                  + + + +
                                  + + + + +
                                  + +

                                  + + static searchObj(nsString, obj) → {*} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Gives you value at key/namespace-key within `obj`; E.g., searchObj('all.your.base', {all: {your: {base: 99}}}) === 99 // `true` +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  nsString + + +String + + + +
                                  obj + + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +* + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + +
                                  Example
                                  + +
                                  ```
                                  if (obj && obj.all && obj.all.your && obj.all.your.base) {
                                    // Thing we want to do
                                  }
                                  
                                  // So with our function becomes
                                  if (searchObj('all.your.base', obj)) {
                                    // Thing we want to do
                                  }
                                  ```
                                  + + + +
                                  + + + + +
                                  + +

                                  + + static toArray(x) → {Array} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Converts incoming value to an array. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  x + + +* + + + + Thing to convert from.
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Array + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static toAssocList(obj) → {Array.<*, *>} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Returns an associated list from given object. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  obj + + +Object +| + +Array +| + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Array.<*, *> + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static toAssocListDeep(obj, TypeConstraintopt) → {*} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Returns an associated list from given object (deeply (on incoming object's type)). +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeAttributesDefaultDescription
                                  obj + + +* + + + + + + + + + + + +
                                  TypeConstraint + + +Constructor +| + +function + + + + + + <optional>
                                  + + + + + +
                                  + + Object + + Type constraint to convert on.
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +* + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static toEnumerableDescriptor() → {TargetDescriptorTuple} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Returns a target-descriptor tuple whose 'descriptor' will be set to enumerable (`enumerable: true`). +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  TypeDescription
                                  + + +TargetDescriptorTuple + + + + [target, descriptor] tuple.
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +TargetDescriptorTuple + + + + + +- - Array of target and descriptor. + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static toTargetDescriptorTuple(targetOrTargetDescriptorTuple) → {Array.<*>|Array.<*, *>} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Returns an target and descriptor tuple from given. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  targetOrTargetDescriptorTuple + + +* +| + +Array.<*, *> + + + + Target object or tuple of target and descriptor.
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Array.<*> +| + +Array.<*, *> + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static toTypeRef(type) → {String} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Resolves/normalizes a type name from either a string or a constructor. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  type + + +function +| + +String + + + + String or function representing a type.
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +String + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  To Do:
                                  +
                                  +
                                    +
                                  • write tests for this function.
                                  • +
                                  +
                                  + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static toTypeRefName(Type) → {String} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Returns possible Type's TypeRef name. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  Type + + +TypeRef +| + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +String + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  To Do:
                                  +
                                  +
                                    +
                                  • Ensure tests are written for this function.
                                  • +
                                  +
                                  + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static toTypeRefNames(…types) → {Array.<String>} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Returns possible Types' TypeRef names. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeAttributesDescription
                                  types + + +TypeRef +| + +* + + + + + + + + + + <repeatable>
                                  + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Array.<String> + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  To Do:
                                  +
                                  +
                                    +
                                  • Ensure tests are written for this function.
                                  • +
                                  +
                                  + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static toTypeRefs(…types) → {Array.<TypeRef>} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Returns an array of type refs from possible type refs (converts null, undefined, NaN, and other values into type refs (either constructor name or constructor name based on whether value(s) is a string, a constructor, or not). +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeAttributesDescription
                                  types + + +TypeRef +| + +* + + + + + + + + + + <repeatable>
                                  + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Array.<TypeRef> + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  To Do:
                                  +
                                  +
                                    +
                                  • Ensure tests are written for this function.
                                  • +
                                  +
                                  + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static typeOf(value) → {string} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Returns the constructor/class/type name of a value. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  value + + +* + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +string + + + + + +- - Constructor's name or derived name (in the case of `null`, `undefined`, or `NaN` (whose normalized names are 'Null', 'Undefined', 'NaN' respectively). + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + +
                                  + + + + + +
                                  + +
                                  + + + + + + + +
                                  + +
                                  + +

                                  object

                                  + + + + +
                                  + +
                                  + +
                                  + + + + + + +
                                  + +
                                  +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + +
                                  + + + + + + + + + + + + + + + +

                                  Members

                                  + +
                                  + + +
                                  +

                                  + static, constant native :Object + + + +

                                  + + +
                                  +
                                  + +
                                  + Contains all the static functions from `Object` but curried and flipped; +
                                  + + + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + + +
                                  Example
                                  + +
                                  // E.g., `Object.defineProperties(obj, descriptor)` can now be used like
                                  import {defineProperties} from 'fjl'
                                  defineProperties(descriptor, someObj),
                                  // Et. al.
                                  + + +
                                  + +
                                  + + + +

                                  Methods

                                  + +
                                  + + +
                                  + +

                                  + + static assign(obj0, …objs) → {Object} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Defined as `Object.assign` else is the same thing but shimmed. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeAttributesDescription
                                  obj0 + + +Object + + + + + + + + + +
                                  objs + + +Object + + + + + + + + + + <repeatable>
                                  + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Object + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static assignDeep(obj0, …objsopt) → {Object} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Merges all objects down into one (takes two or more args). +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeAttributesDescription
                                  obj0 + + +Object + + + + + + + + + +
                                  objs + + +Object + + + + + + <optional>
                                  + + + + + + <repeatable>
                                  + +
                                  One or more objects to merge onto `obj0`.
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Object + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static copy(x, outopt) → {*} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Make a copy of a value or optionally copy incoming value onto an outgoing value (second parameter). +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeAttributesDescription
                                  x + + +* + + + + + + + + + + Thing to copy.
                                  out + + +* + + + + + + <optional>
                                  + + + + + +
                                  Optional value to copy on to. Not required.
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +* + + + + + +- - Copied thing or optionally outgoing value copied onto. + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static createTypedDescriptor(Type, target, propName) → {Descriptor} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Creates a descriptor for a property which is settable but throws errors when the `Type` is disobeyed. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeDescription
                                  Type + + +TypeRef + + + + {String|Function}
                                  target + + +* + + + +
                                  propName + + +String + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Descriptor + + + + + +- - Property descriptor with just getter and setter. + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static defineEnumProp(Type, target, propName, defaultValueopt) → {TargetDescriptorTuple} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Allows you to define a "typed", enumerated property on `target`. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeAttributesDescription
                                  Type + + +TypeRef + + + + + + + + + + {String|Function}
                                  target + + +TargetDescriptorTuple + + + + + + + + + + Target or array of target and descriptor ([target, descriptor]).
                                  propName + + +String + + + + + + + + + +
                                  defaultValue + + +* + + + + + + <optional>
                                  + + + + + +
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +TargetDescriptorTuple + + + + + + + + + +
                                  + + + + + +
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static defineEnumProps(argsTuple, targetopt) → {Array.<TargetDescriptorTuple>} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Allows you to define multiple enum props at once on target. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  NameTypeAttributesDescription
                                  argsTuple + + +Array.<DefinePropArgsTuple> + + + + + + + + + + Array of argArrays for `defineEnumProp`.
                                  target + + +Target + + + + + + <optional>
                                  + + + + + +
                                  Target to use in internal calls if one is not provided but encountered 'argArray'.
                                  + +
                                  + + + + + + + + + + + + + +
                                  +
                                  Returns:
                                  + + + + + +Array.<TargetDescriptorTuple> + + + + + +- - Results of each call to `defineEnumProp`. + + + + + +
                                  + + +
                                  - + + + + + + + + + + + + + + + + + + + + + + + + + + + +
                                  + + + + +
                                  + + + + +
                                  + +

                                  + + static defineProp(Type, target, propName, defaultValueopt) → {TargetDescriptorTuple} + + + + +

                                  + + + +
                                  +
                                  + + +
                                  + Allows you to define a "typed" property on given `target`. +
                                  + + + + + + + + + +
                                  +
                                  Parameters:
                                  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + - + - + + + +
                                  NameTypeAttributesDescription
                                  Type + + +TypeRef + + + + + + + + + + {String|Function}
                                  target + + +TargetDescriptorTuple + + + + + + + + + + Target or array of target and descriptor ([target, descriptor]).
                                  propName + + +String + + + + + + + + + +
                                  defaultValue + + +* + - + + + + <optional>
                                  + - + - + +
                                  +
                                  @@ -7911,70 +20207,28 @@

                                  object

                                  -
                                  - - - - - +
                                  +
                                  Returns:
                                  -
                                  - + - - - +TargetDescriptorTuple - - - - -

                                  Members

                                  -
                                  - -
                                  -

                                  - static, constant native :Object - - - -

                                  -
                                  -
                                  - -
                                  - Contains all the static functions from `Object` but curried and flipped; +
                                  - - @@ -8014,33 +20268,21 @@
                                  Type:
                                  - -
                                  Example
                                  - -
                                  // E.g., `Object.defineProperties(obj, descriptor)` can now be used like
                                  import {defineProperties} from 'fjl'
                                  defineProperties(descriptor, someObj),
                                  // Et. al.
                                  - -
                                  -
                                  - - - -

                                  Methods

                                  - -
                                  +
                                  -

                                  +

                                  - static assign(obj0, …objs) → {Object} + static defineProps(argsTuple, targetopt) → {Array.<TargetDescriptorTuple>}

                                  @@ -8052,7 +20294,7 @@

                                  - Defined as `Object.assign` else is the same thing but shimmed. + Allows you to define multiple props at once on target.
                                  @@ -8090,13 +20332,13 @@

                                  Parameters:
                                  - obj0 + argsTuple -Object +Array.<DefinePropArgsTuple> @@ -8114,20 +20356,20 @@
                                  Parameters:
                                  - + Array of argArrays for `defineProp`. - objs + target -Object +Target @@ -8136,18 +20378,18 @@
                                  Parameters:
                                  - + <optional>
                                  - <repeatable>
                                  + - + Target to use in internal calls if one is not provided but encountered 'argArray'. @@ -8175,12 +20417,14 @@
                                  Returns:
                                  -Object +Array.<TargetDescriptorTuple> +- - Results of each call to `defineProp`. + @@ -8234,14 +20478,14 @@
                                  Returns:
                                  -

                                  +

                                  - static assignDeep(obj0, …objsopt) → {Object} + static fromAssocList(xs, OutTypeopt) → {*}

                                  @@ -8253,7 +20497,7 @@

                                  - Merges all objects down into one (takes two or more args). + From associated list to object.
                                  @@ -8281,6 +20525,8 @@

                                  Parameters:
                                  + Default + Description @@ -8291,13 +20537,13 @@
                                  Parameters:
                                  - obj0 + xs -Object +Array.<Array> @@ -8314,21 +20560,28 @@
                                  Parameters:
                                  + + + + - + Associated list. - objs + OutType -Object +Constructor +| + +function @@ -8343,14 +20596,18 @@
                                  Parameters:
                                  - <repeatable>
                                  - + + + Object + + + - One or more objects to merge onto `obj0`. + Output type. Default `Object`. @@ -8378,12 +20635,14 @@
                                  Returns:
                                  -Object +* +- - Default is `Object` + @@ -8437,14 +20696,14 @@
                                  Returns:
                                  -

                                  +

                                  - static copy(x, outopt) → {*} + static fromAssocListDeep(xs, OutTypeopt) → {*}

                                  @@ -8456,7 +20715,7 @@

                                  - Make a copy of a value or optionally copy incoming value onto an outgoing value (second parameter). + From associated list to object (deep conversion on associative lists (array of 2 value arrays)).
                                  @@ -8484,6 +20743,8 @@

                                  Parameters:
                                  + Default + Description @@ -8494,13 +20755,13 @@
                                  Parameters:
                                  - x + xs -* +Array.<Array> @@ -8517,21 +20778,28 @@
                                  Parameters:
                                  + + + + - Thing to copy. + Associated list. - out + OutType -* +Constructor +| + +function @@ -8550,8 +20818,14 @@
                                  Parameters:
                                  + + + Object + + + - Optional value to copy on to. Not required. + Output type. Default `Object`. @@ -8585,7 +20859,7 @@
                                  Returns:
                                  -- - Copied thing or optionally outgoing value copied onto. +- - Default is `Object` @@ -8640,14 +20914,14 @@
                                  Returns:
                                  -

                                  +

                                  - static fromAssocList(xs, OutTypeopt) → {*} + static hasOwnProperty(propName, typeInstance) → {Boolean}

                                  @@ -8658,10 +20932,6 @@

                                  -
                                  - From associated list to object. -
                                  - @@ -8683,12 +20953,8 @@
                                  Parameters:
                                  Type - Attributes - - Default - Description @@ -8699,77 +20965,46 @@
                                  Parameters:
                                  - xs + propName -Array.<Array> +* - - - - - - - - - - - - - Associated list. + - OutType + typeInstance -Constructor -| - -function +* - - - <optional>
                                  - - - - - - - - - - Object - - - - Output type. Default `Object`. + @@ -8797,13 +21032,11 @@
                                  Returns:
                                  -* - +Boolean -- - Default is `Object` @@ -8832,6 +21065,8 @@
                                  Returns:
                                  +
                                  Deprecated:
                                  • - Use property directly instead.
                                  + @@ -8858,14 +21093,14 @@

                                  Returns:
                                  -

                                  +

                                  - static fromAssocListDeep(xs, OutTypeopt) → {*} + static instanceOf(instanceConstructor, instance) → {Boolean}

                                  @@ -8877,7 +21112,7 @@

                                  - From associated list to object (deep conversion on associative lists (array of 2 value arrays)). + Returns whether constructor has derived object.
                                  @@ -8901,12 +21136,8 @@

                                  Parameters:
                                  Type - Attributes - - Default - Description @@ -8917,77 +21148,46 @@
                                  Parameters:
                                  - xs + instanceConstructor -Array.<Array> +function - - - - - - - - - - - - - Associated list. + Constructor. - OutType + instance -Constructor -| - -function +* - - - <optional>
                                  - - - - - - - - - - Object - - - - Output type. Default `Object`. + @@ -9015,13 +21215,11 @@
                                  Returns:
                                  -* - +Boolean -- - Default is `Object` @@ -9076,14 +21274,14 @@
                                  Returns:
                                  -

                                  +

                                  - static hasOwnProperty(propName, typeInstance) → {Boolean} + static isArray(value) → {boolean}

                                  @@ -9094,6 +21292,10 @@

                                  +
                                  + Checks if value is an array (same as `Array.isArray`). +
                                  + @@ -9127,30 +21329,7 @@
                                  Parameters:
                                  - propName - - - - - -* - - - - - - - - - - - - - - - - - typeInstance + value @@ -9194,7 +21373,7 @@
                                  Returns:
                                  -Boolean +boolean @@ -9227,8 +21406,6 @@
                                  Returns:
                                  -
                                  Deprecated:
                                  • - Use property directly instead.
                                  - @@ -9255,14 +21432,14 @@

                                  Returns:
                                  -

                                  +

                                  - static instanceOf(instanceConstructor, instance) → {Boolean} + static isBoolean(value) → {Boolean}

                                  @@ -9274,7 +21451,7 @@

                                  - Returns whether constructor has derived object. + Checks if value is a boolean.
                                  @@ -9310,30 +21487,7 @@

                                  Parameters:
                                  - instanceConstructor - - - - - -function - - - - - - - - - - Constructor. - - - - - - - instance + value @@ -9436,14 +21590,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isArray(value) → {boolean} + static isCallable(x) → {Boolean}

                                  @@ -9455,7 +21609,7 @@

                                  - Checks if value is an array (same as `Array.isArray`). + Returns a boolean depicting whether a value is callable or not.
                                  @@ -9491,7 +21645,7 @@

                                  Parameters:
                                  - value + x @@ -9535,7 +21689,7 @@
                                  Returns:
                                  -boolean +Boolean @@ -9594,14 +21748,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isBoolean(value) → {Boolean} + static isClass(x) → {boolean}

                                  @@ -9613,7 +21767,7 @@

                                  - Checks if value is a boolean. + Checks if `value` is an es2015 `class`.
                                  @@ -9649,7 +21803,7 @@

                                  Parameters:
                                  - value + x @@ -9693,7 +21847,7 @@
                                  Returns:
                                  -Boolean +boolean @@ -9752,14 +21906,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isCallable(x) → {Boolean} + static isEmpty(value) → {Boolean}

                                  @@ -9771,7 +21925,7 @@

                                  - Returns a boolean depicting whether a value is callable or not. + Checks to see if passed in value is empty; I.e., check for one of '', 0, `null`, `undefined`, `false`, empty array, empty object, empty function (zero arity), or empty collection (es6 Map, Set, WeakMap, or WeakSet etc. (`!value.size`);
                                  @@ -9807,7 +21961,7 @@

                                  Parameters:
                                  - x + value @@ -9823,7 +21977,7 @@
                                  Parameters:
                                  - + Value to check. @@ -9910,14 +22064,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isClass(x) → {boolean} + static isEmptyCollection(x) → {Boolean}

                                  @@ -9929,7 +22083,7 @@

                                  - Checks if `value` is an es2015 `class`. + Checks if collection is empty or not (Map, WeakMap, WeakSet, Set etc.).
                                  @@ -10009,7 +22163,7 @@

                                  Returns:
                                  -boolean +Boolean @@ -10068,14 +22222,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isEmpty(value) → {Boolean} + static isEmptyList(x) → {Boolean}

                                  @@ -10087,7 +22241,7 @@

                                  - Checks to see if passed in value is empty; I.e., check for one of '', 0, `null`, `undefined`, `false`, empty array, empty object, empty function (zero arity), or empty collection (es6 Map, Set, WeakMap, or WeakSet etc. (`!value.size`); + Checks if !length.
                                  @@ -10123,7 +22277,7 @@

                                  Parameters:
                                  - value + x @@ -10139,7 +22293,7 @@
                                  Parameters:
                                  - Value to check. + @@ -10226,14 +22380,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isEmptyCollection(x) → {Boolean} + static isEmptyObject(obj) → {Boolean}

                                  @@ -10245,7 +22399,7 @@

                                  - Checks if collection is empty or not (Map, WeakMap, WeakSet, Set etc.). + Checks if object has own properties/enumerable-props or not.
                                  @@ -10281,7 +22435,7 @@

                                  Parameters:
                                  - x + obj @@ -10384,14 +22538,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isEmptyList(x) → {Boolean} + static isFunction(value) → {Boolean}

                                  @@ -10403,7 +22557,7 @@

                                  - Checks if !length. + Returns whether a value is a function or not.
                                  @@ -10439,7 +22593,7 @@

                                  Parameters:
                                  - x + value @@ -10542,14 +22696,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isEmptyObject(obj) → {Boolean} + static isMap(value) → {Boolean}

                                  @@ -10561,7 +22715,7 @@

                                  - Checks if object has own properties/enumerable-props or not. + Checks whether value is of `Map` or not.
                                  @@ -10597,7 +22751,7 @@

                                  Parameters:
                                  - obj + value @@ -10700,14 +22854,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isFunction(value) → {Boolean} + static isNull(value) → {Boolean}

                                  @@ -10719,7 +22873,7 @@

                                  - Returns whether a value is a function or not. + Checks if value is null.
                                  @@ -10858,14 +23012,14 @@

                                  Returns:
                                  -

                                  +

                                  - static isMap(value) → {Boolean} + static isNumber(value) → {Boolean}

                                  @@ -10877,7 +23031,7 @@

                                  - Checks whether value is of `Map` or not. + Checks if value is a valid number (also checks if isNaN so that you don't have to).
                                  @@ -11016,14 +23170,14 @@

                                  Returns:
                                  -

                                  +

                                  - static isNull(value) → {Boolean} + static isObject(value) → {Boolean}

                                  @@ -11035,7 +23189,7 @@

                                  - Checks if value is null. + Checks whether value is an object or not.
                                  @@ -11076,11 +23230,6 @@

                                  Parameters:
                                  - -* - - - @@ -11174,14 +23323,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isNumber(value) → {Boolean} + static isOfType(type, x) → {Boolean}

                                  @@ -11193,7 +23342,7 @@

                                  - Checks if value is a valid number (also checks if isNaN so that you don't have to). + Loose type checker; E.g., If `type` is not a constructor, but a constructor name, does a type check on constructor names, else if first check fails and `type` is a constructor, performs an `instanceof` check on value with constructor.
                                  @@ -11229,7 +23378,33 @@

                                  Parameters:
                                  - value + type + + + + + +function +| + +String + + + + + + + + + + Type reference (constructor or `constructor.name`). + + + + + + + x @@ -11245,7 +23420,7 @@
                                  Parameters:
                                  - + Value to check. @@ -11324,6 +23499,11 @@
                                  Returns:
                                  +
                                  Example
                                  + +
                                  isOfType(Number, 99) === true        // true  (passes strict type check (numbers are not instances of `Number`
                                                                       //        constructor)
                                  isOfType('Number', 99) === true      // true  (passes strict type check)
                                  isOfType(Number, NaN) === true       // true. (passes instance of check)
                                                                       //        If you want "true" strict type checking use `isType`
                                  isOfType(Object, []) === true        // true  (passes instance of check)
                                  isOfType(Array, []) === true         // true  (passes instance of check)
                                  isOfType(Object, {}) === true        // true  (passes instance of check)
                                  isOfType(Object.name, {}) === true   // true  (Passes strict type check)
                                  class Abc extends String {}
                                  isOfType(String, new Abc('abcd')) // true (passes instanceof check)
                                  + + @@ -11332,14 +23512,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isObject(value) → {Boolean} + static isSet(value) → {Boolean}

                                  @@ -11351,7 +23531,7 @@

                                  - Checks whether value is an object or not. + Checks whether value is of `Set` or not.
                                  @@ -11392,6 +23572,11 @@

                                  Parameters:
                                  + +* + + + @@ -11485,14 +23670,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isOfType(type, x) → {Boolean} + static isset(x) → {Boolean}

                                  @@ -11504,7 +23689,7 @@

                                  - Loose type checker; E.g., If `type` is not a constructor, but a constructor name, does a type check on constructor names, else if first check fails and `type` is a constructor, performs an `instanceof` check on value with constructor. + Returns whether passed in values is defined and not null or not.
                                  @@ -11538,32 +23723,6 @@

                                  Parameters:
                                  - - - type - - - - - -function -| - -String - - - - - - - - - - Type reference (constructor or `constructor.name`). - - - - x @@ -11582,7 +23741,7 @@
                                  Parameters:
                                  - Value to check. + @@ -11661,11 +23820,6 @@
                                  Returns:
                                  -
                                  Example
                                  - -
                                  isOfType(Number, 99) === true        // true  (passes strict type check (numbers are not instances of `Number`
                                                                       //        constructor)
                                  isOfType('Number', 99) === true      // true  (passes strict type check)
                                  isOfType(Number, NaN) === true       // true. (passes instance of check)
                                                                       //        If you want "true" strict type checking use `isType`
                                  isOfType(Object, []) === true        // true  (passes instance of check)
                                  isOfType(Array, []) === true         // true  (passes instance of check)
                                  isOfType(Object, {}) === true        // true  (passes instance of check)
                                  isOfType(Object.name, {}) === true   // true  (Passes strict type check)
                                  class Abc extends String {}
                                  isOfType(String, new Abc('abcd')) // true (passes instanceof check)
                                  - - @@ -11674,14 +23828,14 @@
                                  Example
                                  -

                                  +

                                  - static isset(x) → {Boolean} + static isString(value) → {Boolean}

                                  @@ -11693,7 +23847,7 @@

                                  - Returns whether passed in values is defined and not null or not. + Checks whether value is a string or not.
                                  @@ -11729,7 +23883,7 @@

                                  Parameters:
                                  - x + value @@ -11832,14 +23986,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isSet(value) → {Boolean} + static isSymbol(value) → {Boolean}

                                  @@ -11851,7 +24005,7 @@

                                  - Checks whether value is of `Set` or not. + Checks if value is a `Symbol`.
                                  @@ -11990,14 +24144,14 @@

                                  Returns:
                                  -

                                  +

                                  - static isString(value) → {Boolean} + static isType(type, obj) → {Boolean}

                                  @@ -12009,7 +24163,7 @@

                                  - Checks whether value is a string or not. + Strict type checker. Checks if given value is a direct instance of given type; E.g.,
                                  @@ -12045,7 +24199,36 @@

                                  Parameters:
                                  - value + type + + + + + +function +| + +ObjectConstructor +| + +String + + + + + + + + + + Constructor or constructor name + + + + + + + obj @@ -12140,6 +24323,11 @@
                                  Returns:
                                  +
                                  Example
                                  + +
                                  isType(String, 'abcdefg')  === true // true
                                    isType(String.name, 'abcdefg') === true
                                    isType(Number, NaN) === false
                                    isType(Number, 99) === true
                                    isType('Null', 99) === false // though, for `null` and `undefined` checks
                                                                 // @see `isset`, in this module, instead
                                    isType('Undefined', undefined) === true // true
                                  + + @@ -12148,14 +24336,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isSymbol(value) → {Boolean} + static isUndefined(value) → {Boolean}

                                  @@ -12167,7 +24355,7 @@

                                  - Checks if value is a `Symbol`. + Checks if value is undefined.
                                  @@ -12306,14 +24494,14 @@

                                  Returns:
                                  -

                                  +

                                  - static isType(type, obj) → {Boolean} + static isUsableImmutablePrimitive(x) → {Boolean}

                                  @@ -12325,7 +24513,7 @@

                                  - Strict type checker. Checks if given value is a direct instance of given type; E.g., + Checks if given `x` is set and of one of [String, Boolean, Number, Symbol] (null and undefined are immutable but are not "usable" (usually not what we want to operate on).
                                  @@ -12361,36 +24549,7 @@

                                  Parameters:
                                  - type - - - - - -function -| - -ObjectConstructor -| - -String - - - - - - - - - - Constructor or constructor name - - - - - - - obj + x @@ -12485,11 +24644,6 @@
                                  Returns:
                                  -
                                  Example
                                  - -
                                  isType(String, 'abcdefg')  === true // true
                                    isType(String.name, 'abcdefg') === true
                                    isType(Number, NaN) === false
                                    isType(Number, 99) === true
                                    isType('Null', 99) === false // though, for `null` and `undefined` checks
                                                                 // @see `isset`, in this module, instead
                                    isType('Undefined', undefined) === true // true
                                  - - @@ -12498,14 +24652,14 @@
                                  Example
                                  -

                                  +

                                  - static isUndefined(value) → {Boolean} + static isWeakMap(value) → {Boolean}

                                  @@ -12517,7 +24671,7 @@

                                  - Checks if value is undefined. + Checks whether value is of `WeakMap` or not.
                                  @@ -12656,14 +24810,14 @@

                                  Returns:
                                  -

                                  +

                                  - static isUsableImmutablePrimitive(x) → {Boolean} + static isWeakSet(value) → {Boolean}

                                  @@ -12675,7 +24829,7 @@

                                  - Checks if given `x` is set and of one of [String, Boolean, Number, Symbol] (null and undefined are immutable but are not "usable" (usually not what we want to operate on). + Checks whether value is of `WeakSet` or not.
                                  @@ -12711,7 +24865,7 @@

                                  Parameters:
                                  - x + value @@ -12814,14 +24968,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isWeakMap(value) → {Boolean} + static jsonClone(x) → {*}

                                  @@ -12833,7 +24987,7 @@

                                  - Checks whether value is of `WeakMap` or not. + Clones and object or array using `JSON.parse(JSON.stringify(...))` pattern.
                                  @@ -12869,7 +25023,7 @@

                                  Parameters:
                                  - value + x @@ -12913,7 +25067,7 @@
                                  Returns:
                                  -Boolean +* @@ -12972,14 +25126,14 @@
                                  Returns:
                                  -

                                  +

                                  - static isWeakSet(value) → {Boolean} + static keys(obj) → {Array.<String>}

                                  @@ -12991,7 +25145,7 @@

                                  - Checks whether value is of `WeakSet` or not. + Gets passed in object's own enumerable keys (same as `Object.keys`).
                                  @@ -13027,7 +25181,7 @@

                                  Parameters:
                                  - value + obj @@ -13071,7 +25225,7 @@
                                  Returns:
                                  -Boolean +Array.<String> @@ -13130,14 +25284,14 @@
                                  Returns:
                                  -

                                  +

                                  - static jsonClone(x) → {*} + static length(x) → {Number}

                                  @@ -13148,10 +25302,6 @@

                                  -
                                  - Clones and object or array using `JSON.parse(JSON.stringify(...))` pattern. -
                                  - @@ -13220,6 +25370,35 @@
                                  Parameters:
                                  +
                                  Throws:
                                  + + + +
                                  +
                                  +
                                  + - Throws an error if value doesn't have a `length` property ( `null`, `undefined`, {Boolean}, Symbol, et. al.). +
                                  +
                                  +
                                  +
                                  +
                                  +
                                  + Type +
                                  +
                                  + +Error + + +
                                  +
                                  +
                                  +
                                  +
                                  + + +
                                  @@ -13229,7 +25408,7 @@
                                  Returns:
                                  -* +Number @@ -13288,14 +25467,14 @@
                                  Returns:
                                  -

                                  +

                                  - static keys(obj) → {Array.<String>} + static lookup(key, obj) → {*}

                                  @@ -13307,7 +25486,7 @@

                                  - Gets passed in object's own enumerable keys (same as `Object.keys`). + Looks up property and returns it's value; Else `undefined`. Method is null safe (will not throw on `null` or `undefined`).
                                  @@ -13341,6 +25520,29 @@

                                  Parameters:
                                  + + + key + + + + + +String + + + + + + + + + + Key to search on `obj` + + + + obj @@ -13349,7 +25551,7 @@
                                  Parameters:
                                  -* +Object @@ -13359,7 +25561,7 @@
                                  Parameters:
                                  - + Object to search `name` on. @@ -13387,7 +25589,7 @@
                                  Returns:
                                  -Array.<String> +* @@ -13446,14 +25648,14 @@
                                  Returns:
                                  -

                                  +

                                  - static length(x) → {Number} + static of(x, …argsopt) → {*|undefined}

                                  @@ -13464,6 +25666,10 @@

                                  +
                                  + Creates a value `of` given type; Checks for one of the following construction strategies (in order listed): +
                                  + @@ -13485,6 +25691,8 @@
                                  Parameters:
                                  Type + Attributes + @@ -13510,10 +25718,53 @@
                                  Parameters:
                                  + + + + + + + + - + Value to derive returned value's type from. + + + + + + + args + + + + + +* + + + + + + + + + <optional>
                                  + + + + + + <repeatable>
                                  + + + + + + + Any args to pass in to matched construction strategy. @@ -13532,35 +25783,6 @@
                                  Parameters:
                                  -
                                  Throws:
                                  - - - -
                                  -
                                  -
                                  - - Throws an error if value doesn't have a `length` property ( `null`, `undefined`, {Boolean}, Symbol, et. al.). -
                                  -
                                  -
                                  -
                                  -
                                  -
                                  - Type -
                                  -
                                  - -Error - - -
                                  -
                                  -
                                  -
                                  -
                                  - - -
                                  @@ -13570,12 +25792,17 @@
                                  Returns:
                                  -Number +* +| + +undefined +- - New value of given value's type else `undefined`. + @@ -13621,6 +25848,11 @@
                                  Returns:
                                  +
                                  Example
                                  + +
                                  // - If exists `(value).constructor.of` uses this.
                                  // - If value is of one String, Boolean, Symbol, or Number types calls it's
                                  //      constructor as a function (in cast form;  E.g., `constructor(...args)` )
                                  // - Else if constructor is a function, thus far, then calls constructor using
                                  //      the `new` keyword (with any passed in args).
                                  + +
                                  @@ -13629,14 +25861,14 @@

                                  Returns:
                                  -

                                  +

                                  - static lookup(key, obj) → {*} + static searchObj(nsString, obj) → {*}

                                  @@ -13648,7 +25880,7 @@

                                  - Looks up property and returns it's value; Else `undefined`. Method is null safe (will not throw on `null` or `undefined`). + Gives you value at key/namespace-key within `obj`; E.g., searchObj('all.your.base', {all: {your: {base: 99}}}) === 99 // `true`
                                  @@ -13684,7 +25916,7 @@

                                  Parameters:
                                  - key + nsString @@ -13700,7 +25932,7 @@
                                  Parameters:
                                  - Key to search on `obj` + @@ -13713,7 +25945,7 @@
                                  Parameters:
                                  -Object +* @@ -13723,7 +25955,7 @@
                                  Parameters:
                                  - Object to search `name` on. + @@ -13802,6 +26034,11 @@
                                  Returns:
                                  +
                                  Example
                                  + +
                                  ```
                                  if (obj && obj.all && obj.all.your && obj.all.your.base) {
                                    // Thing we want to do
                                  }
                                  
                                  // So with our function becomes
                                  if (searchObj('all.your.base', obj)) {
                                    // Thing we want to do
                                  }
                                  ```
                                  + + @@ -13810,14 +26047,14 @@
                                  Returns:
                                  -

                                  +

                                  - static of(x, …argsopt) → {*|undefined} + static toArray(x) → {Array}

                                  @@ -13829,7 +26066,7 @@

                                  - Creates a value `of` given type; Checks for one of the following construction strategies (in order listed): + Converts incoming value to an array.
                                  @@ -13840,65 +26077,32 @@

                                  -
                                  -
                                  Parameters:
                                  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                                  NameTypeAttributesDescription
                                  x - - -* - - - - - +
                                  +
                                  Parameters:
                                  + + + + + + + - + - - - + - + - - + + + + - + - - - + @@ -13954,16 +26146,11 @@
                                  Returns:
                                  -* -| - -undefined - +Array -- - New value of given value's type else `undefined`. @@ -14010,11 +26197,6 @@
                                  Returns:
                                  -
                                  Example
                                  - -
                                  // - If exists `(value).constructor.of` uses this.
                                  // - If value is of one String, Boolean, Symbol, or Number types calls it's
                                  //      constructor as a function (in cast form;  E.g., `constructor(...args)` )
                                  // - Else if constructor is a function, thus far, then calls constructor using
                                  //      the `new` keyword (with any passed in args).
                                  - - @@ -14023,14 +26205,14 @@
                                  Example
                                  -

                                  +

                                  - static searchObj(nsString, obj) → {*} + static toAssocList(obj) → {Array.<*, *>}

                                  @@ -14042,7 +26224,7 @@

                                  - Gives you value at key/namespace-key within `obj`; E.g., searchObj('all.your.base', {all: {your: {base: 99}}}) === 99 // `true` + Returns an associated list from given object.
                                  @@ -14078,35 +26260,18 @@

                                  Parameters:
                                  - + - - - - - - - - - +Object +| - - - - +Array +| - + + + + @@ -14264,7 +26428,7 @@
                                  Parameters:
                                  - + + + + + - + + + + + + + + + + + + + + + + + + + + + @@ -14308,7 +26526,7 @@
                                  Returns:
                                  -Array +* @@ -14367,14 +26585,14 @@
                                  Returns:
                                  -

                                  +

                                  - static toAssocList(obj) → {Array.<*, *>} + static toEnumerableDescriptor() → {TargetDescriptorTuple}

                                  @@ -14386,7 +26604,7 @@

                                  - Returns an associated list from given object. + Returns a target-descriptor tuple whose 'descriptor' will be set to enumerable (`enumerable: true`).
                                  @@ -14404,8 +26622,6 @@

                                  Parameters:
                                  - - @@ -14422,19 +26638,11 @@
                                  Parameters:
                                  - - + @@ -14472,11 +26680,13 @@
                                  Returns:
                                  -Array.<*, *> +TargetDescriptorTuple + +- - Array of target and descriptor. @@ -14531,14 +26741,14 @@
                                  Returns:
                                  -

                                  +

                                  - static toAssocListDeep(obj, TypeConstraintopt) → {*} + static toTargetDescriptorTuple(targetOrTargetDescriptorTuple) → {Array.<*>|Array.<*, *>}

                                  @@ -14550,7 +26760,7 @@

                                  - Returns an associated list from given object (deeply (on incoming object's type)). + Returns an target and descriptor tuple from given.
                                  @@ -14574,12 +26784,8 @@

                                  Parameters:
                                  - - - - @@ -14590,77 +26796,26 @@
                                  Parameters:
                                  - + - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -14688,7 +26843,10 @@
                                  Returns:
                                  -* +Array.<*> +| + +Array.<*, *> diff --git a/docs/module-string.html b/docs/module-string.html index 42d56d84..da3ec4f0 100644 --- a/docs/module-string.html +++ b/docs/module-string.html @@ -34,7 +34,7 @@

                                  Module: string

                                    - +
                                    diff --git a/docs/module-utils.html b/docs/module-utils.html index aa6974d6..d481ff8d 100644 --- a/docs/module-utils.html +++ b/docs/module-utils.html @@ -34,7 +34,7 @@

                                    Module: utils

                                      - +
                                      diff --git a/docs/module.exports.html b/docs/module.exports.html index 03a45997..32906165 100644 --- a/docs/module.exports.html +++ b/docs/module.exports.html @@ -34,7 +34,7 @@

                                      Class: exports

                                        - +
                                        diff --git a/docs/object.js.html b/docs/object.js.html index 59cef4b7..d53aa004 100644 --- a/docs/object.js.html +++ b/docs/object.js.html @@ -36,7 +36,7 @@

                                        Source: object.js

                                          - +
                                          diff --git a/docs/object_assignDeep.js.html b/docs/object_assignDeep.js.html index 806997f2..eed0f18a 100644 --- a/docs/object_assignDeep.js.html +++ b/docs/object_assignDeep.js.html @@ -36,7 +36,7 @@

                                          Source: object/assignDeep.js

                                            - +
                                            diff --git a/docs/object_assocList.js.html b/docs/object_assocList.js.html index 1db7e8f6..6493f75d 100644 --- a/docs/object_assocList.js.html +++ b/docs/object_assocList.js.html @@ -36,7 +36,7 @@

                                            Source: object/assocList.js

                                              - +
                                              diff --git a/docs/object_console.js.html b/docs/object_console.js.html index 3f047332..6582cc40 100644 --- a/docs/object_console.js.html +++ b/docs/object_console.js.html @@ -36,7 +36,7 @@

                                              Source: object/console.js

                                                - +
                                                diff --git a/docs/object_copy.js.html b/docs/object_copy.js.html index cf57b033..7cca37e6 100644 --- a/docs/object_copy.js.html +++ b/docs/object_copy.js.html @@ -36,7 +36,7 @@

                                                Source: object/copy.js

                                                  - +
                                                  diff --git a/docs/object_defineProp.js.html b/docs/object_defineProp.js.html new file mode 100644 index 00000000..995f2169 --- /dev/null +++ b/docs/object_defineProp.js.html @@ -0,0 +1,243 @@ + + + + + + + Source: object/defineProp.js | Source: object/defineProp.js + + + + + + + + + + + + + +
                                                  + +
                                                  + + + + + +
                                                  +
                                                  +
                                                  /**
                                                  + * @module object
                                                  + * @note Custom jsdoc type definitions defined toward end of file.
                                                  + */
                                                  +import {curry} from '../function/curry';
                                                  +import {apply} from '../jsPlatform/function';
                                                  +import {errorIfNotType} from '../errorThrowing';
                                                  +import {isUndefined, isType} from './is';
                                                  +
                                                  +/**
                                                  + * Creates `defineProps` and `defineEnumProps` methods based on `{enumerable}` param.
                                                  + * @param {{enumerable: Boolean}}
                                                  + * @returns {function(*, *)|PropsDefinerCall}
                                                  + * @private
                                                  + */
                                                  +function createDefinePropsMethod ({enumerable}) {
                                                  +    const operation = enumerable ? defineEnumProp : defineProp;
                                                  +    return (argTuples, target) => {
                                                  +        argTuples.forEach(argTuple => {
                                                  +            const [TypeRef, propName, defaultValue] = argTuple;
                                                  +            apply(operation, [TypeRef, target, propName, defaultValue]);
                                                  +        });
                                                  +        return target;
                                                  +    };
                                                  +}
                                                  +
                                                  +export const
                                                  +
                                                  +    /**
                                                  +     * Creates a descriptor for a property which is settable but throws
                                                  +     * errors when the `Type` is disobeyed.
                                                  +     * @function module:object.createTypedDescriptor
                                                  +     * @param Type {TypeRef} - {String|Function}
                                                  +     * @param target {*}
                                                  +     * @param propName {String}
                                                  +     * @returns {Descriptor} - Property descriptor with just getter and setter.
                                                  +     */
                                                  +    createTypedDescriptor = (Type, target, propName) => {
                                                  +        let _value;
                                                  +        return {
                                                  +            get: function () {
                                                  +                return _value;
                                                  +            },
                                                  +            set: function (value) {
                                                  +                _value = errorIfNotType(Type, propName, target, value);
                                                  +            }
                                                  +        };
                                                  +    },
                                                  +
                                                  +    /**
                                                  +     * Returns a target-descriptor tuple whose 'descriptor' will be set to
                                                  +     *  enumerable (`enumerable: true`).
                                                  +     * @function module:object.toEnumerableDescriptor
                                                  +     * @param {TargetDescriptorTuple} - [target, descriptor] tuple.
                                                  +     * @returns {TargetDescriptorTuple} - Array of target and descriptor.
                                                  +     */
                                                  +    toEnumerableDescriptor = ([target, descriptor]) => {
                                                  +        descriptor.enumerable = true;
                                                  +        return [target, descriptor];
                                                  +    },
                                                  +
                                                  +    /**
                                                  +     * Returns an target and descriptor tuple from given.
                                                  +     * @function module:object.toTargetDescriptorTuple
                                                  +     * @param targetOrTargetDescriptorTuple {(*|Array<*, *>)} - Target object or tuple of target and descriptor.
                                                  +     * @returns {(Array<*>|Array<*,*>)}
                                                  +     */
                                                  +    toTargetDescriptorTuple = targetOrTargetDescriptorTuple =>
                                                  +        isType('Array', targetOrTargetDescriptorTuple) ? // Strict type check for array
                                                  +            targetOrTargetDescriptorTuple : [targetOrTargetDescriptorTuple],
                                                  +
                                                  +    /**
                                                  +     * Allows you to define a "typed" property on given `target`.
                                                  +     * @function module:object.defineProp
                                                  +     * @param Type {TypeRef} - {String|Function}
                                                  +     * @param target {TargetDescriptorTuple} - Target or array of target and descriptor ([target, descriptor]).
                                                  +     * @param propName {String}
                                                  +     * @param [defaultValue=undefined] {*}
                                                  +     * @returns {TargetDescriptorTuple}
                                                  +     */
                                                  +    defineProp = (Type, target, propName, defaultValue = undefined) => {
                                                  +        const [_target, _descriptor] = toTargetDescriptorTuple(target),
                                                  +            descriptor = _descriptor || createTypedDescriptor(Type, _target, propName);
                                                  +        Object.defineProperty(_target, propName, descriptor);
                                                  +        if (!isUndefined(defaultValue)) {
                                                  +            _target[propName] = defaultValue;
                                                  +        }
                                                  +        return [_target, descriptor];
                                                  +    },
                                                  +
                                                  +    /**
                                                  +     * Allows you to define a "typed", enumerated property on `target`.
                                                  +     * @function module:object.defineEnumProp
                                                  +     * @param Type {TypeRef} - {String|Function}
                                                  +     * @param target {TargetDescriptorTuple} - Target or array of target and descriptor ([target, descriptor]).
                                                  +     * @param propName {String}
                                                  +     * @param [defaultValue=undefined] {*}
                                                  +     * @returns {TargetDescriptorTuple}
                                                  +     */
                                                  +    defineEnumProp = (Type, target, propName, defaultValue = undefined) => {
                                                  +        const [_target, _descriptor] = toTargetDescriptorTuple(target),
                                                  +            descriptor = _descriptor || createTypedDescriptor(Type, _target, propName);
                                                  +        return defineProp(
                                                  +            Type,
                                                  +            toEnumerableDescriptor([_target, descriptor]),
                                                  +            propName,
                                                  +            defaultValue
                                                  +        );
                                                  +    },
                                                  +
                                                  +    /**
                                                  +     * Allows you to define multiple enum props at once on target.
                                                  +     * @function module:object.defineEnumProps
                                                  +     * @param argsTuple {Array.<DefinePropArgsTuple>} - Array of argArrays for `defineEnumProp`.
                                                  +     * @param [target = undefined] {Target} - Target to use in internal calls if one is not provided but encountered 'argArray'.
                                                  +     * @returns {Array.<TargetDescriptorTuple>} - Results of each call to `defineEnumProp`.
                                                  +     */
                                                  +    defineEnumProps = curry(createDefinePropsMethod({enumerable: true})),
                                                  +
                                                  +    /**
                                                  +     * Allows you to define multiple props at once on target.
                                                  +     * @function module:object.defineProps
                                                  +     * @param argsTuple {Array.<DefinePropArgsTuple>} - Array of argArrays for `defineProp`.
                                                  +     * @param [target = undefined] {Target} - Target to use in internal calls if one is not provided but encountered 'argArray'.
                                                  +     * @returns {Array.<TargetDescriptorTuple>} - Results of each call to `defineProp`.
                                                  +     * @curried
                                                  +     */
                                                  +    defineProps = curry(createDefinePropsMethod({enumerable: false}))
                                                  +
                                                  +;
                                                  +
                                                  +/** ============================================================= */
                                                  +/** Type definitions:                                             */
                                                  +/** ============================================================= */
                                                  +
                                                  +/**
                                                  + * @typedef {*} Target
                                                  + */
                                                  +
                                                  +/**
                                                  + * @typedef {Object} Descriptor
                                                  + */
                                                  +
                                                  +/**
                                                  + * @typedef {Array<Target, Descriptor>} TargetDescriptorTuple
                                                  + */
                                                  +
                                                  +/**
                                                  + * @typedef {Array.<TypeRef, TargetDescriptorTuple, String, *>}  DefinePropArgsTuple
                                                  + * @description Arguments list for `defineProp` and/or `defineEnumProp` (note: some
                                                  + *  parts of array/tuple are options (namely the last two args));  E.g.,
                                                  + *  ```
                                                  + *  [String, [someTarget], 'somePropName', 'someDefaultValue] // ...
                                                  + *  ```
                                                  + */
                                                  +
                                                  +/**
                                                  + * @typedef {Function} PropsDefinerCall
                                                  + * @description Same type as `defineProp` and `defineEnumProp`
                                                  + * @param argsTuple {DefinePropArgsTuple}
                                                  + * @param target {Target}
                                                  + * @returns {Array.<TargetDescriptorTuple>}
                                                  + */
                                                  +
                                                  +
                                                  +
                                                  + + + + +
                                                  + +
                                                  + + +
                                                  + + + + + + + + + diff --git a/docs/object_is.js.html b/docs/object_is.js.html index 3b9c401f..c1f2329e 100644 --- a/docs/object_is.js.html +++ b/docs/object_is.js.html @@ -36,7 +36,7 @@

                                                  Source: object/is.js

                                                    - +
                                                    diff --git a/docs/object_jsonClone.js.html b/docs/object_jsonClone.js.html index 1843a578..29b852eb 100644 --- a/docs/object_jsonClone.js.html +++ b/docs/object_jsonClone.js.html @@ -36,7 +36,7 @@

                                                    Source: object/jsonClone.js

                                                      - +
                                                      diff --git a/docs/object_lookup.js.html b/docs/object_lookup.js.html index b03d17f8..d84b1c51 100644 --- a/docs/object_lookup.js.html +++ b/docs/object_lookup.js.html @@ -36,7 +36,7 @@

                                                      Source: object/lookup.js

                                                        - +
                                                        diff --git a/docs/object_of.js.html b/docs/object_of.js.html index 122d6319..606ab5af 100644 --- a/docs/object_of.js.html +++ b/docs/object_of.js.html @@ -36,7 +36,7 @@

                                                        Source: object/of.js

                                                          - +
                                                          diff --git a/docs/object_searchObj.js.html b/docs/object_searchObj.js.html index 9f516c95..41731f12 100644 --- a/docs/object_searchObj.js.html +++ b/docs/object_searchObj.js.html @@ -36,7 +36,7 @@

                                                          Source: object/searchObj.js

                                                            - +
                                                            diff --git a/docs/object_toArray.js.html b/docs/object_toArray.js.html index 1b43404f..3ed462f2 100644 --- a/docs/object_toArray.js.html +++ b/docs/object_toArray.js.html @@ -36,7 +36,7 @@

                                                            Source: object/toArray.js

                                                              - +
                                                              diff --git a/docs/object_typeOf.js.html b/docs/object_typeOf.js.html index 7f40a405..2ce72c6c 100644 --- a/docs/object_typeOf.js.html +++ b/docs/object_typeOf.js.html @@ -36,7 +36,7 @@

                                                              Source: object/typeOf.js

                                                                - +
                                                                diff --git a/docs/string.js.html b/docs/string.js.html index df0b247f..7ef8159d 100644 --- a/docs/string.js.html +++ b/docs/string.js.html @@ -36,7 +36,7 @@

                                                                Source: string.js

                                                                  - +
                                                                  diff --git a/docs/utils.js.html b/docs/utils.js.html index 0f545dc9..ed61a1cd 100644 --- a/docs/utils.js.html +++ b/docs/utils.js.html @@ -36,7 +36,7 @@

                                                                  Source: utils.js

                                                                    - +
                                                                    diff --git a/markdown-fragments/sections/changelog.md b/markdown-fragments/sections/changelog.md index 148bd6fe..98abf9a0 100644 --- a/markdown-fragments/sections/changelog.md +++ b/markdown-fragments/sections/changelog.md @@ -10,6 +10,8 @@ - Added `native` which includes all the static methods that live on `Object` though flipped and curried. +- Added 'fjl-mutable' as part of source. All methods of 'fjl-mutable' now +live directly on 'fjl' and are defined in 'fjl/objects/defineProp' (or more directly in src at './src/objects/defineProp'). #### Development changes. - Updated 'dev-deps' to use latest babel. diff --git a/package.json b/package.json index 6c4fd20b..219ac363 100644 --- a/package.json +++ b/package.json @@ -2,8 +2,8 @@ "name": "fjl", "version": "1.7.0", "description": "Functional Javascript Library", - "main": "dist/package/fjl", - "module": "dist/package/fjl.mjs", + "main": "dist/cjs/fjl", + "module": "dist/es6-module/fjl.mjs", "scripts": { "build": "gulp docs build && npm run test-builds", "test-builds": "jest --testMatch **/tests/*-test-*.js", diff --git a/src/fjl.js b/src/fjl.js index cea09ca3..8ebc48e3 100644 --- a/src/fjl.js +++ b/src/fjl.js @@ -15,3 +15,9 @@ export * from './list'; export * from './string'; export * from './utils'; export * from './errorThrowing'; + +/** + * @typedef {String|Function|ArrayBufferConstructor|ArrayConstructor|BooleanConstructor|MapConstructor|NumberConstructor|SetConstructor|WeakMapConstructor|WeakSetConstructor} TypeRef + * @description Type reference. Either actual type or type's name; E.g., `Type.name` + * Also note: Class cased names are use for values that do not have `name` properties; Namely: 'Null', 'NaN' and 'Undefined' (for their respective values respectively). + */ diff --git a/src/object/defineProp.js b/src/object/defineProp.js new file mode 100644 index 00000000..5d45925d --- /dev/null +++ b/src/object/defineProp.js @@ -0,0 +1,163 @@ +/** + * @module object + * @note Custom jsdoc type definitions defined toward end of file. + */ +import {curry} from '../function/curry'; +import {apply} from '../jsPlatform/function'; +import {errorIfNotType} from '../errorThrowing'; +import {isUndefined, isType} from './is'; + +/** + * Creates `defineProps` and `defineEnumProps` methods based on `{enumerable}` param. + * @param {{enumerable: Boolean}} + * @returns {function(*, *)|PropsDefinerCall} + * @private + */ +function createDefinePropsMethod ({enumerable}) { + const operation = enumerable ? defineEnumProp : defineProp; + return (argTuples, target) => { + argTuples.forEach(argTuple => { + const [TypeRef, propName, defaultValue] = argTuple; + apply(operation, [TypeRef, target, propName, defaultValue]); + }); + return target; + }; +} + +export const + + /** + * Creates a descriptor for a property which is settable but throws + * errors when the `Type` is disobeyed. + * @function module:object.createTypedDescriptor + * @param Type {TypeRef} - {String|Function} + * @param target {*} + * @param propName {String} + * @returns {Descriptor} - Property descriptor with just getter and setter. + */ + createTypedDescriptor = (Type, target, propName) => { + let _value; + return { + get: function () { + return _value; + }, + set: function (value) { + _value = errorIfNotType(Type, propName, target, value); + } + }; + }, + + /** + * Returns a target-descriptor tuple whose 'descriptor' will be set to + * enumerable (`enumerable: true`). + * @function module:object.toEnumerableDescriptor + * @param {TargetDescriptorTuple} - [target, descriptor] tuple. + * @returns {TargetDescriptorTuple} - Array of target and descriptor. + */ + toEnumerableDescriptor = ([target, descriptor]) => { + descriptor.enumerable = true; + return [target, descriptor]; + }, + + /** + * Returns an target and descriptor tuple from given. + * @function module:object.toTargetDescriptorTuple + * @param targetOrTargetDescriptorTuple {(*|Array<*, *>)} - Target object or tuple of target and descriptor. + * @returns {(Array<*>|Array<*,*>)} + */ + toTargetDescriptorTuple = targetOrTargetDescriptorTuple => + isType('Array', targetOrTargetDescriptorTuple) ? // Strict type check for array + targetOrTargetDescriptorTuple : [targetOrTargetDescriptorTuple], + + /** + * Allows you to define a "typed" property on given `target`. + * @function module:object.defineProp + * @param Type {TypeRef} - {String|Function} + * @param target {TargetDescriptorTuple} - Target or array of target and descriptor ([target, descriptor]). + * @param propName {String} + * @param [defaultValue=undefined] {*} + * @returns {TargetDescriptorTuple} + */ + defineProp = (Type, target, propName, defaultValue = undefined) => { + const [_target, _descriptor] = toTargetDescriptorTuple(target), + descriptor = _descriptor || createTypedDescriptor(Type, _target, propName); + Object.defineProperty(_target, propName, descriptor); + if (!isUndefined(defaultValue)) { + _target[propName] = defaultValue; + } + return [_target, descriptor]; + }, + + /** + * Allows you to define a "typed", enumerated property on `target`. + * @function module:object.defineEnumProp + * @param Type {TypeRef} - {String|Function} + * @param target {TargetDescriptorTuple} - Target or array of target and descriptor ([target, descriptor]). + * @param propName {String} + * @param [defaultValue=undefined] {*} + * @returns {TargetDescriptorTuple} + */ + defineEnumProp = (Type, target, propName, defaultValue = undefined) => { + const [_target, _descriptor] = toTargetDescriptorTuple(target), + descriptor = _descriptor || createTypedDescriptor(Type, _target, propName); + return defineProp( + Type, + toEnumerableDescriptor([_target, descriptor]), + propName, + defaultValue + ); + }, + + /** + * Allows you to define multiple enum props at once on target. + * @function module:object.defineEnumProps + * @param argsTuple {Array.} - Array of argArrays for `defineEnumProp`. + * @param [target = undefined] {Target} - Target to use in internal calls if one is not provided but encountered 'argArray'. + * @returns {Array.} - Results of each call to `defineEnumProp`. + */ + defineEnumProps = curry(createDefinePropsMethod({enumerable: true})), + + /** + * Allows you to define multiple props at once on target. + * @function module:object.defineProps + * @param argsTuple {Array.} - Array of argArrays for `defineProp`. + * @param [target = undefined] {Target} - Target to use in internal calls if one is not provided but encountered 'argArray'. + * @returns {Array.} - Results of each call to `defineProp`. + * @curried + */ + defineProps = curry(createDefinePropsMethod({enumerable: false})) + +; + +/** ============================================================= */ +/** Type definitions: */ +/** ============================================================= */ + +/** + * @typedef {*} Target + */ + +/** + * @typedef {Object} Descriptor + */ + +/** + * @typedef {Array} TargetDescriptorTuple + */ + +/** + * @typedef {Array.} DefinePropArgsTuple + * @description Arguments list for `defineProp` and/or `defineEnumProp` (note: some + * parts of array/tuple are options (namely the last two args)); E.g., + * ``` + * [String, [someTarget], 'somePropName', 'someDefaultValue] // ... + * ``` + */ + +/** + * @typedef {Function} PropsDefinerCall + * @description Same type as `defineProp` and `defineEnumProp` + * @param argsTuple {DefinePropArgsTuple} + * @param target {Target} + * @returns {Array.} + */ diff --git a/tests/test-object.defineProp.js b/tests/test-object.defineProp.js new file mode 100644 index 00000000..ca2dc16c --- /dev/null +++ b/tests/test-object.defineProp.js @@ -0,0 +1,418 @@ +import {apply} from '../src/jsPlatform/function'; +import {keys} from '../src/jsPlatform/object'; +import {unfoldr} from '../src/list'; +import { + createTypedDescriptor, + toEnumerableDescriptor, + defineProp, + defineProps, + defineEnumProp, + defineEnumProps +} + from '../src/object/defineProp'; + +describe ('#fjlMutable', function () { + + describe ('#createTypedDescriptor', function () { + const someTarget = {}, + exampleNumberDescriptor = createTypedDescriptor(Number, someTarget, 'someNum'), + result = exampleNumberDescriptor; + it ('should return a descriptor with a setter and a getter', function () { + const ks = keys(result); + expect(ks.length).toEqual(2); + expect(result.hasOwnProperty('get')).toEqual(true); + expect(result.hasOwnProperty('set')).toEqual(true); + }); + + it ('should return a descriptor for whom\'s getter and setter functions' + + 'return and/or set the value for said descriptor.', function () { + expect(result.set(99)).toEqual(undefined); + expect(result.get()).toEqual(99); + }); + + it ('should return a descriptor with a setter that throws an `Error` when ' + + 'passed in value to be set is not of the defined type.', function () { + expect(() => result.set('not expected type')).toThrow(Error); + }); + + it ('should return a descriptor that retains it\'s value even after ' + + 'throwing a `setter` error (for incorrect type being passed in to `set`).', function () { + expect(() => result.set('not expected type')).toThrow(Error); + expect(result.get()).toEqual(99); + }); + + it ('should return a descriptor that doesn\'t expose internally stored value for ' + + 'it\'s defined property.', function () { + const ks = keys(result); + expect(ks.length).toEqual(2); + expect(result.hasOwnProperty('get')).toEqual(true); + expect(result.hasOwnProperty('set')).toEqual(true); + }); + }); + + describe ('#toEnumerableDescriptor', function () { + const descriptor = toEnumerableDescriptor([{}, {}])[1]; + + it ('should return an object with an `enumerable` property set to `true`', function () { + expect(descriptor.hasOwnProperty('enumerable')).toEqual(true); + expect(descriptor.enumerable).toEqual(true); + }); + + it ('should throw an error when no descriptor is passed in `TargetDescriptorPair`', function () { + expect(() => toEnumerableDescriptor([])).toThrow(Error); + expect(() => toEnumerableDescriptor([1]).toThrow(Error)); + }); + }); + + describe ('#defineProp', function () { + const someTarget = {}, + propName = 'someNum', + [target, descriptor] = defineProp(Number, [someTarget], propName); + it ('should return a `target` and `descriptor` pair (tuple)', function () { + expect(target).toEqual(someTarget); + expect(!!descriptor).toEqual(true); + }); + it ('should define property `propName` on `target`', function () { + expect(target.hasOwnProperty(propName)).toEqual(true); + }); + it ('should return a target whose defined `propName` throws an error when ' + + 'the wrong type is passed in', function () { + expect(() => { target[propName] = 'some value'; }).toThrow(Error); + }); + it ('should return a target whose defined `propName` doesn\'t throw' + + 'an error when the correct type of value is passed in', function () { + target[propName] = 99; + expect(target[propName]).toEqual(99); + }); + it ('should allow the user to pass in his/her own `descriptor`', function () { + const somePropName = 'somePropName', + someValue = (new Date()).getTime(), + customDescriptor = { + value: someValue, + enumerable: true + }, + [target2, descriptor2] = defineProp(Number, [someTarget, customDescriptor], somePropName); + expect(() => { target2[somePropName] = 99; }).toThrow(Error); + expect(target2[somePropName]).toEqual(someValue); + expect(descriptor2).toEqual(customDescriptor); + expect(descriptor2.enumerable).toEqual(true); + }); + }); + + describe ('#defineEnumProp', function () { + const someTarget = {}, + propName = 'someNum', + [target, descriptor] = defineEnumProp(Number, [someTarget], propName); + it ('should return a `target` and `descriptor` pair (tuple)', function () { + expect(target).toEqual(someTarget); + expect(!!descriptor).toEqual(true); + }); + it ('should define property `propName` on `target`', function () { + expect(target.hasOwnProperty(propName)).toEqual(true); + }); + it ('should set `enumerable` to `true` on returned descriptor', function () { + expect(descriptor.enumerable).toEqual(true); + expect(Object.getOwnPropertyDescriptor(target, propName).enumerable).toEqual(true); + }); + it ('should return a target whose defined `propName` throws an error when ' + + 'the wrong type is passed in', function () { + expect(() => { target[propName] = 'some value'; }).toThrow(Error); + }); + it ('should return a target whose defined `propName` doesn\'t throw' + + 'an error when the correct type of value is passed in', function () { + target[propName] = 99; + expect(target[propName]).toEqual(99); + }); + it ('should allow the user to pass in his/her own `descriptor`', function () { + const somePropName = 'somePropName', + someValue = (new Date()).getTime(), + customDescriptor = { + value: someValue, + enumerable: false + }, + [target2, descriptor2] = defineEnumProp(Number, [someTarget, customDescriptor], somePropName); + expect(() => { target2[somePropName] = 99; }).toThrow(Error); + expect(target2[somePropName]).toEqual(someValue); + expect(descriptor2).toEqual(customDescriptor); + expect(descriptor2.enumerable).toEqual(true); + }); + }); + + describe ('#defineProps', function () { + const + seedArgTuples = [ + [String, 'someStringProp'], + [Number, 'someNumberProp'], + [Boolean, 'someBooleanProp'], + [Function, 'someFunctionProp'], + [Array, 'someArrayProp'] + ], + seedArgTupleCorrectIncorrectValues = [ + ['99 bottles..', 99], + [99, 'should-be-number'], + [false, 1], + [function () {}, 99, 99], + [[1, 2, 3, 4, 5], function () {}] + ], + seedTarget = seedArgTuples.reduce((agg, tuple) => { + agg[tuple[1]] = null; + return agg; + }, {}), + seedPropNames = keys(seedTarget), + generateTargetData = () => unfoldr((argTuples, ind, _out) => { + const + _argTuples = argTuples.slice(0), + out = [_argTuples.slice(0), {}]; + if (!_out.length) { + return [out, _argTuples]; + } + else if (_argTuples.length) { + _argTuples.pop(); + return [out, _argTuples]; + } + return undefined; + }, + seedArgTuples); + + it ('data for tests should be in correct format', function () { + // Test our test parameters + expect(seedPropNames.length).toEqual(seedArgTuples.length); + seedPropNames.forEach((name, ind) => { + expect(seedArgTuples[ind][1]).toEqual(name); + }); + expect(seedPropNames.length).toEqual(seedArgTuples.length); + }); + + it ('should be able to define many props on given target with only argTuples of length `2`', function () { + generateTargetData().forEach(args => { + // log(args); + const target = defineProps.apply(null, args), + propNames = args[0].map(x => x[1]); + + // log(propNames, '\n', target); + + // Ensure targets have props set + propNames.forEach(name => { + expect(target.hasOwnProperty(name)).toEqual(true); + }); + }); + }); + + it ('should have defined properties that throw errors when they are set to the wrong type' + + 'and no errors when set to the correct type', function () { + generateTargetData().forEach(args => { + // log(args); + const target = defineProps.apply(null, args), + propNames = args[0].map(x => x[1]); + + // log(propNames, '\n', target); + + // Ensure targets have props set + propNames.forEach((name, ind) => { + const [correct, inCorrect] = seedArgTupleCorrectIncorrectValues[ind]; + + // Ensure prop exists + expect(target.hasOwnProperty(name)).toEqual(true); + + // Ensure setter obeys type rule + expect(() => { target[name] = inCorrect; }).toThrow(Error); + + // Ensure setter obeys type rule + expect(target[name] = correct).toEqual(correct); + }); + }); + }); + + it ('should return target with defined properties from operation', function () { + generateTargetData().forEach(args => { + // log(args); + const target = apply(defineProps, args), + argKeyNames = args[0].map(pair => pair[1]); + expect(target).toBeInstanceOf(Object); + argKeyNames.forEach(key => { + const propDescriptor = Object.getOwnPropertyDescriptor(target, key); + expect(['set', 'get'].every(k => propDescriptor[k] instanceof Function)); + }); + }); + }); + + it ('should be able to set types with argTuples of length of `3` (containing a `defaultValue`)', function () { + generateTargetData().map(argTuple => { + const [args, target] = argTuple; + // log(argTuple); + // Return new version of `argTuple` (seeded with `defaultValue`) + return [ + // Add `defaultValue` to arg lists + args.map((argSet, ind) => { + const [TypeRef, propName] = argSet, + [correct] = seedArgTupleCorrectIncorrectValues[ind]; + return [TypeRef, propName, correct]; + }), + target + ]; + }).forEach(args => { + // log(args); + const target = apply(defineProps, args), + argKeyNames = args[0].map(([_, key]) => key); + expect(target).toBeInstanceOf(Object); + argKeyNames.forEach(key => { + const propDescriptor = Object.getOwnPropertyDescriptor(target, key); + expect(['set', 'get'].every(k => propDescriptor[k] instanceof Function)); + }); + }); + }); + + }); + + describe ('#defineEnumProps', function () { + const + seedArgTuples = [ + [String, 'someStringProp'], + [Number, 'someNumberProp'], + [Boolean, 'someBooleanProp'], + [Function, 'someFunctionProp'], + [Array, 'someArrayProp'] + ], + seedArgTupleCorrectIncorrectValues = [ + ['99 bottles..', 99], + [99, 'should-be-number'], + [false, 1], + [function () {}, 99, 99], + [[1, 2, 3, 4, 5], function () {}] + ], + seedTarget = seedArgTuples.reduce((agg, tuple) => { + agg[tuple[1]] = null; + return agg; + }, {}), + seedPropNames = keys(seedTarget), + generateTargetData = () => unfoldr((argTuples, ind, _out) => { + const + _argTuples = argTuples.slice(0), + out = [_argTuples.slice(0), {}]; + if (!_out.length) { + return [out, _argTuples]; + } + else if (_argTuples.length) { + _argTuples.pop(); + return [out, _argTuples]; + } + return undefined; + }, + seedArgTuples); + + it ('data for tests should be in correct format', function () { + // Test our test parameters + expect(seedPropNames.length).toEqual(seedArgTuples.length); + seedPropNames.forEach((name, ind) => { + expect(seedArgTuples[ind][1]).toEqual(name); + }); + expect(seedPropNames.length).toEqual(seedArgTuples.length); + }); + + it ('should be able to define many enum props on given target with only argTuples of length `2`', function () { + generateTargetData().forEach(args => { + // log(args); + const target = apply(defineEnumProps, args), + propNames = args[0].map(([_, name]) => name); + + // log(propNames, '\n', target); + + // Ensure targets have enumerable props set + propNames.forEach(name => { + expect(target.hasOwnProperty(name)).toEqual(true); + expect(Object.getOwnPropertyDescriptor(target, name).enumerable) + .toEqual(true); + }); + }); + }); + + it ('should have defined properties that throw errors when they are set to the wrong type' + + 'and no errors when set to the correct type', function () { + generateTargetData().forEach(args => { + // log(args); + const target = apply(defineEnumProps, args), + propNames = args[0].map(([_, name]) => name); + + // log(propNames, '\n', target); + + // Ensure targets have enumerable props set + propNames.forEach((name, ind) => { + const [correct, inCorrect] = seedArgTupleCorrectIncorrectValues[ind]; + + // Ensure prop exists + expect(target.hasOwnProperty(name)).toEqual(true); + + // Ensure prop is enumerable + expect(Object.getOwnPropertyDescriptor(target, name).enumerable) + .toEqual(true); + + // Ensure setter obeys type rule + expect(() => { target[name] = inCorrect; }).toThrow(Error); + + // Ensure setter obeys type rule + expect(target[name] = correct).toEqual(correct); + }); + }); + }); + + it ('should return target and descriptor tuples from operation', function () { + generateTargetData().forEach(args => { + // log(args); + const target = apply(defineEnumProps, args), + propNames = args[0].map(([_, name]) => name); + expect(target).toBeInstanceOf(Object); + propNames.forEach(name => { + const propDescript = Object.getOwnPropertyDescriptor(target, name); + expect(propDescript.enumerable).toEqual(true); + expect(['set', 'get'].every(key => propDescript[key] instanceof Function)); + }); + }); + }); + + it ('should be able to set types with argTuples of length of `3`(with [target, descriptor] tuple) ' + + 'and `4` (with defaultValue)', function () { + generateTargetData().map(argTuple => { + const [args, target] = argTuple; + // log(argTuple); + // Return new version of `argTuple` seeded `defaultValue` + return [ + // Add `defaultValue` to arg lists + args.map((argSet, ind) => { + const [correct, _] = seedArgTupleCorrectIncorrectValues[ind]; + return argSet.concat([correct]); + }), + target + ]; + + }).forEach(args => { + // log(args); + + const target = apply(defineEnumProps, args), + propNames = args[0].map(([_, name]) => name); + expect(target).toBeInstanceOf(Object); + + // log(propNames, '\n', target); + + // Ensure targets have enumerable props set + propNames.forEach((name, ind) => { + const [correct, inCorrect] = seedArgTupleCorrectIncorrectValues[ind]; + + // Ensure prop exists + expect(target.hasOwnProperty(name)).toEqual(true); + + // Ensure prop is enumerable + expect(Object.getOwnPropertyDescriptor(target, name).enumerable) + .toEqual(true); + + // Ensure setter obeys type rule + expect(() => { target[name] = inCorrect; }).toThrow(Error); + + // Ensure setter obeys type rule + expect(target[name] = correct).toEqual(correct); + }); + }); + }); + + }); + +}); diff --git a/tests/test-object.js b/tests/test-object.js index e1d2ffb6..dfce67e4 100644 --- a/tests/test-object.js +++ b/tests/test-object.js @@ -720,7 +720,12 @@ describe ('#object', function () { Object.getOwnPropertyNames(Object).forEach(key => { const foundOnNative = native[key], foundOnObj = Object[key]; - if (typeof foundOnNative !== 'function') { return; } + + // Test functions only + if (typeof foundOnNative !== 'function') { + return; + } + it(`should have a "${key}" property whose value is of same type as \`Object[key]\``, () => { expect(typeof foundOnNative).toEqual(typeof foundOnObj); }); diff --git a/types/base-types.d.ts b/types/base-types.d.ts index 819be34b..17bbe84c 100644 --- a/types/base-types.d.ts +++ b/types/base-types.d.ts @@ -1 +1,7 @@ -declare type TypeRef = string | Function; +declare type TypeRef = + string | Function | ArrayBufferConstructor | ArrayConstructor | + BooleanConstructor | StringConstructor | + NumberConstructor | MapConstructor | + SetConstructor | WeakMapConstructor | + WeakSetConstructor | PromiseConstructorLike + ; diff --git a/types/index.d.ts b/types/index.d.ts index fb6cc1de..230ac199 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -1,3 +1,5 @@ +export as namespace fjl; + import './base-types'; import './utils'; import './function';
                                                                    NameTypeValue to derive returned value's type from.
                                                                    Description
                                                                    argsx @@ -13911,22 +26115,10 @@
                                                                    Parameters:
                                                                    - - <optional>
                                                                    - - - - - - <repeatable>
                                                                    - -
                                                                    Any args to pass in to matched construction strategy.Thing to convert from.
                                                                    nsStringobj -String - - - -
                                                                    obj - - * @@ -14145,7 +26310,7 @@
                                                                    Returns:
                                                                    -* +Array.<*, *> @@ -14196,11 +26361,6 @@
                                                                    Returns:
                                                                    -
                                                                    Example
                                                                    - -
                                                                    ```
                                                                    if (obj && obj.all && obj.all.your && obj.all.your.base) {
                                                                      // Thing we want to do
                                                                    }
                                                                    
                                                                    // So with our function becomes
                                                                    if (searchObj('all.your.base', obj)) {
                                                                      // Thing we want to do
                                                                    }
                                                                    ```
                                                                    - - @@ -14209,14 +26369,14 @@
                                                                    Example
                                                                    -

                                                                    +

                                                                    - static toArray(x) → {Array} + static toAssocListDeep(obj, TypeConstraintopt) → {*}

                                                                    @@ -14228,7 +26388,7 @@

                                                                    - Converts incoming value to an array. + Returns an associated list from given object (deeply (on incoming object's type)).
                                                                    @@ -14252,8 +26412,12 @@

                                                                    Parameters:
                                                                    TypeAttributesDefaultDescription
                                                                    xobj @@ -14277,10 +26441,64 @@
                                                                    Parameters:
                                                                    + + + + + + + + Thing to convert from.
                                                                    TypeConstraint + + +Constructor +| + +function + + + + + + <optional>
                                                                    + + + + + +
                                                                    + + Object + + Type constraint to convert on.
                                                                    NameType
                                                                    obj -Object -| - -Array -| - -* +TargetDescriptorTuple @@ -14444,7 +26652,7 @@
                                                                    Parameters:
                                                                    -
                                                                    [target, descriptor] tuple.
                                                                    TypeAttributesDefaultDescription
                                                                    objtargetOrTargetDescriptorTuple * - - - - - - - - - - - -
                                                                    TypeConstraint - - -Constructor | -function +Array.<*, *> - - <optional>
                                                                    - - - - - -
                                                                    - - Object - - Type constraint to convert on.Target object or tuple of target and descriptor.