@dbmx/toasts 0.0.47 → 0.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/_virtual/_commonjsHelpers.cjs +33 -0
- package/cjs/_virtual/artefacts.cjs +5 -0
- package/cjs/_virtual/core.cjs +5 -0
- package/cjs/_virtual/dependencyResolver.cjs +5 -0
- package/cjs/_virtual/index.esm.cjs +8 -0
- package/cjs/_virtual/items.cjs +5 -0
- package/cjs/_virtual/sdmx.cjs +5 -0
- package/cjs/components/SdmxDatagrid/index.cjs +1 -1
- package/cjs/components/SdmxDatagrid/utils/index.cjs +9 -7
- package/cjs/node_modules/@dbmx/sdmx/cjs/core.cjs +940 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/data.cjs +140 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/dependencyResolver.cjs +73 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/items.cjs +100 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/assoc.cjs +38 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/assocPath.cjs +55 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/bind.cjs +41 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/compose.cjs +43 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/concat.cjs +69 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/curryN.cjs +66 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/defaultTo.cjs +38 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/dissoc.cjs +33 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/dissocPath.cjs +79 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/equals.cjs +42 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/filter.cjs +63 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/forEach.cjs +58 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/identity.cjs +34 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_arity.cjs +56 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_arrayFromIterator.cjs +13 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_arrayReduce.cjs +14 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_assoc.cjs +37 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_checkForMethod.cjs +30 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_complement.cjs +10 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_createReduce.cjs +32 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_curry1.cjs +27 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_curry2.cjs +38 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_curry3.cjs +56 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_curryN.cjs +48 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_dispatchable.cjs +49 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_dissoc.cjs +36 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_equals.cjs +143 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_filter.cjs +17 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_functionName.cjs +10 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_has.cjs +8 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_identity.cjs +8 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_includes.cjs +11 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_includesWith.cjs +16 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_indexOf.cjs +61 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_isArguments.cjs +18 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_isArray.cjs +20 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_isArrayLike.cjs +55 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_isFunction.cjs +9 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_isInteger.cjs +16 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_isObject.cjs +8 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_isPlaceholder.cjs +8 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_isString.cjs +8 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_isTransformer.cjs +8 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_map.cjs +15 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_objectIs.cjs +18 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_pipe.cjs +10 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_quote.cjs +10 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_toISOString.cjs +17 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_toString.cjs +62 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_xArrayReduce.cjs +18 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_xReduce.cjs +30 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_xfBase.cjs +13 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_xfilter.cjs +26 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_xmap.cjs +27 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/internal/_xwrap.cjs +24 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/is.cjs +39 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/isNil.cjs +32 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/keys.cjs +80 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/map.cjs +75 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/nth.cjs +44 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/path.cjs +41 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/pathOr.cjs +38 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/paths.cjs +50 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/pick.cjs +41 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/pipe.cjs +46 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/prop.cjs +43 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/propOr.cjs +46 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/reduce.cjs +71 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/reject.cjs +43 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/remove.cjs +37 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/reverse.cjs +41 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/slice.cjs +42 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/tail.cjs +46 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/times.cjs +49 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/toString.cjs +53 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/type.cjs +41 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/node_modules/ramda/es/values.cjs +42 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/types/artefacts.cjs +40 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/types/categorisation.cjs +32 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/types/categoryscheme.cjs +16 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/types/codelist.cjs +31 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/types/conceptscheme.cjs +41 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/types/contentconstraint.cjs +40 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/types/dataconstraint.cjs +39 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/types/dataflow.cjs +32 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/types/dataproviderscheme.cjs +16 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/types/datastructure.cjs +73 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/types/hierarchicalcodelist.cjs +38 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/types/metadatastructure.cjs +62 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/types/provisionagreement.cjs +32 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/types/sdmx.cjs +71 -0
- package/cjs/node_modules/@dbmx/sdmx/cjs/utils/url-regexp.cjs +30 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/_virtual/_commonjsHelpers.cjs +10 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/_virtual/url-join.cjs +5 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/core.cjs +554 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/datastructures.cjs +73 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/dependencyResolver.cjs +65 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/bind.cjs +39 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/compose.cjs +40 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/curryN.cjs +63 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/defaultTo.cjs +37 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/forEach.cjs +59 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/identity.cjs +32 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/internal/_arity.cjs +66 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/internal/_arrayReduce.cjs +15 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/internal/_checkForMethod.cjs +29 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/internal/_createReduce.cjs +36 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/internal/_curry1.cjs +24 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/internal/_curry2.cjs +36 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/internal/_curry3.cjs +54 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/internal/_curryN.cjs +50 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/internal/_dispatchable.cjs +51 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/internal/_has.cjs +7 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/internal/_identity.cjs +7 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/internal/_isArguments.cjs +19 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/internal/_isArray.cjs +19 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/internal/_isArrayLike.cjs +58 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/internal/_isInteger.cjs +15 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/internal/_isPlaceholder.cjs +7 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/internal/_isString.cjs +7 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/internal/_isTransformer.cjs +7 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/internal/_map.cjs +16 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/internal/_pipe.cjs +9 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/internal/_xArrayReduce.cjs +21 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/internal/_xReduce.cjs +34 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/internal/_xfBase.cjs +12 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/internal/_xmap.cjs +31 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/internal/_xwrap.cjs +29 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/is.cjs +38 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/keys.cjs +94 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/map.cjs +71 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/nth.cjs +42 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/path.cjs +39 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/pathOr.cjs +35 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/paths.cjs +50 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/pick.cjs +43 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/pipe.cjs +41 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/prop.cjs +41 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/propOr.cjs +43 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/reduce.cjs +68 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/reverse.cjs +39 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/slice.cjs +41 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/tail.cjs +45 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/ramda/es/values.cjs +42 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/node_modules/url-join/lib/url-join.cjs +89 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/query.cjs +85 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/types/artefacts.cjs +31 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/types/categorisation.cjs +19 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/types/categoryscheme.cjs +13 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/types/codelist.cjs +19 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/types/conceptscheme.cjs +29 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/types/contentconstraint.cjs +23 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/types/dataconstraint.cjs +22 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/types/dataflow.cjs +20 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/types/dataproviderscheme.cjs +13 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/types/datastructure.cjs +74 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/types/hierarchicalcodelist.cjs +22 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/types/metadatastructure.cjs +58 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/types/provisionagreement.cjs +19 -0
- package/cjs/node_modules/@dbmx/sdmx/esm/types/sdmx.cjs +51 -0
- package/cjs/node_modules/@dbmx/semver/dist/index.esm.cjs +584 -0
- package/cjs/node_modules/lru-cache/index.cjs +281 -0
- package/cjs/node_modules/yallist/iterator.cjs +20 -0
- package/cjs/node_modules/yallist/yallist.cjs +370 -0
- package/esm/index-FCPRKLj2.js +720 -0
- package/esm/index-FCPRKLj2.js.map +1 -0
- package/esm/index-Mh78z9aW.js +562 -0
- package/esm/index-Mh78z9aW.js.map +1 -0
- package/esm/index-T2bcfyHI.js +8510 -0
- package/esm/index-T2bcfyHI.js.map +1 -0
- package/esm/index-W7MLRHBf.js +87 -0
- package/esm/index-W7MLRHBf.js.map +1 -0
- package/esm/index-gBe37Ynf.js +8438 -0
- package/esm/index-gBe37Ynf.js.map +1 -0
- package/esm/index-ndYjFD6I.js +8438 -0
- package/esm/index-ndYjFD6I.js.map +1 -0
- package/esm/index.js +1 -1
- package/package.json +3 -3
- package/cjs/fake-ZW05emqw.js +0 -35
- package/cjs/fake-ZW05emqw.js.map +0 -1
- package/cjs/index.cjs.map +0 -1
- package/esm/fake-JHdVf8lQ.js +0 -14
- package/esm/fake-JHdVf8lQ.js.map +0 -1
- package/esm/index-lo-MKsEb.js +0 -556
- package/esm/index-lo-MKsEb.js.map +0 -1
- package/yarn-error.log +0 -7136
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _arity = require('./internal/_arity.cjs');
|
|
4
|
+
var _curry2 = require('./internal/_curry2.cjs');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Creates a function that is bound to a context.
|
|
8
|
+
* Note: `R.bind` does not provide the additional argument-binding capabilities of
|
|
9
|
+
* [Function.prototype.bind](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).
|
|
10
|
+
*
|
|
11
|
+
* @func
|
|
12
|
+
* @memberOf R
|
|
13
|
+
* @since v0.6.0
|
|
14
|
+
* @category Function
|
|
15
|
+
* @category Object
|
|
16
|
+
* @sig (* -> *) -> {*} -> (* -> *)
|
|
17
|
+
* @param {Function} fn The function to bind to context
|
|
18
|
+
* @param {Object} thisObj The context to bind `fn` to
|
|
19
|
+
* @return {Function} A function that will execute in the context of `thisObj`.
|
|
20
|
+
* @see R.partial
|
|
21
|
+
* @example
|
|
22
|
+
*
|
|
23
|
+
* const log = R.bind(console.log, console);
|
|
24
|
+
* R.pipe(R.assoc('a', 2), R.tap(log), R.assoc('a', 3))({a: 1}); //=> {a: 3}
|
|
25
|
+
* // logs {a: 2}
|
|
26
|
+
* @symb R.bind(f, o)(a, b) = f.call(o, a, b)
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
var bind =
|
|
30
|
+
/*#__PURE__*/
|
|
31
|
+
_curry2(function bind(fn, thisObj) {
|
|
32
|
+
return _arity(fn.length, function () {
|
|
33
|
+
return fn.apply(thisObj, arguments);
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
var bind$1 = bind;
|
|
38
|
+
|
|
39
|
+
module.exports = bind$1;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var pipe = require('./pipe.cjs');
|
|
4
|
+
var reverse = require('./reverse.cjs');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Performs right-to-left function composition. The last argument may have
|
|
8
|
+
* any arity; the remaining arguments must be unary.
|
|
9
|
+
*
|
|
10
|
+
* **Note:** The result of compose is not automatically curried.
|
|
11
|
+
*
|
|
12
|
+
* @func
|
|
13
|
+
* @memberOf R
|
|
14
|
+
* @since v0.1.0
|
|
15
|
+
* @category Function
|
|
16
|
+
* @sig ((y -> z), (x -> y), ..., (o -> p), ((a, b, ..., n) -> o)) -> ((a, b, ..., n) -> z)
|
|
17
|
+
* @param {...Function} ...functions The functions to compose
|
|
18
|
+
* @return {Function}
|
|
19
|
+
* @see R.pipe
|
|
20
|
+
* @example
|
|
21
|
+
*
|
|
22
|
+
* const classyGreeting = (firstName, lastName) => "The name's " + lastName + ", " + firstName + " " + lastName
|
|
23
|
+
* const yellGreeting = R.compose(R.toUpper, classyGreeting);
|
|
24
|
+
* yellGreeting('James', 'Bond'); //=> "THE NAME'S BOND, JAMES BOND"
|
|
25
|
+
*
|
|
26
|
+
* R.compose(Math.abs, R.add(1), R.multiply(2))(-4) //=> 7
|
|
27
|
+
*
|
|
28
|
+
* @symb R.compose(f, g, h)(a, b) = f(g(h(a, b)))
|
|
29
|
+
* @symb R.compose(f, g, h)(a)(b) = f(g(h(a)))(b)
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
function compose() {
|
|
33
|
+
if (arguments.length === 0) {
|
|
34
|
+
throw new Error('compose requires at least one argument');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return pipe.apply(this, reverse(arguments));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
module.exports = compose;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _arity = require('./internal/_arity.cjs');
|
|
4
|
+
var _curry1 = require('./internal/_curry1.cjs');
|
|
5
|
+
var _curry2 = require('./internal/_curry2.cjs');
|
|
6
|
+
var _curryN = require('./internal/_curryN.cjs');
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Returns a curried equivalent of the provided function, with the specified
|
|
10
|
+
* arity. The curried function has two unusual capabilities. First, its
|
|
11
|
+
* arguments needn't be provided one at a time. If `g` is `R.curryN(3, f)`, the
|
|
12
|
+
* following are equivalent:
|
|
13
|
+
*
|
|
14
|
+
* - `g(1)(2)(3)`
|
|
15
|
+
* - `g(1)(2, 3)`
|
|
16
|
+
* - `g(1, 2)(3)`
|
|
17
|
+
* - `g(1, 2, 3)`
|
|
18
|
+
*
|
|
19
|
+
* Secondly, the special placeholder value [`R.__`](#__) may be used to specify
|
|
20
|
+
* "gaps", allowing partial application of any combination of arguments,
|
|
21
|
+
* regardless of their positions. If `g` is as above and `_` is [`R.__`](#__),
|
|
22
|
+
* the following are equivalent:
|
|
23
|
+
*
|
|
24
|
+
* - `g(1, 2, 3)`
|
|
25
|
+
* - `g(_, 2, 3)(1)`
|
|
26
|
+
* - `g(_, _, 3)(1)(2)`
|
|
27
|
+
* - `g(_, _, 3)(1, 2)`
|
|
28
|
+
* - `g(_, 2)(1)(3)`
|
|
29
|
+
* - `g(_, 2)(1, 3)`
|
|
30
|
+
* - `g(_, 2)(_, 3)(1)`
|
|
31
|
+
*
|
|
32
|
+
* @func
|
|
33
|
+
* @memberOf R
|
|
34
|
+
* @since v0.5.0
|
|
35
|
+
* @category Function
|
|
36
|
+
* @sig Number -> (* -> a) -> (* -> a)
|
|
37
|
+
* @param {Number} length The arity for the returned function.
|
|
38
|
+
* @param {Function} fn The function to curry.
|
|
39
|
+
* @return {Function} A new, curried function.
|
|
40
|
+
* @see R.curry
|
|
41
|
+
* @example
|
|
42
|
+
*
|
|
43
|
+
* const sumArgs = (...args) => R.sum(args);
|
|
44
|
+
*
|
|
45
|
+
* const curriedAddFourNumbers = R.curryN(4, sumArgs);
|
|
46
|
+
* const f = curriedAddFourNumbers(1, 2);
|
|
47
|
+
* const g = f(3);
|
|
48
|
+
* g(4); //=> 10
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
var curryN =
|
|
52
|
+
/*#__PURE__*/
|
|
53
|
+
_curry2(function curryN(length, fn) {
|
|
54
|
+
if (length === 1) {
|
|
55
|
+
return _curry1(fn);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
return _arity(length, _curryN(length, [], fn));
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
var curryN$1 = curryN;
|
|
62
|
+
|
|
63
|
+
module.exports = curryN$1;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _curry2 = require('./internal/_curry2.cjs');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Returns the second argument if it is not `null`, `undefined` or `NaN`;
|
|
7
|
+
* otherwise the first argument is returned.
|
|
8
|
+
*
|
|
9
|
+
* @func
|
|
10
|
+
* @memberOf R
|
|
11
|
+
* @since v0.10.0
|
|
12
|
+
* @category Logic
|
|
13
|
+
* @sig a -> b -> a | b
|
|
14
|
+
* @param {a} default The default value.
|
|
15
|
+
* @param {b} val `val` will be returned instead of `default` unless `val` is `null`, `undefined` or `NaN`.
|
|
16
|
+
* @return {*} The second value if it is not `null`, `undefined` or `NaN`, otherwise the default value
|
|
17
|
+
* @example
|
|
18
|
+
*
|
|
19
|
+
* const defaultTo42 = R.defaultTo(42);
|
|
20
|
+
*
|
|
21
|
+
* defaultTo42(null); //=> 42
|
|
22
|
+
* defaultTo42(undefined); //=> 42
|
|
23
|
+
* defaultTo42(false); //=> false
|
|
24
|
+
* defaultTo42('Ramda'); //=> 'Ramda'
|
|
25
|
+
* // parseInt('string') results in NaN
|
|
26
|
+
* defaultTo42(parseInt('string')); //=> 42
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
var defaultTo =
|
|
30
|
+
/*#__PURE__*/
|
|
31
|
+
_curry2(function defaultTo(d, v) {
|
|
32
|
+
return v == null || v !== v ? d : v;
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
var defaultTo$1 = defaultTo;
|
|
36
|
+
|
|
37
|
+
module.exports = defaultTo$1;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _checkForMethod = require('./internal/_checkForMethod.cjs');
|
|
4
|
+
var _curry2 = require('./internal/_curry2.cjs');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Iterate over an input `list`, calling a provided function `fn` for each
|
|
8
|
+
* element in the list.
|
|
9
|
+
*
|
|
10
|
+
* `fn` receives one argument: *(value)*.
|
|
11
|
+
*
|
|
12
|
+
* Note: `R.forEach` does not skip deleted or unassigned indices (sparse
|
|
13
|
+
* arrays), unlike the native `Array.prototype.forEach` method. For more
|
|
14
|
+
* details on this behavior, see:
|
|
15
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach#Description
|
|
16
|
+
*
|
|
17
|
+
* Also note that, unlike `Array.prototype.forEach`, Ramda's `forEach` returns
|
|
18
|
+
* the original array. In some libraries this function is named `each`.
|
|
19
|
+
*
|
|
20
|
+
* Dispatches to the `forEach` method of the second argument, if present.
|
|
21
|
+
*
|
|
22
|
+
* @func
|
|
23
|
+
* @memberOf R
|
|
24
|
+
* @since v0.1.1
|
|
25
|
+
* @category List
|
|
26
|
+
* @sig (a -> *) -> [a] -> [a]
|
|
27
|
+
* @param {Function} fn The function to invoke. Receives one argument, `value`.
|
|
28
|
+
* @param {Array} list The list to iterate over.
|
|
29
|
+
* @return {Array} The original list.
|
|
30
|
+
* @see R.addIndex
|
|
31
|
+
* @example
|
|
32
|
+
*
|
|
33
|
+
* const printXPlusFive = x => console.log(x + 5);
|
|
34
|
+
* R.forEach(printXPlusFive, [1, 2, 3]); //=> [1, 2, 3]
|
|
35
|
+
* // logs 6
|
|
36
|
+
* // logs 7
|
|
37
|
+
* // logs 8
|
|
38
|
+
* @symb R.forEach(f, [a, b, c]) = [a, b, c]
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
var forEach =
|
|
42
|
+
/*#__PURE__*/
|
|
43
|
+
_curry2(
|
|
44
|
+
/*#__PURE__*/
|
|
45
|
+
_checkForMethod('forEach', function forEach(fn, list) {
|
|
46
|
+
var len = list.length;
|
|
47
|
+
var idx = 0;
|
|
48
|
+
|
|
49
|
+
while (idx < len) {
|
|
50
|
+
fn(list[idx]);
|
|
51
|
+
idx += 1;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return list;
|
|
55
|
+
}));
|
|
56
|
+
|
|
57
|
+
var forEach$1 = forEach;
|
|
58
|
+
|
|
59
|
+
module.exports = forEach$1;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _curry1 = require('./internal/_curry1.cjs');
|
|
4
|
+
var _identity = require('./internal/_identity.cjs');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A function that does nothing but return the parameter supplied to it. Good
|
|
8
|
+
* as a default or placeholder function.
|
|
9
|
+
*
|
|
10
|
+
* @func
|
|
11
|
+
* @memberOf R
|
|
12
|
+
* @since v0.1.0
|
|
13
|
+
* @category Function
|
|
14
|
+
* @sig a -> a
|
|
15
|
+
* @param {*} x The value to return.
|
|
16
|
+
* @return {*} The input value, `x`.
|
|
17
|
+
* @example
|
|
18
|
+
*
|
|
19
|
+
* R.identity(1); //=> 1
|
|
20
|
+
*
|
|
21
|
+
* const obj = {};
|
|
22
|
+
* R.identity(obj) === obj; //=> true
|
|
23
|
+
* @symb R.identity(a) = a
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
var identity =
|
|
27
|
+
/*#__PURE__*/
|
|
28
|
+
_curry1(_identity);
|
|
29
|
+
|
|
30
|
+
var identity$1 = identity;
|
|
31
|
+
|
|
32
|
+
module.exports = identity$1;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function _arity(n, fn) {
|
|
4
|
+
/* eslint-disable no-unused-vars */
|
|
5
|
+
switch (n) {
|
|
6
|
+
case 0:
|
|
7
|
+
return function () {
|
|
8
|
+
return fn.apply(this, arguments);
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
case 1:
|
|
12
|
+
return function (a0) {
|
|
13
|
+
return fn.apply(this, arguments);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
case 2:
|
|
17
|
+
return function (a0, a1) {
|
|
18
|
+
return fn.apply(this, arguments);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
case 3:
|
|
22
|
+
return function (a0, a1, a2) {
|
|
23
|
+
return fn.apply(this, arguments);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
case 4:
|
|
27
|
+
return function (a0, a1, a2, a3) {
|
|
28
|
+
return fn.apply(this, arguments);
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
case 5:
|
|
32
|
+
return function (a0, a1, a2, a3, a4) {
|
|
33
|
+
return fn.apply(this, arguments);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
case 6:
|
|
37
|
+
return function (a0, a1, a2, a3, a4, a5) {
|
|
38
|
+
return fn.apply(this, arguments);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
case 7:
|
|
42
|
+
return function (a0, a1, a2, a3, a4, a5, a6) {
|
|
43
|
+
return fn.apply(this, arguments);
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
case 8:
|
|
47
|
+
return function (a0, a1, a2, a3, a4, a5, a6, a7) {
|
|
48
|
+
return fn.apply(this, arguments);
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
case 9:
|
|
52
|
+
return function (a0, a1, a2, a3, a4, a5, a6, a7, a8) {
|
|
53
|
+
return fn.apply(this, arguments);
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
case 10:
|
|
57
|
+
return function (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) {
|
|
58
|
+
return fn.apply(this, arguments);
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
default:
|
|
62
|
+
throw new Error('First argument to _arity must be a non-negative integer no greater than ten');
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
module.exports = _arity;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _isArray = require('./_isArray.cjs');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* This checks whether a function has a [methodname] function. If it isn't an
|
|
7
|
+
* array it will execute that function otherwise it will default to the ramda
|
|
8
|
+
* implementation.
|
|
9
|
+
*
|
|
10
|
+
* @private
|
|
11
|
+
* @param {Function} fn ramda implementation
|
|
12
|
+
* @param {String} methodname property to check for a custom implementation
|
|
13
|
+
* @return {Object} Whatever the return value of the method is.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
function _checkForMethod(methodname, fn) {
|
|
17
|
+
return function () {
|
|
18
|
+
var length = arguments.length;
|
|
19
|
+
|
|
20
|
+
if (length === 0) {
|
|
21
|
+
return fn();
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
var obj = arguments[length - 1];
|
|
25
|
+
return _isArray(obj) || typeof obj[methodname] !== 'function' ? fn.apply(this, arguments) : obj[methodname].apply(obj, Array.prototype.slice.call(arguments, 0, length - 1));
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
module.exports = _checkForMethod;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _isArrayLike = require('./_isArrayLike.cjs');
|
|
4
|
+
|
|
5
|
+
var symIterator = typeof Symbol !== 'undefined' ? Symbol.iterator : '@@iterator';
|
|
6
|
+
function _createReduce(arrayReduce, methodReduce, iterableReduce) {
|
|
7
|
+
return function _reduce(xf, acc, list) {
|
|
8
|
+
if (_isArrayLike(list)) {
|
|
9
|
+
return arrayReduce(xf, acc, list);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (list == null) {
|
|
13
|
+
return acc;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
if (typeof list['fantasy-land/reduce'] === 'function') {
|
|
17
|
+
return methodReduce(xf, acc, list, 'fantasy-land/reduce');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (list[symIterator] != null) {
|
|
21
|
+
return iterableReduce(xf, acc, list[symIterator]());
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (typeof list.next === 'function') {
|
|
25
|
+
return iterableReduce(xf, acc, list);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (typeof list.reduce === 'function') {
|
|
29
|
+
return methodReduce(xf, acc, list, 'reduce');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
throw new TypeError('reduce: list must be array or iterable');
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
module.exports = _createReduce;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _isPlaceholder = require('./_isPlaceholder.cjs');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Optimized internal one-arity curry function.
|
|
7
|
+
*
|
|
8
|
+
* @private
|
|
9
|
+
* @category Function
|
|
10
|
+
* @param {Function} fn The function to curry.
|
|
11
|
+
* @return {Function} The curried function.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
function _curry1(fn) {
|
|
15
|
+
return function f1(a) {
|
|
16
|
+
if (arguments.length === 0 || _isPlaceholder(a)) {
|
|
17
|
+
return f1;
|
|
18
|
+
} else {
|
|
19
|
+
return fn.apply(this, arguments);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
module.exports = _curry1;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _curry1 = require('./_curry1.cjs');
|
|
4
|
+
var _isPlaceholder = require('./_isPlaceholder.cjs');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Optimized internal two-arity curry function.
|
|
8
|
+
*
|
|
9
|
+
* @private
|
|
10
|
+
* @category Function
|
|
11
|
+
* @param {Function} fn The function to curry.
|
|
12
|
+
* @return {Function} The curried function.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
function _curry2(fn) {
|
|
16
|
+
return function f2(a, b) {
|
|
17
|
+
switch (arguments.length) {
|
|
18
|
+
case 0:
|
|
19
|
+
return f2;
|
|
20
|
+
|
|
21
|
+
case 1:
|
|
22
|
+
return _isPlaceholder(a) ? f2 : _curry1(function (_b) {
|
|
23
|
+
return fn(a, _b);
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
default:
|
|
27
|
+
return _isPlaceholder(a) && _isPlaceholder(b) ? f2 : _isPlaceholder(a) ? _curry1(function (_a) {
|
|
28
|
+
return fn(_a, b);
|
|
29
|
+
}) : _isPlaceholder(b) ? _curry1(function (_b) {
|
|
30
|
+
return fn(a, _b);
|
|
31
|
+
}) : fn(a, b);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
module.exports = _curry2;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _curry1 = require('./_curry1.cjs');
|
|
4
|
+
var _curry2 = require('./_curry2.cjs');
|
|
5
|
+
var _isPlaceholder = require('./_isPlaceholder.cjs');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Optimized internal three-arity curry function.
|
|
9
|
+
*
|
|
10
|
+
* @private
|
|
11
|
+
* @category Function
|
|
12
|
+
* @param {Function} fn The function to curry.
|
|
13
|
+
* @return {Function} The curried function.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
function _curry3(fn) {
|
|
17
|
+
return function f3(a, b, c) {
|
|
18
|
+
switch (arguments.length) {
|
|
19
|
+
case 0:
|
|
20
|
+
return f3;
|
|
21
|
+
|
|
22
|
+
case 1:
|
|
23
|
+
return _isPlaceholder(a) ? f3 : _curry2(function (_b, _c) {
|
|
24
|
+
return fn(a, _b, _c);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
case 2:
|
|
28
|
+
return _isPlaceholder(a) && _isPlaceholder(b) ? f3 : _isPlaceholder(a) ? _curry2(function (_a, _c) {
|
|
29
|
+
return fn(_a, b, _c);
|
|
30
|
+
}) : _isPlaceholder(b) ? _curry2(function (_b, _c) {
|
|
31
|
+
return fn(a, _b, _c);
|
|
32
|
+
}) : _curry1(function (_c) {
|
|
33
|
+
return fn(a, b, _c);
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
default:
|
|
37
|
+
return _isPlaceholder(a) && _isPlaceholder(b) && _isPlaceholder(c) ? f3 : _isPlaceholder(a) && _isPlaceholder(b) ? _curry2(function (_a, _b) {
|
|
38
|
+
return fn(_a, _b, c);
|
|
39
|
+
}) : _isPlaceholder(a) && _isPlaceholder(c) ? _curry2(function (_a, _c) {
|
|
40
|
+
return fn(_a, b, _c);
|
|
41
|
+
}) : _isPlaceholder(b) && _isPlaceholder(c) ? _curry2(function (_b, _c) {
|
|
42
|
+
return fn(a, _b, _c);
|
|
43
|
+
}) : _isPlaceholder(a) ? _curry1(function (_a) {
|
|
44
|
+
return fn(_a, b, c);
|
|
45
|
+
}) : _isPlaceholder(b) ? _curry1(function (_b) {
|
|
46
|
+
return fn(a, _b, c);
|
|
47
|
+
}) : _isPlaceholder(c) ? _curry1(function (_c) {
|
|
48
|
+
return fn(a, b, _c);
|
|
49
|
+
}) : fn(a, b, c);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
module.exports = _curry3;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _arity = require('./_arity.cjs');
|
|
4
|
+
var _isPlaceholder = require('./_isPlaceholder.cjs');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal curryN function.
|
|
8
|
+
*
|
|
9
|
+
* @private
|
|
10
|
+
* @category Function
|
|
11
|
+
* @param {Number} length The arity of the curried function.
|
|
12
|
+
* @param {Array} received An array of arguments received thus far.
|
|
13
|
+
* @param {Function} fn The function to curry.
|
|
14
|
+
* @return {Function} The curried function.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
function _curryN(length, received, fn) {
|
|
18
|
+
return function () {
|
|
19
|
+
var combined = [];
|
|
20
|
+
var argsIdx = 0;
|
|
21
|
+
var left = length;
|
|
22
|
+
var combinedIdx = 0;
|
|
23
|
+
var hasPlaceholder = false;
|
|
24
|
+
|
|
25
|
+
while (combinedIdx < received.length || argsIdx < arguments.length) {
|
|
26
|
+
var result;
|
|
27
|
+
|
|
28
|
+
if (combinedIdx < received.length && (!_isPlaceholder(received[combinedIdx]) || argsIdx >= arguments.length)) {
|
|
29
|
+
result = received[combinedIdx];
|
|
30
|
+
} else {
|
|
31
|
+
result = arguments[argsIdx];
|
|
32
|
+
argsIdx += 1;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
combined[combinedIdx] = result;
|
|
36
|
+
|
|
37
|
+
if (!_isPlaceholder(result)) {
|
|
38
|
+
left -= 1;
|
|
39
|
+
} else {
|
|
40
|
+
hasPlaceholder = true;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
combinedIdx += 1;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return !hasPlaceholder && left <= 0 ? fn.apply(this, combined) : _arity(Math.max(0, left), _curryN(length, combined, fn));
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
module.exports = _curryN;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _isArray = require('./_isArray.cjs');
|
|
4
|
+
var _isTransformer = require('./_isTransformer.cjs');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Returns a function that dispatches with different strategies based on the
|
|
8
|
+
* object in list position (last argument). If it is an array, executes [fn].
|
|
9
|
+
* Otherwise, if it has a function with one of the given method names, it will
|
|
10
|
+
* execute that function (functor case). Otherwise, if it is a transformer,
|
|
11
|
+
* uses transducer created by [transducerCreator] to return a new transformer
|
|
12
|
+
* (transducer case).
|
|
13
|
+
* Otherwise, it will default to executing [fn].
|
|
14
|
+
*
|
|
15
|
+
* @private
|
|
16
|
+
* @param {Array} methodNames properties to check for a custom implementation
|
|
17
|
+
* @param {Function} transducerCreator transducer factory if object is transformer
|
|
18
|
+
* @param {Function} fn default ramda implementation
|
|
19
|
+
* @return {Function} A function that dispatches on object in list position
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
function _dispatchable(methodNames, transducerCreator, fn) {
|
|
23
|
+
return function () {
|
|
24
|
+
if (arguments.length === 0) {
|
|
25
|
+
return fn();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
var obj = arguments[arguments.length - 1];
|
|
29
|
+
|
|
30
|
+
if (!_isArray(obj)) {
|
|
31
|
+
var idx = 0;
|
|
32
|
+
|
|
33
|
+
while (idx < methodNames.length) {
|
|
34
|
+
if (typeof obj[methodNames[idx]] === 'function') {
|
|
35
|
+
return obj[methodNames[idx]].apply(obj, Array.prototype.slice.call(arguments, 0, -1));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
idx += 1;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (_isTransformer(obj)) {
|
|
42
|
+
var transducer = transducerCreator.apply(null, Array.prototype.slice.call(arguments, 0, -1));
|
|
43
|
+
return transducer(obj);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return fn.apply(this, arguments);
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
module.exports = _dispatchable;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _has = require('./_has.cjs');
|
|
4
|
+
|
|
5
|
+
var toString = Object.prototype.toString;
|
|
6
|
+
|
|
7
|
+
var _isArguments =
|
|
8
|
+
/*#__PURE__*/
|
|
9
|
+
function () {
|
|
10
|
+
return toString.call(arguments) === '[object Arguments]' ? function _isArguments(x) {
|
|
11
|
+
return toString.call(x) === '[object Arguments]';
|
|
12
|
+
} : function _isArguments(x) {
|
|
13
|
+
return _has('callee', x);
|
|
14
|
+
};
|
|
15
|
+
}();
|
|
16
|
+
|
|
17
|
+
var _isArguments$1 = _isArguments;
|
|
18
|
+
|
|
19
|
+
module.exports = _isArguments$1;
|