@bigbinary/neetoui 5.0.8 → 5.0.10
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/formik.cjs.js +637 -700
- package/formik.cjs.js.map +1 -1
- package/formik.js +637 -700
- package/formik.js.map +1 -1
- package/index.cjs.js +474 -537
- package/index.cjs.js.map +1 -1
- package/index.js +474 -537
- package/index.js.map +1 -1
- package/package.json +4 -4
package/formik.cjs.js
CHANGED
|
@@ -468,224 +468,56 @@ var _xfBase = {
|
|
|
468
468
|
}
|
|
469
469
|
};
|
|
470
470
|
|
|
471
|
-
function
|
|
472
|
-
var
|
|
473
|
-
var
|
|
474
|
-
var result = Array(len);
|
|
475
|
-
|
|
476
|
-
while (idx < len) {
|
|
477
|
-
result[idx] = fn(functor[idx]);
|
|
478
|
-
idx += 1;
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
return result;
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
function _isString(x) {
|
|
485
|
-
return Object.prototype.toString.call(x) === '[object String]';
|
|
486
|
-
}
|
|
487
|
-
|
|
488
|
-
/**
|
|
489
|
-
* Tests whether or not an object is similar to an array.
|
|
490
|
-
*
|
|
491
|
-
* @private
|
|
492
|
-
* @category Type
|
|
493
|
-
* @category List
|
|
494
|
-
* @sig * -> Boolean
|
|
495
|
-
* @param {*} x The object to test.
|
|
496
|
-
* @return {Boolean} `true` if `x` has a numeric length property and extreme indices defined; `false` otherwise.
|
|
497
|
-
* @example
|
|
498
|
-
*
|
|
499
|
-
* _isArrayLike([]); //=> true
|
|
500
|
-
* _isArrayLike(true); //=> false
|
|
501
|
-
* _isArrayLike({}); //=> false
|
|
502
|
-
* _isArrayLike({length: 10}); //=> false
|
|
503
|
-
* _isArrayLike({0: 'zero', 9: 'nine', length: 10}); //=> true
|
|
504
|
-
* _isArrayLike({nodeType: 1, length: 1}) // => false
|
|
505
|
-
*/
|
|
506
|
-
|
|
507
|
-
var _isArrayLike =
|
|
508
|
-
/*#__PURE__*/
|
|
509
|
-
_curry1(function isArrayLike(x) {
|
|
510
|
-
if (_isArray(x)) {
|
|
511
|
-
return true;
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
if (!x) {
|
|
515
|
-
return false;
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
if (typeof x !== 'object') {
|
|
519
|
-
return false;
|
|
520
|
-
}
|
|
521
|
-
|
|
522
|
-
if (_isString(x)) {
|
|
523
|
-
return false;
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
if (x.length === 0) {
|
|
527
|
-
return true;
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
if (x.length > 0) {
|
|
531
|
-
return x.hasOwnProperty(0) && x.hasOwnProperty(x.length - 1);
|
|
532
|
-
}
|
|
533
|
-
|
|
534
|
-
return false;
|
|
535
|
-
});
|
|
471
|
+
function _arrayFromIterator(iter) {
|
|
472
|
+
var list = [];
|
|
473
|
+
var next;
|
|
536
474
|
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
function () {
|
|
540
|
-
function XWrap(fn) {
|
|
541
|
-
this.f = fn;
|
|
475
|
+
while (!(next = iter.next()).done) {
|
|
476
|
+
list.push(next.value);
|
|
542
477
|
}
|
|
543
478
|
|
|
544
|
-
|
|
545
|
-
throw new Error('init not implemented on XWrap');
|
|
546
|
-
};
|
|
547
|
-
|
|
548
|
-
XWrap.prototype['@@transducer/result'] = function (acc) {
|
|
549
|
-
return acc;
|
|
550
|
-
};
|
|
551
|
-
|
|
552
|
-
XWrap.prototype['@@transducer/step'] = function (acc, x) {
|
|
553
|
-
return this.f(acc, x);
|
|
554
|
-
};
|
|
555
|
-
|
|
556
|
-
return XWrap;
|
|
557
|
-
}();
|
|
558
|
-
|
|
559
|
-
function _xwrap(fn) {
|
|
560
|
-
return new XWrap(fn);
|
|
479
|
+
return list;
|
|
561
480
|
}
|
|
562
481
|
|
|
563
|
-
|
|
564
|
-
* Creates a function that is bound to a context.
|
|
565
|
-
* Note: `R.bind` does not provide the additional argument-binding capabilities of
|
|
566
|
-
* [Function.prototype.bind](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind).
|
|
567
|
-
*
|
|
568
|
-
* @func
|
|
569
|
-
* @memberOf R
|
|
570
|
-
* @since v0.6.0
|
|
571
|
-
* @category Function
|
|
572
|
-
* @category Object
|
|
573
|
-
* @sig (* -> *) -> {*} -> (* -> *)
|
|
574
|
-
* @param {Function} fn The function to bind to context
|
|
575
|
-
* @param {Object} thisObj The context to bind `fn` to
|
|
576
|
-
* @return {Function} A function that will execute in the context of `thisObj`.
|
|
577
|
-
* @see R.partial
|
|
578
|
-
* @example
|
|
579
|
-
*
|
|
580
|
-
* const log = R.bind(console.log, console);
|
|
581
|
-
* R.pipe(R.assoc('a', 2), R.tap(log), R.assoc('a', 3))({a: 1}); //=> {a: 3}
|
|
582
|
-
* // logs {a: 2}
|
|
583
|
-
* @symb R.bind(f, o)(a, b) = f.call(o, a, b)
|
|
584
|
-
*/
|
|
585
|
-
|
|
586
|
-
var bind =
|
|
587
|
-
/*#__PURE__*/
|
|
588
|
-
_curry2(function bind(fn, thisObj) {
|
|
589
|
-
return _arity(fn.length, function () {
|
|
590
|
-
return fn.apply(thisObj, arguments);
|
|
591
|
-
});
|
|
592
|
-
});
|
|
593
|
-
|
|
594
|
-
function _arrayReduce(xf, acc, list) {
|
|
482
|
+
function _includesWith(pred, x, list) {
|
|
595
483
|
var idx = 0;
|
|
596
484
|
var len = list.length;
|
|
597
485
|
|
|
598
486
|
while (idx < len) {
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
if (acc && acc['@@transducer/reduced']) {
|
|
602
|
-
acc = acc['@@transducer/value'];
|
|
603
|
-
break;
|
|
487
|
+
if (pred(x, list[idx])) {
|
|
488
|
+
return true;
|
|
604
489
|
}
|
|
605
490
|
|
|
606
491
|
idx += 1;
|
|
607
492
|
}
|
|
608
493
|
|
|
609
|
-
return
|
|
494
|
+
return false;
|
|
610
495
|
}
|
|
611
496
|
|
|
612
|
-
function
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
acc = xf['@@transducer/step'](acc, step.value);
|
|
617
|
-
|
|
618
|
-
if (acc && acc['@@transducer/reduced']) {
|
|
619
|
-
acc = acc['@@transducer/value'];
|
|
620
|
-
break;
|
|
621
|
-
}
|
|
622
|
-
|
|
623
|
-
step = iter.next();
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
return xf['@@transducer/result'](acc);
|
|
497
|
+
function _functionName(f) {
|
|
498
|
+
// String(x => x) evaluates to "x => x", so the pattern may not match.
|
|
499
|
+
var match = String(f).match(/^function (\w*)/);
|
|
500
|
+
return match == null ? '' : match[1];
|
|
627
501
|
}
|
|
628
502
|
|
|
629
|
-
function
|
|
630
|
-
return
|
|
503
|
+
function _has(prop, obj) {
|
|
504
|
+
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
631
505
|
}
|
|
632
506
|
|
|
633
|
-
|
|
634
|
-
function
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
if (typeof list['fantasy-land/reduce'] === 'function') {
|
|
644
|
-
return _methodReduce(fn, acc, list, 'fantasy-land/reduce');
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
if (list[symIterator] != null) {
|
|
648
|
-
return _iterableReduce(fn, acc, list[symIterator]());
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
if (typeof list.next === 'function') {
|
|
652
|
-
return _iterableReduce(fn, acc, list);
|
|
653
|
-
}
|
|
654
|
-
|
|
655
|
-
if (typeof list.reduce === 'function') {
|
|
656
|
-
return _methodReduce(fn, acc, list, 'reduce');
|
|
507
|
+
// Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
508
|
+
function _objectIs(a, b) {
|
|
509
|
+
// SameValue algorithm
|
|
510
|
+
if (a === b) {
|
|
511
|
+
// Steps 1-5, 7-10
|
|
512
|
+
// Steps 6.b-6.e: +0 != -0
|
|
513
|
+
return a !== 0 || 1 / a === 1 / b;
|
|
514
|
+
} else {
|
|
515
|
+
// Step 6.a: NaN == NaN
|
|
516
|
+
return a !== a && b !== b;
|
|
657
517
|
}
|
|
658
|
-
|
|
659
|
-
throw new TypeError('reduce: list must be array or iterable');
|
|
660
518
|
}
|
|
661
519
|
|
|
662
|
-
var
|
|
663
|
-
/*#__PURE__*/
|
|
664
|
-
function () {
|
|
665
|
-
function XMap(f, xf) {
|
|
666
|
-
this.xf = xf;
|
|
667
|
-
this.f = f;
|
|
668
|
-
}
|
|
669
|
-
|
|
670
|
-
XMap.prototype['@@transducer/init'] = _xfBase.init;
|
|
671
|
-
XMap.prototype['@@transducer/result'] = _xfBase.result;
|
|
672
|
-
|
|
673
|
-
XMap.prototype['@@transducer/step'] = function (result, input) {
|
|
674
|
-
return this.xf['@@transducer/step'](result, this.f(input));
|
|
675
|
-
};
|
|
676
|
-
|
|
677
|
-
return XMap;
|
|
678
|
-
}();
|
|
679
|
-
|
|
680
|
-
var _xmap =
|
|
681
|
-
/*#__PURE__*/
|
|
682
|
-
_curry2(function _xmap(f, xf) {
|
|
683
|
-
return new XMap(f, xf);
|
|
684
|
-
});
|
|
685
|
-
|
|
686
|
-
function _has(prop, obj) {
|
|
687
|
-
return Object.prototype.hasOwnProperty.call(obj, prop);
|
|
688
|
-
}
|
|
520
|
+
var _objectIs$1 = typeof Object.is === 'function' ? Object.is : _objectIs;
|
|
689
521
|
|
|
690
522
|
var toString = Object.prototype.toString;
|
|
691
523
|
|
|
@@ -786,668 +618,773 @@ _curry1(function keys(obj) {
|
|
|
786
618
|
});
|
|
787
619
|
|
|
788
620
|
/**
|
|
789
|
-
*
|
|
790
|
-
*
|
|
791
|
-
*
|
|
792
|
-
*
|
|
793
|
-
*
|
|
794
|
-
* Ramda provides suitable `map` implementations for `Array` and `Object`,
|
|
795
|
-
* so this function may be applied to `[1, 2, 3]` or `{x: 1, y: 2, z: 3}`.
|
|
796
|
-
*
|
|
797
|
-
* Dispatches to the `map` method of the second argument, if present.
|
|
798
|
-
*
|
|
799
|
-
* Acts as a transducer if a transformer is given in list position.
|
|
800
|
-
*
|
|
801
|
-
* Also treats functions as functors and will compose them together.
|
|
621
|
+
* Gives a single-word string description of the (native) type of a value,
|
|
622
|
+
* returning such answers as 'Object', 'Number', 'Array', or 'Null'. Does not
|
|
623
|
+
* attempt to distinguish user Object types any further, reporting them all as
|
|
624
|
+
* 'Object'.
|
|
802
625
|
*
|
|
803
626
|
* @func
|
|
804
627
|
* @memberOf R
|
|
805
|
-
* @since v0.
|
|
806
|
-
* @category
|
|
807
|
-
* @sig
|
|
808
|
-
* @param {
|
|
809
|
-
* @
|
|
810
|
-
* @return {Array} The new list.
|
|
811
|
-
* @see R.transduce, R.addIndex, R.pluck, R.project
|
|
628
|
+
* @since v0.8.0
|
|
629
|
+
* @category Type
|
|
630
|
+
* @sig * -> String
|
|
631
|
+
* @param {*} val The value to test
|
|
632
|
+
* @return {String}
|
|
812
633
|
* @example
|
|
813
634
|
*
|
|
814
|
-
*
|
|
815
|
-
*
|
|
816
|
-
* R.
|
|
817
|
-
*
|
|
818
|
-
* R.
|
|
819
|
-
*
|
|
820
|
-
*
|
|
821
|
-
*
|
|
635
|
+
* R.type({}); //=> "Object"
|
|
636
|
+
* R.type(1); //=> "Number"
|
|
637
|
+
* R.type(false); //=> "Boolean"
|
|
638
|
+
* R.type('s'); //=> "String"
|
|
639
|
+
* R.type(null); //=> "Null"
|
|
640
|
+
* R.type([]); //=> "Array"
|
|
641
|
+
* R.type(/[A-z]/); //=> "RegExp"
|
|
642
|
+
* R.type(() => {}); //=> "Function"
|
|
643
|
+
* R.type(undefined); //=> "Undefined"
|
|
822
644
|
*/
|
|
823
645
|
|
|
824
|
-
var
|
|
825
|
-
/*#__PURE__*/
|
|
826
|
-
_curry2(
|
|
646
|
+
var type =
|
|
827
647
|
/*#__PURE__*/
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
return curryN(functor.length, function () {
|
|
832
|
-
return fn.call(this, functor.apply(this, arguments));
|
|
833
|
-
});
|
|
834
|
-
|
|
835
|
-
case '[object Object]':
|
|
836
|
-
return _reduce(function (acc, key) {
|
|
837
|
-
acc[key] = fn(functor[key]);
|
|
838
|
-
return acc;
|
|
839
|
-
}, {}, keys(functor));
|
|
840
|
-
|
|
841
|
-
default:
|
|
842
|
-
return _map(fn, functor);
|
|
843
|
-
}
|
|
844
|
-
}));
|
|
648
|
+
_curry1(function type(val) {
|
|
649
|
+
return val === null ? 'Null' : val === undefined ? 'Undefined' : Object.prototype.toString.call(val).slice(8, -1);
|
|
650
|
+
});
|
|
845
651
|
|
|
846
652
|
/**
|
|
847
|
-
*
|
|
653
|
+
* private _uniqContentEquals function.
|
|
654
|
+
* That function is checking equality of 2 iterator contents with 2 assumptions
|
|
655
|
+
* - iterators lengths are the same
|
|
656
|
+
* - iterators values are unique
|
|
848
657
|
*
|
|
849
|
-
*
|
|
850
|
-
*
|
|
851
|
-
*
|
|
852
|
-
*
|
|
853
|
-
*/
|
|
854
|
-
var _isInteger = Number.isInteger || function _isInteger(n) {
|
|
855
|
-
return n << 0 === n;
|
|
856
|
-
};
|
|
658
|
+
* false-positive result will be returned for comparison of, e.g.
|
|
659
|
+
* - [1,2,3] and [1,2,3,4]
|
|
660
|
+
* - [1,1,1] and [1,2,3]
|
|
661
|
+
* */
|
|
857
662
|
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
* element at index length + n is returned.
|
|
861
|
-
*
|
|
862
|
-
* @func
|
|
863
|
-
* @memberOf R
|
|
864
|
-
* @since v0.1.0
|
|
865
|
-
* @category List
|
|
866
|
-
* @sig Number -> [a] -> a | Undefined
|
|
867
|
-
* @sig Number -> String -> String
|
|
868
|
-
* @param {Number} offset
|
|
869
|
-
* @param {*} list
|
|
870
|
-
* @return {*}
|
|
871
|
-
* @example
|
|
872
|
-
*
|
|
873
|
-
* const list = ['foo', 'bar', 'baz', 'quux'];
|
|
874
|
-
* R.nth(1, list); //=> 'bar'
|
|
875
|
-
* R.nth(-1, list); //=> 'quux'
|
|
876
|
-
* R.nth(-99, list); //=> undefined
|
|
877
|
-
*
|
|
878
|
-
* R.nth(2, 'abc'); //=> 'c'
|
|
879
|
-
* R.nth(3, 'abc'); //=> ''
|
|
880
|
-
* @symb R.nth(-1, [a, b, c]) = c
|
|
881
|
-
* @symb R.nth(0, [a, b, c]) = a
|
|
882
|
-
* @symb R.nth(1, [a, b, c]) = b
|
|
883
|
-
*/
|
|
663
|
+
function _uniqContentEquals(aIterator, bIterator, stackA, stackB) {
|
|
664
|
+
var a = _arrayFromIterator(aIterator);
|
|
884
665
|
|
|
885
|
-
var
|
|
886
|
-
/*#__PURE__*/
|
|
887
|
-
_curry2(function nth(offset, list) {
|
|
888
|
-
var idx = offset < 0 ? list.length + offset : offset;
|
|
889
|
-
return _isString(list) ? list.charAt(idx) : list[idx];
|
|
890
|
-
});
|
|
666
|
+
var b = _arrayFromIterator(bIterator);
|
|
891
667
|
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
*
|
|
895
|
-
*
|
|
896
|
-
* @func
|
|
897
|
-
* @memberOf R
|
|
898
|
-
* @since v0.1.0
|
|
899
|
-
* @category Object
|
|
900
|
-
* @typedefn Idx = String | Int | Symbol
|
|
901
|
-
* @sig Idx -> {s: a} -> a | Undefined
|
|
902
|
-
* @param {String|Number} p The property name or array index
|
|
903
|
-
* @param {Object} obj The object to query
|
|
904
|
-
* @return {*} The value at `obj.p`.
|
|
905
|
-
* @see R.path, R.props, R.pluck, R.project, R.nth
|
|
906
|
-
* @example
|
|
907
|
-
*
|
|
908
|
-
* R.prop('x', {x: 100}); //=> 100
|
|
909
|
-
* R.prop('x', {}); //=> undefined
|
|
910
|
-
* R.prop(0, [100]); //=> 100
|
|
911
|
-
* R.compose(R.inc, R.prop('x'))({ x: 3 }) //=> 4
|
|
912
|
-
*/
|
|
668
|
+
function eq(_a, _b) {
|
|
669
|
+
return _equals(_a, _b, stackA.slice(), stackB.slice());
|
|
670
|
+
} // if *a* array contains any element that is not included in *b*
|
|
913
671
|
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
672
|
+
|
|
673
|
+
return !_includesWith(function (b, aItem) {
|
|
674
|
+
return !_includesWith(eq, aItem, b);
|
|
675
|
+
}, b, a);
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
function _equals(a, b, stackA, stackB) {
|
|
679
|
+
if (_objectIs$1(a, b)) {
|
|
680
|
+
return true;
|
|
919
681
|
}
|
|
920
682
|
|
|
921
|
-
|
|
922
|
-
});
|
|
683
|
+
var typeA = type(a);
|
|
923
684
|
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
*
|
|
928
|
-
* `pluck` will work on
|
|
929
|
-
* any [functor](https://github.com/fantasyland/fantasy-land#functor) in
|
|
930
|
-
* addition to arrays, as it is equivalent to `R.map(R.prop(k), f)`.
|
|
931
|
-
*
|
|
932
|
-
* @func
|
|
933
|
-
* @memberOf R
|
|
934
|
-
* @since v0.1.0
|
|
935
|
-
* @category List
|
|
936
|
-
* @sig Functor f => k -> f {k: v} -> f v
|
|
937
|
-
* @param {Number|String} key The key name to pluck off of each object.
|
|
938
|
-
* @param {Array} f The array or functor to consider.
|
|
939
|
-
* @return {Array} The list of values for the given key.
|
|
940
|
-
* @see R.project, R.prop, R.props
|
|
941
|
-
* @example
|
|
942
|
-
*
|
|
943
|
-
* var getAges = R.pluck('age');
|
|
944
|
-
* getAges([{name: 'fred', age: 29}, {name: 'wilma', age: 27}]); //=> [29, 27]
|
|
945
|
-
*
|
|
946
|
-
* R.pluck(0, [[1, 2], [3, 4]]); //=> [1, 3]
|
|
947
|
-
* R.pluck('val', {a: {val: 3}, b: {val: 5}}); //=> {a: 3, b: 5}
|
|
948
|
-
* @symb R.pluck('x', [{x: 1, y: 2}, {x: 3, y: 4}, {x: 5, y: 6}]) = [1, 3, 5]
|
|
949
|
-
* @symb R.pluck(0, [[1, 2], [3, 4], [5, 6]]) = [1, 3, 5]
|
|
950
|
-
*/
|
|
685
|
+
if (typeA !== type(b)) {
|
|
686
|
+
return false;
|
|
687
|
+
}
|
|
951
688
|
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
689
|
+
if (typeof a['fantasy-land/equals'] === 'function' || typeof b['fantasy-land/equals'] === 'function') {
|
|
690
|
+
return typeof a['fantasy-land/equals'] === 'function' && a['fantasy-land/equals'](b) && typeof b['fantasy-land/equals'] === 'function' && b['fantasy-land/equals'](a);
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
if (typeof a.equals === 'function' || typeof b.equals === 'function') {
|
|
694
|
+
return typeof a.equals === 'function' && a.equals(b) && typeof b.equals === 'function' && b.equals(a);
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
switch (typeA) {
|
|
698
|
+
case 'Arguments':
|
|
699
|
+
case 'Array':
|
|
700
|
+
case 'Object':
|
|
701
|
+
if (typeof a.constructor === 'function' && _functionName(a.constructor) === 'Promise') {
|
|
702
|
+
return a === b;
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
break;
|
|
706
|
+
|
|
707
|
+
case 'Boolean':
|
|
708
|
+
case 'Number':
|
|
709
|
+
case 'String':
|
|
710
|
+
if (!(typeof a === typeof b && _objectIs$1(a.valueOf(), b.valueOf()))) {
|
|
711
|
+
return false;
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
break;
|
|
715
|
+
|
|
716
|
+
case 'Date':
|
|
717
|
+
if (!_objectIs$1(a.valueOf(), b.valueOf())) {
|
|
718
|
+
return false;
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
break;
|
|
722
|
+
|
|
723
|
+
case 'Error':
|
|
724
|
+
return a.name === b.name && a.message === b.message;
|
|
725
|
+
|
|
726
|
+
case 'RegExp':
|
|
727
|
+
if (!(a.source === b.source && a.global === b.global && a.ignoreCase === b.ignoreCase && a.multiline === b.multiline && a.sticky === b.sticky && a.unicode === b.unicode)) {
|
|
728
|
+
return false;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
break;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
var idx = stackA.length - 1;
|
|
735
|
+
|
|
736
|
+
while (idx >= 0) {
|
|
737
|
+
if (stackA[idx] === a) {
|
|
738
|
+
return stackB[idx] === b;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
idx -= 1;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
switch (typeA) {
|
|
745
|
+
case 'Map':
|
|
746
|
+
if (a.size !== b.size) {
|
|
747
|
+
return false;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
return _uniqContentEquals(a.entries(), b.entries(), stackA.concat([a]), stackB.concat([b]));
|
|
751
|
+
|
|
752
|
+
case 'Set':
|
|
753
|
+
if (a.size !== b.size) {
|
|
754
|
+
return false;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
return _uniqContentEquals(a.values(), b.values(), stackA.concat([a]), stackB.concat([b]));
|
|
758
|
+
|
|
759
|
+
case 'Arguments':
|
|
760
|
+
case 'Array':
|
|
761
|
+
case 'Object':
|
|
762
|
+
case 'Boolean':
|
|
763
|
+
case 'Number':
|
|
764
|
+
case 'String':
|
|
765
|
+
case 'Date':
|
|
766
|
+
case 'Error':
|
|
767
|
+
case 'RegExp':
|
|
768
|
+
case 'Int8Array':
|
|
769
|
+
case 'Uint8Array':
|
|
770
|
+
case 'Uint8ClampedArray':
|
|
771
|
+
case 'Int16Array':
|
|
772
|
+
case 'Uint16Array':
|
|
773
|
+
case 'Int32Array':
|
|
774
|
+
case 'Uint32Array':
|
|
775
|
+
case 'Float32Array':
|
|
776
|
+
case 'Float64Array':
|
|
777
|
+
case 'ArrayBuffer':
|
|
778
|
+
break;
|
|
779
|
+
|
|
780
|
+
default:
|
|
781
|
+
// Values of other types are only equal if identical.
|
|
782
|
+
return false;
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
var keysA = keys(a);
|
|
786
|
+
|
|
787
|
+
if (keysA.length !== keys(b).length) {
|
|
788
|
+
return false;
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
var extendedStackA = stackA.concat([a]);
|
|
792
|
+
var extendedStackB = stackB.concat([b]);
|
|
793
|
+
idx = keysA.length - 1;
|
|
794
|
+
|
|
795
|
+
while (idx >= 0) {
|
|
796
|
+
var key = keysA[idx];
|
|
797
|
+
|
|
798
|
+
if (!(_has(key, b) && _equals(b[key], a[key], extendedStackA, extendedStackB))) {
|
|
799
|
+
return false;
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
idx -= 1;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
return true;
|
|
806
|
+
}
|
|
957
807
|
|
|
958
808
|
/**
|
|
959
|
-
*
|
|
809
|
+
* Returns `true` if its arguments are equivalent, `false` otherwise. Handles
|
|
810
|
+
* cyclical data structures.
|
|
960
811
|
*
|
|
961
|
-
* Dispatches to the `
|
|
962
|
-
*
|
|
812
|
+
* Dispatches symmetrically to the `equals` methods of both arguments, if
|
|
813
|
+
* present.
|
|
963
814
|
*
|
|
964
815
|
* @func
|
|
965
816
|
* @memberOf R
|
|
966
|
-
* @since v0.
|
|
967
|
-
* @category
|
|
968
|
-
* @sig
|
|
969
|
-
* @
|
|
970
|
-
* @
|
|
971
|
-
* @
|
|
972
|
-
* @param {*} applyX
|
|
973
|
-
* @return {*}
|
|
817
|
+
* @since v0.15.0
|
|
818
|
+
* @category Relation
|
|
819
|
+
* @sig a -> b -> Boolean
|
|
820
|
+
* @param {*} a
|
|
821
|
+
* @param {*} b
|
|
822
|
+
* @return {Boolean}
|
|
974
823
|
* @example
|
|
975
824
|
*
|
|
976
|
-
* R.
|
|
977
|
-
* R.
|
|
825
|
+
* R.equals(1, 1); //=> true
|
|
826
|
+
* R.equals(1, '1'); //=> false
|
|
827
|
+
* R.equals([1, 2, 3], [1, 2, 3]); //=> true
|
|
978
828
|
*
|
|
979
|
-
*
|
|
980
|
-
*
|
|
981
|
-
* R.
|
|
982
|
-
* @symb R.ap([f, g], [a, b]) = [f(a), f(b), g(a), g(b)]
|
|
829
|
+
* const a = {}; a.v = a;
|
|
830
|
+
* const b = {}; b.v = b;
|
|
831
|
+
* R.equals(a, b); //=> true
|
|
983
832
|
*/
|
|
984
833
|
|
|
985
|
-
var
|
|
834
|
+
var equals =
|
|
986
835
|
/*#__PURE__*/
|
|
987
|
-
_curry2(function
|
|
988
|
-
return
|
|
989
|
-
return applyF(x)(applyX(x));
|
|
990
|
-
} : _reduce(function (acc, f) {
|
|
991
|
-
return _concat(acc, map(f, applyX));
|
|
992
|
-
}, [], applyF);
|
|
836
|
+
_curry2(function equals(a, b) {
|
|
837
|
+
return _equals(a, b, [], []);
|
|
993
838
|
});
|
|
994
839
|
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
* copied by reference.
|
|
1000
|
-
*
|
|
1001
|
-
* @private
|
|
1002
|
-
* @param {String|Number} prop The property name to set
|
|
1003
|
-
* @param {*} val The new value
|
|
1004
|
-
* @param {Object|Array} obj The object to clone
|
|
1005
|
-
* @return {Object|Array} A new object equivalent to the original except for the changed property.
|
|
1006
|
-
*/
|
|
840
|
+
function _map(fn, functor) {
|
|
841
|
+
var idx = 0;
|
|
842
|
+
var len = functor.length;
|
|
843
|
+
var result = Array(len);
|
|
1007
844
|
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
arr[prop] = val;
|
|
1012
|
-
return arr;
|
|
845
|
+
while (idx < len) {
|
|
846
|
+
result[idx] = fn(functor[idx]);
|
|
847
|
+
idx += 1;
|
|
1013
848
|
}
|
|
1014
849
|
|
|
1015
|
-
|
|
850
|
+
return result;
|
|
851
|
+
}
|
|
1016
852
|
|
|
1017
|
-
|
|
1018
|
-
|
|
853
|
+
function _arrayReduce(reducer, acc, list) {
|
|
854
|
+
var index = 0;
|
|
855
|
+
var length = list.length;
|
|
856
|
+
|
|
857
|
+
while (index < length) {
|
|
858
|
+
acc = reducer(acc, list[index]);
|
|
859
|
+
index += 1;
|
|
1019
860
|
}
|
|
1020
861
|
|
|
1021
|
-
|
|
1022
|
-
return result;
|
|
862
|
+
return acc;
|
|
1023
863
|
}
|
|
1024
864
|
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
* @func
|
|
1029
|
-
* @memberOf R
|
|
1030
|
-
* @since v0.9.0
|
|
1031
|
-
* @category Type
|
|
1032
|
-
* @sig * -> Boolean
|
|
1033
|
-
* @param {*} x The value to test.
|
|
1034
|
-
* @return {Boolean} `true` if `x` is `undefined` or `null`, otherwise `false`.
|
|
1035
|
-
* @example
|
|
1036
|
-
*
|
|
1037
|
-
* R.isNil(null); //=> true
|
|
1038
|
-
* R.isNil(undefined); //=> true
|
|
1039
|
-
* R.isNil(0); //=> false
|
|
1040
|
-
* R.isNil([]); //=> false
|
|
1041
|
-
*/
|
|
865
|
+
function _isObject(x) {
|
|
866
|
+
return Object.prototype.toString.call(x) === '[object Object]';
|
|
867
|
+
}
|
|
1042
868
|
|
|
1043
|
-
var
|
|
869
|
+
var XMap =
|
|
1044
870
|
/*#__PURE__*/
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
871
|
+
function () {
|
|
872
|
+
function XMap(f, xf) {
|
|
873
|
+
this.xf = xf;
|
|
874
|
+
this.f = f;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
XMap.prototype['@@transducer/init'] = _xfBase.init;
|
|
878
|
+
XMap.prototype['@@transducer/result'] = _xfBase.result;
|
|
879
|
+
|
|
880
|
+
XMap.prototype['@@transducer/step'] = function (result, input) {
|
|
881
|
+
return this.xf['@@transducer/step'](result, this.f(input));
|
|
882
|
+
};
|
|
883
|
+
|
|
884
|
+
return XMap;
|
|
885
|
+
}();
|
|
886
|
+
|
|
887
|
+
var _xmap = function _xmap(f) {
|
|
888
|
+
return function (xf) {
|
|
889
|
+
return new XMap(f, xf);
|
|
890
|
+
};
|
|
891
|
+
};
|
|
1048
892
|
|
|
1049
893
|
/**
|
|
1050
|
-
*
|
|
1051
|
-
*
|
|
1052
|
-
*
|
|
1053
|
-
*
|
|
894
|
+
* Takes a function and
|
|
895
|
+
* a [functor](https://github.com/fantasyland/fantasy-land#functor),
|
|
896
|
+
* applies the function to each of the functor's values, and returns
|
|
897
|
+
* a functor of the same shape.
|
|
898
|
+
*
|
|
899
|
+
* Ramda provides suitable `map` implementations for `Array` and `Object`,
|
|
900
|
+
* so this function may be applied to `[1, 2, 3]` or `{x: 1, y: 2, z: 3}`.
|
|
901
|
+
*
|
|
902
|
+
* Dispatches to the `map` method of the second argument, if present.
|
|
903
|
+
*
|
|
904
|
+
* Acts as a transducer if a transformer is given in list position.
|
|
905
|
+
*
|
|
906
|
+
* Also treats functions as functors and will compose them together.
|
|
1054
907
|
*
|
|
1055
908
|
* @func
|
|
1056
909
|
* @memberOf R
|
|
1057
|
-
* @since v0.
|
|
1058
|
-
* @category
|
|
1059
|
-
* @
|
|
1060
|
-
* @
|
|
1061
|
-
* @param {Array}
|
|
1062
|
-
* @
|
|
1063
|
-
* @
|
|
1064
|
-
* @return {Object} A new object equivalent to the original except along the specified path.
|
|
1065
|
-
* @see R.dissocPath
|
|
910
|
+
* @since v0.1.0
|
|
911
|
+
* @category List
|
|
912
|
+
* @sig Functor f => (a -> b) -> f a -> f b
|
|
913
|
+
* @param {Function} fn The function to be called on every element of the input `list`.
|
|
914
|
+
* @param {Array} list The list to be iterated over.
|
|
915
|
+
* @return {Array} The new list.
|
|
916
|
+
* @see R.transduce, R.addIndex, R.pluck, R.project
|
|
1066
917
|
* @example
|
|
1067
918
|
*
|
|
1068
|
-
*
|
|
919
|
+
* const double = x => x * 2;
|
|
1069
920
|
*
|
|
1070
|
-
*
|
|
1071
|
-
*
|
|
921
|
+
* R.map(double, [1, 2, 3]); //=> [2, 4, 6]
|
|
922
|
+
*
|
|
923
|
+
* R.map(double, {x: 1, y: 2, z: 3}); //=> {x: 2, y: 4, z: 6}
|
|
924
|
+
* @symb R.map(f, [a, b]) = [f(a), f(b)]
|
|
925
|
+
* @symb R.map(f, { x: a, y: b }) = { x: f(a), y: f(b) }
|
|
926
|
+
* @symb R.map(f, functor_o) = functor_o.map(f)
|
|
1072
927
|
*/
|
|
1073
928
|
|
|
1074
|
-
var
|
|
929
|
+
var map =
|
|
1075
930
|
/*#__PURE__*/
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
931
|
+
_curry2(
|
|
932
|
+
/*#__PURE__*/
|
|
933
|
+
_dispatchable(['fantasy-land/map', 'map'], _xmap, function map(fn, functor) {
|
|
934
|
+
switch (Object.prototype.toString.call(functor)) {
|
|
935
|
+
case '[object Function]':
|
|
936
|
+
return curryN(functor.length, function () {
|
|
937
|
+
return fn.call(this, functor.apply(this, arguments));
|
|
938
|
+
});
|
|
1080
939
|
|
|
1081
|
-
|
|
940
|
+
case '[object Object]':
|
|
941
|
+
return _arrayReduce(function (acc, key) {
|
|
942
|
+
acc[key] = fn(functor[key]);
|
|
943
|
+
return acc;
|
|
944
|
+
}, {}, keys(functor));
|
|
1082
945
|
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
val = assocPath(Array.prototype.slice.call(path, 1), val, nextObj);
|
|
946
|
+
default:
|
|
947
|
+
return _map(fn, functor);
|
|
1086
948
|
}
|
|
949
|
+
}));
|
|
1087
950
|
|
|
1088
|
-
|
|
1089
|
-
|
|
951
|
+
/**
|
|
952
|
+
* Determine if the passed argument is an integer.
|
|
953
|
+
*
|
|
954
|
+
* @private
|
|
955
|
+
* @param {*} n
|
|
956
|
+
* @category Type
|
|
957
|
+
* @return {Boolean}
|
|
958
|
+
*/
|
|
959
|
+
var _isInteger = Number.isInteger || function _isInteger(n) {
|
|
960
|
+
return n << 0 === n;
|
|
961
|
+
};
|
|
962
|
+
|
|
963
|
+
function _isString(x) {
|
|
964
|
+
return Object.prototype.toString.call(x) === '[object String]';
|
|
965
|
+
}
|
|
1090
966
|
|
|
1091
967
|
/**
|
|
1092
|
-
*
|
|
1093
|
-
*
|
|
1094
|
-
* properties onto the new object as well. All non-primitive properties are
|
|
1095
|
-
* copied by reference.
|
|
968
|
+
* Returns the nth element of the given list or string. If n is negative the
|
|
969
|
+
* element at index length + n is returned.
|
|
1096
970
|
*
|
|
1097
971
|
* @func
|
|
1098
972
|
* @memberOf R
|
|
1099
|
-
* @since v0.
|
|
1100
|
-
* @category
|
|
1101
|
-
* @
|
|
1102
|
-
* @sig
|
|
1103
|
-
* @param {
|
|
1104
|
-
* @param {*}
|
|
1105
|
-
* @
|
|
1106
|
-
* @return {Object} A new object equivalent to the original except for the changed property.
|
|
1107
|
-
* @see R.dissoc, R.pick
|
|
973
|
+
* @since v0.1.0
|
|
974
|
+
* @category List
|
|
975
|
+
* @sig Number -> [a] -> a | Undefined
|
|
976
|
+
* @sig Number -> String -> String
|
|
977
|
+
* @param {Number} offset
|
|
978
|
+
* @param {*} list
|
|
979
|
+
* @return {*}
|
|
1108
980
|
* @example
|
|
1109
981
|
*
|
|
1110
|
-
*
|
|
982
|
+
* const list = ['foo', 'bar', 'baz', 'quux'];
|
|
983
|
+
* R.nth(1, list); //=> 'bar'
|
|
984
|
+
* R.nth(-1, list); //=> 'quux'
|
|
985
|
+
* R.nth(-99, list); //=> undefined
|
|
986
|
+
*
|
|
987
|
+
* R.nth(2, 'abc'); //=> 'c'
|
|
988
|
+
* R.nth(3, 'abc'); //=> ''
|
|
989
|
+
* @symb R.nth(-1, [a, b, c]) = c
|
|
990
|
+
* @symb R.nth(0, [a, b, c]) = a
|
|
991
|
+
* @symb R.nth(1, [a, b, c]) = b
|
|
1111
992
|
*/
|
|
1112
993
|
|
|
1113
|
-
var
|
|
994
|
+
var nth =
|
|
1114
995
|
/*#__PURE__*/
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
function _isFunction(x) {
|
|
1120
|
-
var type = Object.prototype.toString.call(x);
|
|
1121
|
-
return type === '[object Function]' || type === '[object AsyncFunction]' || type === '[object GeneratorFunction]' || type === '[object AsyncGeneratorFunction]';
|
|
1122
|
-
}
|
|
996
|
+
_curry2(function nth(offset, list) {
|
|
997
|
+
var idx = offset < 0 ? list.length + offset : offset;
|
|
998
|
+
return _isString(list) ? list.charAt(idx) : list[idx];
|
|
999
|
+
});
|
|
1123
1000
|
|
|
1124
1001
|
/**
|
|
1125
|
-
*
|
|
1126
|
-
*
|
|
1002
|
+
* Returns a function that when supplied an object returns the indicated
|
|
1003
|
+
* property of that object, if it exists.
|
|
1127
1004
|
*
|
|
1128
1005
|
* @func
|
|
1129
1006
|
* @memberOf R
|
|
1130
|
-
* @since v0.
|
|
1131
|
-
* @category
|
|
1132
|
-
* @
|
|
1133
|
-
* @
|
|
1134
|
-
* @
|
|
1135
|
-
* @
|
|
1007
|
+
* @since v0.1.0
|
|
1008
|
+
* @category Object
|
|
1009
|
+
* @typedefn Idx = String | Int | Symbol
|
|
1010
|
+
* @sig Idx -> {s: a} -> a | Undefined
|
|
1011
|
+
* @param {String|Number} p The property name or array index
|
|
1012
|
+
* @param {Object} obj The object to query
|
|
1013
|
+
* @return {*} The value at `obj.p`.
|
|
1014
|
+
* @see R.path, R.props, R.pluck, R.project, R.nth
|
|
1136
1015
|
* @example
|
|
1137
1016
|
*
|
|
1138
|
-
*
|
|
1139
|
-
*
|
|
1017
|
+
* R.prop('x', {x: 100}); //=> 100
|
|
1018
|
+
* R.prop('x', {}); //=> undefined
|
|
1019
|
+
* R.prop(0, [100]); //=> 100
|
|
1020
|
+
* R.compose(R.inc, R.prop('x'))({ x: 3 }) //=> 4
|
|
1140
1021
|
*/
|
|
1141
1022
|
|
|
1142
|
-
var
|
|
1023
|
+
var prop =
|
|
1143
1024
|
/*#__PURE__*/
|
|
1144
|
-
_curry2(function
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1025
|
+
_curry2(function prop(p, obj) {
|
|
1026
|
+
if (obj == null) {
|
|
1027
|
+
return;
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
return _isInteger(p) ? nth(p, obj) : obj[p];
|
|
1149
1031
|
});
|
|
1150
1032
|
|
|
1151
1033
|
/**
|
|
1152
|
-
*
|
|
1153
|
-
*
|
|
1034
|
+
* Returns a new list by plucking the same named property off all objects in
|
|
1035
|
+
* the list supplied.
|
|
1036
|
+
*
|
|
1037
|
+
* `pluck` will work on
|
|
1038
|
+
* any [functor](https://github.com/fantasyland/fantasy-land#functor) in
|
|
1039
|
+
* addition to arrays, as it is equivalent to `R.map(R.prop(k), f)`.
|
|
1154
1040
|
*
|
|
1155
1041
|
* @func
|
|
1156
1042
|
* @memberOf R
|
|
1157
|
-
* @since v0.
|
|
1158
|
-
* @category
|
|
1159
|
-
* @sig
|
|
1160
|
-
* @param {
|
|
1161
|
-
* @
|
|
1162
|
-
* @
|
|
1043
|
+
* @since v0.1.0
|
|
1044
|
+
* @category List
|
|
1045
|
+
* @sig Functor f => k -> f {k: v} -> f v
|
|
1046
|
+
* @param {Number|String} key The key name to pluck off of each object.
|
|
1047
|
+
* @param {Array} f The array or functor to consider.
|
|
1048
|
+
* @return {Array} The list of values for the given key.
|
|
1049
|
+
* @see R.project, R.prop, R.props
|
|
1163
1050
|
* @example
|
|
1164
1051
|
*
|
|
1165
|
-
*
|
|
1166
|
-
*
|
|
1167
|
-
* madd3([100, 200], [30, 40], [5, 6, 7]); //=> [135, 136, 137, 145, 146, 147, 235, 236, 237, 245, 246, 247]
|
|
1168
|
-
*
|
|
1169
|
-
* const madd5 = R.lift((a, b, c, d, e) => a + b + c + d + e);
|
|
1052
|
+
* var getAges = R.pluck('age');
|
|
1053
|
+
* getAges([{name: 'fred', age: 29}, {name: 'wilma', age: 27}]); //=> [29, 27]
|
|
1170
1054
|
*
|
|
1171
|
-
*
|
|
1055
|
+
* R.pluck(0, [[1, 2], [3, 4]]); //=> [1, 3]
|
|
1056
|
+
* R.pluck('val', {a: {val: 3}, b: {val: 5}}); //=> {a: 3, b: 5}
|
|
1057
|
+
* @symb R.pluck('x', [{x: 1, y: 2}, {x: 3, y: 4}, {x: 5, y: 6}]) = [1, 3, 5]
|
|
1058
|
+
* @symb R.pluck(0, [[1, 2], [3, 4], [5, 6]]) = [1, 3, 5]
|
|
1172
1059
|
*/
|
|
1173
1060
|
|
|
1174
|
-
var
|
|
1061
|
+
var pluck =
|
|
1175
1062
|
/*#__PURE__*/
|
|
1176
|
-
|
|
1177
|
-
return
|
|
1063
|
+
_curry2(function pluck(p, list) {
|
|
1064
|
+
return map(prop(p), list);
|
|
1178
1065
|
});
|
|
1179
1066
|
|
|
1180
1067
|
/**
|
|
1181
|
-
*
|
|
1182
|
-
* returning such answers as 'Object', 'Number', 'Array', or 'Null'. Does not
|
|
1183
|
-
* attempt to distinguish user Object types any further, reporting them all as
|
|
1184
|
-
* 'Object'.
|
|
1068
|
+
* Tests whether or not an object is similar to an array.
|
|
1185
1069
|
*
|
|
1186
|
-
* @
|
|
1187
|
-
* @memberOf R
|
|
1188
|
-
* @since v0.8.0
|
|
1070
|
+
* @private
|
|
1189
1071
|
* @category Type
|
|
1190
|
-
* @
|
|
1191
|
-
* @
|
|
1192
|
-
* @
|
|
1072
|
+
* @category List
|
|
1073
|
+
* @sig * -> Boolean
|
|
1074
|
+
* @param {*} x The object to test.
|
|
1075
|
+
* @return {Boolean} `true` if `x` has a numeric length property and extreme indices defined; `false` otherwise.
|
|
1193
1076
|
* @example
|
|
1194
1077
|
*
|
|
1195
|
-
*
|
|
1196
|
-
*
|
|
1197
|
-
*
|
|
1198
|
-
*
|
|
1199
|
-
*
|
|
1200
|
-
*
|
|
1201
|
-
* R.type(/[A-z]/); //=> "RegExp"
|
|
1202
|
-
* R.type(() => {}); //=> "Function"
|
|
1203
|
-
* R.type(undefined); //=> "Undefined"
|
|
1078
|
+
* _isArrayLike([]); //=> true
|
|
1079
|
+
* _isArrayLike(true); //=> false
|
|
1080
|
+
* _isArrayLike({}); //=> false
|
|
1081
|
+
* _isArrayLike({length: 10}); //=> false
|
|
1082
|
+
* _isArrayLike({0: 'zero', 9: 'nine', length: 10}); //=> true
|
|
1083
|
+
* _isArrayLike({nodeType: 1, length: 1}) // => false
|
|
1204
1084
|
*/
|
|
1205
1085
|
|
|
1206
|
-
var
|
|
1086
|
+
var _isArrayLike =
|
|
1207
1087
|
/*#__PURE__*/
|
|
1208
|
-
_curry1(function
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
function _arrayFromIterator(iter) {
|
|
1213
|
-
var list = [];
|
|
1214
|
-
var next;
|
|
1088
|
+
_curry1(function isArrayLike(x) {
|
|
1089
|
+
if (_isArray(x)) {
|
|
1090
|
+
return true;
|
|
1091
|
+
}
|
|
1215
1092
|
|
|
1216
|
-
|
|
1217
|
-
|
|
1093
|
+
if (!x) {
|
|
1094
|
+
return false;
|
|
1218
1095
|
}
|
|
1219
1096
|
|
|
1220
|
-
|
|
1221
|
-
|
|
1097
|
+
if (typeof x !== 'object') {
|
|
1098
|
+
return false;
|
|
1099
|
+
}
|
|
1222
1100
|
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1101
|
+
if (_isString(x)) {
|
|
1102
|
+
return false;
|
|
1103
|
+
}
|
|
1226
1104
|
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
}
|
|
1105
|
+
if (x.length === 0) {
|
|
1106
|
+
return true;
|
|
1107
|
+
}
|
|
1231
1108
|
|
|
1232
|
-
|
|
1109
|
+
if (x.length > 0) {
|
|
1110
|
+
return x.hasOwnProperty(0) && x.hasOwnProperty(x.length - 1);
|
|
1233
1111
|
}
|
|
1234
1112
|
|
|
1235
1113
|
return false;
|
|
1236
|
-
}
|
|
1237
|
-
|
|
1238
|
-
function _functionName(f) {
|
|
1239
|
-
// String(x => x) evaluates to "x => x", so the pattern may not match.
|
|
1240
|
-
var match = String(f).match(/^function (\w*)/);
|
|
1241
|
-
return match == null ? '' : match[1];
|
|
1242
|
-
}
|
|
1243
|
-
|
|
1244
|
-
// Based on https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
1245
|
-
function _objectIs(a, b) {
|
|
1246
|
-
// SameValue algorithm
|
|
1247
|
-
if (a === b) {
|
|
1248
|
-
// Steps 1-5, 7-10
|
|
1249
|
-
// Steps 6.b-6.e: +0 != -0
|
|
1250
|
-
return a !== 0 || 1 / a === 1 / b;
|
|
1251
|
-
} else {
|
|
1252
|
-
// Step 6.a: NaN == NaN
|
|
1253
|
-
return a !== a && b !== b;
|
|
1254
|
-
}
|
|
1255
|
-
}
|
|
1114
|
+
});
|
|
1256
1115
|
|
|
1257
|
-
var
|
|
1116
|
+
var symIterator = typeof Symbol !== 'undefined' ? Symbol.iterator : '@@iterator';
|
|
1117
|
+
function _createReduce(arrayReduce, methodReduce, iterableReduce) {
|
|
1118
|
+
return function _reduce(xf, acc, list) {
|
|
1119
|
+
if (_isArrayLike(list)) {
|
|
1120
|
+
return arrayReduce(xf, acc, list);
|
|
1121
|
+
}
|
|
1258
1122
|
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
* - iterators lengths are the same
|
|
1263
|
-
* - iterators values are unique
|
|
1264
|
-
*
|
|
1265
|
-
* false-positive result will be returned for comparison of, e.g.
|
|
1266
|
-
* - [1,2,3] and [1,2,3,4]
|
|
1267
|
-
* - [1,1,1] and [1,2,3]
|
|
1268
|
-
* */
|
|
1123
|
+
if (list == null) {
|
|
1124
|
+
return acc;
|
|
1125
|
+
}
|
|
1269
1126
|
|
|
1270
|
-
|
|
1271
|
-
|
|
1127
|
+
if (typeof list['fantasy-land/reduce'] === 'function') {
|
|
1128
|
+
return methodReduce(xf, acc, list, 'fantasy-land/reduce');
|
|
1129
|
+
}
|
|
1272
1130
|
|
|
1273
|
-
|
|
1131
|
+
if (list[symIterator] != null) {
|
|
1132
|
+
return iterableReduce(xf, acc, list[symIterator]());
|
|
1133
|
+
}
|
|
1274
1134
|
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1135
|
+
if (typeof list.next === 'function') {
|
|
1136
|
+
return iterableReduce(xf, acc, list);
|
|
1137
|
+
}
|
|
1278
1138
|
|
|
1139
|
+
if (typeof list.reduce === 'function') {
|
|
1140
|
+
return methodReduce(xf, acc, list, 'reduce');
|
|
1141
|
+
}
|
|
1279
1142
|
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
}, b, a);
|
|
1143
|
+
throw new TypeError('reduce: list must be array or iterable');
|
|
1144
|
+
};
|
|
1283
1145
|
}
|
|
1284
1146
|
|
|
1285
|
-
function
|
|
1286
|
-
|
|
1287
|
-
return true;
|
|
1288
|
-
}
|
|
1289
|
-
|
|
1290
|
-
var typeA = type(a);
|
|
1291
|
-
|
|
1292
|
-
if (typeA !== type(b)) {
|
|
1293
|
-
return false;
|
|
1294
|
-
}
|
|
1295
|
-
|
|
1296
|
-
if (typeof a['fantasy-land/equals'] === 'function' || typeof b['fantasy-land/equals'] === 'function') {
|
|
1297
|
-
return typeof a['fantasy-land/equals'] === 'function' && a['fantasy-land/equals'](b) && typeof b['fantasy-land/equals'] === 'function' && b['fantasy-land/equals'](a);
|
|
1298
|
-
}
|
|
1147
|
+
function _iterableReduce(reducer, acc, iter) {
|
|
1148
|
+
var step = iter.next();
|
|
1299
1149
|
|
|
1300
|
-
|
|
1301
|
-
|
|
1150
|
+
while (!step.done) {
|
|
1151
|
+
acc = reducer(acc, step.value);
|
|
1152
|
+
step = iter.next();
|
|
1302
1153
|
}
|
|
1303
1154
|
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
case 'Array':
|
|
1307
|
-
case 'Object':
|
|
1308
|
-
if (typeof a.constructor === 'function' && _functionName(a.constructor) === 'Promise') {
|
|
1309
|
-
return a === b;
|
|
1310
|
-
}
|
|
1311
|
-
|
|
1312
|
-
break;
|
|
1313
|
-
|
|
1314
|
-
case 'Boolean':
|
|
1315
|
-
case 'Number':
|
|
1316
|
-
case 'String':
|
|
1317
|
-
if (!(typeof a === typeof b && _objectIs$1(a.valueOf(), b.valueOf()))) {
|
|
1318
|
-
return false;
|
|
1319
|
-
}
|
|
1155
|
+
return acc;
|
|
1156
|
+
}
|
|
1320
1157
|
|
|
1321
|
-
|
|
1158
|
+
function _methodReduce(reducer, acc, obj, methodName) {
|
|
1159
|
+
return obj[methodName](reducer, acc);
|
|
1160
|
+
}
|
|
1322
1161
|
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
}
|
|
1162
|
+
var _reduce =
|
|
1163
|
+
/*#__PURE__*/
|
|
1164
|
+
_createReduce(_arrayReduce, _methodReduce, _iterableReduce);
|
|
1327
1165
|
|
|
1328
|
-
|
|
1166
|
+
/**
|
|
1167
|
+
* ap applies a list of functions to a list of values.
|
|
1168
|
+
*
|
|
1169
|
+
* Dispatches to the `ap` method of the first argument, if present. Also
|
|
1170
|
+
* treats curried functions as applicatives.
|
|
1171
|
+
*
|
|
1172
|
+
* @func
|
|
1173
|
+
* @memberOf R
|
|
1174
|
+
* @since v0.3.0
|
|
1175
|
+
* @category Function
|
|
1176
|
+
* @sig [a -> b] -> [a] -> [b]
|
|
1177
|
+
* @sig Apply f => f (a -> b) -> f a -> f b
|
|
1178
|
+
* @sig (r -> a -> b) -> (r -> a) -> (r -> b)
|
|
1179
|
+
* @param {*} applyF
|
|
1180
|
+
* @param {*} applyX
|
|
1181
|
+
* @return {*}
|
|
1182
|
+
* @example
|
|
1183
|
+
*
|
|
1184
|
+
* R.ap([R.multiply(2), R.add(3)], [1,2,3]); //=> [2, 4, 6, 4, 5, 6]
|
|
1185
|
+
* R.ap([R.concat('tasty '), R.toUpper], ['pizza', 'salad']); //=> ["tasty pizza", "tasty salad", "PIZZA", "SALAD"]
|
|
1186
|
+
*
|
|
1187
|
+
* // R.ap can also be used as S combinator
|
|
1188
|
+
* // when only two functions are passed
|
|
1189
|
+
* R.ap(R.concat, R.toUpper)('Ramda') //=> 'RamdaRAMDA'
|
|
1190
|
+
* @symb R.ap([f, g], [a, b]) = [f(a), f(b), g(a), g(b)]
|
|
1191
|
+
*/
|
|
1329
1192
|
|
|
1330
|
-
|
|
1331
|
-
|
|
1193
|
+
var ap =
|
|
1194
|
+
/*#__PURE__*/
|
|
1195
|
+
_curry2(function ap(applyF, applyX) {
|
|
1196
|
+
return typeof applyX['fantasy-land/ap'] === 'function' ? applyX['fantasy-land/ap'](applyF) : typeof applyF.ap === 'function' ? applyF.ap(applyX) : typeof applyF === 'function' ? function (x) {
|
|
1197
|
+
return applyF(x)(applyX(x));
|
|
1198
|
+
} : _reduce(function (acc, f) {
|
|
1199
|
+
return _concat(acc, map(f, applyX));
|
|
1200
|
+
}, [], applyF);
|
|
1201
|
+
});
|
|
1332
1202
|
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1203
|
+
/**
|
|
1204
|
+
* Makes a shallow clone of an object, setting or overriding the specified
|
|
1205
|
+
* property with the given value. Note that this copies and flattens prototype
|
|
1206
|
+
* properties onto the new object as well. All non-primitive properties are
|
|
1207
|
+
* copied by reference.
|
|
1208
|
+
*
|
|
1209
|
+
* @private
|
|
1210
|
+
* @param {String|Number} prop The property name to set
|
|
1211
|
+
* @param {*} val The new value
|
|
1212
|
+
* @param {Object|Array} obj The object to clone
|
|
1213
|
+
* @return {Object|Array} A new object equivalent to the original except for the changed property.
|
|
1214
|
+
*/
|
|
1337
1215
|
|
|
1338
|
-
|
|
1216
|
+
function _assoc(prop, val, obj) {
|
|
1217
|
+
if (_isInteger(prop) && _isArray(obj)) {
|
|
1218
|
+
var arr = [].concat(obj);
|
|
1219
|
+
arr[prop] = val;
|
|
1220
|
+
return arr;
|
|
1339
1221
|
}
|
|
1340
1222
|
|
|
1341
|
-
var
|
|
1342
|
-
|
|
1343
|
-
while (idx >= 0) {
|
|
1344
|
-
if (stackA[idx] === a) {
|
|
1345
|
-
return stackB[idx] === b;
|
|
1346
|
-
}
|
|
1223
|
+
var result = {};
|
|
1347
1224
|
|
|
1348
|
-
|
|
1225
|
+
for (var p in obj) {
|
|
1226
|
+
result[p] = obj[p];
|
|
1349
1227
|
}
|
|
1350
1228
|
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
return false;
|
|
1355
|
-
}
|
|
1356
|
-
|
|
1357
|
-
return _uniqContentEquals(a.entries(), b.entries(), stackA.concat([a]), stackB.concat([b]));
|
|
1229
|
+
result[prop] = val;
|
|
1230
|
+
return result;
|
|
1231
|
+
}
|
|
1358
1232
|
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1233
|
+
/**
|
|
1234
|
+
* Checks if the input value is `null` or `undefined`.
|
|
1235
|
+
*
|
|
1236
|
+
* @func
|
|
1237
|
+
* @memberOf R
|
|
1238
|
+
* @since v0.9.0
|
|
1239
|
+
* @category Type
|
|
1240
|
+
* @sig * -> Boolean
|
|
1241
|
+
* @param {*} x The value to test.
|
|
1242
|
+
* @return {Boolean} `true` if `x` is `undefined` or `null`, otherwise `false`.
|
|
1243
|
+
* @example
|
|
1244
|
+
*
|
|
1245
|
+
* R.isNil(null); //=> true
|
|
1246
|
+
* R.isNil(undefined); //=> true
|
|
1247
|
+
* R.isNil(0); //=> false
|
|
1248
|
+
* R.isNil([]); //=> false
|
|
1249
|
+
*/
|
|
1363
1250
|
|
|
1364
|
-
|
|
1251
|
+
var isNil =
|
|
1252
|
+
/*#__PURE__*/
|
|
1253
|
+
_curry1(function isNil(x) {
|
|
1254
|
+
return x == null;
|
|
1255
|
+
});
|
|
1365
1256
|
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1257
|
+
/**
|
|
1258
|
+
* Makes a shallow clone of an object, setting or overriding the nodes required
|
|
1259
|
+
* to create the given path, and placing the specific value at the tail end of
|
|
1260
|
+
* that path. Note that this copies and flattens prototype properties onto the
|
|
1261
|
+
* new object as well. All non-primitive properties are copied by reference.
|
|
1262
|
+
*
|
|
1263
|
+
* @func
|
|
1264
|
+
* @memberOf R
|
|
1265
|
+
* @since v0.8.0
|
|
1266
|
+
* @category Object
|
|
1267
|
+
* @typedefn Idx = String | Int | Symbol
|
|
1268
|
+
* @sig [Idx] -> a -> {a} -> {a}
|
|
1269
|
+
* @param {Array} path the path to set
|
|
1270
|
+
* @param {*} val The new value
|
|
1271
|
+
* @param {Object} obj The object to clone
|
|
1272
|
+
* @return {Object} A new object equivalent to the original except along the specified path.
|
|
1273
|
+
* @see R.dissocPath
|
|
1274
|
+
* @example
|
|
1275
|
+
*
|
|
1276
|
+
* R.assocPath(['a', 'b', 'c'], 42, {a: {b: {c: 0}}}); //=> {a: {b: {c: 42}}}
|
|
1277
|
+
*
|
|
1278
|
+
* // Any missing or non-object keys in path will be overridden
|
|
1279
|
+
* R.assocPath(['a', 'b', 'c'], 42, {a: 5}); //=> {a: {b: {c: 42}}}
|
|
1280
|
+
*/
|
|
1386
1281
|
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1282
|
+
var assocPath =
|
|
1283
|
+
/*#__PURE__*/
|
|
1284
|
+
_curry3(function assocPath(path, val, obj) {
|
|
1285
|
+
if (path.length === 0) {
|
|
1286
|
+
return val;
|
|
1390
1287
|
}
|
|
1391
1288
|
|
|
1392
|
-
var
|
|
1289
|
+
var idx = path[0];
|
|
1393
1290
|
|
|
1394
|
-
if (
|
|
1395
|
-
|
|
1291
|
+
if (path.length > 1) {
|
|
1292
|
+
var nextObj = !isNil(obj) && _has(idx, obj) && typeof obj[idx] === 'object' ? obj[idx] : _isInteger(path[1]) ? [] : {};
|
|
1293
|
+
val = assocPath(Array.prototype.slice.call(path, 1), val, nextObj);
|
|
1396
1294
|
}
|
|
1397
1295
|
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
idx = keysA.length - 1;
|
|
1401
|
-
|
|
1402
|
-
while (idx >= 0) {
|
|
1403
|
-
var key = keysA[idx];
|
|
1296
|
+
return _assoc(idx, val, obj);
|
|
1297
|
+
});
|
|
1404
1298
|
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1299
|
+
/**
|
|
1300
|
+
* Makes a shallow clone of an object, setting or overriding the specified
|
|
1301
|
+
* property with the given value. Note that this copies and flattens prototype
|
|
1302
|
+
* properties onto the new object as well. All non-primitive properties are
|
|
1303
|
+
* copied by reference.
|
|
1304
|
+
*
|
|
1305
|
+
* @func
|
|
1306
|
+
* @memberOf R
|
|
1307
|
+
* @since v0.8.0
|
|
1308
|
+
* @category Object
|
|
1309
|
+
* @typedefn Idx = String | Int
|
|
1310
|
+
* @sig Idx -> a -> {k: v} -> {k: v}
|
|
1311
|
+
* @param {String|Number} prop The property name to set
|
|
1312
|
+
* @param {*} val The new value
|
|
1313
|
+
* @param {Object} obj The object to clone
|
|
1314
|
+
* @return {Object} A new object equivalent to the original except for the changed property.
|
|
1315
|
+
* @see R.dissoc, R.pick
|
|
1316
|
+
* @example
|
|
1317
|
+
*
|
|
1318
|
+
* R.assoc('c', 3, {a: 1, b: 2}); //=> {a: 1, b: 2, c: 3}
|
|
1319
|
+
*/
|
|
1408
1320
|
|
|
1409
|
-
|
|
1410
|
-
|
|
1321
|
+
var assoc =
|
|
1322
|
+
/*#__PURE__*/
|
|
1323
|
+
_curry3(function assoc(prop, val, obj) {
|
|
1324
|
+
return assocPath([prop], val, obj);
|
|
1325
|
+
});
|
|
1411
1326
|
|
|
1412
|
-
|
|
1327
|
+
function _isFunction(x) {
|
|
1328
|
+
var type = Object.prototype.toString.call(x);
|
|
1329
|
+
return type === '[object Function]' || type === '[object AsyncFunction]' || type === '[object GeneratorFunction]' || type === '[object AsyncGeneratorFunction]';
|
|
1413
1330
|
}
|
|
1414
1331
|
|
|
1415
1332
|
/**
|
|
1416
|
-
*
|
|
1417
|
-
*
|
|
1333
|
+
* "lifts" a function to be the specified arity, so that it may "map over" that
|
|
1334
|
+
* many lists, Functions or other objects that satisfy the [FantasyLand Apply spec](https://github.com/fantasyland/fantasy-land#apply).
|
|
1418
1335
|
*
|
|
1419
|
-
*
|
|
1420
|
-
*
|
|
1336
|
+
* @func
|
|
1337
|
+
* @memberOf R
|
|
1338
|
+
* @since v0.7.0
|
|
1339
|
+
* @category Function
|
|
1340
|
+
* @sig Number -> (*... -> *) -> ([*]... -> [*])
|
|
1341
|
+
* @param {Function} fn The function to lift into higher context
|
|
1342
|
+
* @return {Function} The lifted function.
|
|
1343
|
+
* @see R.lift, R.ap
|
|
1344
|
+
* @example
|
|
1345
|
+
*
|
|
1346
|
+
* const madd3 = R.liftN(3, (...args) => R.sum(args));
|
|
1347
|
+
* madd3([1,2,3], [1,2,3], [1]); //=> [3, 4, 5, 4, 5, 6, 5, 6, 7]
|
|
1348
|
+
*/
|
|
1349
|
+
|
|
1350
|
+
var liftN =
|
|
1351
|
+
/*#__PURE__*/
|
|
1352
|
+
_curry2(function liftN(arity, fn) {
|
|
1353
|
+
var lifted = curryN(arity, fn);
|
|
1354
|
+
return curryN(arity, function () {
|
|
1355
|
+
return _arrayReduce(ap, map(lifted, arguments[0]), Array.prototype.slice.call(arguments, 1));
|
|
1356
|
+
});
|
|
1357
|
+
});
|
|
1358
|
+
|
|
1359
|
+
/**
|
|
1360
|
+
* "lifts" a function of arity >= 1 so that it may "map over" a list, Function or other
|
|
1361
|
+
* object that satisfies the [FantasyLand Apply spec](https://github.com/fantasyland/fantasy-land#apply).
|
|
1421
1362
|
*
|
|
1422
1363
|
* @func
|
|
1423
1364
|
* @memberOf R
|
|
1424
|
-
* @since v0.
|
|
1425
|
-
* @category
|
|
1426
|
-
* @sig
|
|
1427
|
-
* @param {
|
|
1428
|
-
* @
|
|
1429
|
-
* @
|
|
1365
|
+
* @since v0.7.0
|
|
1366
|
+
* @category Function
|
|
1367
|
+
* @sig (*... -> *) -> ([*]... -> [*])
|
|
1368
|
+
* @param {Function} fn The function to lift into higher context
|
|
1369
|
+
* @return {Function} The lifted function.
|
|
1370
|
+
* @see R.liftN
|
|
1430
1371
|
* @example
|
|
1431
1372
|
*
|
|
1432
|
-
* R.
|
|
1433
|
-
* R.equals(1, '1'); //=> false
|
|
1434
|
-
* R.equals([1, 2, 3], [1, 2, 3]); //=> true
|
|
1373
|
+
* const madd3 = R.lift((a, b, c) => a + b + c);
|
|
1435
1374
|
*
|
|
1436
|
-
*
|
|
1437
|
-
*
|
|
1438
|
-
* R.
|
|
1375
|
+
* madd3([100, 200], [30, 40], [5, 6, 7]); //=> [135, 136, 137, 145, 146, 147, 235, 236, 237, 245, 246, 247]
|
|
1376
|
+
*
|
|
1377
|
+
* const madd5 = R.lift((a, b, c, d, e) => a + b + c + d + e);
|
|
1378
|
+
*
|
|
1379
|
+
* madd5([10, 20], [1], [2, 3], [4], [100, 200]); //=> [117, 217, 118, 218, 127, 227, 128, 228]
|
|
1439
1380
|
*/
|
|
1440
1381
|
|
|
1441
|
-
var
|
|
1382
|
+
var lift =
|
|
1442
1383
|
/*#__PURE__*/
|
|
1443
|
-
|
|
1444
|
-
return
|
|
1384
|
+
_curry1(function lift(fn) {
|
|
1385
|
+
return liftN(fn.length, fn);
|
|
1445
1386
|
});
|
|
1446
1387
|
|
|
1447
|
-
function _isObject(x) {
|
|
1448
|
-
return Object.prototype.toString.call(x) === '[object Object]';
|
|
1449
|
-
}
|
|
1450
|
-
|
|
1451
1388
|
/**
|
|
1452
1389
|
* Returns the first argument if it is truthy, otherwise the second argument.
|
|
1453
1390
|
* Acts as the boolean `or` statement if both inputs are `Boolean`s.
|
|
@@ -1493,7 +1430,7 @@ _curry2(function or(a, b) {
|
|
|
1493
1430
|
* @param {Function} f a predicate
|
|
1494
1431
|
* @param {Function} g another predicate
|
|
1495
1432
|
* @return {Function} a function that applies its arguments to `f` and `g` and `||`s their outputs together.
|
|
1496
|
-
* @see R.both, R.or
|
|
1433
|
+
* @see R.both, R.anyPass, R.or
|
|
1497
1434
|
* @example
|
|
1498
1435
|
*
|
|
1499
1436
|
* const gt10 = x => x > 10;
|
|
@@ -14125,7 +14062,7 @@ var FormikButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
|
|
14125
14062
|
values = _useFormikContext.values,
|
|
14126
14063
|
initialValues = _useFormikContext.initialValues,
|
|
14127
14064
|
isValid = _useFormikContext.isValid;
|
|
14128
|
-
var isDisabled = disabled !== null && disabled !== void 0 ? disabled : isSubmitting ||
|
|
14065
|
+
var isDisabled = disabled !== null && disabled !== void 0 ? disabled : isSubmitting || equals(values, initialValues);
|
|
14129
14066
|
return /*#__PURE__*/React__default["default"].createElement(Button, _extends$2({
|
|
14130
14067
|
disabled: isDisabled,
|
|
14131
14068
|
loading: isSubmitting && isValid,
|