opengate-js 16.1.2 → 16.3.0
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/README.md +84 -8
- package/dist/{opengate-api-bower-16.1.2.js → opengate-api-bower-16.3.0.js} +1493 -1153
- package/dist/opengate-api-bower-16.3.0.js.map +6 -0
- package/dist/opengate-api-bower-16.3.0.min.js +117 -0
- package/dist/opengate-api-bower-16.3.0.min.js.map +6 -0
- package/dist/opengate-api-npm.js +4 -0
- package/dist/opengate-api-npm.js.map +1 -1
- package/dist/opengate-api-npm.mjs +167 -56
- package/dist/opengate-api-npm.mjs.map +2 -2
- package/dist/src/InternalOpenGateAPI.js +38 -2
- package/dist/src/InternalOpenGateAPI.js.map +1 -1
- package/dist/src/notebookScheduler/NotebookScheduler.js +13 -0
- package/dist/src/notebookScheduler/NotebookScheduler.js.map +1 -1
- package/dist/src/searching/AssetSearch.js +1 -1
- package/dist/src/searching/AssetSearch.js.map +1 -1
- package/dist/src/searching/BaseSearch.js +3 -3
- package/dist/src/searching/DeviceSearch.js +1 -1
- package/dist/src/searching/DeviceSearch.js.map +1 -1
- package/dist/src/searching/EntitySearch.js +1 -1
- package/dist/src/searching/EntitySearch.js.map +1 -1
- package/dist/src/searching/WPSearch.js +1 -1
- package/dist/src/searching/WPSearch.js.map +1 -1
- package/dist/src/security/Certificates.js +0 -14
- package/dist/src/security/Certificates.js.map +1 -1
- package/dist/src/util/NorthAmpliaREST.js +77 -2
- package/dist/src/util/NorthAmpliaREST.js.map +1 -1
- package/dist/src/util/http/RequestSpec.js +21 -10
- package/dist/src/util/http/RequestSpec.js.map +1 -1
- package/opengate-api-npm.js +6 -0
- package/package.json +2 -2
- package/src/InternalOpenGateAPI.js +46 -2
- package/src/notebookScheduler/NotebookScheduler.js +14 -0
- package/src/searching/AssetSearch.js +1 -1
- package/src/searching/BaseSearch.js +3 -3
- package/src/searching/DeviceSearch.js +1 -1
- package/src/searching/EntitySearch.js +1 -1
- package/src/searching/WPSearch.js +1 -1
- package/src/security/Certificates.js +0 -32
- package/src/util/NorthAmpliaREST.js +87 -2
- package/src/util/http/RequestSpec.js +29 -10
- package/types/opengate-api-npm.d.ts +7 -1
- package/types/src/InternalOpenGateAPI.d.ts +103 -8
- package/types/src/notebookScheduler/NotebookScheduler.d.ts +7 -0
- package/types/src/security/Certificates.d.ts +0 -1
- package/types/src/util/NorthAmpliaREST.d.ts +25 -0
- package/dist/opengate-api-bower-16.1.2.js.map +0 -6
- package/dist/opengate-api-bower-16.1.2.min.js +0 -116
- package/dist/opengate-api-bower-16.1.2.min.js.map +0 -6
|
@@ -615,16 +615,16 @@
|
|
|
615
615
|
return func.apply(thisArg, args);
|
|
616
616
|
}
|
|
617
617
|
function arrayAggregator(array, setter, iteratee, accumulator) {
|
|
618
|
-
var index2 = -1,
|
|
619
|
-
while (++index2 <
|
|
618
|
+
var index2 = -1, length = array == null ? 0 : array.length;
|
|
619
|
+
while (++index2 < length) {
|
|
620
620
|
var value = array[index2];
|
|
621
621
|
setter(accumulator, value, iteratee(value), array);
|
|
622
622
|
}
|
|
623
623
|
return accumulator;
|
|
624
624
|
}
|
|
625
625
|
function arrayEach(array, iteratee) {
|
|
626
|
-
var index2 = -1,
|
|
627
|
-
while (++index2 <
|
|
626
|
+
var index2 = -1, length = array == null ? 0 : array.length;
|
|
627
|
+
while (++index2 < length) {
|
|
628
628
|
if (iteratee(array[index2], index2, array) === false) {
|
|
629
629
|
break;
|
|
630
630
|
}
|
|
@@ -632,17 +632,17 @@
|
|
|
632
632
|
return array;
|
|
633
633
|
}
|
|
634
634
|
function arrayEachRight(array, iteratee) {
|
|
635
|
-
var
|
|
636
|
-
while (
|
|
637
|
-
if (iteratee(array[
|
|
635
|
+
var length = array == null ? 0 : array.length;
|
|
636
|
+
while (length--) {
|
|
637
|
+
if (iteratee(array[length], length, array) === false) {
|
|
638
638
|
break;
|
|
639
639
|
}
|
|
640
640
|
}
|
|
641
641
|
return array;
|
|
642
642
|
}
|
|
643
643
|
function arrayEvery(array, predicate) {
|
|
644
|
-
var index2 = -1,
|
|
645
|
-
while (++index2 <
|
|
644
|
+
var index2 = -1, length = array == null ? 0 : array.length;
|
|
645
|
+
while (++index2 < length) {
|
|
646
646
|
if (!predicate(array[index2], index2, array)) {
|
|
647
647
|
return false;
|
|
648
648
|
}
|
|
@@ -650,8 +650,8 @@
|
|
|
650
650
|
return true;
|
|
651
651
|
}
|
|
652
652
|
function arrayFilter(array, predicate) {
|
|
653
|
-
var index2 = -1,
|
|
654
|
-
while (++index2 <
|
|
653
|
+
var index2 = -1, length = array == null ? 0 : array.length, resIndex = 0, result = [];
|
|
654
|
+
while (++index2 < length) {
|
|
655
655
|
var value = array[index2];
|
|
656
656
|
if (predicate(value, index2, array)) {
|
|
657
657
|
result[resIndex++] = value;
|
|
@@ -660,12 +660,12 @@
|
|
|
660
660
|
return result;
|
|
661
661
|
}
|
|
662
662
|
function arrayIncludes(array, value) {
|
|
663
|
-
var
|
|
664
|
-
return !!
|
|
663
|
+
var length = array == null ? 0 : array.length;
|
|
664
|
+
return !!length && baseIndexOf(array, value, 0) > -1;
|
|
665
665
|
}
|
|
666
666
|
function arrayIncludesWith(array, value, comparator) {
|
|
667
|
-
var index2 = -1,
|
|
668
|
-
while (++index2 <
|
|
667
|
+
var index2 = -1, length = array == null ? 0 : array.length;
|
|
668
|
+
while (++index2 < length) {
|
|
669
669
|
if (comparator(value, array[index2])) {
|
|
670
670
|
return true;
|
|
671
671
|
}
|
|
@@ -673,42 +673,42 @@
|
|
|
673
673
|
return false;
|
|
674
674
|
}
|
|
675
675
|
function arrayMap(array, iteratee) {
|
|
676
|
-
var index2 = -1,
|
|
677
|
-
while (++index2 <
|
|
676
|
+
var index2 = -1, length = array == null ? 0 : array.length, result = Array(length);
|
|
677
|
+
while (++index2 < length) {
|
|
678
678
|
result[index2] = iteratee(array[index2], index2, array);
|
|
679
679
|
}
|
|
680
680
|
return result;
|
|
681
681
|
}
|
|
682
682
|
function arrayPush(array, values) {
|
|
683
|
-
var index2 = -1,
|
|
684
|
-
while (++index2 <
|
|
683
|
+
var index2 = -1, length = values.length, offset = array.length;
|
|
684
|
+
while (++index2 < length) {
|
|
685
685
|
array[offset + index2] = values[index2];
|
|
686
686
|
}
|
|
687
687
|
return array;
|
|
688
688
|
}
|
|
689
689
|
function arrayReduce(array, iteratee, accumulator, initAccum) {
|
|
690
|
-
var index2 = -1,
|
|
691
|
-
if (initAccum &&
|
|
690
|
+
var index2 = -1, length = array == null ? 0 : array.length;
|
|
691
|
+
if (initAccum && length) {
|
|
692
692
|
accumulator = array[++index2];
|
|
693
693
|
}
|
|
694
|
-
while (++index2 <
|
|
694
|
+
while (++index2 < length) {
|
|
695
695
|
accumulator = iteratee(accumulator, array[index2], index2, array);
|
|
696
696
|
}
|
|
697
697
|
return accumulator;
|
|
698
698
|
}
|
|
699
699
|
function arrayReduceRight(array, iteratee, accumulator, initAccum) {
|
|
700
|
-
var
|
|
701
|
-
if (initAccum &&
|
|
702
|
-
accumulator = array[--
|
|
700
|
+
var length = array == null ? 0 : array.length;
|
|
701
|
+
if (initAccum && length) {
|
|
702
|
+
accumulator = array[--length];
|
|
703
703
|
}
|
|
704
|
-
while (
|
|
705
|
-
accumulator = iteratee(accumulator, array[
|
|
704
|
+
while (length--) {
|
|
705
|
+
accumulator = iteratee(accumulator, array[length], length, array);
|
|
706
706
|
}
|
|
707
707
|
return accumulator;
|
|
708
708
|
}
|
|
709
709
|
function arraySome(array, predicate) {
|
|
710
|
-
var index2 = -1,
|
|
711
|
-
while (++index2 <
|
|
710
|
+
var index2 = -1, length = array == null ? 0 : array.length;
|
|
711
|
+
while (++index2 < length) {
|
|
712
712
|
if (predicate(array[index2], index2, array)) {
|
|
713
713
|
return true;
|
|
714
714
|
}
|
|
@@ -733,8 +733,8 @@
|
|
|
733
733
|
return result;
|
|
734
734
|
}
|
|
735
735
|
function baseFindIndex(array, predicate, fromIndex, fromRight) {
|
|
736
|
-
var
|
|
737
|
-
while (fromRight ? index2-- : ++index2 <
|
|
736
|
+
var length = array.length, index2 = fromIndex + (fromRight ? 1 : -1);
|
|
737
|
+
while (fromRight ? index2-- : ++index2 < length) {
|
|
738
738
|
if (predicate(array[index2], index2, array)) {
|
|
739
739
|
return index2;
|
|
740
740
|
}
|
|
@@ -745,8 +745,8 @@
|
|
|
745
745
|
return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex);
|
|
746
746
|
}
|
|
747
747
|
function baseIndexOfWith(array, value, fromIndex, comparator) {
|
|
748
|
-
var index2 = fromIndex - 1,
|
|
749
|
-
while (++index2 <
|
|
748
|
+
var index2 = fromIndex - 1, length = array.length;
|
|
749
|
+
while (++index2 < length) {
|
|
750
750
|
if (comparator(array[index2], value)) {
|
|
751
751
|
return index2;
|
|
752
752
|
}
|
|
@@ -757,8 +757,8 @@
|
|
|
757
757
|
return value !== value;
|
|
758
758
|
}
|
|
759
759
|
function baseMean(array, iteratee) {
|
|
760
|
-
var
|
|
761
|
-
return
|
|
760
|
+
var length = array == null ? 0 : array.length;
|
|
761
|
+
return length ? baseSum(array, iteratee) / length : NAN;
|
|
762
762
|
}
|
|
763
763
|
function baseProperty(key2) {
|
|
764
764
|
return function(object) {
|
|
@@ -777,16 +777,16 @@
|
|
|
777
777
|
return accumulator;
|
|
778
778
|
}
|
|
779
779
|
function baseSortBy(array, comparer) {
|
|
780
|
-
var
|
|
780
|
+
var length = array.length;
|
|
781
781
|
array.sort(comparer);
|
|
782
|
-
while (
|
|
783
|
-
array[
|
|
782
|
+
while (length--) {
|
|
783
|
+
array[length] = array[length].value;
|
|
784
784
|
}
|
|
785
785
|
return array;
|
|
786
786
|
}
|
|
787
787
|
function baseSum(array, iteratee) {
|
|
788
|
-
var result, index2 = -1,
|
|
789
|
-
while (++index2 <
|
|
788
|
+
var result, index2 = -1, length = array.length;
|
|
789
|
+
while (++index2 < length) {
|
|
790
790
|
var current = iteratee(array[index2]);
|
|
791
791
|
if (current !== undefined2) {
|
|
792
792
|
result = result === undefined2 ? current : result + current;
|
|
@@ -823,8 +823,8 @@
|
|
|
823
823
|
return cache.has(key2);
|
|
824
824
|
}
|
|
825
825
|
function charsStartIndex(strSymbols, chrSymbols) {
|
|
826
|
-
var index2 = -1,
|
|
827
|
-
while (++index2 <
|
|
826
|
+
var index2 = -1, length = strSymbols.length;
|
|
827
|
+
while (++index2 < length && baseIndexOf(chrSymbols, strSymbols[index2], 0) > -1) {
|
|
828
828
|
}
|
|
829
829
|
return index2;
|
|
830
830
|
}
|
|
@@ -835,9 +835,9 @@
|
|
|
835
835
|
return index2;
|
|
836
836
|
}
|
|
837
837
|
function countHolders(array, placeholder) {
|
|
838
|
-
var
|
|
839
|
-
while (
|
|
840
|
-
if (array[
|
|
838
|
+
var length = array.length, result = 0;
|
|
839
|
+
while (length--) {
|
|
840
|
+
if (array[length] === placeholder) {
|
|
841
841
|
++result;
|
|
842
842
|
}
|
|
843
843
|
}
|
|
@@ -877,8 +877,8 @@
|
|
|
877
877
|
};
|
|
878
878
|
}
|
|
879
879
|
function replaceHolders(array, placeholder) {
|
|
880
|
-
var index2 = -1,
|
|
881
|
-
while (++index2 <
|
|
880
|
+
var index2 = -1, length = array.length, resIndex = 0, result = [];
|
|
881
|
+
while (++index2 < length) {
|
|
882
882
|
var value = array[index2];
|
|
883
883
|
if (value === placeholder || value === PLACEHOLDER) {
|
|
884
884
|
array[index2] = PLACEHOLDER;
|
|
@@ -902,8 +902,8 @@
|
|
|
902
902
|
return result;
|
|
903
903
|
}
|
|
904
904
|
function strictIndexOf(array, value, fromIndex) {
|
|
905
|
-
var index2 = fromIndex - 1,
|
|
906
|
-
while (++index2 <
|
|
905
|
+
var index2 = fromIndex - 1, length = array.length;
|
|
906
|
+
while (++index2 < length) {
|
|
907
907
|
if (array[index2] === value) {
|
|
908
908
|
return index2;
|
|
909
909
|
}
|
|
@@ -1095,13 +1095,13 @@
|
|
|
1095
1095
|
return result2;
|
|
1096
1096
|
}
|
|
1097
1097
|
function lazyValue() {
|
|
1098
|
-
var array = this.__wrapped__.value(), dir = this.__dir__, isArr = isArray(array), isRight = dir < 0, arrLength = isArr ? array.length : 0, view = getView(0, arrLength, this.__views__), start = view.start, end = view.end,
|
|
1099
|
-
if (!isArr || !isRight && arrLength ==
|
|
1098
|
+
var array = this.__wrapped__.value(), dir = this.__dir__, isArr = isArray(array), isRight = dir < 0, arrLength = isArr ? array.length : 0, view = getView(0, arrLength, this.__views__), start = view.start, end = view.end, length = end - start, index2 = isRight ? end : start - 1, iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin(length, this.__takeCount__);
|
|
1099
|
+
if (!isArr || !isRight && arrLength == length && takeCount == length) {
|
|
1100
1100
|
return baseWrapperValue(array, this.__actions__);
|
|
1101
1101
|
}
|
|
1102
1102
|
var result2 = [];
|
|
1103
1103
|
outer:
|
|
1104
|
-
while (
|
|
1104
|
+
while (length-- && resIndex < takeCount) {
|
|
1105
1105
|
index2 += dir;
|
|
1106
1106
|
var iterIndex = -1, value = array[index2];
|
|
1107
1107
|
while (++iterIndex < iterLength) {
|
|
@@ -1123,9 +1123,9 @@
|
|
|
1123
1123
|
LazyWrapper.prototype = baseCreate(baseLodash.prototype);
|
|
1124
1124
|
LazyWrapper.prototype.constructor = LazyWrapper;
|
|
1125
1125
|
function Hash(entries) {
|
|
1126
|
-
var index2 = -1,
|
|
1126
|
+
var index2 = -1, length = entries == null ? 0 : entries.length;
|
|
1127
1127
|
this.clear();
|
|
1128
|
-
while (++index2 <
|
|
1128
|
+
while (++index2 < length) {
|
|
1129
1129
|
var entry = entries[index2];
|
|
1130
1130
|
this.set(entry[0], entry[1]);
|
|
1131
1131
|
}
|
|
@@ -1163,9 +1163,9 @@
|
|
|
1163
1163
|
Hash.prototype.has = hashHas;
|
|
1164
1164
|
Hash.prototype.set = hashSet;
|
|
1165
1165
|
function ListCache(entries) {
|
|
1166
|
-
var index2 = -1,
|
|
1166
|
+
var index2 = -1, length = entries == null ? 0 : entries.length;
|
|
1167
1167
|
this.clear();
|
|
1168
|
-
while (++index2 <
|
|
1168
|
+
while (++index2 < length) {
|
|
1169
1169
|
var entry = entries[index2];
|
|
1170
1170
|
this.set(entry[0], entry[1]);
|
|
1171
1171
|
}
|
|
@@ -1211,9 +1211,9 @@
|
|
|
1211
1211
|
ListCache.prototype.has = listCacheHas;
|
|
1212
1212
|
ListCache.prototype.set = listCacheSet;
|
|
1213
1213
|
function MapCache(entries) {
|
|
1214
|
-
var index2 = -1,
|
|
1214
|
+
var index2 = -1, length = entries == null ? 0 : entries.length;
|
|
1215
1215
|
this.clear();
|
|
1216
|
-
while (++index2 <
|
|
1216
|
+
while (++index2 < length) {
|
|
1217
1217
|
var entry = entries[index2];
|
|
1218
1218
|
this.set(entry[0], entry[1]);
|
|
1219
1219
|
}
|
|
@@ -1249,9 +1249,9 @@
|
|
|
1249
1249
|
MapCache.prototype.has = mapCacheHas;
|
|
1250
1250
|
MapCache.prototype.set = mapCacheSet;
|
|
1251
1251
|
function SetCache(values2) {
|
|
1252
|
-
var index2 = -1,
|
|
1252
|
+
var index2 = -1, length = values2 == null ? 0 : values2.length;
|
|
1253
1253
|
this.__data__ = new MapCache();
|
|
1254
|
-
while (++index2 <
|
|
1254
|
+
while (++index2 < length) {
|
|
1255
1255
|
this.add(values2[index2]);
|
|
1256
1256
|
}
|
|
1257
1257
|
}
|
|
@@ -1304,21 +1304,21 @@
|
|
|
1304
1304
|
Stack.prototype.has = stackHas;
|
|
1305
1305
|
Stack.prototype.set = stackSet;
|
|
1306
1306
|
function arrayLikeKeys(value, inherited) {
|
|
1307
|
-
var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result2 = skipIndexes ? baseTimes(value.length, String2) : [],
|
|
1307
|
+
var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result2 = skipIndexes ? baseTimes(value.length, String2) : [], length = result2.length;
|
|
1308
1308
|
for (var key2 in value) {
|
|
1309
1309
|
if ((inherited || hasOwnProperty.call(value, key2)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
1310
1310
|
(key2 == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
1311
1311
|
isBuff && (key2 == "offset" || key2 == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
1312
1312
|
isType && (key2 == "buffer" || key2 == "byteLength" || key2 == "byteOffset") || // Skip index properties.
|
|
1313
|
-
isIndex(key2,
|
|
1313
|
+
isIndex(key2, length)))) {
|
|
1314
1314
|
result2.push(key2);
|
|
1315
1315
|
}
|
|
1316
1316
|
}
|
|
1317
1317
|
return result2;
|
|
1318
1318
|
}
|
|
1319
1319
|
function arraySample(array) {
|
|
1320
|
-
var
|
|
1321
|
-
return
|
|
1320
|
+
var length = array.length;
|
|
1321
|
+
return length ? array[baseRandom(0, length - 1)] : undefined2;
|
|
1322
1322
|
}
|
|
1323
1323
|
function arraySampleSize(array, n) {
|
|
1324
1324
|
return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length));
|
|
@@ -1338,10 +1338,10 @@
|
|
|
1338
1338
|
}
|
|
1339
1339
|
}
|
|
1340
1340
|
function assocIndexOf(array, key2) {
|
|
1341
|
-
var
|
|
1342
|
-
while (
|
|
1343
|
-
if (eq(array[
|
|
1344
|
-
return
|
|
1341
|
+
var length = array.length;
|
|
1342
|
+
while (length--) {
|
|
1343
|
+
if (eq(array[length][0], key2)) {
|
|
1344
|
+
return length;
|
|
1345
1345
|
}
|
|
1346
1346
|
}
|
|
1347
1347
|
return -1;
|
|
@@ -1371,8 +1371,8 @@
|
|
|
1371
1371
|
}
|
|
1372
1372
|
}
|
|
1373
1373
|
function baseAt(object, paths) {
|
|
1374
|
-
var index2 = -1,
|
|
1375
|
-
while (++index2 <
|
|
1374
|
+
var index2 = -1, length = paths.length, result2 = Array2(length), skip = object == null;
|
|
1375
|
+
while (++index2 < length) {
|
|
1376
1376
|
result2[index2] = skip ? undefined2 : get(object, paths[index2]);
|
|
1377
1377
|
}
|
|
1378
1378
|
return result2;
|
|
@@ -1455,13 +1455,13 @@
|
|
|
1455
1455
|
};
|
|
1456
1456
|
}
|
|
1457
1457
|
function baseConformsTo(object, source, props) {
|
|
1458
|
-
var
|
|
1458
|
+
var length = props.length;
|
|
1459
1459
|
if (object == null) {
|
|
1460
|
-
return !
|
|
1460
|
+
return !length;
|
|
1461
1461
|
}
|
|
1462
1462
|
object = Object2(object);
|
|
1463
|
-
while (
|
|
1464
|
-
var key2 = props[
|
|
1463
|
+
while (length--) {
|
|
1464
|
+
var key2 = props[length], predicate = source[key2], value = object[key2];
|
|
1465
1465
|
if (value === undefined2 && !(key2 in object) || !predicate(value)) {
|
|
1466
1466
|
return false;
|
|
1467
1467
|
}
|
|
@@ -1477,8 +1477,8 @@
|
|
|
1477
1477
|
}, wait);
|
|
1478
1478
|
}
|
|
1479
1479
|
function baseDifference(array, values2, iteratee2, comparator) {
|
|
1480
|
-
var index2 = -1, includes2 = arrayIncludes, isCommon = true,
|
|
1481
|
-
if (!
|
|
1480
|
+
var index2 = -1, includes2 = arrayIncludes, isCommon = true, length = array.length, result2 = [], valuesLength = values2.length;
|
|
1481
|
+
if (!length) {
|
|
1482
1482
|
return result2;
|
|
1483
1483
|
}
|
|
1484
1484
|
if (iteratee2) {
|
|
@@ -1493,7 +1493,7 @@
|
|
|
1493
1493
|
values2 = new SetCache(values2);
|
|
1494
1494
|
}
|
|
1495
1495
|
outer:
|
|
1496
|
-
while (++index2 <
|
|
1496
|
+
while (++index2 < length) {
|
|
1497
1497
|
var value = array[index2], computed = iteratee2 == null ? value : iteratee2(value);
|
|
1498
1498
|
value = comparator || value !== 0 ? value : 0;
|
|
1499
1499
|
if (isCommon && computed === computed) {
|
|
@@ -1521,8 +1521,8 @@
|
|
|
1521
1521
|
return result2;
|
|
1522
1522
|
}
|
|
1523
1523
|
function baseExtremum(array, iteratee2, comparator) {
|
|
1524
|
-
var index2 = -1,
|
|
1525
|
-
while (++index2 <
|
|
1524
|
+
var index2 = -1, length = array.length;
|
|
1525
|
+
while (++index2 < length) {
|
|
1526
1526
|
var value = array[index2], current = iteratee2(value);
|
|
1527
1527
|
if (current != null && (computed === undefined2 ? current === current && !isSymbol(current) : comparator(current, computed))) {
|
|
1528
1528
|
var computed = current, result2 = value;
|
|
@@ -1531,14 +1531,14 @@
|
|
|
1531
1531
|
return result2;
|
|
1532
1532
|
}
|
|
1533
1533
|
function baseFill(array, value, start, end) {
|
|
1534
|
-
var
|
|
1534
|
+
var length = array.length;
|
|
1535
1535
|
start = toInteger(start);
|
|
1536
1536
|
if (start < 0) {
|
|
1537
|
-
start = -start >
|
|
1537
|
+
start = -start > length ? 0 : length + start;
|
|
1538
1538
|
}
|
|
1539
|
-
end = end === undefined2 || end >
|
|
1539
|
+
end = end === undefined2 || end > length ? length : toInteger(end);
|
|
1540
1540
|
if (end < 0) {
|
|
1541
|
-
end +=
|
|
1541
|
+
end += length;
|
|
1542
1542
|
}
|
|
1543
1543
|
end = start > end ? 0 : toLength(end);
|
|
1544
1544
|
while (start < end) {
|
|
@@ -1556,10 +1556,10 @@
|
|
|
1556
1556
|
return result2;
|
|
1557
1557
|
}
|
|
1558
1558
|
function baseFlatten(array, depth, predicate, isStrict, result2) {
|
|
1559
|
-
var index2 = -1,
|
|
1559
|
+
var index2 = -1, length = array.length;
|
|
1560
1560
|
predicate || (predicate = isFlattenable);
|
|
1561
1561
|
result2 || (result2 = []);
|
|
1562
|
-
while (++index2 <
|
|
1562
|
+
while (++index2 < length) {
|
|
1563
1563
|
var value = array[index2];
|
|
1564
1564
|
if (depth > 0 && predicate(value)) {
|
|
1565
1565
|
if (depth > 1) {
|
|
@@ -1588,11 +1588,11 @@
|
|
|
1588
1588
|
}
|
|
1589
1589
|
function baseGet(object, path) {
|
|
1590
1590
|
path = castPath(path, object);
|
|
1591
|
-
var index2 = 0,
|
|
1592
|
-
while (object != null && index2 <
|
|
1591
|
+
var index2 = 0, length = path.length;
|
|
1592
|
+
while (object != null && index2 < length) {
|
|
1593
1593
|
object = object[toKey(path[index2++])];
|
|
1594
1594
|
}
|
|
1595
|
-
return index2 && index2 ==
|
|
1595
|
+
return index2 && index2 == length ? object : undefined2;
|
|
1596
1596
|
}
|
|
1597
1597
|
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
|
|
1598
1598
|
var result2 = keysFunc(object);
|
|
@@ -1617,19 +1617,19 @@
|
|
|
1617
1617
|
return number >= nativeMin(start, end) && number < nativeMax(start, end);
|
|
1618
1618
|
}
|
|
1619
1619
|
function baseIntersection(arrays, iteratee2, comparator) {
|
|
1620
|
-
var includes2 = comparator ? arrayIncludesWith : arrayIncludes,
|
|
1620
|
+
var includes2 = comparator ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array2(othLength), maxLength = Infinity, result2 = [];
|
|
1621
1621
|
while (othIndex--) {
|
|
1622
1622
|
var array = arrays[othIndex];
|
|
1623
1623
|
if (othIndex && iteratee2) {
|
|
1624
1624
|
array = arrayMap(array, baseUnary(iteratee2));
|
|
1625
1625
|
}
|
|
1626
1626
|
maxLength = nativeMin(array.length, maxLength);
|
|
1627
|
-
caches[othIndex] = !comparator && (iteratee2 ||
|
|
1627
|
+
caches[othIndex] = !comparator && (iteratee2 || length >= 120 && array.length >= 120) ? new SetCache(othIndex && array) : undefined2;
|
|
1628
1628
|
}
|
|
1629
1629
|
array = arrays[0];
|
|
1630
1630
|
var index2 = -1, seen = caches[0];
|
|
1631
1631
|
outer:
|
|
1632
|
-
while (++index2 <
|
|
1632
|
+
while (++index2 < length && result2.length < maxLength) {
|
|
1633
1633
|
var value = array[index2], computed = iteratee2 ? iteratee2(value) : value;
|
|
1634
1634
|
value = comparator || value !== 0 ? value : 0;
|
|
1635
1635
|
if (!(seen ? cacheHas(seen, computed) : includes2(result2, computed, comparator))) {
|
|
@@ -1712,9 +1712,9 @@
|
|
|
1712
1712
|
return isObjectLike(value) && getTag(value) == mapTag;
|
|
1713
1713
|
}
|
|
1714
1714
|
function baseIsMatch(object, source, matchData, customizer) {
|
|
1715
|
-
var index2 = matchData.length,
|
|
1715
|
+
var index2 = matchData.length, length = index2, noCustomizer = !customizer;
|
|
1716
1716
|
if (object == null) {
|
|
1717
|
-
return !
|
|
1717
|
+
return !length;
|
|
1718
1718
|
}
|
|
1719
1719
|
object = Object2(object);
|
|
1720
1720
|
while (index2--) {
|
|
@@ -1723,7 +1723,7 @@
|
|
|
1723
1723
|
return false;
|
|
1724
1724
|
}
|
|
1725
1725
|
}
|
|
1726
|
-
while (++index2 <
|
|
1726
|
+
while (++index2 < length) {
|
|
1727
1727
|
data = matchData[index2];
|
|
1728
1728
|
var key2 = data[0], objValue = object[key2], srcValue = data[1];
|
|
1729
1729
|
if (noCustomizer && data[2]) {
|
|
@@ -1883,12 +1883,12 @@
|
|
|
1883
1883
|
assignMergeValue(object, key2, newValue);
|
|
1884
1884
|
}
|
|
1885
1885
|
function baseNth(array, n) {
|
|
1886
|
-
var
|
|
1887
|
-
if (!
|
|
1886
|
+
var length = array.length;
|
|
1887
|
+
if (!length) {
|
|
1888
1888
|
return;
|
|
1889
1889
|
}
|
|
1890
|
-
n += n < 0 ?
|
|
1891
|
-
return isIndex(n,
|
|
1890
|
+
n += n < 0 ? length : 0;
|
|
1891
|
+
return isIndex(n, length) ? array[n] : undefined2;
|
|
1892
1892
|
}
|
|
1893
1893
|
function baseOrderBy(collection, iteratees, orders) {
|
|
1894
1894
|
if (iteratees.length) {
|
|
@@ -1921,8 +1921,8 @@
|
|
|
1921
1921
|
});
|
|
1922
1922
|
}
|
|
1923
1923
|
function basePickBy(object, paths, predicate) {
|
|
1924
|
-
var index2 = -1,
|
|
1925
|
-
while (++index2 <
|
|
1924
|
+
var index2 = -1, length = paths.length, result2 = {};
|
|
1925
|
+
while (++index2 < length) {
|
|
1926
1926
|
var path = paths[index2], value = baseGet(object, path);
|
|
1927
1927
|
if (predicate(value, path)) {
|
|
1928
1928
|
baseSet(result2, castPath(path, object), value);
|
|
@@ -1936,14 +1936,14 @@
|
|
|
1936
1936
|
};
|
|
1937
1937
|
}
|
|
1938
1938
|
function basePullAll(array, values2, iteratee2, comparator) {
|
|
1939
|
-
var indexOf2 = comparator ? baseIndexOfWith : baseIndexOf, index2 = -1,
|
|
1939
|
+
var indexOf2 = comparator ? baseIndexOfWith : baseIndexOf, index2 = -1, length = values2.length, seen = array;
|
|
1940
1940
|
if (array === values2) {
|
|
1941
1941
|
values2 = copyArray(values2);
|
|
1942
1942
|
}
|
|
1943
1943
|
if (iteratee2) {
|
|
1944
1944
|
seen = arrayMap(array, baseUnary(iteratee2));
|
|
1945
1945
|
}
|
|
1946
|
-
while (++index2 <
|
|
1946
|
+
while (++index2 < length) {
|
|
1947
1947
|
var fromIndex = 0, value = values2[index2], computed = iteratee2 ? iteratee2(value) : value;
|
|
1948
1948
|
while ((fromIndex = indexOf2(seen, computed, fromIndex, comparator)) > -1) {
|
|
1949
1949
|
if (seen !== array) {
|
|
@@ -1955,10 +1955,10 @@
|
|
|
1955
1955
|
return array;
|
|
1956
1956
|
}
|
|
1957
1957
|
function basePullAt(array, indexes) {
|
|
1958
|
-
var
|
|
1959
|
-
while (
|
|
1960
|
-
var index2 = indexes[
|
|
1961
|
-
if (
|
|
1958
|
+
var length = array ? indexes.length : 0, lastIndex = length - 1;
|
|
1959
|
+
while (length--) {
|
|
1960
|
+
var index2 = indexes[length];
|
|
1961
|
+
if (length == lastIndex || index2 !== previous) {
|
|
1962
1962
|
var previous = index2;
|
|
1963
1963
|
if (isIndex(index2)) {
|
|
1964
1964
|
splice.call(array, index2, 1);
|
|
@@ -1973,9 +1973,9 @@
|
|
|
1973
1973
|
return lower + nativeFloor(nativeRandom() * (upper - lower + 1));
|
|
1974
1974
|
}
|
|
1975
1975
|
function baseRange(start, end, step, fromRight) {
|
|
1976
|
-
var index2 = -1,
|
|
1977
|
-
while (
|
|
1978
|
-
result2[fromRight ?
|
|
1976
|
+
var index2 = -1, length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result2 = Array2(length);
|
|
1977
|
+
while (length--) {
|
|
1978
|
+
result2[fromRight ? length : ++index2] = start;
|
|
1979
1979
|
start += step;
|
|
1980
1980
|
}
|
|
1981
1981
|
return result2;
|
|
@@ -2011,8 +2011,8 @@
|
|
|
2011
2011
|
return object;
|
|
2012
2012
|
}
|
|
2013
2013
|
path = castPath(path, object);
|
|
2014
|
-
var index2 = -1,
|
|
2015
|
-
while (nested != null && ++index2 <
|
|
2014
|
+
var index2 = -1, length = path.length, lastIndex = length - 1, nested = object;
|
|
2015
|
+
while (nested != null && ++index2 < length) {
|
|
2016
2016
|
var key2 = toKey(path[index2]), newValue = value;
|
|
2017
2017
|
if (key2 === "__proto__" || key2 === "constructor" || key2 === "prototype") {
|
|
2018
2018
|
return object;
|
|
@@ -2045,18 +2045,18 @@
|
|
|
2045
2045
|
return shuffleSelf(values(collection));
|
|
2046
2046
|
}
|
|
2047
2047
|
function baseSlice(array, start, end) {
|
|
2048
|
-
var index2 = -1,
|
|
2048
|
+
var index2 = -1, length = array.length;
|
|
2049
2049
|
if (start < 0) {
|
|
2050
|
-
start = -start >
|
|
2050
|
+
start = -start > length ? 0 : length + start;
|
|
2051
2051
|
}
|
|
2052
|
-
end = end >
|
|
2052
|
+
end = end > length ? length : end;
|
|
2053
2053
|
if (end < 0) {
|
|
2054
|
-
end +=
|
|
2054
|
+
end += length;
|
|
2055
2055
|
}
|
|
2056
|
-
|
|
2056
|
+
length = start > end ? 0 : end - start >>> 0;
|
|
2057
2057
|
start >>>= 0;
|
|
2058
|
-
var result2 = Array2(
|
|
2059
|
-
while (++index2 <
|
|
2058
|
+
var result2 = Array2(length);
|
|
2059
|
+
while (++index2 < length) {
|
|
2060
2060
|
result2[index2] = array[index2 + start];
|
|
2061
2061
|
}
|
|
2062
2062
|
return result2;
|
|
@@ -2115,8 +2115,8 @@
|
|
|
2115
2115
|
return nativeMin(high, MAX_ARRAY_INDEX);
|
|
2116
2116
|
}
|
|
2117
2117
|
function baseSortedUniq(array, iteratee2) {
|
|
2118
|
-
var index2 = -1,
|
|
2119
|
-
while (++index2 <
|
|
2118
|
+
var index2 = -1, length = array.length, resIndex = 0, result2 = [];
|
|
2119
|
+
while (++index2 < length) {
|
|
2120
2120
|
var value = array[index2], computed = iteratee2 ? iteratee2(value) : value;
|
|
2121
2121
|
if (!index2 || !eq(computed, seen)) {
|
|
2122
2122
|
var seen = computed;
|
|
@@ -2148,11 +2148,11 @@
|
|
|
2148
2148
|
return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2;
|
|
2149
2149
|
}
|
|
2150
2150
|
function baseUniq(array, iteratee2, comparator) {
|
|
2151
|
-
var index2 = -1, includes2 = arrayIncludes,
|
|
2151
|
+
var index2 = -1, includes2 = arrayIncludes, length = array.length, isCommon = true, result2 = [], seen = result2;
|
|
2152
2152
|
if (comparator) {
|
|
2153
2153
|
isCommon = false;
|
|
2154
2154
|
includes2 = arrayIncludesWith;
|
|
2155
|
-
} else if (
|
|
2155
|
+
} else if (length >= LARGE_ARRAY_SIZE) {
|
|
2156
2156
|
var set2 = iteratee2 ? null : createSet(array);
|
|
2157
2157
|
if (set2) {
|
|
2158
2158
|
return setToArray(set2);
|
|
@@ -2164,7 +2164,7 @@
|
|
|
2164
2164
|
seen = iteratee2 ? [] : result2;
|
|
2165
2165
|
}
|
|
2166
2166
|
outer:
|
|
2167
|
-
while (++index2 <
|
|
2167
|
+
while (++index2 < length) {
|
|
2168
2168
|
var value = array[index2], computed = iteratee2 ? iteratee2(value) : value;
|
|
2169
2169
|
value = comparator || value !== 0 ? value : 0;
|
|
2170
2170
|
if (isCommon && computed === computed) {
|
|
@@ -2189,16 +2189,16 @@
|
|
|
2189
2189
|
}
|
|
2190
2190
|
function baseUnset(object, path) {
|
|
2191
2191
|
path = castPath(path, object);
|
|
2192
|
-
var index2 = -1,
|
|
2193
|
-
if (!
|
|
2192
|
+
var index2 = -1, length = path.length;
|
|
2193
|
+
if (!length) {
|
|
2194
2194
|
return true;
|
|
2195
2195
|
}
|
|
2196
|
-
while (++index2 <
|
|
2196
|
+
while (++index2 < length) {
|
|
2197
2197
|
var key2 = toKey(path[index2]);
|
|
2198
2198
|
if (key2 === "__proto__" && !hasOwnProperty.call(object, "__proto__")) {
|
|
2199
2199
|
return false;
|
|
2200
2200
|
}
|
|
2201
|
-
if ((key2 === "constructor" || key2 === "prototype") && index2 <
|
|
2201
|
+
if ((key2 === "constructor" || key2 === "prototype") && index2 < length - 1) {
|
|
2202
2202
|
return false;
|
|
2203
2203
|
}
|
|
2204
2204
|
}
|
|
@@ -2209,10 +2209,10 @@
|
|
|
2209
2209
|
return baseSet(object, path, updater(baseGet(object, path)), customizer);
|
|
2210
2210
|
}
|
|
2211
2211
|
function baseWhile(array, predicate, isDrop, fromRight) {
|
|
2212
|
-
var
|
|
2213
|
-
while ((fromRight ? index2-- : ++index2 <
|
|
2212
|
+
var length = array.length, index2 = fromRight ? length : -1;
|
|
2213
|
+
while ((fromRight ? index2-- : ++index2 < length) && predicate(array[index2], index2, array)) {
|
|
2214
2214
|
}
|
|
2215
|
-
return isDrop ? baseSlice(array, fromRight ? 0 : index2, fromRight ? index2 + 1 :
|
|
2215
|
+
return isDrop ? baseSlice(array, fromRight ? 0 : index2, fromRight ? index2 + 1 : length) : baseSlice(array, fromRight ? index2 + 1 : 0, fromRight ? length : index2);
|
|
2216
2216
|
}
|
|
2217
2217
|
function baseWrapperValue(value, actions) {
|
|
2218
2218
|
var result2 = value;
|
|
@@ -2224,14 +2224,14 @@
|
|
|
2224
2224
|
}, result2);
|
|
2225
2225
|
}
|
|
2226
2226
|
function baseXor(arrays, iteratee2, comparator) {
|
|
2227
|
-
var
|
|
2228
|
-
if (
|
|
2229
|
-
return
|
|
2227
|
+
var length = arrays.length;
|
|
2228
|
+
if (length < 2) {
|
|
2229
|
+
return length ? baseUniq(arrays[0]) : [];
|
|
2230
2230
|
}
|
|
2231
|
-
var index2 = -1, result2 = Array2(
|
|
2232
|
-
while (++index2 <
|
|
2231
|
+
var index2 = -1, result2 = Array2(length);
|
|
2232
|
+
while (++index2 < length) {
|
|
2233
2233
|
var array = arrays[index2], othIndex = -1;
|
|
2234
|
-
while (++othIndex <
|
|
2234
|
+
while (++othIndex < length) {
|
|
2235
2235
|
if (othIndex != index2) {
|
|
2236
2236
|
result2[index2] = baseDifference(result2[index2] || array, arrays[othIndex], iteratee2, comparator);
|
|
2237
2237
|
}
|
|
@@ -2240,8 +2240,8 @@
|
|
|
2240
2240
|
return baseUniq(baseFlatten(result2, 1), iteratee2, comparator);
|
|
2241
2241
|
}
|
|
2242
2242
|
function baseZipObject(props, values2, assignFunc) {
|
|
2243
|
-
var index2 = -1,
|
|
2244
|
-
while (++index2 <
|
|
2243
|
+
var index2 = -1, length = props.length, valsLength = values2.length, result2 = {};
|
|
2244
|
+
while (++index2 < length) {
|
|
2245
2245
|
var value = index2 < valsLength ? values2[index2] : undefined2;
|
|
2246
2246
|
assignFunc(result2, props[index2], value);
|
|
2247
2247
|
}
|
|
@@ -2261,9 +2261,9 @@
|
|
|
2261
2261
|
}
|
|
2262
2262
|
var castRest = baseRest;
|
|
2263
2263
|
function castSlice(array, start, end) {
|
|
2264
|
-
var
|
|
2265
|
-
end = end === undefined2 ?
|
|
2266
|
-
return !start && end >=
|
|
2264
|
+
var length = array.length;
|
|
2265
|
+
end = end === undefined2 ? length : end;
|
|
2266
|
+
return !start && end >= length ? array : baseSlice(array, start, end);
|
|
2267
2267
|
}
|
|
2268
2268
|
var clearTimeout2 = ctxClearTimeout || function(id) {
|
|
2269
2269
|
return root.clearTimeout(id);
|
|
@@ -2272,7 +2272,7 @@
|
|
|
2272
2272
|
if (isDeep) {
|
|
2273
2273
|
return buffer.slice();
|
|
2274
2274
|
}
|
|
2275
|
-
var
|
|
2275
|
+
var length = buffer.length, result2 = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);
|
|
2276
2276
|
buffer.copy(result2);
|
|
2277
2277
|
return result2;
|
|
2278
2278
|
}
|
|
@@ -2311,8 +2311,8 @@
|
|
|
2311
2311
|
return 0;
|
|
2312
2312
|
}
|
|
2313
2313
|
function compareMultiple(object, other, orders) {
|
|
2314
|
-
var index2 = -1, objCriteria = object.criteria, othCriteria = other.criteria,
|
|
2315
|
-
while (++index2 <
|
|
2314
|
+
var index2 = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length;
|
|
2315
|
+
while (++index2 < length) {
|
|
2316
2316
|
var result2 = compareAscending(objCriteria[index2], othCriteria[index2]);
|
|
2317
2317
|
if (result2) {
|
|
2318
2318
|
if (index2 >= ordersLength) {
|
|
@@ -2356,9 +2356,9 @@
|
|
|
2356
2356
|
return result2;
|
|
2357
2357
|
}
|
|
2358
2358
|
function copyArray(source, array) {
|
|
2359
|
-
var index2 = -1,
|
|
2360
|
-
array || (array = Array2(
|
|
2361
|
-
while (++index2 <
|
|
2359
|
+
var index2 = -1, length = source.length;
|
|
2360
|
+
array || (array = Array2(length));
|
|
2361
|
+
while (++index2 < length) {
|
|
2362
2362
|
array[index2] = source[index2];
|
|
2363
2363
|
}
|
|
2364
2364
|
return array;
|
|
@@ -2366,8 +2366,8 @@
|
|
|
2366
2366
|
function copyObject(source, props, object, customizer) {
|
|
2367
2367
|
var isNew = !object;
|
|
2368
2368
|
object || (object = {});
|
|
2369
|
-
var index2 = -1,
|
|
2370
|
-
while (++index2 <
|
|
2369
|
+
var index2 = -1, length = props.length;
|
|
2370
|
+
while (++index2 < length) {
|
|
2371
2371
|
var key2 = props[index2];
|
|
2372
2372
|
var newValue = customizer ? customizer(object[key2], source[key2], key2, object, source) : undefined2;
|
|
2373
2373
|
if (newValue === undefined2) {
|
|
@@ -2395,14 +2395,14 @@
|
|
|
2395
2395
|
}
|
|
2396
2396
|
function createAssigner(assigner) {
|
|
2397
2397
|
return baseRest(function(object, sources) {
|
|
2398
|
-
var index2 = -1,
|
|
2399
|
-
customizer = assigner.length > 3 && typeof customizer == "function" ? (
|
|
2398
|
+
var index2 = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined2, guard = length > 2 ? sources[2] : undefined2;
|
|
2399
|
+
customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : undefined2;
|
|
2400
2400
|
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
|
|
2401
|
-
customizer =
|
|
2402
|
-
|
|
2401
|
+
customizer = length < 3 ? undefined2 : customizer;
|
|
2402
|
+
length = 1;
|
|
2403
2403
|
}
|
|
2404
2404
|
object = Object2(object);
|
|
2405
|
-
while (++index2 <
|
|
2405
|
+
while (++index2 < length) {
|
|
2406
2406
|
var source = sources[index2];
|
|
2407
2407
|
if (source) {
|
|
2408
2408
|
assigner(object, source, index2, customizer);
|
|
@@ -2419,8 +2419,8 @@
|
|
|
2419
2419
|
if (!isArrayLike(collection)) {
|
|
2420
2420
|
return eachFunc(collection, iteratee2);
|
|
2421
2421
|
}
|
|
2422
|
-
var
|
|
2423
|
-
while (fromRight ? index2-- : ++index2 <
|
|
2422
|
+
var length = collection.length, index2 = fromRight ? length : -1, iterable = Object2(collection);
|
|
2423
|
+
while (fromRight ? index2-- : ++index2 < length) {
|
|
2424
2424
|
if (iteratee2(iterable[index2], index2, iterable) === false) {
|
|
2425
2425
|
break;
|
|
2426
2426
|
}
|
|
@@ -2430,9 +2430,9 @@
|
|
|
2430
2430
|
}
|
|
2431
2431
|
function createBaseFor(fromRight) {
|
|
2432
2432
|
return function(object, iteratee2, keysFunc) {
|
|
2433
|
-
var index2 = -1, iterable = Object2(object), props = keysFunc(object),
|
|
2434
|
-
while (
|
|
2435
|
-
var key2 = props[fromRight ?
|
|
2433
|
+
var index2 = -1, iterable = Object2(object), props = keysFunc(object), length = props.length;
|
|
2434
|
+
while (length--) {
|
|
2435
|
+
var key2 = props[fromRight ? length : ++index2];
|
|
2436
2436
|
if (iteratee2(iterable[key2], key2, iterable) === false) {
|
|
2437
2437
|
break;
|
|
2438
2438
|
}
|
|
@@ -2490,13 +2490,13 @@
|
|
|
2490
2490
|
function createCurry(func, bitmask, arity) {
|
|
2491
2491
|
var Ctor = createCtor(func);
|
|
2492
2492
|
function wrapper() {
|
|
2493
|
-
var
|
|
2493
|
+
var length = arguments.length, args = Array2(length), index2 = length, placeholder = getHolder(wrapper);
|
|
2494
2494
|
while (index2--) {
|
|
2495
2495
|
args[index2] = arguments[index2];
|
|
2496
2496
|
}
|
|
2497
|
-
var holders =
|
|
2498
|
-
|
|
2499
|
-
if (
|
|
2497
|
+
var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : replaceHolders(args, placeholder);
|
|
2498
|
+
length -= holders.length;
|
|
2499
|
+
if (length < arity) {
|
|
2500
2500
|
return createRecurry(
|
|
2501
2501
|
func,
|
|
2502
2502
|
bitmask,
|
|
@@ -2507,7 +2507,7 @@
|
|
|
2507
2507
|
holders,
|
|
2508
2508
|
undefined2,
|
|
2509
2509
|
undefined2,
|
|
2510
|
-
arity -
|
|
2510
|
+
arity - length
|
|
2511
2511
|
);
|
|
2512
2512
|
}
|
|
2513
2513
|
var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
|
|
@@ -2531,7 +2531,7 @@
|
|
|
2531
2531
|
}
|
|
2532
2532
|
function createFlow(fromRight) {
|
|
2533
2533
|
return flatRest(function(funcs) {
|
|
2534
|
-
var
|
|
2534
|
+
var length = funcs.length, index2 = length, prereq = LodashWrapper.prototype.thru;
|
|
2535
2535
|
if (fromRight) {
|
|
2536
2536
|
funcs.reverse();
|
|
2537
2537
|
}
|
|
@@ -2544,8 +2544,8 @@
|
|
|
2544
2544
|
var wrapper = new LodashWrapper([], true);
|
|
2545
2545
|
}
|
|
2546
2546
|
}
|
|
2547
|
-
index2 = wrapper ? index2 :
|
|
2548
|
-
while (++index2 <
|
|
2547
|
+
index2 = wrapper ? index2 : length;
|
|
2548
|
+
while (++index2 < length) {
|
|
2549
2549
|
func = funcs[index2];
|
|
2550
2550
|
var funcName = getFuncName(func), data = funcName == "wrapper" ? getData(func) : undefined2;
|
|
2551
2551
|
if (data && isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data[4].length && data[9] == 1) {
|
|
@@ -2559,8 +2559,8 @@
|
|
|
2559
2559
|
if (wrapper && args.length == 1 && isArray(value)) {
|
|
2560
2560
|
return wrapper.plant(value).value();
|
|
2561
2561
|
}
|
|
2562
|
-
var index3 = 0, result2 =
|
|
2563
|
-
while (++index3 <
|
|
2562
|
+
var index3 = 0, result2 = length ? funcs[index3].apply(this, args) : value;
|
|
2563
|
+
while (++index3 < length) {
|
|
2564
2564
|
result2 = funcs[index3].call(this, result2);
|
|
2565
2565
|
}
|
|
2566
2566
|
return result2;
|
|
@@ -2570,7 +2570,7 @@
|
|
|
2570
2570
|
function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary2, arity) {
|
|
2571
2571
|
var isAry = bitmask & WRAP_ARY_FLAG, isBind = bitmask & WRAP_BIND_FLAG, isBindKey = bitmask & WRAP_BIND_KEY_FLAG, isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), isFlip = bitmask & WRAP_FLIP_FLAG, Ctor = isBindKey ? undefined2 : createCtor(func);
|
|
2572
2572
|
function wrapper() {
|
|
2573
|
-
var
|
|
2573
|
+
var length = arguments.length, args = Array2(length), index2 = length;
|
|
2574
2574
|
while (index2--) {
|
|
2575
2575
|
args[index2] = arguments[index2];
|
|
2576
2576
|
}
|
|
@@ -2583,8 +2583,8 @@
|
|
|
2583
2583
|
if (partialsRight) {
|
|
2584
2584
|
args = composeArgsRight(args, partialsRight, holdersRight, isCurried);
|
|
2585
2585
|
}
|
|
2586
|
-
|
|
2587
|
-
if (isCurried &&
|
|
2586
|
+
length -= holdersCount;
|
|
2587
|
+
if (isCurried && length < arity) {
|
|
2588
2588
|
var newHolders = replaceHolders(args, placeholder);
|
|
2589
2589
|
return createRecurry(
|
|
2590
2590
|
func,
|
|
@@ -2596,17 +2596,17 @@
|
|
|
2596
2596
|
newHolders,
|
|
2597
2597
|
argPos,
|
|
2598
2598
|
ary2,
|
|
2599
|
-
arity -
|
|
2599
|
+
arity - length
|
|
2600
2600
|
);
|
|
2601
2601
|
}
|
|
2602
2602
|
var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func;
|
|
2603
|
-
|
|
2603
|
+
length = args.length;
|
|
2604
2604
|
if (argPos) {
|
|
2605
2605
|
args = reorder(args, argPos);
|
|
2606
|
-
} else if (isFlip &&
|
|
2606
|
+
} else if (isFlip && length > 1) {
|
|
2607
2607
|
args.reverse();
|
|
2608
2608
|
}
|
|
2609
|
-
if (isAry && ary2 <
|
|
2609
|
+
if (isAry && ary2 < length) {
|
|
2610
2610
|
args.length = ary2;
|
|
2611
2611
|
}
|
|
2612
2612
|
if (this && this !== root && this instanceof wrapper) {
|
|
@@ -2657,14 +2657,14 @@
|
|
|
2657
2657
|
});
|
|
2658
2658
|
});
|
|
2659
2659
|
}
|
|
2660
|
-
function createPadding(
|
|
2660
|
+
function createPadding(length, chars) {
|
|
2661
2661
|
chars = chars === undefined2 ? " " : baseToString(chars);
|
|
2662
2662
|
var charsLength = chars.length;
|
|
2663
2663
|
if (charsLength < 2) {
|
|
2664
|
-
return charsLength ? baseRepeat(chars,
|
|
2664
|
+
return charsLength ? baseRepeat(chars, length) : chars;
|
|
2665
2665
|
}
|
|
2666
|
-
var result2 = baseRepeat(chars, nativeCeil(
|
|
2667
|
-
return hasUnicode(chars) ? castSlice(stringToArray(result2), 0,
|
|
2666
|
+
var result2 = baseRepeat(chars, nativeCeil(length / stringSize(chars)));
|
|
2667
|
+
return hasUnicode(chars) ? castSlice(stringToArray(result2), 0, length).join("") : result2.slice(0, length);
|
|
2668
2668
|
}
|
|
2669
2669
|
function createPartial(func, bitmask, thisArg, partials) {
|
|
2670
2670
|
var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func);
|
|
@@ -2764,14 +2764,14 @@
|
|
|
2764
2764
|
if (!isBindKey && typeof func != "function") {
|
|
2765
2765
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
2766
2766
|
}
|
|
2767
|
-
var
|
|
2768
|
-
if (!
|
|
2767
|
+
var length = partials ? partials.length : 0;
|
|
2768
|
+
if (!length) {
|
|
2769
2769
|
bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG);
|
|
2770
2770
|
partials = holders = undefined2;
|
|
2771
2771
|
}
|
|
2772
2772
|
ary2 = ary2 === undefined2 ? ary2 : nativeMax(toInteger(ary2), 0);
|
|
2773
2773
|
arity = arity === undefined2 ? arity : toInteger(arity);
|
|
2774
|
-
|
|
2774
|
+
length -= holders ? holders.length : 0;
|
|
2775
2775
|
if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) {
|
|
2776
2776
|
var partialsRight = partials, holdersRight = holders;
|
|
2777
2777
|
partials = holders = undefined2;
|
|
@@ -2797,7 +2797,7 @@
|
|
|
2797
2797
|
thisArg = newData[2];
|
|
2798
2798
|
partials = newData[3];
|
|
2799
2799
|
holders = newData[4];
|
|
2800
|
-
arity = newData[9] = newData[9] === undefined2 ? isBindKey ? 0 : func.length : nativeMax(newData[9] -
|
|
2800
|
+
arity = newData[9] = newData[9] === undefined2 ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0);
|
|
2801
2801
|
if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) {
|
|
2802
2802
|
bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG);
|
|
2803
2803
|
}
|
|
@@ -2975,9 +2975,9 @@
|
|
|
2975
2975
|
return metaMap.get(func);
|
|
2976
2976
|
};
|
|
2977
2977
|
function getFuncName(func) {
|
|
2978
|
-
var result2 = func.name + "", array = realNames[result2],
|
|
2979
|
-
while (
|
|
2980
|
-
var data = array[
|
|
2978
|
+
var result2 = func.name + "", array = realNames[result2], length = hasOwnProperty.call(realNames, result2) ? array.length : 0;
|
|
2979
|
+
while (length--) {
|
|
2980
|
+
var data = array[length], otherFunc = data.func;
|
|
2981
2981
|
if (otherFunc == null || otherFunc == func) {
|
|
2982
2982
|
return data.name;
|
|
2983
2983
|
}
|
|
@@ -2998,10 +2998,10 @@
|
|
|
2998
2998
|
return isKeyable(key2) ? data[typeof key2 == "string" ? "string" : "hash"] : data.map;
|
|
2999
2999
|
}
|
|
3000
3000
|
function getMatchData(object) {
|
|
3001
|
-
var result2 = keys(object),
|
|
3002
|
-
while (
|
|
3003
|
-
var key2 = result2[
|
|
3004
|
-
result2[
|
|
3001
|
+
var result2 = keys(object), length = result2.length;
|
|
3002
|
+
while (length--) {
|
|
3003
|
+
var key2 = result2[length], value = object[key2];
|
|
3004
|
+
result2[length] = [key2, value, isStrictComparable(value)];
|
|
3005
3005
|
}
|
|
3006
3006
|
return result2;
|
|
3007
3007
|
}
|
|
@@ -3065,8 +3065,8 @@
|
|
|
3065
3065
|
};
|
|
3066
3066
|
}
|
|
3067
3067
|
function getView(start, end, transforms) {
|
|
3068
|
-
var index2 = -1,
|
|
3069
|
-
while (++index2 <
|
|
3068
|
+
var index2 = -1, length = transforms.length;
|
|
3069
|
+
while (++index2 < length) {
|
|
3070
3070
|
var data = transforms[index2], size2 = data.size;
|
|
3071
3071
|
switch (data.type) {
|
|
3072
3072
|
case "drop":
|
|
@@ -3091,23 +3091,23 @@
|
|
|
3091
3091
|
}
|
|
3092
3092
|
function hasPath(object, path, hasFunc) {
|
|
3093
3093
|
path = castPath(path, object);
|
|
3094
|
-
var index2 = -1,
|
|
3095
|
-
while (++index2 <
|
|
3094
|
+
var index2 = -1, length = path.length, result2 = false;
|
|
3095
|
+
while (++index2 < length) {
|
|
3096
3096
|
var key2 = toKey(path[index2]);
|
|
3097
3097
|
if (!(result2 = object != null && hasFunc(object, key2))) {
|
|
3098
3098
|
break;
|
|
3099
3099
|
}
|
|
3100
3100
|
object = object[key2];
|
|
3101
3101
|
}
|
|
3102
|
-
if (result2 || ++index2 !=
|
|
3102
|
+
if (result2 || ++index2 != length) {
|
|
3103
3103
|
return result2;
|
|
3104
3104
|
}
|
|
3105
|
-
|
|
3106
|
-
return !!
|
|
3105
|
+
length = object == null ? 0 : object.length;
|
|
3106
|
+
return !!length && isLength(length) && isIndex(key2, length) && (isArray(object) || isArguments(object));
|
|
3107
3107
|
}
|
|
3108
3108
|
function initCloneArray(array) {
|
|
3109
|
-
var
|
|
3110
|
-
if (
|
|
3109
|
+
var length = array.length, result2 = new array.constructor(length);
|
|
3110
|
+
if (length && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) {
|
|
3111
3111
|
result2.index = array.index;
|
|
3112
3112
|
result2.input = array.input;
|
|
3113
3113
|
}
|
|
@@ -3150,22 +3150,22 @@
|
|
|
3150
3150
|
}
|
|
3151
3151
|
}
|
|
3152
3152
|
function insertWrapDetails(source, details) {
|
|
3153
|
-
var
|
|
3154
|
-
if (!
|
|
3153
|
+
var length = details.length;
|
|
3154
|
+
if (!length) {
|
|
3155
3155
|
return source;
|
|
3156
3156
|
}
|
|
3157
|
-
var lastIndex =
|
|
3158
|
-
details[lastIndex] = (
|
|
3159
|
-
details = details.join(
|
|
3157
|
+
var lastIndex = length - 1;
|
|
3158
|
+
details[lastIndex] = (length > 1 ? "& " : "") + details[lastIndex];
|
|
3159
|
+
details = details.join(length > 2 ? ", " : " ");
|
|
3160
3160
|
return source.replace(reWrapComment, "{\n/* [wrapped with " + details + "] */\n");
|
|
3161
3161
|
}
|
|
3162
3162
|
function isFlattenable(value) {
|
|
3163
3163
|
return isArray(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]);
|
|
3164
3164
|
}
|
|
3165
|
-
function isIndex(value,
|
|
3165
|
+
function isIndex(value, length) {
|
|
3166
3166
|
var type = typeof value;
|
|
3167
|
-
|
|
3168
|
-
return !!
|
|
3167
|
+
length = length == null ? MAX_SAFE_INTEGER : length;
|
|
3168
|
+
return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
|
|
3169
3169
|
}
|
|
3170
3170
|
function isIterateeCall(value, index2, object) {
|
|
3171
3171
|
if (!isObject(object)) {
|
|
@@ -3282,8 +3282,8 @@
|
|
|
3282
3282
|
function overRest(func, start, transform2) {
|
|
3283
3283
|
start = nativeMax(start === undefined2 ? func.length - 1 : start, 0);
|
|
3284
3284
|
return function() {
|
|
3285
|
-
var args = arguments, index2 = -1,
|
|
3286
|
-
while (++index2 <
|
|
3285
|
+
var args = arguments, index2 = -1, length = nativeMax(args.length - start, 0), array = Array2(length);
|
|
3286
|
+
while (++index2 < length) {
|
|
3287
3287
|
array[index2] = args[start + index2];
|
|
3288
3288
|
}
|
|
3289
3289
|
index2 = -1;
|
|
@@ -3299,10 +3299,10 @@
|
|
|
3299
3299
|
return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1));
|
|
3300
3300
|
}
|
|
3301
3301
|
function reorder(array, indexes) {
|
|
3302
|
-
var arrLength = array.length,
|
|
3303
|
-
while (
|
|
3304
|
-
var index2 = indexes[
|
|
3305
|
-
array[
|
|
3302
|
+
var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array);
|
|
3303
|
+
while (length--) {
|
|
3304
|
+
var index2 = indexes[length];
|
|
3305
|
+
array[length] = isIndex(index2, arrLength) ? oldArray[index2] : undefined2;
|
|
3306
3306
|
}
|
|
3307
3307
|
return array;
|
|
3308
3308
|
}
|
|
@@ -3340,8 +3340,8 @@
|
|
|
3340
3340
|
};
|
|
3341
3341
|
}
|
|
3342
3342
|
function shuffleSelf(array, size2) {
|
|
3343
|
-
var index2 = -1,
|
|
3344
|
-
size2 = size2 === undefined2 ?
|
|
3343
|
+
var index2 = -1, length = array.length, lastIndex = length - 1;
|
|
3344
|
+
size2 = size2 === undefined2 ? length : size2;
|
|
3345
3345
|
while (++index2 < size2) {
|
|
3346
3346
|
var rand = baseRandom(index2, lastIndex), value = array[rand];
|
|
3347
3347
|
array[rand] = array[index2];
|
|
@@ -3405,19 +3405,19 @@
|
|
|
3405
3405
|
} else {
|
|
3406
3406
|
size2 = nativeMax(toInteger(size2), 0);
|
|
3407
3407
|
}
|
|
3408
|
-
var
|
|
3409
|
-
if (!
|
|
3408
|
+
var length = array == null ? 0 : array.length;
|
|
3409
|
+
if (!length || size2 < 1) {
|
|
3410
3410
|
return [];
|
|
3411
3411
|
}
|
|
3412
|
-
var index2 = 0, resIndex = 0, result2 = Array2(nativeCeil(
|
|
3413
|
-
while (index2 <
|
|
3412
|
+
var index2 = 0, resIndex = 0, result2 = Array2(nativeCeil(length / size2));
|
|
3413
|
+
while (index2 < length) {
|
|
3414
3414
|
result2[resIndex++] = baseSlice(array, index2, index2 += size2);
|
|
3415
3415
|
}
|
|
3416
3416
|
return result2;
|
|
3417
3417
|
}
|
|
3418
3418
|
function compact(array) {
|
|
3419
|
-
var index2 = -1,
|
|
3420
|
-
while (++index2 <
|
|
3419
|
+
var index2 = -1, length = array == null ? 0 : array.length, resIndex = 0, result2 = [];
|
|
3420
|
+
while (++index2 < length) {
|
|
3421
3421
|
var value = array[index2];
|
|
3422
3422
|
if (value) {
|
|
3423
3423
|
result2[resIndex++] = value;
|
|
@@ -3426,11 +3426,11 @@
|
|
|
3426
3426
|
return result2;
|
|
3427
3427
|
}
|
|
3428
3428
|
function concat() {
|
|
3429
|
-
var
|
|
3430
|
-
if (!
|
|
3429
|
+
var length = arguments.length;
|
|
3430
|
+
if (!length) {
|
|
3431
3431
|
return [];
|
|
3432
3432
|
}
|
|
3433
|
-
var args = Array2(
|
|
3433
|
+
var args = Array2(length - 1), array = arguments[0], index2 = length;
|
|
3434
3434
|
while (index2--) {
|
|
3435
3435
|
args[index2 - 1] = arguments[index2];
|
|
3436
3436
|
}
|
|
@@ -3454,20 +3454,20 @@
|
|
|
3454
3454
|
return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), undefined2, comparator) : [];
|
|
3455
3455
|
});
|
|
3456
3456
|
function drop(array, n, guard) {
|
|
3457
|
-
var
|
|
3458
|
-
if (!
|
|
3457
|
+
var length = array == null ? 0 : array.length;
|
|
3458
|
+
if (!length) {
|
|
3459
3459
|
return [];
|
|
3460
3460
|
}
|
|
3461
3461
|
n = guard || n === undefined2 ? 1 : toInteger(n);
|
|
3462
|
-
return baseSlice(array, n < 0 ? 0 : n,
|
|
3462
|
+
return baseSlice(array, n < 0 ? 0 : n, length);
|
|
3463
3463
|
}
|
|
3464
3464
|
function dropRight(array, n, guard) {
|
|
3465
|
-
var
|
|
3466
|
-
if (!
|
|
3465
|
+
var length = array == null ? 0 : array.length;
|
|
3466
|
+
if (!length) {
|
|
3467
3467
|
return [];
|
|
3468
3468
|
}
|
|
3469
3469
|
n = guard || n === undefined2 ? 1 : toInteger(n);
|
|
3470
|
-
n =
|
|
3470
|
+
n = length - n;
|
|
3471
3471
|
return baseSlice(array, 0, n < 0 ? 0 : n);
|
|
3472
3472
|
}
|
|
3473
3473
|
function dropRightWhile(array, predicate) {
|
|
@@ -3477,58 +3477,58 @@
|
|
|
3477
3477
|
return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true) : [];
|
|
3478
3478
|
}
|
|
3479
3479
|
function fill(array, value, start, end) {
|
|
3480
|
-
var
|
|
3481
|
-
if (!
|
|
3480
|
+
var length = array == null ? 0 : array.length;
|
|
3481
|
+
if (!length) {
|
|
3482
3482
|
return [];
|
|
3483
3483
|
}
|
|
3484
3484
|
if (start && typeof start != "number" && isIterateeCall(array, value, start)) {
|
|
3485
3485
|
start = 0;
|
|
3486
|
-
end =
|
|
3486
|
+
end = length;
|
|
3487
3487
|
}
|
|
3488
3488
|
return baseFill(array, value, start, end);
|
|
3489
3489
|
}
|
|
3490
3490
|
function findIndex(array, predicate, fromIndex) {
|
|
3491
|
-
var
|
|
3492
|
-
if (!
|
|
3491
|
+
var length = array == null ? 0 : array.length;
|
|
3492
|
+
if (!length) {
|
|
3493
3493
|
return -1;
|
|
3494
3494
|
}
|
|
3495
3495
|
var index2 = fromIndex == null ? 0 : toInteger(fromIndex);
|
|
3496
3496
|
if (index2 < 0) {
|
|
3497
|
-
index2 = nativeMax(
|
|
3497
|
+
index2 = nativeMax(length + index2, 0);
|
|
3498
3498
|
}
|
|
3499
3499
|
return baseFindIndex(array, getIteratee(predicate, 3), index2);
|
|
3500
3500
|
}
|
|
3501
3501
|
function findLastIndex(array, predicate, fromIndex) {
|
|
3502
|
-
var
|
|
3503
|
-
if (!
|
|
3502
|
+
var length = array == null ? 0 : array.length;
|
|
3503
|
+
if (!length) {
|
|
3504
3504
|
return -1;
|
|
3505
3505
|
}
|
|
3506
|
-
var index2 =
|
|
3506
|
+
var index2 = length - 1;
|
|
3507
3507
|
if (fromIndex !== undefined2) {
|
|
3508
3508
|
index2 = toInteger(fromIndex);
|
|
3509
|
-
index2 = fromIndex < 0 ? nativeMax(
|
|
3509
|
+
index2 = fromIndex < 0 ? nativeMax(length + index2, 0) : nativeMin(index2, length - 1);
|
|
3510
3510
|
}
|
|
3511
3511
|
return baseFindIndex(array, getIteratee(predicate, 3), index2, true);
|
|
3512
3512
|
}
|
|
3513
3513
|
function flatten(array) {
|
|
3514
|
-
var
|
|
3515
|
-
return
|
|
3514
|
+
var length = array == null ? 0 : array.length;
|
|
3515
|
+
return length ? baseFlatten(array, 1) : [];
|
|
3516
3516
|
}
|
|
3517
3517
|
function flattenDeep(array) {
|
|
3518
|
-
var
|
|
3519
|
-
return
|
|
3518
|
+
var length = array == null ? 0 : array.length;
|
|
3519
|
+
return length ? baseFlatten(array, INFINITY) : [];
|
|
3520
3520
|
}
|
|
3521
3521
|
function flattenDepth(array, depth) {
|
|
3522
|
-
var
|
|
3523
|
-
if (!
|
|
3522
|
+
var length = array == null ? 0 : array.length;
|
|
3523
|
+
if (!length) {
|
|
3524
3524
|
return [];
|
|
3525
3525
|
}
|
|
3526
3526
|
depth = depth === undefined2 ? 1 : toInteger(depth);
|
|
3527
3527
|
return baseFlatten(array, depth);
|
|
3528
3528
|
}
|
|
3529
3529
|
function fromPairs(pairs) {
|
|
3530
|
-
var index2 = -1,
|
|
3531
|
-
while (++index2 <
|
|
3530
|
+
var index2 = -1, length = pairs == null ? 0 : pairs.length, result2 = {};
|
|
3531
|
+
while (++index2 < length) {
|
|
3532
3532
|
var pair = pairs[index2];
|
|
3533
3533
|
baseAssignValue(result2, pair[0], pair[1]);
|
|
3534
3534
|
}
|
|
@@ -3538,19 +3538,19 @@
|
|
|
3538
3538
|
return array && array.length ? array[0] : undefined2;
|
|
3539
3539
|
}
|
|
3540
3540
|
function indexOf(array, value, fromIndex) {
|
|
3541
|
-
var
|
|
3542
|
-
if (!
|
|
3541
|
+
var length = array == null ? 0 : array.length;
|
|
3542
|
+
if (!length) {
|
|
3543
3543
|
return -1;
|
|
3544
3544
|
}
|
|
3545
3545
|
var index2 = fromIndex == null ? 0 : toInteger(fromIndex);
|
|
3546
3546
|
if (index2 < 0) {
|
|
3547
|
-
index2 = nativeMax(
|
|
3547
|
+
index2 = nativeMax(length + index2, 0);
|
|
3548
3548
|
}
|
|
3549
3549
|
return baseIndexOf(array, value, index2);
|
|
3550
3550
|
}
|
|
3551
3551
|
function initial(array) {
|
|
3552
|
-
var
|
|
3553
|
-
return
|
|
3552
|
+
var length = array == null ? 0 : array.length;
|
|
3553
|
+
return length ? baseSlice(array, 0, -1) : [];
|
|
3554
3554
|
}
|
|
3555
3555
|
var intersection = baseRest(function(arrays) {
|
|
3556
3556
|
var mapped = arrayMap(arrays, castArrayLikeObject);
|
|
@@ -3577,18 +3577,18 @@
|
|
|
3577
3577
|
return array == null ? "" : nativeJoin.call(array, separator);
|
|
3578
3578
|
}
|
|
3579
3579
|
function last(array) {
|
|
3580
|
-
var
|
|
3581
|
-
return
|
|
3580
|
+
var length = array == null ? 0 : array.length;
|
|
3581
|
+
return length ? array[length - 1] : undefined2;
|
|
3582
3582
|
}
|
|
3583
3583
|
function lastIndexOf(array, value, fromIndex) {
|
|
3584
|
-
var
|
|
3585
|
-
if (!
|
|
3584
|
+
var length = array == null ? 0 : array.length;
|
|
3585
|
+
if (!length) {
|
|
3586
3586
|
return -1;
|
|
3587
3587
|
}
|
|
3588
|
-
var index2 =
|
|
3588
|
+
var index2 = length;
|
|
3589
3589
|
if (fromIndex !== undefined2) {
|
|
3590
3590
|
index2 = toInteger(fromIndex);
|
|
3591
|
-
index2 = index2 < 0 ? nativeMax(
|
|
3591
|
+
index2 = index2 < 0 ? nativeMax(length + index2, 0) : nativeMin(index2, length - 1);
|
|
3592
3592
|
}
|
|
3593
3593
|
return value === value ? strictLastIndexOf(array, value, index2) : baseFindIndex(array, baseIsNaN, index2, true);
|
|
3594
3594
|
}
|
|
@@ -3606,9 +3606,9 @@
|
|
|
3606
3606
|
return array && array.length && values2 && values2.length ? basePullAll(array, values2, undefined2, comparator) : array;
|
|
3607
3607
|
}
|
|
3608
3608
|
var pullAt = flatRest(function(array, indexes) {
|
|
3609
|
-
var
|
|
3609
|
+
var length = array == null ? 0 : array.length, result2 = baseAt(array, indexes);
|
|
3610
3610
|
basePullAt(array, arrayMap(indexes, function(index2) {
|
|
3611
|
-
return isIndex(index2,
|
|
3611
|
+
return isIndex(index2, length) ? +index2 : index2;
|
|
3612
3612
|
}).sort(compareAscending));
|
|
3613
3613
|
return result2;
|
|
3614
3614
|
});
|
|
@@ -3617,9 +3617,9 @@
|
|
|
3617
3617
|
if (!(array && array.length)) {
|
|
3618
3618
|
return result2;
|
|
3619
3619
|
}
|
|
3620
|
-
var index2 = -1, indexes = [],
|
|
3620
|
+
var index2 = -1, indexes = [], length = array.length;
|
|
3621
3621
|
predicate = getIteratee(predicate, 3);
|
|
3622
|
-
while (++index2 <
|
|
3622
|
+
while (++index2 < length) {
|
|
3623
3623
|
var value = array[index2];
|
|
3624
3624
|
if (predicate(value, index2, array)) {
|
|
3625
3625
|
result2.push(value);
|
|
@@ -3633,16 +3633,16 @@
|
|
|
3633
3633
|
return array == null ? array : nativeReverse.call(array);
|
|
3634
3634
|
}
|
|
3635
3635
|
function slice(array, start, end) {
|
|
3636
|
-
var
|
|
3637
|
-
if (!
|
|
3636
|
+
var length = array == null ? 0 : array.length;
|
|
3637
|
+
if (!length) {
|
|
3638
3638
|
return [];
|
|
3639
3639
|
}
|
|
3640
3640
|
if (end && typeof end != "number" && isIterateeCall(array, start, end)) {
|
|
3641
3641
|
start = 0;
|
|
3642
|
-
end =
|
|
3642
|
+
end = length;
|
|
3643
3643
|
} else {
|
|
3644
3644
|
start = start == null ? 0 : toInteger(start);
|
|
3645
|
-
end = end === undefined2 ?
|
|
3645
|
+
end = end === undefined2 ? length : toInteger(end);
|
|
3646
3646
|
}
|
|
3647
3647
|
return baseSlice(array, start, end);
|
|
3648
3648
|
}
|
|
@@ -3653,10 +3653,10 @@
|
|
|
3653
3653
|
return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2));
|
|
3654
3654
|
}
|
|
3655
3655
|
function sortedIndexOf(array, value) {
|
|
3656
|
-
var
|
|
3657
|
-
if (
|
|
3656
|
+
var length = array == null ? 0 : array.length;
|
|
3657
|
+
if (length) {
|
|
3658
3658
|
var index2 = baseSortedIndex(array, value);
|
|
3659
|
-
if (index2 <
|
|
3659
|
+
if (index2 < length && eq(array[index2], value)) {
|
|
3660
3660
|
return index2;
|
|
3661
3661
|
}
|
|
3662
3662
|
}
|
|
@@ -3669,8 +3669,8 @@
|
|
|
3669
3669
|
return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2), true);
|
|
3670
3670
|
}
|
|
3671
3671
|
function sortedLastIndexOf(array, value) {
|
|
3672
|
-
var
|
|
3673
|
-
if (
|
|
3672
|
+
var length = array == null ? 0 : array.length;
|
|
3673
|
+
if (length) {
|
|
3674
3674
|
var index2 = baseSortedIndex(array, value, true) - 1;
|
|
3675
3675
|
if (eq(array[index2], value)) {
|
|
3676
3676
|
return index2;
|
|
@@ -3685,8 +3685,8 @@
|
|
|
3685
3685
|
return array && array.length ? baseSortedUniq(array, getIteratee(iteratee2, 2)) : [];
|
|
3686
3686
|
}
|
|
3687
3687
|
function tail(array) {
|
|
3688
|
-
var
|
|
3689
|
-
return
|
|
3688
|
+
var length = array == null ? 0 : array.length;
|
|
3689
|
+
return length ? baseSlice(array, 1, length) : [];
|
|
3690
3690
|
}
|
|
3691
3691
|
function take(array, n, guard) {
|
|
3692
3692
|
if (!(array && array.length)) {
|
|
@@ -3696,13 +3696,13 @@
|
|
|
3696
3696
|
return baseSlice(array, 0, n < 0 ? 0 : n);
|
|
3697
3697
|
}
|
|
3698
3698
|
function takeRight(array, n, guard) {
|
|
3699
|
-
var
|
|
3700
|
-
if (!
|
|
3699
|
+
var length = array == null ? 0 : array.length;
|
|
3700
|
+
if (!length) {
|
|
3701
3701
|
return [];
|
|
3702
3702
|
}
|
|
3703
3703
|
n = guard || n === undefined2 ? 1 : toInteger(n);
|
|
3704
|
-
n =
|
|
3705
|
-
return baseSlice(array, n < 0 ? 0 : n,
|
|
3704
|
+
n = length - n;
|
|
3705
|
+
return baseSlice(array, n < 0 ? 0 : n, length);
|
|
3706
3706
|
}
|
|
3707
3707
|
function takeRightWhile(array, predicate) {
|
|
3708
3708
|
return array && array.length ? baseWhile(array, getIteratee(predicate, 3), false, true) : [];
|
|
@@ -3739,14 +3739,14 @@
|
|
|
3739
3739
|
if (!(array && array.length)) {
|
|
3740
3740
|
return [];
|
|
3741
3741
|
}
|
|
3742
|
-
var
|
|
3742
|
+
var length = 0;
|
|
3743
3743
|
array = arrayFilter(array, function(group) {
|
|
3744
3744
|
if (isArrayLikeObject(group)) {
|
|
3745
|
-
|
|
3745
|
+
length = nativeMax(group.length, length);
|
|
3746
3746
|
return true;
|
|
3747
3747
|
}
|
|
3748
3748
|
});
|
|
3749
|
-
return baseTimes(
|
|
3749
|
+
return baseTimes(length, function(index2) {
|
|
3750
3750
|
return arrayMap(array, baseProperty(index2));
|
|
3751
3751
|
});
|
|
3752
3752
|
}
|
|
@@ -3788,7 +3788,7 @@
|
|
|
3788
3788
|
return baseZipObject(props || [], values2 || [], baseSet);
|
|
3789
3789
|
}
|
|
3790
3790
|
var zipWith = baseRest(function(arrays) {
|
|
3791
|
-
var
|
|
3791
|
+
var length = arrays.length, iteratee2 = length > 1 ? arrays[length - 1] : undefined2;
|
|
3792
3792
|
iteratee2 = typeof iteratee2 == "function" ? (arrays.pop(), iteratee2) : undefined2;
|
|
3793
3793
|
return unzipWith(arrays, iteratee2);
|
|
3794
3794
|
});
|
|
@@ -3805,20 +3805,20 @@
|
|
|
3805
3805
|
return interceptor(value);
|
|
3806
3806
|
}
|
|
3807
3807
|
var wrapperAt = flatRest(function(paths) {
|
|
3808
|
-
var
|
|
3808
|
+
var length = paths.length, start = length ? paths[0] : 0, value = this.__wrapped__, interceptor = function(object) {
|
|
3809
3809
|
return baseAt(object, paths);
|
|
3810
3810
|
};
|
|
3811
|
-
if (
|
|
3811
|
+
if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) {
|
|
3812
3812
|
return this.thru(interceptor);
|
|
3813
3813
|
}
|
|
3814
|
-
value = value.slice(start, +start + (
|
|
3814
|
+
value = value.slice(start, +start + (length ? 1 : 0));
|
|
3815
3815
|
value.__actions__.push({
|
|
3816
3816
|
"func": thru,
|
|
3817
3817
|
"args": [interceptor],
|
|
3818
3818
|
"thisArg": undefined2
|
|
3819
3819
|
});
|
|
3820
3820
|
return new LodashWrapper(value, this.__chain__).thru(function(array) {
|
|
3821
|
-
if (
|
|
3821
|
+
if (length && !array.length) {
|
|
3822
3822
|
array.push(undefined2);
|
|
3823
3823
|
}
|
|
3824
3824
|
return array;
|
|
@@ -3925,11 +3925,11 @@
|
|
|
3925
3925
|
function includes(collection, value, fromIndex, guard) {
|
|
3926
3926
|
collection = isArrayLike(collection) ? collection : values(collection);
|
|
3927
3927
|
fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0;
|
|
3928
|
-
var
|
|
3928
|
+
var length = collection.length;
|
|
3929
3929
|
if (fromIndex < 0) {
|
|
3930
|
-
fromIndex = nativeMax(
|
|
3930
|
+
fromIndex = nativeMax(length + fromIndex, 0);
|
|
3931
3931
|
}
|
|
3932
|
-
return isString(collection) ? fromIndex <=
|
|
3932
|
+
return isString(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1;
|
|
3933
3933
|
}
|
|
3934
3934
|
var invokeMap = baseRest(function(collection, path, args) {
|
|
3935
3935
|
var index2 = -1, isFunc = typeof path == "function", result2 = isArrayLike(collection) ? Array2(collection.length) : [];
|
|
@@ -4016,10 +4016,10 @@
|
|
|
4016
4016
|
if (collection == null) {
|
|
4017
4017
|
return [];
|
|
4018
4018
|
}
|
|
4019
|
-
var
|
|
4020
|
-
if (
|
|
4019
|
+
var length = iteratees.length;
|
|
4020
|
+
if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) {
|
|
4021
4021
|
iteratees = [];
|
|
4022
|
-
} else if (
|
|
4022
|
+
} else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) {
|
|
4023
4023
|
iteratees = [iteratees[0]];
|
|
4024
4024
|
}
|
|
4025
4025
|
return baseOrderBy(collection, baseFlatten(iteratees, 1), []);
|
|
@@ -4220,8 +4220,8 @@
|
|
|
4220
4220
|
transforms = transforms.length == 1 && isArray(transforms[0]) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
|
|
4221
4221
|
var funcsLength = transforms.length;
|
|
4222
4222
|
return baseRest(function(args) {
|
|
4223
|
-
var index2 = -1,
|
|
4224
|
-
while (++index2 <
|
|
4223
|
+
var index2 = -1, length = nativeMin(args.length, funcsLength);
|
|
4224
|
+
while (++index2 < length) {
|
|
4225
4225
|
args[index2] = transforms[index2].call(this, args[index2]);
|
|
4226
4226
|
}
|
|
4227
4227
|
return apply(func, this, args);
|
|
@@ -4538,12 +4538,12 @@
|
|
|
4538
4538
|
var defaults = baseRest(function(object, sources) {
|
|
4539
4539
|
object = Object2(object);
|
|
4540
4540
|
var index2 = -1;
|
|
4541
|
-
var
|
|
4542
|
-
var guard =
|
|
4541
|
+
var length = sources.length;
|
|
4542
|
+
var guard = length > 2 ? sources[2] : undefined2;
|
|
4543
4543
|
if (guard && isIterateeCall(sources[0], sources[1], guard)) {
|
|
4544
|
-
|
|
4544
|
+
length = 1;
|
|
4545
4545
|
}
|
|
4546
|
-
while (++index2 <
|
|
4546
|
+
while (++index2 < length) {
|
|
4547
4547
|
var source = sources[index2];
|
|
4548
4548
|
var props = keysIn(source);
|
|
4549
4549
|
var propsIndex = -1;
|
|
@@ -4656,9 +4656,9 @@
|
|
|
4656
4656
|
if (isDeep) {
|
|
4657
4657
|
result2 = baseClone(result2, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone);
|
|
4658
4658
|
}
|
|
4659
|
-
var
|
|
4660
|
-
while (
|
|
4661
|
-
baseUnset(result2, paths[
|
|
4659
|
+
var length = paths.length;
|
|
4660
|
+
while (length--) {
|
|
4661
|
+
baseUnset(result2, paths[length]);
|
|
4662
4662
|
}
|
|
4663
4663
|
return result2;
|
|
4664
4664
|
});
|
|
@@ -4682,15 +4682,15 @@
|
|
|
4682
4682
|
}
|
|
4683
4683
|
function result(object, path, defaultValue) {
|
|
4684
4684
|
path = castPath(path, object);
|
|
4685
|
-
var index2 = -1,
|
|
4686
|
-
if (!
|
|
4687
|
-
|
|
4685
|
+
var index2 = -1, length = path.length;
|
|
4686
|
+
if (!length) {
|
|
4687
|
+
length = 1;
|
|
4688
4688
|
object = undefined2;
|
|
4689
4689
|
}
|
|
4690
|
-
while (++index2 <
|
|
4690
|
+
while (++index2 < length) {
|
|
4691
4691
|
var value = object == null ? undefined2 : object[toKey(path[index2])];
|
|
4692
4692
|
if (value === undefined2) {
|
|
4693
|
-
index2 =
|
|
4693
|
+
index2 = length;
|
|
4694
4694
|
value = defaultValue;
|
|
4695
4695
|
}
|
|
4696
4696
|
object = isFunction(value) ? value.call(object) : value;
|
|
@@ -4816,8 +4816,8 @@
|
|
|
4816
4816
|
function endsWith(string, target, position) {
|
|
4817
4817
|
string = toString(string);
|
|
4818
4818
|
target = baseToString(target);
|
|
4819
|
-
var
|
|
4820
|
-
position = position === undefined2 ?
|
|
4819
|
+
var length = string.length;
|
|
4820
|
+
position = position === undefined2 ? length : baseClamp(toInteger(position), 0, length);
|
|
4821
4821
|
var end = position;
|
|
4822
4822
|
position -= target.length;
|
|
4823
4823
|
return position >= 0 && string.slice(position, end) == target;
|
|
@@ -4837,27 +4837,27 @@
|
|
|
4837
4837
|
return result2 + (index2 ? " " : "") + word.toLowerCase();
|
|
4838
4838
|
});
|
|
4839
4839
|
var lowerFirst = createCaseFirst("toLowerCase");
|
|
4840
|
-
function pad(string,
|
|
4840
|
+
function pad(string, length, chars) {
|
|
4841
4841
|
string = toString(string);
|
|
4842
|
-
|
|
4843
|
-
var strLength =
|
|
4844
|
-
if (!
|
|
4842
|
+
length = toInteger(length);
|
|
4843
|
+
var strLength = length ? stringSize(string) : 0;
|
|
4844
|
+
if (!length || strLength >= length) {
|
|
4845
4845
|
return string;
|
|
4846
4846
|
}
|
|
4847
|
-
var mid = (
|
|
4847
|
+
var mid = (length - strLength) / 2;
|
|
4848
4848
|
return createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars);
|
|
4849
4849
|
}
|
|
4850
|
-
function padEnd(string,
|
|
4850
|
+
function padEnd(string, length, chars) {
|
|
4851
4851
|
string = toString(string);
|
|
4852
|
-
|
|
4853
|
-
var strLength =
|
|
4854
|
-
return
|
|
4852
|
+
length = toInteger(length);
|
|
4853
|
+
var strLength = length ? stringSize(string) : 0;
|
|
4854
|
+
return length && strLength < length ? string + createPadding(length - strLength, chars) : string;
|
|
4855
4855
|
}
|
|
4856
|
-
function padStart(string,
|
|
4856
|
+
function padStart(string, length, chars) {
|
|
4857
4857
|
string = toString(string);
|
|
4858
|
-
|
|
4859
|
-
var strLength =
|
|
4860
|
-
return
|
|
4858
|
+
length = toInteger(length);
|
|
4859
|
+
var strLength = length ? stringSize(string) : 0;
|
|
4860
|
+
return length && strLength < length ? createPadding(length - strLength, chars) + string : string;
|
|
4861
4861
|
}
|
|
4862
4862
|
function parseInt2(string, radix, guard) {
|
|
4863
4863
|
if (guard || radix == null) {
|
|
@@ -5002,10 +5002,10 @@
|
|
|
5002
5002
|
return castSlice(strSymbols, start).join("");
|
|
5003
5003
|
}
|
|
5004
5004
|
function truncate(string, options) {
|
|
5005
|
-
var
|
|
5005
|
+
var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION;
|
|
5006
5006
|
if (isObject(options)) {
|
|
5007
5007
|
var separator = "separator" in options ? options.separator : separator;
|
|
5008
|
-
|
|
5008
|
+
length = "length" in options ? toInteger(options.length) : length;
|
|
5009
5009
|
omission = "omission" in options ? baseToString(options.omission) : omission;
|
|
5010
5010
|
}
|
|
5011
5011
|
string = toString(string);
|
|
@@ -5014,10 +5014,10 @@
|
|
|
5014
5014
|
var strSymbols = stringToArray(string);
|
|
5015
5015
|
strLength = strSymbols.length;
|
|
5016
5016
|
}
|
|
5017
|
-
if (
|
|
5017
|
+
if (length >= strLength) {
|
|
5018
5018
|
return string;
|
|
5019
5019
|
}
|
|
5020
|
-
var end =
|
|
5020
|
+
var end = length - stringSize(omission);
|
|
5021
5021
|
if (end < 1) {
|
|
5022
5022
|
return omission;
|
|
5023
5023
|
}
|
|
@@ -5079,8 +5079,8 @@
|
|
|
5079
5079
|
return object;
|
|
5080
5080
|
});
|
|
5081
5081
|
function cond(pairs) {
|
|
5082
|
-
var
|
|
5083
|
-
pairs = !
|
|
5082
|
+
var length = pairs == null ? 0 : pairs.length, toIteratee = getIteratee();
|
|
5083
|
+
pairs = !length ? [] : arrayMap(pairs, function(pair) {
|
|
5084
5084
|
if (typeof pair[1] != "function") {
|
|
5085
5085
|
throw new TypeError2(FUNC_ERROR_TEXT);
|
|
5086
5086
|
}
|
|
@@ -5088,7 +5088,7 @@
|
|
|
5088
5088
|
});
|
|
5089
5089
|
return baseRest(function(args) {
|
|
5090
5090
|
var index2 = -1;
|
|
5091
|
-
while (++index2 <
|
|
5091
|
+
while (++index2 < length) {
|
|
5092
5092
|
var pair = pairs[index2];
|
|
5093
5093
|
if (apply(pair[0], this, args)) {
|
|
5094
5094
|
return apply(pair[1], this, args);
|
|
@@ -5205,10 +5205,10 @@
|
|
|
5205
5205
|
if (n < 1 || n > MAX_SAFE_INTEGER) {
|
|
5206
5206
|
return [];
|
|
5207
5207
|
}
|
|
5208
|
-
var index2 = MAX_ARRAY_LENGTH,
|
|
5208
|
+
var index2 = MAX_ARRAY_LENGTH, length = nativeMin(n, MAX_ARRAY_LENGTH);
|
|
5209
5209
|
iteratee2 = getIteratee(iteratee2);
|
|
5210
5210
|
n -= MAX_ARRAY_LENGTH;
|
|
5211
|
-
var result2 = baseTimes(
|
|
5211
|
+
var result2 = baseTimes(length, iteratee2);
|
|
5212
5212
|
while (++index2 < n) {
|
|
5213
5213
|
iteratee2(index2);
|
|
5214
5214
|
}
|
|
@@ -5905,19 +5905,19 @@
|
|
|
5905
5905
|
var array_slice = uncurryThis(Array.prototype.slice);
|
|
5906
5906
|
var array_reduce = uncurryThis(
|
|
5907
5907
|
Array.prototype.reduce || function(callback, basis) {
|
|
5908
|
-
var index2 = 0,
|
|
5908
|
+
var index2 = 0, length = this.length;
|
|
5909
5909
|
if (arguments.length === 1) {
|
|
5910
5910
|
do {
|
|
5911
5911
|
if (index2 in this) {
|
|
5912
5912
|
basis = this[index2++];
|
|
5913
5913
|
break;
|
|
5914
5914
|
}
|
|
5915
|
-
if (++index2 >=
|
|
5915
|
+
if (++index2 >= length) {
|
|
5916
5916
|
throw new TypeError();
|
|
5917
5917
|
}
|
|
5918
5918
|
} while (1);
|
|
5919
5919
|
}
|
|
5920
|
-
for (; index2 <
|
|
5920
|
+
for (; index2 < length; index2++) {
|
|
5921
5921
|
if (index2 in this) {
|
|
5922
5922
|
basis = callback(basis, this[index2], index2);
|
|
5923
5923
|
}
|
|
@@ -7058,6 +7058,7 @@
|
|
|
7058
7058
|
nullInput: false,
|
|
7059
7059
|
invalidEra: null,
|
|
7060
7060
|
invalidMonth: null,
|
|
7061
|
+
invalidOffset: null,
|
|
7061
7062
|
invalidFormat: false,
|
|
7062
7063
|
userInvalidated: false,
|
|
7063
7064
|
iso: false,
|
|
@@ -7088,23 +7089,26 @@
|
|
|
7088
7089
|
return false;
|
|
7089
7090
|
};
|
|
7090
7091
|
}
|
|
7091
|
-
function isValid(m) {
|
|
7092
|
-
|
|
7093
|
-
|
|
7092
|
+
function isValid$2(m) {
|
|
7093
|
+
var flags = null, parsedParts = false, isNowValid = m._d && !isNaN(m._d.getTime());
|
|
7094
|
+
if (isNowValid) {
|
|
7095
|
+
flags = getParsingFlags(m);
|
|
7096
|
+
parsedParts = some.call(flags.parsedDateParts, function(i) {
|
|
7094
7097
|
return i != null;
|
|
7095
|
-
})
|
|
7098
|
+
});
|
|
7099
|
+
isNowValid = flags.overflow < 0 && !flags.empty && !flags.invalidEra && !flags.invalidMonth && !flags.invalidOffset && !flags.invalidWeekday && !flags.weekdayMismatch && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || flags.meridiem && parsedParts);
|
|
7096
7100
|
if (m._strict) {
|
|
7097
7101
|
isNowValid = isNowValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === void 0;
|
|
7098
7102
|
}
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
|
|
7103
|
-
|
|
7103
|
+
}
|
|
7104
|
+
if (Object.isFrozen == null || !Object.isFrozen(m)) {
|
|
7105
|
+
m._isValid = isNowValid;
|
|
7106
|
+
} else {
|
|
7107
|
+
return isNowValid;
|
|
7104
7108
|
}
|
|
7105
7109
|
return m._isValid;
|
|
7106
7110
|
}
|
|
7107
|
-
function createInvalid(flags) {
|
|
7111
|
+
function createInvalid$1(flags) {
|
|
7108
7112
|
var m = createUTC(NaN);
|
|
7109
7113
|
if (flags != null) {
|
|
7110
7114
|
extend(getParsingFlags(m), flags);
|
|
@@ -7214,7 +7218,7 @@
|
|
|
7214
7218
|
hooks2.deprecationHandler(name, msg);
|
|
7215
7219
|
}
|
|
7216
7220
|
if (!deprecations[name]) {
|
|
7217
|
-
warn(msg);
|
|
7221
|
+
warn(msg + "\n" + new Error().stack);
|
|
7218
7222
|
deprecations[name] = true;
|
|
7219
7223
|
}
|
|
7220
7224
|
}
|
|
@@ -7223,81 +7227,106 @@
|
|
|
7223
7227
|
function isFunction(input) {
|
|
7224
7228
|
return typeof Function !== "undefined" && input instanceof Function || Object.prototype.toString.call(input) === "[object Function]";
|
|
7225
7229
|
}
|
|
7226
|
-
|
|
7227
|
-
|
|
7228
|
-
|
|
7229
|
-
|
|
7230
|
-
|
|
7231
|
-
|
|
7232
|
-
|
|
7233
|
-
|
|
7234
|
-
|
|
7235
|
-
|
|
7236
|
-
|
|
7237
|
-
|
|
7238
|
-
|
|
7239
|
-
|
|
7240
|
-
|
|
7241
|
-
|
|
7230
|
+
var aliases = {
|
|
7231
|
+
D: "date",
|
|
7232
|
+
dates: "date",
|
|
7233
|
+
date: "date",
|
|
7234
|
+
d: "day",
|
|
7235
|
+
days: "day",
|
|
7236
|
+
day: "day",
|
|
7237
|
+
e: "weekday",
|
|
7238
|
+
weekdays: "weekday",
|
|
7239
|
+
weekday: "weekday",
|
|
7240
|
+
E: "isoWeekday",
|
|
7241
|
+
isoweekdays: "isoWeekday",
|
|
7242
|
+
isoweekday: "isoWeekday",
|
|
7243
|
+
DDD: "dayOfYear",
|
|
7244
|
+
dayofyears: "dayOfYear",
|
|
7245
|
+
dayofyear: "dayOfYear",
|
|
7246
|
+
h: "hour",
|
|
7247
|
+
hours: "hour",
|
|
7248
|
+
hour: "hour",
|
|
7249
|
+
ms: "millisecond",
|
|
7250
|
+
milliseconds: "millisecond",
|
|
7251
|
+
millisecond: "millisecond",
|
|
7252
|
+
m: "minute",
|
|
7253
|
+
minutes: "minute",
|
|
7254
|
+
minute: "minute",
|
|
7255
|
+
M: "month",
|
|
7256
|
+
months: "month",
|
|
7257
|
+
month: "month",
|
|
7258
|
+
Q: "quarter",
|
|
7259
|
+
quarters: "quarter",
|
|
7260
|
+
quarter: "quarter",
|
|
7261
|
+
s: "second",
|
|
7262
|
+
seconds: "second",
|
|
7263
|
+
second: "second",
|
|
7264
|
+
gg: "weekYear",
|
|
7265
|
+
weekyears: "weekYear",
|
|
7266
|
+
weekyear: "weekYear",
|
|
7267
|
+
GG: "isoWeekYear",
|
|
7268
|
+
isoweekyears: "isoWeekYear",
|
|
7269
|
+
isoweekyear: "isoWeekYear",
|
|
7270
|
+
w: "week",
|
|
7271
|
+
weeks: "week",
|
|
7272
|
+
week: "week",
|
|
7273
|
+
W: "isoWeek",
|
|
7274
|
+
isoweeks: "isoWeek",
|
|
7275
|
+
isoweek: "isoWeek",
|
|
7276
|
+
y: "year",
|
|
7277
|
+
years: "year",
|
|
7278
|
+
year: "year"
|
|
7279
|
+
};
|
|
7280
|
+
function normalizeUnits(units) {
|
|
7281
|
+
return typeof units === "string" ? aliases[units] || aliases[units.toLowerCase()] : void 0;
|
|
7242
7282
|
}
|
|
7243
|
-
function
|
|
7244
|
-
var
|
|
7245
|
-
for (prop in
|
|
7246
|
-
if (hasOwnProp(
|
|
7247
|
-
|
|
7248
|
-
|
|
7249
|
-
|
|
7250
|
-
extend(res[prop], childConfig[prop]);
|
|
7251
|
-
} else if (childConfig[prop] != null) {
|
|
7252
|
-
res[prop] = childConfig[prop];
|
|
7253
|
-
} else {
|
|
7254
|
-
delete res[prop];
|
|
7283
|
+
function normalizeObjectUnits(inputObject) {
|
|
7284
|
+
var normalizedInput = {}, normalizedProp, prop;
|
|
7285
|
+
for (prop in inputObject) {
|
|
7286
|
+
if (hasOwnProp(inputObject, prop)) {
|
|
7287
|
+
normalizedProp = normalizeUnits(prop);
|
|
7288
|
+
if (normalizedProp) {
|
|
7289
|
+
normalizedInput[normalizedProp] = inputObject[prop];
|
|
7255
7290
|
}
|
|
7256
7291
|
}
|
|
7257
7292
|
}
|
|
7258
|
-
|
|
7259
|
-
if (hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop])) {
|
|
7260
|
-
res[prop] = extend({}, res[prop]);
|
|
7261
|
-
}
|
|
7262
|
-
}
|
|
7263
|
-
return res;
|
|
7264
|
-
}
|
|
7265
|
-
function Locale(config) {
|
|
7266
|
-
if (config != null) {
|
|
7267
|
-
this.set(config);
|
|
7268
|
-
}
|
|
7269
|
-
}
|
|
7270
|
-
var keys;
|
|
7271
|
-
if (Object.keys) {
|
|
7272
|
-
keys = Object.keys;
|
|
7273
|
-
} else {
|
|
7274
|
-
keys = function(obj) {
|
|
7275
|
-
var i, res = [];
|
|
7276
|
-
for (i in obj) {
|
|
7277
|
-
if (hasOwnProp(obj, i)) {
|
|
7278
|
-
res.push(i);
|
|
7279
|
-
}
|
|
7280
|
-
}
|
|
7281
|
-
return res;
|
|
7282
|
-
};
|
|
7293
|
+
return normalizedInput;
|
|
7283
7294
|
}
|
|
7284
|
-
var
|
|
7285
|
-
|
|
7286
|
-
|
|
7287
|
-
|
|
7288
|
-
|
|
7289
|
-
|
|
7290
|
-
|
|
7295
|
+
var priorities = {
|
|
7296
|
+
date: 9,
|
|
7297
|
+
day: 11,
|
|
7298
|
+
weekday: 11,
|
|
7299
|
+
isoWeekday: 11,
|
|
7300
|
+
dayOfYear: 4,
|
|
7301
|
+
hour: 13,
|
|
7302
|
+
millisecond: 16,
|
|
7303
|
+
minute: 14,
|
|
7304
|
+
month: 8,
|
|
7305
|
+
quarter: 7,
|
|
7306
|
+
second: 15,
|
|
7307
|
+
weekYear: 1,
|
|
7308
|
+
isoWeekYear: 1,
|
|
7309
|
+
week: 5,
|
|
7310
|
+
isoWeek: 5,
|
|
7311
|
+
year: 1
|
|
7291
7312
|
};
|
|
7292
|
-
function
|
|
7293
|
-
var
|
|
7294
|
-
|
|
7313
|
+
function getPrioritizedUnits(unitsObj) {
|
|
7314
|
+
var units = [], u;
|
|
7315
|
+
for (u in unitsObj) {
|
|
7316
|
+
if (hasOwnProp(unitsObj, u)) {
|
|
7317
|
+
units.push({ unit: u, priority: priorities[u] });
|
|
7318
|
+
}
|
|
7319
|
+
}
|
|
7320
|
+
units.sort(function(a, b) {
|
|
7321
|
+
return a.priority - b.priority;
|
|
7322
|
+
});
|
|
7323
|
+
return units;
|
|
7295
7324
|
}
|
|
7296
7325
|
function zeroFill(number, targetLength, forceSign) {
|
|
7297
7326
|
var absNumber = "" + Math.abs(number), zerosToFill = targetLength - absNumber.length, sign2 = number >= 0;
|
|
7298
7327
|
return (sign2 ? forceSign ? "+" : "" : "-") + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber;
|
|
7299
7328
|
}
|
|
7300
|
-
var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, formatFunctions = {}, formatTokenFunctions = {};
|
|
7329
|
+
var formattingTokens = /(\[[^\[]*\])|(\\e)|(\\)?(eHHmm|[Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, formatFunctions = {}, formatTokenFunctions = {};
|
|
7301
7330
|
function addFormatToken(token2, padded, ordinal2, callback) {
|
|
7302
7331
|
var func = callback;
|
|
7303
7332
|
if (typeof callback === "string") {
|
|
@@ -7329,8 +7358,8 @@
|
|
|
7329
7358
|
return input.replace(/\\/g, "");
|
|
7330
7359
|
}
|
|
7331
7360
|
function makeFormatFunction(format2) {
|
|
7332
|
-
var array = format2.match(formattingTokens), i,
|
|
7333
|
-
for (i = 0,
|
|
7361
|
+
var array = format2.match(formattingTokens), i, length;
|
|
7362
|
+
for (i = 0, length = array.length; i < length; i++) {
|
|
7334
7363
|
if (formatTokenFunctions[array[i]]) {
|
|
7335
7364
|
array[i] = formatTokenFunctions[array[i]];
|
|
7336
7365
|
} else {
|
|
@@ -7339,7 +7368,7 @@
|
|
|
7339
7368
|
}
|
|
7340
7369
|
return function(mom) {
|
|
7341
7370
|
var output = "", i2;
|
|
7342
|
-
for (i2 = 0; i2 <
|
|
7371
|
+
for (i2 = 0; i2 < length; i2++) {
|
|
7343
7372
|
output += isFunction(array[i2]) ? array[i2].call(mom, format2) : array[i2];
|
|
7344
7373
|
}
|
|
7345
7374
|
return output;
|
|
@@ -7350,8 +7379,11 @@
|
|
|
7350
7379
|
return m.localeData().invalidDate();
|
|
7351
7380
|
}
|
|
7352
7381
|
format2 = expandFormat(format2, m.localeData());
|
|
7353
|
-
|
|
7354
|
-
|
|
7382
|
+
var cacheKey = "$" + format2;
|
|
7383
|
+
if (!hasOwnProp(formatFunctions, cacheKey)) {
|
|
7384
|
+
formatFunctions[cacheKey] = makeFormatFunction(format2);
|
|
7385
|
+
}
|
|
7386
|
+
return formatFunctions[cacheKey](m);
|
|
7355
7387
|
}
|
|
7356
7388
|
function expandFormat(format2, locale2) {
|
|
7357
7389
|
var i = 5;
|
|
@@ -7369,99 +7401,31 @@
|
|
|
7369
7401
|
}
|
|
7370
7402
|
return format2;
|
|
7371
7403
|
}
|
|
7372
|
-
var
|
|
7373
|
-
|
|
7374
|
-
|
|
7375
|
-
|
|
7376
|
-
|
|
7377
|
-
|
|
7378
|
-
LLLL: "dddd, MMMM D, YYYY h:mm A"
|
|
7379
|
-
};
|
|
7380
|
-
function longDateFormat(key2) {
|
|
7381
|
-
var format2 = this._longDateFormat[key2], formatUpper = this._longDateFormat[key2.toUpperCase()];
|
|
7382
|
-
if (format2 || !formatUpper) {
|
|
7383
|
-
return format2;
|
|
7384
|
-
}
|
|
7385
|
-
this._longDateFormat[key2] = formatUpper.match(formattingTokens).map(function(tok) {
|
|
7386
|
-
if (tok === "MMMM" || tok === "MM" || tok === "DD" || tok === "dddd") {
|
|
7387
|
-
return tok.slice(1);
|
|
7388
|
-
}
|
|
7389
|
-
return tok;
|
|
7390
|
-
}).join("");
|
|
7391
|
-
return this._longDateFormat[key2];
|
|
7392
|
-
}
|
|
7393
|
-
var defaultInvalidDate = "Invalid date";
|
|
7394
|
-
function invalidDate() {
|
|
7395
|
-
return this._invalidDate;
|
|
7396
|
-
}
|
|
7397
|
-
var defaultOrdinal = "%d", defaultDayOfMonthOrdinalParse = /\d{1,2}/;
|
|
7398
|
-
function ordinal(number) {
|
|
7399
|
-
return this._ordinal.replace("%d", number);
|
|
7400
|
-
}
|
|
7401
|
-
var defaultRelativeTime = {
|
|
7402
|
-
future: "in %s",
|
|
7403
|
-
past: "%s ago",
|
|
7404
|
-
s: "a few seconds",
|
|
7405
|
-
ss: "%d seconds",
|
|
7406
|
-
m: "a minute",
|
|
7407
|
-
mm: "%d minutes",
|
|
7408
|
-
h: "an hour",
|
|
7409
|
-
hh: "%d hours",
|
|
7410
|
-
d: "a day",
|
|
7411
|
-
dd: "%d days",
|
|
7412
|
-
w: "a week",
|
|
7413
|
-
ww: "%d weeks",
|
|
7414
|
-
M: "a month",
|
|
7415
|
-
MM: "%d months",
|
|
7416
|
-
y: "a year",
|
|
7417
|
-
yy: "%d years"
|
|
7418
|
-
};
|
|
7419
|
-
function relativeTime(number, withoutSuffix, string, isFuture) {
|
|
7420
|
-
var output = this._relativeTime[string];
|
|
7421
|
-
return isFunction(output) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number);
|
|
7422
|
-
}
|
|
7423
|
-
function pastFuture(diff2, output) {
|
|
7424
|
-
var format2 = this._relativeTime[diff2 > 0 ? "future" : "past"];
|
|
7425
|
-
return isFunction(format2) ? format2(output) : format2.replace(/%s/i, output);
|
|
7426
|
-
}
|
|
7427
|
-
var aliases = {};
|
|
7428
|
-
function addUnitAlias(unit, shorthand) {
|
|
7429
|
-
var lowerCase = unit.toLowerCase();
|
|
7430
|
-
aliases[lowerCase] = aliases[lowerCase + "s"] = aliases[shorthand] = unit;
|
|
7431
|
-
}
|
|
7432
|
-
function normalizeUnits(units) {
|
|
7433
|
-
return typeof units === "string" ? aliases[units] || aliases[units.toLowerCase()] : void 0;
|
|
7404
|
+
var match1 = /\d/, match2 = /\d\d/, match3 = /\d{3}/, match4 = /\d{4}/, match6 = /[+-]?\d{6}/, match1to2 = /\d\d?/, match3to4 = /\d\d\d\d?/, match5to6 = /\d\d\d\d\d\d?/, match1to3 = /\d{1,3}/, match1to4 = /\d{1,4}/, match1to6 = /[+-]?\d{1,6}/, matchUnsigned = /\d+/, matchSigned = /[+-]?\d+/, matchOffset = /Z|[+-]\d\d:?\d\d/gi, matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi, matchTimestamp = /[+-]?\d+(\.\d{1,3})?/, matchWord = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i, match1to2NoLeadingZero = /^[1-9]\d?/, match1to2HasZero = /^([1-9]\d|\d)/, regexes;
|
|
7405
|
+
regexes = {};
|
|
7406
|
+
function addRegexToken(token2, regex, strictRegex) {
|
|
7407
|
+
regexes[token2] = isFunction(regex) ? regex : function(isStrict, localeData2) {
|
|
7408
|
+
return isStrict && strictRegex ? strictRegex : regex;
|
|
7409
|
+
};
|
|
7434
7410
|
}
|
|
7435
|
-
function
|
|
7436
|
-
|
|
7437
|
-
|
|
7438
|
-
if (hasOwnProp(inputObject, prop)) {
|
|
7439
|
-
normalizedProp = normalizeUnits(prop);
|
|
7440
|
-
if (normalizedProp) {
|
|
7441
|
-
normalizedInput[normalizedProp] = inputObject[prop];
|
|
7442
|
-
}
|
|
7443
|
-
}
|
|
7411
|
+
function getParseRegexForToken(token2, config) {
|
|
7412
|
+
if (!hasOwnProp(regexes, token2)) {
|
|
7413
|
+
return new RegExp(unescapeFormat(token2));
|
|
7444
7414
|
}
|
|
7445
|
-
return
|
|
7446
|
-
}
|
|
7447
|
-
var priorities = {};
|
|
7448
|
-
function addUnitPriority(unit, priority) {
|
|
7449
|
-
priorities[unit] = priority;
|
|
7415
|
+
return regexes[token2](config._strict, config._locale);
|
|
7450
7416
|
}
|
|
7451
|
-
function
|
|
7452
|
-
|
|
7453
|
-
|
|
7454
|
-
|
|
7455
|
-
|
|
7456
|
-
|
|
7457
|
-
|
|
7458
|
-
|
|
7459
|
-
|
|
7460
|
-
});
|
|
7461
|
-
return units;
|
|
7417
|
+
function unescapeFormat(s) {
|
|
7418
|
+
return regexEscape(
|
|
7419
|
+
s.replace("\\", "").replace(
|
|
7420
|
+
/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,
|
|
7421
|
+
function(matched, p1, p2, p3, p4) {
|
|
7422
|
+
return p1 || p2 || p3 || p4;
|
|
7423
|
+
}
|
|
7424
|
+
)
|
|
7425
|
+
);
|
|
7462
7426
|
}
|
|
7463
|
-
function
|
|
7464
|
-
return
|
|
7427
|
+
function regexEscape(s) {
|
|
7428
|
+
return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
7465
7429
|
}
|
|
7466
7430
|
function absFloor(number) {
|
|
7467
7431
|
if (number < 0) {
|
|
@@ -7477,6 +7441,72 @@
|
|
|
7477
7441
|
}
|
|
7478
7442
|
return value;
|
|
7479
7443
|
}
|
|
7444
|
+
var tokens = {};
|
|
7445
|
+
function addParseToken(token2, callback) {
|
|
7446
|
+
var i, func = callback, tokenLen;
|
|
7447
|
+
if (typeof token2 === "string") {
|
|
7448
|
+
token2 = [token2];
|
|
7449
|
+
}
|
|
7450
|
+
if (isNumber(callback)) {
|
|
7451
|
+
func = function(input, array) {
|
|
7452
|
+
array[callback] = toInt(input);
|
|
7453
|
+
};
|
|
7454
|
+
}
|
|
7455
|
+
tokenLen = token2.length;
|
|
7456
|
+
for (i = 0; i < tokenLen; i++) {
|
|
7457
|
+
tokens[token2[i]] = func;
|
|
7458
|
+
}
|
|
7459
|
+
}
|
|
7460
|
+
function addWeekParseToken(token2, callback) {
|
|
7461
|
+
addParseToken(token2, function(input, array, config, token3) {
|
|
7462
|
+
config._w = config._w || {};
|
|
7463
|
+
callback(input, config._w, config, token3);
|
|
7464
|
+
});
|
|
7465
|
+
}
|
|
7466
|
+
function addTimeToArrayFromToken(token2, input, config) {
|
|
7467
|
+
if (input != null && hasOwnProp(tokens, token2)) {
|
|
7468
|
+
tokens[token2](input, config._a, config, token2);
|
|
7469
|
+
}
|
|
7470
|
+
}
|
|
7471
|
+
function isLeapYear(year) {
|
|
7472
|
+
return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
|
|
7473
|
+
}
|
|
7474
|
+
var YEAR = 0, MONTH = 1, DATE = 2, HOUR = 3, MINUTE = 4, SECOND = 5, MILLISECOND = 6, WEEK = 7, WEEKDAY = 8;
|
|
7475
|
+
addFormatToken("Y", 0, 0, function() {
|
|
7476
|
+
var y = this.year();
|
|
7477
|
+
return y <= 9999 ? zeroFill(y, 4) : "+" + y;
|
|
7478
|
+
});
|
|
7479
|
+
addFormatToken(0, ["YY", 2], 0, function() {
|
|
7480
|
+
return this.year() % 100;
|
|
7481
|
+
});
|
|
7482
|
+
addFormatToken(0, ["YYYY", 4], 0, "year");
|
|
7483
|
+
addFormatToken(0, ["YYYYY", 5], 0, "year");
|
|
7484
|
+
addFormatToken(0, ["YYYYYY", 6, true], 0, "year");
|
|
7485
|
+
addRegexToken("Y", matchSigned);
|
|
7486
|
+
addRegexToken("YY", match1to2, match2);
|
|
7487
|
+
addRegexToken("YYYY", match1to4, match4);
|
|
7488
|
+
addRegexToken("YYYYY", match1to6, match6);
|
|
7489
|
+
addRegexToken("YYYYYY", match1to6, match6);
|
|
7490
|
+
addParseToken(["YYYYY", "YYYYYY"], YEAR);
|
|
7491
|
+
addParseToken("YYYY", function(input, array) {
|
|
7492
|
+
array[YEAR] = input.length === 2 ? hooks2.parseTwoDigitYear(input) : toInt(input);
|
|
7493
|
+
});
|
|
7494
|
+
addParseToken("YY", function(input, array) {
|
|
7495
|
+
array[YEAR] = hooks2.parseTwoDigitYear(input);
|
|
7496
|
+
});
|
|
7497
|
+
addParseToken("Y", function(input, array) {
|
|
7498
|
+
array[YEAR] = parseInt(input, 10);
|
|
7499
|
+
});
|
|
7500
|
+
function daysInYear(year) {
|
|
7501
|
+
return isLeapYear(year) ? 366 : 365;
|
|
7502
|
+
}
|
|
7503
|
+
hooks2.parseTwoDigitYear = function(input) {
|
|
7504
|
+
return toInt(input) + (toInt(input) > 68 ? 1900 : 2e3);
|
|
7505
|
+
};
|
|
7506
|
+
var getSetYear = makeGetSet("FullYear", true);
|
|
7507
|
+
function getIsLeapYear() {
|
|
7508
|
+
return isLeapYear(this.year());
|
|
7509
|
+
}
|
|
7480
7510
|
function makeGetSet(unit, keepTime) {
|
|
7481
7511
|
return function(value) {
|
|
7482
7512
|
if (value != null) {
|
|
@@ -7484,26 +7514,69 @@
|
|
|
7484
7514
|
hooks2.updateOffset(this, keepTime);
|
|
7485
7515
|
return this;
|
|
7486
7516
|
} else {
|
|
7487
|
-
return get(this, unit);
|
|
7517
|
+
return get$2(this, unit);
|
|
7488
7518
|
}
|
|
7489
7519
|
};
|
|
7490
7520
|
}
|
|
7491
|
-
function get(mom, unit) {
|
|
7492
|
-
|
|
7521
|
+
function get$2(mom, unit) {
|
|
7522
|
+
if (!mom.isValid()) {
|
|
7523
|
+
return NaN;
|
|
7524
|
+
}
|
|
7525
|
+
var d = mom._d, isUTC = mom._isUTC;
|
|
7526
|
+
switch (unit) {
|
|
7527
|
+
case "Milliseconds":
|
|
7528
|
+
return isUTC ? d.getUTCMilliseconds() : d.getMilliseconds();
|
|
7529
|
+
case "Seconds":
|
|
7530
|
+
return isUTC ? d.getUTCSeconds() : d.getSeconds();
|
|
7531
|
+
case "Minutes":
|
|
7532
|
+
return isUTC ? d.getUTCMinutes() : d.getMinutes();
|
|
7533
|
+
case "Hours":
|
|
7534
|
+
return isUTC ? d.getUTCHours() : d.getHours();
|
|
7535
|
+
case "Date":
|
|
7536
|
+
return isUTC ? d.getUTCDate() : d.getDate();
|
|
7537
|
+
case "Day":
|
|
7538
|
+
return isUTC ? d.getUTCDay() : d.getDay();
|
|
7539
|
+
case "Month":
|
|
7540
|
+
return isUTC ? d.getUTCMonth() : d.getMonth();
|
|
7541
|
+
case "FullYear":
|
|
7542
|
+
return isUTC ? d.getUTCFullYear() : d.getFullYear();
|
|
7543
|
+
default:
|
|
7544
|
+
return NaN;
|
|
7545
|
+
}
|
|
7493
7546
|
}
|
|
7494
7547
|
function set$1(mom, unit, value) {
|
|
7495
|
-
|
|
7496
|
-
|
|
7497
|
-
|
|
7498
|
-
|
|
7499
|
-
|
|
7500
|
-
|
|
7501
|
-
|
|
7502
|
-
|
|
7503
|
-
|
|
7504
|
-
|
|
7505
|
-
|
|
7548
|
+
var d, isUTC, year, month, date;
|
|
7549
|
+
if (!mom.isValid() || isNaN(value)) {
|
|
7550
|
+
return;
|
|
7551
|
+
}
|
|
7552
|
+
d = mom._d;
|
|
7553
|
+
isUTC = mom._isUTC;
|
|
7554
|
+
switch (unit) {
|
|
7555
|
+
case "Milliseconds":
|
|
7556
|
+
return void (isUTC ? d.setUTCMilliseconds(value) : d.setMilliseconds(value));
|
|
7557
|
+
case "Seconds":
|
|
7558
|
+
return void (isUTC ? d.setUTCSeconds(value) : d.setSeconds(value));
|
|
7559
|
+
case "Minutes":
|
|
7560
|
+
return void (isUTC ? d.setUTCMinutes(value) : d.setMinutes(value));
|
|
7561
|
+
case "Hours":
|
|
7562
|
+
return void (isUTC ? d.setUTCHours(value) : d.setHours(value));
|
|
7563
|
+
case "Date":
|
|
7564
|
+
return void (isUTC ? d.setUTCDate(value) : d.setDate(value));
|
|
7565
|
+
// case 'Day': // Not real
|
|
7566
|
+
// return void (isUTC ? d.setUTCDay(value) : d.setDay(value));
|
|
7567
|
+
// case 'Month': // Not used because we need to pass two variables
|
|
7568
|
+
// return void (isUTC ? d.setUTCMonth(value) : d.setMonth(value));
|
|
7569
|
+
case "FullYear":
|
|
7570
|
+
break;
|
|
7571
|
+
// See below ...
|
|
7572
|
+
default:
|
|
7573
|
+
return;
|
|
7506
7574
|
}
|
|
7575
|
+
year = value;
|
|
7576
|
+
month = mom.month();
|
|
7577
|
+
date = mom.date();
|
|
7578
|
+
date = date === 29 && month === 1 && !isLeapYear(year) ? 28 : date;
|
|
7579
|
+
void (isUTC ? d.setUTCFullYear(year, month, date) : d.setFullYear(year, month, date));
|
|
7507
7580
|
}
|
|
7508
7581
|
function stringGet(units) {
|
|
7509
7582
|
units = normalizeUnits(units);
|
|
@@ -7527,61 +7600,7 @@
|
|
|
7527
7600
|
}
|
|
7528
7601
|
return this;
|
|
7529
7602
|
}
|
|
7530
|
-
|
|
7531
|
-
regexes = {};
|
|
7532
|
-
function addRegexToken(token2, regex, strictRegex) {
|
|
7533
|
-
regexes[token2] = isFunction(regex) ? regex : function(isStrict, localeData2) {
|
|
7534
|
-
return isStrict && strictRegex ? strictRegex : regex;
|
|
7535
|
-
};
|
|
7536
|
-
}
|
|
7537
|
-
function getParseRegexForToken(token2, config) {
|
|
7538
|
-
if (!hasOwnProp(regexes, token2)) {
|
|
7539
|
-
return new RegExp(unescapeFormat(token2));
|
|
7540
|
-
}
|
|
7541
|
-
return regexes[token2](config._strict, config._locale);
|
|
7542
|
-
}
|
|
7543
|
-
function unescapeFormat(s) {
|
|
7544
|
-
return regexEscape(
|
|
7545
|
-
s.replace("\\", "").replace(
|
|
7546
|
-
/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,
|
|
7547
|
-
function(matched, p1, p2, p3, p4) {
|
|
7548
|
-
return p1 || p2 || p3 || p4;
|
|
7549
|
-
}
|
|
7550
|
-
)
|
|
7551
|
-
);
|
|
7552
|
-
}
|
|
7553
|
-
function regexEscape(s) {
|
|
7554
|
-
return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
7555
|
-
}
|
|
7556
|
-
var tokens = {};
|
|
7557
|
-
function addParseToken(token2, callback) {
|
|
7558
|
-
var i, func = callback, tokenLen;
|
|
7559
|
-
if (typeof token2 === "string") {
|
|
7560
|
-
token2 = [token2];
|
|
7561
|
-
}
|
|
7562
|
-
if (isNumber(callback)) {
|
|
7563
|
-
func = function(input, array) {
|
|
7564
|
-
array[callback] = toInt(input);
|
|
7565
|
-
};
|
|
7566
|
-
}
|
|
7567
|
-
tokenLen = token2.length;
|
|
7568
|
-
for (i = 0; i < tokenLen; i++) {
|
|
7569
|
-
tokens[token2[i]] = func;
|
|
7570
|
-
}
|
|
7571
|
-
}
|
|
7572
|
-
function addWeekParseToken(token2, callback) {
|
|
7573
|
-
addParseToken(token2, function(input, array, config, token3) {
|
|
7574
|
-
config._w = config._w || {};
|
|
7575
|
-
callback(input, config._w, config, token3);
|
|
7576
|
-
});
|
|
7577
|
-
}
|
|
7578
|
-
function addTimeToArrayFromToken(token2, input, config) {
|
|
7579
|
-
if (input != null && hasOwnProp(tokens, token2)) {
|
|
7580
|
-
tokens[token2](input, config._a, config, token2);
|
|
7581
|
-
}
|
|
7582
|
-
}
|
|
7583
|
-
var YEAR = 0, MONTH = 1, DATE = 2, HOUR = 3, MINUTE = 4, SECOND = 5, MILLISECOND = 6, WEEK = 7, WEEKDAY = 8;
|
|
7584
|
-
function mod(n, x) {
|
|
7603
|
+
function mod$1(n, x) {
|
|
7585
7604
|
return (n % x + x) % x;
|
|
7586
7605
|
}
|
|
7587
7606
|
var indexOf;
|
|
@@ -7602,7 +7621,7 @@
|
|
|
7602
7621
|
if (isNaN(year) || isNaN(month)) {
|
|
7603
7622
|
return NaN;
|
|
7604
7623
|
}
|
|
7605
|
-
var modMonth = mod(month, 12);
|
|
7624
|
+
var modMonth = mod$1(month, 12);
|
|
7606
7625
|
year += (month - modMonth) / 12;
|
|
7607
7626
|
return modMonth === 1 ? isLeapYear(year) ? 29 : 28 : 31 - modMonth % 7 % 2;
|
|
7608
7627
|
}
|
|
@@ -7615,9 +7634,7 @@
|
|
|
7615
7634
|
addFormatToken("MMMM", 0, 0, function(format2) {
|
|
7616
7635
|
return this.localeData().months(this, format2);
|
|
7617
7636
|
});
|
|
7618
|
-
|
|
7619
|
-
addUnitPriority("month", 8);
|
|
7620
|
-
addRegexToken("M", match1to2);
|
|
7637
|
+
addRegexToken("M", match1to2, match1to2NoLeadingZero);
|
|
7621
7638
|
addRegexToken("MM", match1to2, match2);
|
|
7622
7639
|
addRegexToken("MMM", function(isStrict, locale2) {
|
|
7623
7640
|
return locale2.monthsShortRegex(isStrict);
|
|
@@ -7638,7 +7655,24 @@
|
|
|
7638
7655
|
});
|
|
7639
7656
|
var defaultLocaleMonths = "January_February_March_April_May_June_July_August_September_October_November_December".split(
|
|
7640
7657
|
"_"
|
|
7641
|
-
), defaultLocaleMonthsShort = "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/, defaultMonthsShortRegex = matchWord, defaultMonthsRegex = matchWord
|
|
7658
|
+
), defaultLocaleMonthsShort = "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/, defaultMonthsShortRegex = matchWord, defaultMonthsRegex = matchWord, monthsParseProperties = [
|
|
7659
|
+
"monthsParse",
|
|
7660
|
+
"longMonthsParse",
|
|
7661
|
+
"shortMonthsParse",
|
|
7662
|
+
"monthsRegex",
|
|
7663
|
+
"monthsShortRegex",
|
|
7664
|
+
"monthsStrictRegex",
|
|
7665
|
+
"monthsShortStrictRegex"
|
|
7666
|
+
];
|
|
7667
|
+
function clearMonthsParseCache(locale2, config) {
|
|
7668
|
+
var i, prop;
|
|
7669
|
+
for (i = 0; i < monthsParseProperties.length; i++) {
|
|
7670
|
+
prop = monthsParseProperties[i];
|
|
7671
|
+
if (!hasOwnProp(config, prop)) {
|
|
7672
|
+
delete locale2["_" + prop];
|
|
7673
|
+
}
|
|
7674
|
+
}
|
|
7675
|
+
}
|
|
7642
7676
|
function localeMonths(m, format2) {
|
|
7643
7677
|
if (!m) {
|
|
7644
7678
|
return isArray(this._months) ? this._months : this._months["standalone"];
|
|
@@ -7651,7 +7685,7 @@
|
|
|
7651
7685
|
}
|
|
7652
7686
|
return isArray(this._monthsShort) ? this._monthsShort[m.month()] : this._monthsShort[MONTHS_IN_FORMAT.test(format2) ? "format" : "standalone"][m.month()];
|
|
7653
7687
|
}
|
|
7654
|
-
function handleStrictParse(monthName, format2, strict) {
|
|
7688
|
+
function handleStrictParse$1(monthName, format2, strict) {
|
|
7655
7689
|
var i, ii, mom, llc = monthName.toLocaleLowerCase();
|
|
7656
7690
|
if (!this._monthsParse) {
|
|
7657
7691
|
this._monthsParse = [];
|
|
@@ -7695,7 +7729,7 @@
|
|
|
7695
7729
|
function localeMonthsParse(monthName, format2, strict) {
|
|
7696
7730
|
var i, mom, regex;
|
|
7697
7731
|
if (this._monthsParseExact) {
|
|
7698
|
-
return handleStrictParse.call(this, monthName, format2, strict);
|
|
7732
|
+
return handleStrictParse$1.call(this, monthName, format2, strict);
|
|
7699
7733
|
}
|
|
7700
7734
|
if (!this._monthsParse) {
|
|
7701
7735
|
this._monthsParse = [];
|
|
@@ -7728,7 +7762,6 @@
|
|
|
7728
7762
|
}
|
|
7729
7763
|
}
|
|
7730
7764
|
function setMonth(mom, value) {
|
|
7731
|
-
var dayOfMonth;
|
|
7732
7765
|
if (!mom.isValid()) {
|
|
7733
7766
|
return mom;
|
|
7734
7767
|
}
|
|
@@ -7742,8 +7775,9 @@
|
|
|
7742
7775
|
}
|
|
7743
7776
|
}
|
|
7744
7777
|
}
|
|
7745
|
-
|
|
7746
|
-
|
|
7778
|
+
var month = value, date = mom.date();
|
|
7779
|
+
date = date < 29 ? date : Math.min(date, daysInMonth(mom.year(), month));
|
|
7780
|
+
void (mom._isUTC ? mom._d.setUTCMonth(month, date) : mom._d.setMonth(month, date));
|
|
7747
7781
|
return mom;
|
|
7748
7782
|
}
|
|
7749
7783
|
function getSetMonth(value) {
|
|
@@ -7752,7 +7786,7 @@
|
|
|
7752
7786
|
hooks2.updateOffset(this, true);
|
|
7753
7787
|
return this;
|
|
7754
7788
|
} else {
|
|
7755
|
-
return get(this, "Month");
|
|
7789
|
+
return get$2(this, "Month");
|
|
7756
7790
|
}
|
|
7757
7791
|
}
|
|
7758
7792
|
function getDaysInMonth() {
|
|
@@ -7796,24 +7830,19 @@
|
|
|
7796
7830
|
function cmpLenRev(a, b) {
|
|
7797
7831
|
return b.length - a.length;
|
|
7798
7832
|
}
|
|
7799
|
-
var shortPieces = [], longPieces = [], mixedPieces = [], i, mom;
|
|
7833
|
+
var shortPieces = [], longPieces = [], mixedPieces = [], i, mom, shortP, longP;
|
|
7800
7834
|
for (i = 0; i < 12; i++) {
|
|
7801
7835
|
mom = createUTC([2e3, i]);
|
|
7802
|
-
|
|
7803
|
-
|
|
7804
|
-
|
|
7805
|
-
|
|
7836
|
+
shortP = regexEscape(this.monthsShort(mom, ""));
|
|
7837
|
+
longP = regexEscape(this.months(mom, ""));
|
|
7838
|
+
shortPieces.push(shortP);
|
|
7839
|
+
longPieces.push(longP);
|
|
7840
|
+
mixedPieces.push(longP);
|
|
7841
|
+
mixedPieces.push(shortP);
|
|
7806
7842
|
}
|
|
7807
7843
|
shortPieces.sort(cmpLenRev);
|
|
7808
7844
|
longPieces.sort(cmpLenRev);
|
|
7809
7845
|
mixedPieces.sort(cmpLenRev);
|
|
7810
|
-
for (i = 0; i < 12; i++) {
|
|
7811
|
-
shortPieces[i] = regexEscape(shortPieces[i]);
|
|
7812
|
-
longPieces[i] = regexEscape(longPieces[i]);
|
|
7813
|
-
}
|
|
7814
|
-
for (i = 0; i < 24; i++) {
|
|
7815
|
-
mixedPieces[i] = regexEscape(mixedPieces[i]);
|
|
7816
|
-
}
|
|
7817
7846
|
this._monthsRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i");
|
|
7818
7847
|
this._monthsShortRegex = this._monthsRegex;
|
|
7819
7848
|
this._monthsStrictRegex = new RegExp(
|
|
@@ -7825,150 +7854,6 @@
|
|
|
7825
7854
|
"i"
|
|
7826
7855
|
);
|
|
7827
7856
|
}
|
|
7828
|
-
addFormatToken("Y", 0, 0, function() {
|
|
7829
|
-
var y = this.year();
|
|
7830
|
-
return y <= 9999 ? zeroFill(y, 4) : "+" + y;
|
|
7831
|
-
});
|
|
7832
|
-
addFormatToken(0, ["YY", 2], 0, function() {
|
|
7833
|
-
return this.year() % 100;
|
|
7834
|
-
});
|
|
7835
|
-
addFormatToken(0, ["YYYY", 4], 0, "year");
|
|
7836
|
-
addFormatToken(0, ["YYYYY", 5], 0, "year");
|
|
7837
|
-
addFormatToken(0, ["YYYYYY", 6, true], 0, "year");
|
|
7838
|
-
addUnitAlias("year", "y");
|
|
7839
|
-
addUnitPriority("year", 1);
|
|
7840
|
-
addRegexToken("Y", matchSigned);
|
|
7841
|
-
addRegexToken("YY", match1to2, match2);
|
|
7842
|
-
addRegexToken("YYYY", match1to4, match4);
|
|
7843
|
-
addRegexToken("YYYYY", match1to6, match6);
|
|
7844
|
-
addRegexToken("YYYYYY", match1to6, match6);
|
|
7845
|
-
addParseToken(["YYYYY", "YYYYYY"], YEAR);
|
|
7846
|
-
addParseToken("YYYY", function(input, array) {
|
|
7847
|
-
array[YEAR] = input.length === 2 ? hooks2.parseTwoDigitYear(input) : toInt(input);
|
|
7848
|
-
});
|
|
7849
|
-
addParseToken("YY", function(input, array) {
|
|
7850
|
-
array[YEAR] = hooks2.parseTwoDigitYear(input);
|
|
7851
|
-
});
|
|
7852
|
-
addParseToken("Y", function(input, array) {
|
|
7853
|
-
array[YEAR] = parseInt(input, 10);
|
|
7854
|
-
});
|
|
7855
|
-
function daysInYear(year) {
|
|
7856
|
-
return isLeapYear(year) ? 366 : 365;
|
|
7857
|
-
}
|
|
7858
|
-
hooks2.parseTwoDigitYear = function(input) {
|
|
7859
|
-
return toInt(input) + (toInt(input) > 68 ? 1900 : 2e3);
|
|
7860
|
-
};
|
|
7861
|
-
var getSetYear = makeGetSet("FullYear", true);
|
|
7862
|
-
function getIsLeapYear() {
|
|
7863
|
-
return isLeapYear(this.year());
|
|
7864
|
-
}
|
|
7865
|
-
function createDate(y, m, d, h, M, s, ms) {
|
|
7866
|
-
var date;
|
|
7867
|
-
if (y < 100 && y >= 0) {
|
|
7868
|
-
date = new Date(y + 400, m, d, h, M, s, ms);
|
|
7869
|
-
if (isFinite(date.getFullYear())) {
|
|
7870
|
-
date.setFullYear(y);
|
|
7871
|
-
}
|
|
7872
|
-
} else {
|
|
7873
|
-
date = new Date(y, m, d, h, M, s, ms);
|
|
7874
|
-
}
|
|
7875
|
-
return date;
|
|
7876
|
-
}
|
|
7877
|
-
function createUTCDate(y) {
|
|
7878
|
-
var date, args;
|
|
7879
|
-
if (y < 100 && y >= 0) {
|
|
7880
|
-
args = Array.prototype.slice.call(arguments);
|
|
7881
|
-
args[0] = y + 400;
|
|
7882
|
-
date = new Date(Date.UTC.apply(null, args));
|
|
7883
|
-
if (isFinite(date.getUTCFullYear())) {
|
|
7884
|
-
date.setUTCFullYear(y);
|
|
7885
|
-
}
|
|
7886
|
-
} else {
|
|
7887
|
-
date = new Date(Date.UTC.apply(null, arguments));
|
|
7888
|
-
}
|
|
7889
|
-
return date;
|
|
7890
|
-
}
|
|
7891
|
-
function firstWeekOffset(year, dow, doy) {
|
|
7892
|
-
var fwd = 7 + dow - doy, fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
|
|
7893
|
-
return -fwdlw + fwd - 1;
|
|
7894
|
-
}
|
|
7895
|
-
function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
|
|
7896
|
-
var localWeekday = (7 + weekday - dow) % 7, weekOffset = firstWeekOffset(year, dow, doy), dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, resYear, resDayOfYear;
|
|
7897
|
-
if (dayOfYear <= 0) {
|
|
7898
|
-
resYear = year - 1;
|
|
7899
|
-
resDayOfYear = daysInYear(resYear) + dayOfYear;
|
|
7900
|
-
} else if (dayOfYear > daysInYear(year)) {
|
|
7901
|
-
resYear = year + 1;
|
|
7902
|
-
resDayOfYear = dayOfYear - daysInYear(year);
|
|
7903
|
-
} else {
|
|
7904
|
-
resYear = year;
|
|
7905
|
-
resDayOfYear = dayOfYear;
|
|
7906
|
-
}
|
|
7907
|
-
return {
|
|
7908
|
-
year: resYear,
|
|
7909
|
-
dayOfYear: resDayOfYear
|
|
7910
|
-
};
|
|
7911
|
-
}
|
|
7912
|
-
function weekOfYear(mom, dow, doy) {
|
|
7913
|
-
var weekOffset = firstWeekOffset(mom.year(), dow, doy), week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, resWeek, resYear;
|
|
7914
|
-
if (week < 1) {
|
|
7915
|
-
resYear = mom.year() - 1;
|
|
7916
|
-
resWeek = week + weeksInYear(resYear, dow, doy);
|
|
7917
|
-
} else if (week > weeksInYear(mom.year(), dow, doy)) {
|
|
7918
|
-
resWeek = week - weeksInYear(mom.year(), dow, doy);
|
|
7919
|
-
resYear = mom.year() + 1;
|
|
7920
|
-
} else {
|
|
7921
|
-
resYear = mom.year();
|
|
7922
|
-
resWeek = week;
|
|
7923
|
-
}
|
|
7924
|
-
return {
|
|
7925
|
-
week: resWeek,
|
|
7926
|
-
year: resYear
|
|
7927
|
-
};
|
|
7928
|
-
}
|
|
7929
|
-
function weeksInYear(year, dow, doy) {
|
|
7930
|
-
var weekOffset = firstWeekOffset(year, dow, doy), weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
|
|
7931
|
-
return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
|
|
7932
|
-
}
|
|
7933
|
-
addFormatToken("w", ["ww", 2], "wo", "week");
|
|
7934
|
-
addFormatToken("W", ["WW", 2], "Wo", "isoWeek");
|
|
7935
|
-
addUnitAlias("week", "w");
|
|
7936
|
-
addUnitAlias("isoWeek", "W");
|
|
7937
|
-
addUnitPriority("week", 5);
|
|
7938
|
-
addUnitPriority("isoWeek", 5);
|
|
7939
|
-
addRegexToken("w", match1to2);
|
|
7940
|
-
addRegexToken("ww", match1to2, match2);
|
|
7941
|
-
addRegexToken("W", match1to2);
|
|
7942
|
-
addRegexToken("WW", match1to2, match2);
|
|
7943
|
-
addWeekParseToken(
|
|
7944
|
-
["w", "ww", "W", "WW"],
|
|
7945
|
-
function(input, week, config, token2) {
|
|
7946
|
-
week[token2.substr(0, 1)] = toInt(input);
|
|
7947
|
-
}
|
|
7948
|
-
);
|
|
7949
|
-
function localeWeek(mom) {
|
|
7950
|
-
return weekOfYear(mom, this._week.dow, this._week.doy).week;
|
|
7951
|
-
}
|
|
7952
|
-
var defaultLocaleWeek = {
|
|
7953
|
-
dow: 0,
|
|
7954
|
-
// Sunday is the first day of the week.
|
|
7955
|
-
doy: 6
|
|
7956
|
-
// The week that contains Jan 6th is the first week of the year.
|
|
7957
|
-
};
|
|
7958
|
-
function localeFirstDayOfWeek() {
|
|
7959
|
-
return this._week.dow;
|
|
7960
|
-
}
|
|
7961
|
-
function localeFirstDayOfYear() {
|
|
7962
|
-
return this._week.doy;
|
|
7963
|
-
}
|
|
7964
|
-
function getSetWeek(input) {
|
|
7965
|
-
var week = this.localeData().week(this);
|
|
7966
|
-
return input == null ? week : this.add((input - week) * 7, "d");
|
|
7967
|
-
}
|
|
7968
|
-
function getSetISOWeek(input) {
|
|
7969
|
-
var week = weekOfYear(this, 1, 4).week;
|
|
7970
|
-
return input == null ? week : this.add((input - week) * 7, "d");
|
|
7971
|
-
}
|
|
7972
7857
|
addFormatToken("d", 0, "do", "day");
|
|
7973
7858
|
addFormatToken("dd", 0, 0, function(format2) {
|
|
7974
7859
|
return this.localeData().weekdaysMin(this, format2);
|
|
@@ -7981,15 +7866,13 @@
|
|
|
7981
7866
|
});
|
|
7982
7867
|
addFormatToken("e", 0, 0, "weekday");
|
|
7983
7868
|
addFormatToken("E", 0, 0, "isoWeekday");
|
|
7984
|
-
|
|
7985
|
-
|
|
7986
|
-
|
|
7987
|
-
addUnitPriority("day", 11);
|
|
7988
|
-
addUnitPriority("weekday", 11);
|
|
7989
|
-
addUnitPriority("isoWeekday", 11);
|
|
7869
|
+
addFormatToken("eHHmm", 0, 0, function() {
|
|
7870
|
+
return "" + this.weekday() + zeroFill(this.hours(), 2) + zeroFill(this.minutes(), 2);
|
|
7871
|
+
});
|
|
7990
7872
|
addRegexToken("d", match1to2);
|
|
7991
7873
|
addRegexToken("e", match1to2);
|
|
7992
7874
|
addRegexToken("E", match1to2);
|
|
7875
|
+
addRegexToken("eHHmm", match5to6);
|
|
7993
7876
|
addRegexToken("dd", function(isStrict, locale2) {
|
|
7994
7877
|
return locale2.weekdaysMinRegex(isStrict);
|
|
7995
7878
|
});
|
|
@@ -8010,6 +7893,12 @@
|
|
|
8010
7893
|
addWeekParseToken(["d", "e", "E"], function(input, week, config, token2) {
|
|
8011
7894
|
week[token2] = toInt(input);
|
|
8012
7895
|
});
|
|
7896
|
+
addWeekParseToken("eHHmm", function(input, week, config) {
|
|
7897
|
+
var weekdayEnd = input.length - 4;
|
|
7898
|
+
week.e = toInt(input.substr(0, weekdayEnd));
|
|
7899
|
+
config._a[HOUR] = toInt(input.substr(weekdayEnd, 2));
|
|
7900
|
+
config._a[MINUTE] = toInt(input.substr(weekdayEnd + 2));
|
|
7901
|
+
});
|
|
8013
7902
|
function parseWeekday(input, locale2) {
|
|
8014
7903
|
if (typeof input !== "string") {
|
|
8015
7904
|
return input;
|
|
@@ -8032,7 +7921,27 @@
|
|
|
8032
7921
|
function shiftWeekdays(ws, n) {
|
|
8033
7922
|
return ws.slice(n, 7).concat(ws.slice(0, n));
|
|
8034
7923
|
}
|
|
8035
|
-
var defaultLocaleWeekdays = "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), defaultLocaleWeekdaysShort = "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), defaultLocaleWeekdaysMin = "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), defaultWeekdaysRegex = matchWord, defaultWeekdaysShortRegex = matchWord, defaultWeekdaysMinRegex = matchWord
|
|
7924
|
+
var defaultLocaleWeekdays = "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), defaultLocaleWeekdaysShort = "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), defaultLocaleWeekdaysMin = "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), defaultWeekdaysRegex = matchWord, defaultWeekdaysShortRegex = matchWord, defaultWeekdaysMinRegex = matchWord, weekdaysParseProperties = [
|
|
7925
|
+
"weekdaysParse",
|
|
7926
|
+
"fullWeekdaysParse",
|
|
7927
|
+
"shortWeekdaysParse",
|
|
7928
|
+
"minWeekdaysParse",
|
|
7929
|
+
"weekdaysRegex",
|
|
7930
|
+
"weekdaysShortRegex",
|
|
7931
|
+
"weekdaysMinRegex",
|
|
7932
|
+
"weekdaysStrictRegex",
|
|
7933
|
+
"weekdaysShortStrictRegex",
|
|
7934
|
+
"weekdaysMinStrictRegex"
|
|
7935
|
+
];
|
|
7936
|
+
function clearWeekdaysParseCache(locale2, config) {
|
|
7937
|
+
var i, prop;
|
|
7938
|
+
for (i = 0; i < weekdaysParseProperties.length; i++) {
|
|
7939
|
+
prop = weekdaysParseProperties[i];
|
|
7940
|
+
if (!hasOwnProp(config, prop)) {
|
|
7941
|
+
delete locale2["_" + prop];
|
|
7942
|
+
}
|
|
7943
|
+
}
|
|
7944
|
+
}
|
|
8036
7945
|
function localeWeekdays(m, format2) {
|
|
8037
7946
|
var weekdays = isArray(this._weekdays) ? this._weekdays : this._weekdays[m && m !== true && this._weekdays.isFormat.test(format2) ? "format" : "standalone"];
|
|
8038
7947
|
return m === true ? shiftWeekdays(weekdays, this._week.dow) : m ? weekdays[m.day()] : weekdays;
|
|
@@ -8043,7 +7952,7 @@
|
|
|
8043
7952
|
function localeWeekdaysMin(m) {
|
|
8044
7953
|
return m === true ? shiftWeekdays(this._weekdaysMin, this._week.dow) : m ? this._weekdaysMin[m.day()] : this._weekdaysMin;
|
|
8045
7954
|
}
|
|
8046
|
-
function handleStrictParse
|
|
7955
|
+
function handleStrictParse(weekdayName, format2, strict) {
|
|
8047
7956
|
var i, ii, mom, llc = weekdayName.toLocaleLowerCase();
|
|
8048
7957
|
if (!this._weekdaysParse) {
|
|
8049
7958
|
this._weekdaysParse = [];
|
|
@@ -8113,7 +8022,7 @@
|
|
|
8113
8022
|
function localeWeekdaysParse(weekdayName, format2, strict) {
|
|
8114
8023
|
var i, mom, regex;
|
|
8115
8024
|
if (this._weekdaysParseExact) {
|
|
8116
|
-
return handleStrictParse
|
|
8025
|
+
return handleStrictParse.call(this, weekdayName, format2, strict);
|
|
8117
8026
|
}
|
|
8118
8027
|
if (!this._weekdaysParse) {
|
|
8119
8028
|
this._weekdaysParse = [];
|
|
@@ -8156,7 +8065,7 @@
|
|
|
8156
8065
|
if (!this.isValid()) {
|
|
8157
8066
|
return input != null ? this : NaN;
|
|
8158
8067
|
}
|
|
8159
|
-
var day = this
|
|
8068
|
+
var day = get$2(this, "Day");
|
|
8160
8069
|
if (input != null) {
|
|
8161
8070
|
input = parseWeekday(input, this.localeData());
|
|
8162
8071
|
return this.add(input - day, "d");
|
|
@@ -8270,6 +8179,271 @@
|
|
|
8270
8179
|
"i"
|
|
8271
8180
|
);
|
|
8272
8181
|
}
|
|
8182
|
+
function set(config) {
|
|
8183
|
+
var prop, i;
|
|
8184
|
+
clearMonthsParseCache(this, config);
|
|
8185
|
+
clearWeekdaysParseCache(this, config);
|
|
8186
|
+
for (i in config) {
|
|
8187
|
+
if (hasOwnProp(config, i)) {
|
|
8188
|
+
prop = config[i];
|
|
8189
|
+
if (isFunction(prop)) {
|
|
8190
|
+
this[i] = prop;
|
|
8191
|
+
} else {
|
|
8192
|
+
this["_" + i] = prop;
|
|
8193
|
+
}
|
|
8194
|
+
}
|
|
8195
|
+
}
|
|
8196
|
+
this._config = config;
|
|
8197
|
+
this._dayOfMonthOrdinalParseLenient = new RegExp(
|
|
8198
|
+
(this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + "|" + /\d{1,2}/.source
|
|
8199
|
+
);
|
|
8200
|
+
}
|
|
8201
|
+
function mergeConfigs(parentConfig, childConfig) {
|
|
8202
|
+
var res = extend({}, parentConfig), prop;
|
|
8203
|
+
for (prop in childConfig) {
|
|
8204
|
+
if (hasOwnProp(childConfig, prop)) {
|
|
8205
|
+
if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) {
|
|
8206
|
+
res[prop] = {};
|
|
8207
|
+
extend(res[prop], parentConfig[prop]);
|
|
8208
|
+
extend(res[prop], childConfig[prop]);
|
|
8209
|
+
} else if (childConfig[prop] != null) {
|
|
8210
|
+
res[prop] = childConfig[prop];
|
|
8211
|
+
} else {
|
|
8212
|
+
delete res[prop];
|
|
8213
|
+
}
|
|
8214
|
+
}
|
|
8215
|
+
}
|
|
8216
|
+
for (prop in parentConfig) {
|
|
8217
|
+
if (hasOwnProp(parentConfig, prop) && !hasOwnProp(childConfig, prop) && isObject(parentConfig[prop])) {
|
|
8218
|
+
res[prop] = extend({}, res[prop]);
|
|
8219
|
+
}
|
|
8220
|
+
}
|
|
8221
|
+
return res;
|
|
8222
|
+
}
|
|
8223
|
+
function Locale(config) {
|
|
8224
|
+
if (config != null) {
|
|
8225
|
+
this.set(config);
|
|
8226
|
+
}
|
|
8227
|
+
}
|
|
8228
|
+
var keys;
|
|
8229
|
+
if (Object.keys) {
|
|
8230
|
+
keys = Object.keys;
|
|
8231
|
+
} else {
|
|
8232
|
+
keys = function(obj) {
|
|
8233
|
+
var i, res = [];
|
|
8234
|
+
for (i in obj) {
|
|
8235
|
+
if (hasOwnProp(obj, i)) {
|
|
8236
|
+
res.push(i);
|
|
8237
|
+
}
|
|
8238
|
+
}
|
|
8239
|
+
return res;
|
|
8240
|
+
};
|
|
8241
|
+
}
|
|
8242
|
+
var defaultCalendar = {
|
|
8243
|
+
sameDay: "[Today at] LT",
|
|
8244
|
+
nextDay: "[Tomorrow at] LT",
|
|
8245
|
+
nextWeek: "dddd [at] LT",
|
|
8246
|
+
lastDay: "[Yesterday at] LT",
|
|
8247
|
+
lastWeek: "[Last] dddd [at] LT",
|
|
8248
|
+
sameElse: "L"
|
|
8249
|
+
};
|
|
8250
|
+
function calendar$1(key2, mom, now2) {
|
|
8251
|
+
var output = this._calendar[key2] || this._calendar["sameElse"];
|
|
8252
|
+
return isFunction(output) ? output.call(mom, now2) : output;
|
|
8253
|
+
}
|
|
8254
|
+
var defaultLongDateFormat = {
|
|
8255
|
+
LTS: "h:mm:ss A",
|
|
8256
|
+
LT: "h:mm A",
|
|
8257
|
+
L: "MM/DD/YYYY",
|
|
8258
|
+
LL: "MMMM D, YYYY",
|
|
8259
|
+
LLL: "MMMM D, YYYY h:mm A",
|
|
8260
|
+
LLLL: "dddd, MMMM D, YYYY h:mm A"
|
|
8261
|
+
};
|
|
8262
|
+
function longDateFormat(key2) {
|
|
8263
|
+
var format2 = this._longDateFormat[key2], formatUpper = this._longDateFormat[key2.toUpperCase()], formatCache = this._longDateFormatCache;
|
|
8264
|
+
if (format2 || !formatUpper) {
|
|
8265
|
+
return format2;
|
|
8266
|
+
}
|
|
8267
|
+
if (formatCache && formatCache[key2] && formatCache[key2].formatUpper === formatUpper) {
|
|
8268
|
+
return formatCache[key2].format;
|
|
8269
|
+
}
|
|
8270
|
+
format2 = formatUpper.match(formattingTokens).map(function(tok) {
|
|
8271
|
+
if (tok === "MMMM" || tok === "MM" || tok === "DD" || tok === "dddd") {
|
|
8272
|
+
return tok.slice(1);
|
|
8273
|
+
}
|
|
8274
|
+
return tok;
|
|
8275
|
+
}).join("");
|
|
8276
|
+
if (!formatCache) {
|
|
8277
|
+
formatCache = this._longDateFormatCache = {};
|
|
8278
|
+
}
|
|
8279
|
+
formatCache[key2] = {
|
|
8280
|
+
formatUpper,
|
|
8281
|
+
format: format2
|
|
8282
|
+
};
|
|
8283
|
+
return format2;
|
|
8284
|
+
}
|
|
8285
|
+
var defaultInvalidDate = "Invalid date";
|
|
8286
|
+
function invalidDate() {
|
|
8287
|
+
return this._invalidDate;
|
|
8288
|
+
}
|
|
8289
|
+
var defaultOrdinal = "%d", defaultDayOfMonthOrdinalParse = /\d{1,2}/;
|
|
8290
|
+
function ordinal(number) {
|
|
8291
|
+
return this._ordinal.replace("%d", number);
|
|
8292
|
+
}
|
|
8293
|
+
var defaultRelativeTime = {
|
|
8294
|
+
future: "in %s",
|
|
8295
|
+
past: "%s ago",
|
|
8296
|
+
s: "a few seconds",
|
|
8297
|
+
ss: "%d seconds",
|
|
8298
|
+
m: "a minute",
|
|
8299
|
+
mm: "%d minutes",
|
|
8300
|
+
h: "an hour",
|
|
8301
|
+
hh: "%d hours",
|
|
8302
|
+
d: "a day",
|
|
8303
|
+
dd: "%d days",
|
|
8304
|
+
w: "a week",
|
|
8305
|
+
ww: "%d weeks",
|
|
8306
|
+
M: "a month",
|
|
8307
|
+
MM: "%d months",
|
|
8308
|
+
y: "a year",
|
|
8309
|
+
yy: "%d years"
|
|
8310
|
+
};
|
|
8311
|
+
function relativeTimeWithoutPostformat(number, withoutSuffix, string, isFuture) {
|
|
8312
|
+
var output = this._relativeTime[string];
|
|
8313
|
+
return isFunction(output) ? output(number, withoutSuffix, string, isFuture) : output.replace(/%d/i, number);
|
|
8314
|
+
}
|
|
8315
|
+
function relativeTime$1(number, withoutSuffix, string, isFuture) {
|
|
8316
|
+
return this.postformat(
|
|
8317
|
+
relativeTimeWithoutPostformat.call(
|
|
8318
|
+
this,
|
|
8319
|
+
number,
|
|
8320
|
+
withoutSuffix,
|
|
8321
|
+
string,
|
|
8322
|
+
isFuture
|
|
8323
|
+
)
|
|
8324
|
+
);
|
|
8325
|
+
}
|
|
8326
|
+
function pastFutureWithoutPostformat(diff2, output) {
|
|
8327
|
+
var format2 = this._relativeTime[diff2 > 0 ? "future" : "past"];
|
|
8328
|
+
return isFunction(format2) ? format2(output) : format2.replace(/%s/i, output);
|
|
8329
|
+
}
|
|
8330
|
+
function pastFuture(diff2, output) {
|
|
8331
|
+
return this.postformat(
|
|
8332
|
+
pastFutureWithoutPostformat.call(this, diff2, output)
|
|
8333
|
+
);
|
|
8334
|
+
}
|
|
8335
|
+
function createDate(y, m, d, h, M, s, ms) {
|
|
8336
|
+
var date;
|
|
8337
|
+
if (y < 100 && y >= 0) {
|
|
8338
|
+
date = new Date(y + 400, m, d, h, M, s, ms);
|
|
8339
|
+
if (isFinite(date.getFullYear())) {
|
|
8340
|
+
date.setFullYear(y);
|
|
8341
|
+
}
|
|
8342
|
+
} else {
|
|
8343
|
+
date = new Date(y, m, d, h, M, s, ms);
|
|
8344
|
+
}
|
|
8345
|
+
return date;
|
|
8346
|
+
}
|
|
8347
|
+
function createUTCDate(y) {
|
|
8348
|
+
var date, args;
|
|
8349
|
+
if (y < 100 && y >= 0) {
|
|
8350
|
+
args = Array.prototype.slice.call(arguments);
|
|
8351
|
+
args[0] = y + 400;
|
|
8352
|
+
date = new Date(Date.UTC.apply(null, args));
|
|
8353
|
+
if (isFinite(date.getUTCFullYear())) {
|
|
8354
|
+
date.setUTCFullYear(y);
|
|
8355
|
+
}
|
|
8356
|
+
} else {
|
|
8357
|
+
date = new Date(Date.UTC.apply(null, arguments));
|
|
8358
|
+
}
|
|
8359
|
+
return date;
|
|
8360
|
+
}
|
|
8361
|
+
function firstWeekOffset(year, dow, doy) {
|
|
8362
|
+
var fwd = 7 + dow - doy, fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7;
|
|
8363
|
+
return -fwdlw + fwd - 1;
|
|
8364
|
+
}
|
|
8365
|
+
function dayOfYearFromWeeks(year, week, weekday, dow, doy) {
|
|
8366
|
+
var localWeekday = (7 + weekday - dow) % 7, weekOffset = firstWeekOffset(year, dow, doy), dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, resYear, resDayOfYear;
|
|
8367
|
+
if (dayOfYear <= 0) {
|
|
8368
|
+
resYear = year - 1;
|
|
8369
|
+
resDayOfYear = daysInYear(resYear) + dayOfYear;
|
|
8370
|
+
} else if (dayOfYear > daysInYear(year)) {
|
|
8371
|
+
resYear = year + 1;
|
|
8372
|
+
resDayOfYear = dayOfYear - daysInYear(year);
|
|
8373
|
+
} else {
|
|
8374
|
+
resYear = year;
|
|
8375
|
+
resDayOfYear = dayOfYear;
|
|
8376
|
+
}
|
|
8377
|
+
return {
|
|
8378
|
+
year: resYear,
|
|
8379
|
+
dayOfYear: resDayOfYear
|
|
8380
|
+
};
|
|
8381
|
+
}
|
|
8382
|
+
function weekOfYearFromDayOfYear(year, dayOfYear, dow, doy) {
|
|
8383
|
+
var weekOffset = firstWeekOffset(year, dow, doy), week = Math.floor((dayOfYear - weekOffset - 1) / 7) + 1, resWeek, resYear;
|
|
8384
|
+
if (week < 1) {
|
|
8385
|
+
resYear = year - 1;
|
|
8386
|
+
resWeek = week + weeksInYear(resYear, dow, doy);
|
|
8387
|
+
} else if (week > weeksInYear(year, dow, doy)) {
|
|
8388
|
+
resWeek = week - weeksInYear(year, dow, doy);
|
|
8389
|
+
resYear = year + 1;
|
|
8390
|
+
} else {
|
|
8391
|
+
resYear = year;
|
|
8392
|
+
resWeek = week;
|
|
8393
|
+
}
|
|
8394
|
+
return {
|
|
8395
|
+
week: resWeek,
|
|
8396
|
+
year: resYear
|
|
8397
|
+
};
|
|
8398
|
+
}
|
|
8399
|
+
function weekOfYear(mom, dow, doy) {
|
|
8400
|
+
return weekOfYearFromDayOfYear(mom.year(), mom.dayOfYear(), dow, doy);
|
|
8401
|
+
}
|
|
8402
|
+
function weekOfYearFromDate(year, month, date, dow, doy) {
|
|
8403
|
+
var dayOfYear = Math.round(
|
|
8404
|
+
(createUTCDate(year, month, date) - createUTCDate(year, 0, 1)) / 864e5
|
|
8405
|
+
) + 1;
|
|
8406
|
+
return weekOfYearFromDayOfYear(year, dayOfYear, dow, doy);
|
|
8407
|
+
}
|
|
8408
|
+
function weeksInYear(year, dow, doy) {
|
|
8409
|
+
var weekOffset = firstWeekOffset(year, dow, doy), weekOffsetNext = firstWeekOffset(year + 1, dow, doy);
|
|
8410
|
+
return (daysInYear(year) - weekOffset + weekOffsetNext) / 7;
|
|
8411
|
+
}
|
|
8412
|
+
addFormatToken("w", ["ww", 2], "wo", "week");
|
|
8413
|
+
addFormatToken("W", ["WW", 2], "Wo", "isoWeek");
|
|
8414
|
+
addRegexToken("w", match1to2, match1to2NoLeadingZero);
|
|
8415
|
+
addRegexToken("ww", match1to2, match2);
|
|
8416
|
+
addRegexToken("W", match1to2, match1to2NoLeadingZero);
|
|
8417
|
+
addRegexToken("WW", match1to2, match2);
|
|
8418
|
+
addWeekParseToken(
|
|
8419
|
+
["w", "ww", "W", "WW"],
|
|
8420
|
+
function(input, week, config, token2) {
|
|
8421
|
+
week[token2.substr(0, 1)] = toInt(input);
|
|
8422
|
+
}
|
|
8423
|
+
);
|
|
8424
|
+
function localeWeek(mom) {
|
|
8425
|
+
return weekOfYear(mom, this._week.dow, this._week.doy).week;
|
|
8426
|
+
}
|
|
8427
|
+
var defaultLocaleWeek = {
|
|
8428
|
+
dow: 0,
|
|
8429
|
+
// Sunday is the first day of the week.
|
|
8430
|
+
doy: 6
|
|
8431
|
+
// The week that contains Jan 6th is the first week of the year.
|
|
8432
|
+
};
|
|
8433
|
+
function localeFirstDayOfWeek() {
|
|
8434
|
+
return this._week.dow;
|
|
8435
|
+
}
|
|
8436
|
+
function localeFirstDayOfYear() {
|
|
8437
|
+
return this._week.doy;
|
|
8438
|
+
}
|
|
8439
|
+
function getSetWeek(input) {
|
|
8440
|
+
var week = this.localeData().week(this);
|
|
8441
|
+
return input == null ? week : this.add((input - week) * 7, "d");
|
|
8442
|
+
}
|
|
8443
|
+
function getSetISOWeek(input) {
|
|
8444
|
+
var week = weekOfYear(this, 1, 4).week;
|
|
8445
|
+
return input == null ? week : this.add((input - week) * 7, "d");
|
|
8446
|
+
}
|
|
8273
8447
|
function hFormat() {
|
|
8274
8448
|
return this.hours() % 12 || 12;
|
|
8275
8449
|
}
|
|
@@ -8302,16 +8476,14 @@
|
|
|
8302
8476
|
}
|
|
8303
8477
|
meridiem("a", true);
|
|
8304
8478
|
meridiem("A", false);
|
|
8305
|
-
addUnitAlias("hour", "h");
|
|
8306
|
-
addUnitPriority("hour", 13);
|
|
8307
8479
|
function matchMeridiem(isStrict, locale2) {
|
|
8308
8480
|
return locale2._meridiemParse;
|
|
8309
8481
|
}
|
|
8310
8482
|
addRegexToken("a", matchMeridiem);
|
|
8311
8483
|
addRegexToken("A", matchMeridiem);
|
|
8312
|
-
addRegexToken("H", match1to2);
|
|
8313
|
-
addRegexToken("h", match1to2);
|
|
8314
|
-
addRegexToken("k", match1to2);
|
|
8484
|
+
addRegexToken("H", match1to2, match1to2HasZero);
|
|
8485
|
+
addRegexToken("h", match1to2, match1to2NoLeadingZero);
|
|
8486
|
+
addRegexToken("k", match1to2, match1to2NoLeadingZero);
|
|
8315
8487
|
addRegexToken("HH", match1to2, match2);
|
|
8316
8488
|
addRegexToken("hh", match1to2, match2);
|
|
8317
8489
|
addRegexToken("kk", match1to2, match2);
|
|
@@ -8417,21 +8589,30 @@
|
|
|
8417
8589
|
return globalLocale;
|
|
8418
8590
|
}
|
|
8419
8591
|
function isLocaleNameSane(name) {
|
|
8420
|
-
return name
|
|
8592
|
+
return typeof name === "string" && /^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(name);
|
|
8421
8593
|
}
|
|
8422
8594
|
function loadLocale(name) {
|
|
8423
|
-
var oldLocale = null, aliasedRequire;
|
|
8424
|
-
if (locales
|
|
8595
|
+
var oldLocale = null, aliasedRequire, normalizedName;
|
|
8596
|
+
if (hasOwnProp(locales, name)) {
|
|
8597
|
+
return locales[name];
|
|
8598
|
+
}
|
|
8599
|
+
normalizedName = normalizeLocale(name);
|
|
8600
|
+
if (hasOwnProp(locales, normalizedName)) {
|
|
8601
|
+
return locales[normalizedName];
|
|
8602
|
+
}
|
|
8603
|
+
if (typeof module !== "undefined" && module && module.exports && isLocaleNameSane(normalizedName)) {
|
|
8425
8604
|
try {
|
|
8426
8605
|
oldLocale = globalLocale._abbr;
|
|
8427
8606
|
aliasedRequire = __require;
|
|
8428
|
-
aliasedRequire("./locale/" +
|
|
8607
|
+
aliasedRequire("./locale/" + normalizedName);
|
|
8429
8608
|
getSetGlobalLocale(oldLocale);
|
|
8430
8609
|
} catch (e) {
|
|
8431
|
-
locales[
|
|
8610
|
+
locales[normalizedName] = null;
|
|
8432
8611
|
}
|
|
8433
8612
|
}
|
|
8434
|
-
|
|
8613
|
+
if (hasOwnProp(locales, normalizedName)) {
|
|
8614
|
+
return locales[normalizedName];
|
|
8615
|
+
}
|
|
8435
8616
|
}
|
|
8436
8617
|
function getSetGlobalLocale(key2, values) {
|
|
8437
8618
|
var data;
|
|
@@ -8496,12 +8677,14 @@
|
|
|
8496
8677
|
}
|
|
8497
8678
|
}
|
|
8498
8679
|
function updateLocale(name, config) {
|
|
8680
|
+
var locale2, tmpLocale = loadLocale(name), parentConfig = baseConfig;
|
|
8681
|
+
if (tmpLocale != null) {
|
|
8682
|
+
name = tmpLocale._abbr;
|
|
8683
|
+
}
|
|
8499
8684
|
if (config != null) {
|
|
8500
|
-
var locale2, tmpLocale, parentConfig = baseConfig;
|
|
8501
8685
|
if (locales[name] != null && locales[name].parentLocale != null) {
|
|
8502
8686
|
locales[name].set(mergeConfigs(locales[name]._config, config));
|
|
8503
8687
|
} else {
|
|
8504
|
-
tmpLocale = loadLocale(name);
|
|
8505
8688
|
if (tmpLocale != null) {
|
|
8506
8689
|
parentConfig = tmpLocale._config;
|
|
8507
8690
|
}
|
|
@@ -8758,8 +8941,38 @@
|
|
|
8758
8941
|
}
|
|
8759
8942
|
return c;
|
|
8760
8943
|
}
|
|
8761
|
-
function currentDateArray(config) {
|
|
8762
|
-
var
|
|
8944
|
+
function currentDateArray(config, now2, forWeek) {
|
|
8945
|
+
var hadWeekContext = Object.prototype.hasOwnProperty.call(
|
|
8946
|
+
config,
|
|
8947
|
+
"_isDefaultDatePartsForWeek"
|
|
8948
|
+
), weekContext = config._isDefaultDatePartsForWeek;
|
|
8949
|
+
config._isDefaultDatePartsForWeek = !!forWeek;
|
|
8950
|
+
try {
|
|
8951
|
+
return hooks2._getDefaultDateParts(config, now2, forWeek);
|
|
8952
|
+
} finally {
|
|
8953
|
+
if (hadWeekContext) {
|
|
8954
|
+
config._isDefaultDatePartsForWeek = weekContext;
|
|
8955
|
+
} else {
|
|
8956
|
+
delete config._isDefaultDatePartsForWeek;
|
|
8957
|
+
}
|
|
8958
|
+
}
|
|
8959
|
+
}
|
|
8960
|
+
function currentDateNow(config) {
|
|
8961
|
+
var now2 = config._defaultDatePartsNow;
|
|
8962
|
+
if (!now2) {
|
|
8963
|
+
return hooks2.now();
|
|
8964
|
+
}
|
|
8965
|
+
if (!now2.hasValue) {
|
|
8966
|
+
now2.value = hooks2.now();
|
|
8967
|
+
now2.hasValue = true;
|
|
8968
|
+
}
|
|
8969
|
+
return now2.value;
|
|
8970
|
+
}
|
|
8971
|
+
function getDefaultDateParts(config, now2, forWeek) {
|
|
8972
|
+
var useWeekDefaults = forWeek || config._isDefaultDatePartsForWeek, nowValue = useWeekDefaults ? createLocal(now2) : new Date(now2);
|
|
8973
|
+
if (useWeekDefaults) {
|
|
8974
|
+
return [nowValue.year(), nowValue.month(), nowValue.date()];
|
|
8975
|
+
}
|
|
8763
8976
|
if (config._useUTC) {
|
|
8764
8977
|
return [
|
|
8765
8978
|
nowValue.getUTCFullYear(),
|
|
@@ -8769,17 +8982,21 @@
|
|
|
8769
8982
|
}
|
|
8770
8983
|
return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()];
|
|
8771
8984
|
}
|
|
8985
|
+
hooks2._getDefaultDateParts = getDefaultDateParts;
|
|
8772
8986
|
function configFromArray(config) {
|
|
8773
|
-
var i, date, input = [], currentDate, expectedWeekday, yearToUse;
|
|
8987
|
+
var i, date, input = [], now2, currentDate, expectedWeekday, yearToUse, dateIsDefaulted;
|
|
8774
8988
|
if (config._d) {
|
|
8775
8989
|
return;
|
|
8776
8990
|
}
|
|
8777
|
-
|
|
8991
|
+
if (config._a[YEAR] == null || config._a[MONTH] == null || config._a[DATE] == null) {
|
|
8992
|
+
now2 = currentDateNow(config);
|
|
8993
|
+
currentDate = currentDateArray(config, now2);
|
|
8994
|
+
}
|
|
8778
8995
|
if (config._w && config._a[DATE] == null && config._a[MONTH] == null) {
|
|
8779
|
-
dayOfYearFromWeekInfo(config);
|
|
8996
|
+
dayOfYearFromWeekInfo(config, currentDateArray(config, now2, true));
|
|
8780
8997
|
}
|
|
8781
8998
|
if (config._dayOfYear != null) {
|
|
8782
|
-
yearToUse =
|
|
8999
|
+
yearToUse = config._a[YEAR] != null ? config._a[YEAR] : currentDate[YEAR];
|
|
8783
9000
|
if (config._dayOfYear > daysInYear(yearToUse) || config._dayOfYear === 0) {
|
|
8784
9001
|
getParsingFlags(config)._overflowDayOfYear = true;
|
|
8785
9002
|
}
|
|
@@ -8787,6 +9004,7 @@
|
|
|
8787
9004
|
config._a[MONTH] = date.getUTCMonth();
|
|
8788
9005
|
config._a[DATE] = date.getUTCDate();
|
|
8789
9006
|
}
|
|
9007
|
+
dateIsDefaulted = config._a[YEAR] == null || config._a[MONTH] == null || config._a[DATE] == null;
|
|
8790
9008
|
for (i = 0; i < 3 && config._a[i] == null; ++i) {
|
|
8791
9009
|
config._a[i] = input[i] = currentDate[i];
|
|
8792
9010
|
}
|
|
@@ -8808,11 +9026,11 @@
|
|
|
8808
9026
|
if (config._nextDay) {
|
|
8809
9027
|
config._a[HOUR] = 24;
|
|
8810
9028
|
}
|
|
8811
|
-
if (config._w && typeof config._w.d !== "undefined" && config._w.d !== expectedWeekday) {
|
|
9029
|
+
if (config._w && typeof config._w.d !== "undefined" && !dateIsDefaulted && config._w.d !== expectedWeekday) {
|
|
8812
9030
|
getParsingFlags(config).weekdayMismatch = true;
|
|
8813
9031
|
}
|
|
8814
9032
|
}
|
|
8815
|
-
function dayOfYearFromWeekInfo(config) {
|
|
9033
|
+
function dayOfYearFromWeekInfo(config, currentDate) {
|
|
8816
9034
|
var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;
|
|
8817
9035
|
w = config._w;
|
|
8818
9036
|
if (w.GG != null || w.W != null || w.E != null) {
|
|
@@ -8821,7 +9039,13 @@
|
|
|
8821
9039
|
weekYear = defaults(
|
|
8822
9040
|
w.GG,
|
|
8823
9041
|
config._a[YEAR],
|
|
8824
|
-
|
|
9042
|
+
weekOfYearFromDate(
|
|
9043
|
+
currentDate[YEAR],
|
|
9044
|
+
currentDate[MONTH],
|
|
9045
|
+
currentDate[DATE],
|
|
9046
|
+
1,
|
|
9047
|
+
4
|
|
9048
|
+
).year
|
|
8825
9049
|
);
|
|
8826
9050
|
week = defaults(w.W, 1);
|
|
8827
9051
|
weekday = defaults(w.E, 1);
|
|
@@ -8831,7 +9055,13 @@
|
|
|
8831
9055
|
} else {
|
|
8832
9056
|
dow = config._locale._week.dow;
|
|
8833
9057
|
doy = config._locale._week.doy;
|
|
8834
|
-
curWeek =
|
|
9058
|
+
curWeek = weekOfYearFromDate(
|
|
9059
|
+
currentDate[YEAR],
|
|
9060
|
+
currentDate[MONTH],
|
|
9061
|
+
currentDate[DATE],
|
|
9062
|
+
dow,
|
|
9063
|
+
doy
|
|
9064
|
+
);
|
|
8835
9065
|
weekYear = defaults(w.gg, config._a[YEAR], curWeek.year);
|
|
8836
9066
|
week = defaults(w.w, curWeek.week);
|
|
8837
9067
|
if (w.d != null) {
|
|
@@ -8942,7 +9172,7 @@
|
|
|
8942
9172
|
}
|
|
8943
9173
|
}
|
|
8944
9174
|
function configFromStringAndArray(config) {
|
|
8945
|
-
var tempConfig, bestMoment, scoreToBeat, i, currentScore, validFormatFound, bestFormatIsValid = false, configfLen = config._f.length;
|
|
9175
|
+
var tempConfig, bestMoment, scoreToBeat, i, currentScore, validFormatFound, bestFormatIsValid = false, defaultDatePartsNow = {}, configfLen = config._f.length;
|
|
8946
9176
|
if (configfLen === 0) {
|
|
8947
9177
|
getParsingFlags(config).invalidFormat = true;
|
|
8948
9178
|
config._d = /* @__PURE__ */ new Date(NaN);
|
|
@@ -8955,9 +9185,10 @@
|
|
|
8955
9185
|
if (config._useUTC != null) {
|
|
8956
9186
|
tempConfig._useUTC = config._useUTC;
|
|
8957
9187
|
}
|
|
9188
|
+
tempConfig._defaultDatePartsNow = defaultDatePartsNow;
|
|
8958
9189
|
tempConfig._f = config._f[i];
|
|
8959
9190
|
configFromStringAndFormat(tempConfig);
|
|
8960
|
-
if (isValid(tempConfig)) {
|
|
9191
|
+
if (isValid$2(tempConfig)) {
|
|
8961
9192
|
validFormatFound = true;
|
|
8962
9193
|
}
|
|
8963
9194
|
currentScore += getParsingFlags(tempConfig).charsLeftOver;
|
|
@@ -9005,7 +9236,7 @@
|
|
|
9005
9236
|
var input = config._i, format2 = config._f;
|
|
9006
9237
|
config._locale = config._locale || getLocale(config._l);
|
|
9007
9238
|
if (input === null || format2 === void 0 && input === "") {
|
|
9008
|
-
return createInvalid({ nullInput: true });
|
|
9239
|
+
return createInvalid$1({ nullInput: true });
|
|
9009
9240
|
}
|
|
9010
9241
|
if (typeof input === "string") {
|
|
9011
9242
|
config._i = input = config._locale.preparse(input);
|
|
@@ -9021,7 +9252,7 @@
|
|
|
9021
9252
|
} else {
|
|
9022
9253
|
configFromInput(config);
|
|
9023
9254
|
}
|
|
9024
|
-
if (!isValid(config)) {
|
|
9255
|
+
if (!isValid$2(config)) {
|
|
9025
9256
|
config._d = null;
|
|
9026
9257
|
}
|
|
9027
9258
|
return config;
|
|
@@ -9078,7 +9309,7 @@
|
|
|
9078
9309
|
if (this.isValid() && other.isValid()) {
|
|
9079
9310
|
return other < this ? this : other;
|
|
9080
9311
|
} else {
|
|
9081
|
-
return createInvalid();
|
|
9312
|
+
return createInvalid$1();
|
|
9082
9313
|
}
|
|
9083
9314
|
}
|
|
9084
9315
|
), prototypeMax = deprecate(
|
|
@@ -9088,7 +9319,7 @@
|
|
|
9088
9319
|
if (this.isValid() && other.isValid()) {
|
|
9089
9320
|
return other > this ? this : other;
|
|
9090
9321
|
} else {
|
|
9091
|
-
return createInvalid();
|
|
9322
|
+
return createInvalid$1();
|
|
9092
9323
|
}
|
|
9093
9324
|
}
|
|
9094
9325
|
);
|
|
@@ -9100,9 +9331,17 @@
|
|
|
9100
9331
|
if (!moments.length) {
|
|
9101
9332
|
return createLocal();
|
|
9102
9333
|
}
|
|
9103
|
-
|
|
9104
|
-
|
|
9105
|
-
|
|
9334
|
+
for (i = 0; i < moments.length; ++i) {
|
|
9335
|
+
if (isMoment(moments[i])) {
|
|
9336
|
+
res = moments[i];
|
|
9337
|
+
break;
|
|
9338
|
+
}
|
|
9339
|
+
}
|
|
9340
|
+
if (!res) {
|
|
9341
|
+
return createInvalid$1();
|
|
9342
|
+
}
|
|
9343
|
+
for (++i; i < moments.length; ++i) {
|
|
9344
|
+
if (isMoment(moments[i]) && (!moments[i].isValid() || moments[i][fn](res))) {
|
|
9106
9345
|
res = moments[i];
|
|
9107
9346
|
}
|
|
9108
9347
|
}
|
|
@@ -9152,7 +9391,7 @@
|
|
|
9152
9391
|
function isValid$1() {
|
|
9153
9392
|
return this._isValid;
|
|
9154
9393
|
}
|
|
9155
|
-
function createInvalid
|
|
9394
|
+
function createInvalid() {
|
|
9156
9395
|
return createDuration(NaN);
|
|
9157
9396
|
}
|
|
9158
9397
|
function Duration(duration) {
|
|
@@ -9180,7 +9419,7 @@
|
|
|
9180
9419
|
function compareArrays(array1, array2, dontConvert) {
|
|
9181
9420
|
var len = Math.min(array1.length, array2.length), lengthDiff = Math.abs(array1.length - array2.length), diffs = 0, i;
|
|
9182
9421
|
for (i = 0; i < len; i++) {
|
|
9183
|
-
if (
|
|
9422
|
+
if (toInt(array1[i]) !== toInt(array2[i])) {
|
|
9184
9423
|
diffs++;
|
|
9185
9424
|
}
|
|
9186
9425
|
}
|
|
@@ -9201,8 +9440,12 @@
|
|
|
9201
9440
|
addRegexToken("Z", matchShortOffset);
|
|
9202
9441
|
addRegexToken("ZZ", matchShortOffset);
|
|
9203
9442
|
addParseToken(["Z", "ZZ"], function(input, array, config) {
|
|
9443
|
+
var offset2 = offsetFromString(matchShortOffset, input);
|
|
9204
9444
|
config._useUTC = true;
|
|
9205
|
-
config._tzm =
|
|
9445
|
+
config._tzm = offset2;
|
|
9446
|
+
if (offset2 === null) {
|
|
9447
|
+
getParsingFlags(config).invalidOffset = input;
|
|
9448
|
+
}
|
|
9206
9449
|
});
|
|
9207
9450
|
var chunkOffset = /([\+\-]|\d\d)/gi;
|
|
9208
9451
|
function offsetFromString(matcher, string) {
|
|
@@ -9213,6 +9456,9 @@
|
|
|
9213
9456
|
chunk = matches[matches.length - 1] || [];
|
|
9214
9457
|
parts = (chunk + "").match(chunkOffset) || ["-", 0, 0];
|
|
9215
9458
|
minutes2 = +(parts[1] * 60) + toInt(parts[2]);
|
|
9459
|
+
if (toInt(parts[2]) > 59 || (parts[0] === "+" ? minutes2 > 14 * 60 : minutes2 > 12 * 60)) {
|
|
9460
|
+
return null;
|
|
9461
|
+
}
|
|
9216
9462
|
return minutes2 === 0 ? 0 : parts[0] === "+" ? minutes2 : -minutes2;
|
|
9217
9463
|
}
|
|
9218
9464
|
function cloneWithOffset(input, model) {
|
|
@@ -9256,7 +9502,7 @@
|
|
|
9256
9502
|
}
|
|
9257
9503
|
if (offset2 !== input) {
|
|
9258
9504
|
if (!keepLocalTime || this._changeInProgress) {
|
|
9259
|
-
addSubtract(
|
|
9505
|
+
addSubtract$1(
|
|
9260
9506
|
this,
|
|
9261
9507
|
createDuration(input - offset2, "m"),
|
|
9262
9508
|
1,
|
|
@@ -9403,7 +9649,7 @@
|
|
|
9403
9649
|
return ret;
|
|
9404
9650
|
}
|
|
9405
9651
|
createDuration.fn = Duration.prototype;
|
|
9406
|
-
createDuration.invalid = createInvalid
|
|
9652
|
+
createDuration.invalid = createInvalid;
|
|
9407
9653
|
function parseIso(inp, sign2) {
|
|
9408
9654
|
var res = inp && parseFloat(inp.replace(",", "."));
|
|
9409
9655
|
return (isNaN(res) ? 0 : res) * sign2;
|
|
@@ -9445,21 +9691,21 @@
|
|
|
9445
9691
|
period = tmp;
|
|
9446
9692
|
}
|
|
9447
9693
|
dur = createDuration(val, period);
|
|
9448
|
-
addSubtract(this, dur, direction);
|
|
9694
|
+
addSubtract$1(this, dur, direction);
|
|
9449
9695
|
return this;
|
|
9450
9696
|
};
|
|
9451
9697
|
}
|
|
9452
|
-
function addSubtract(mom, duration, isAdding, updateOffset) {
|
|
9698
|
+
function addSubtract$1(mom, duration, isAdding, updateOffset) {
|
|
9453
9699
|
var milliseconds2 = duration._milliseconds, days2 = absRound(duration._days), months2 = absRound(duration._months);
|
|
9454
9700
|
if (!mom.isValid()) {
|
|
9455
9701
|
return;
|
|
9456
9702
|
}
|
|
9457
9703
|
updateOffset = updateOffset == null ? true : updateOffset;
|
|
9458
9704
|
if (months2) {
|
|
9459
|
-
setMonth(mom, get(mom, "Month") + months2 * isAdding);
|
|
9705
|
+
setMonth(mom, get$2(mom, "Month") + months2 * isAdding);
|
|
9460
9706
|
}
|
|
9461
9707
|
if (days2) {
|
|
9462
|
-
set$1(mom, "Date", get(mom, "Date") + days2 * isAdding);
|
|
9708
|
+
set$1(mom, "Date", get$2(mom, "Date") + days2 * isAdding);
|
|
9463
9709
|
}
|
|
9464
9710
|
if (milliseconds2) {
|
|
9465
9711
|
mom._d.setTime(mom._d.valueOf() + milliseconds2 * isAdding);
|
|
@@ -9468,7 +9714,7 @@
|
|
|
9468
9714
|
hooks2.updateOffset(mom, days2 || months2);
|
|
9469
9715
|
}
|
|
9470
9716
|
}
|
|
9471
|
-
var add = createAdder(1, "add"), subtract = createAdder(-1, "subtract");
|
|
9717
|
+
var add$1 = createAdder(1, "add"), subtract$1 = createAdder(-1, "subtract");
|
|
9472
9718
|
function isString(input) {
|
|
9473
9719
|
return typeof input === "string" || input instanceof String;
|
|
9474
9720
|
}
|
|
@@ -9536,7 +9782,7 @@
|
|
|
9536
9782
|
var diff2 = myMoment.diff(now2, "days", true);
|
|
9537
9783
|
return diff2 < -6 ? "sameElse" : diff2 < -1 ? "lastWeek" : diff2 < 0 ? "lastDay" : diff2 < 1 ? "sameDay" : diff2 < 2 ? "nextDay" : diff2 < 7 ? "nextWeek" : "sameElse";
|
|
9538
9784
|
}
|
|
9539
|
-
function calendar
|
|
9785
|
+
function calendar(time, formats) {
|
|
9540
9786
|
if (arguments.length === 1) {
|
|
9541
9787
|
if (!arguments[0]) {
|
|
9542
9788
|
time = void 0;
|
|
@@ -9554,7 +9800,7 @@
|
|
|
9554
9800
|
output || this.localeData().calendar(format2, this, createLocal(now2))
|
|
9555
9801
|
);
|
|
9556
9802
|
}
|
|
9557
|
-
function clone() {
|
|
9803
|
+
function clone$1() {
|
|
9558
9804
|
return new Moment(this);
|
|
9559
9805
|
}
|
|
9560
9806
|
function isAfter(input, units) {
|
|
@@ -9673,7 +9919,7 @@
|
|
|
9673
9919
|
function toString() {
|
|
9674
9920
|
return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ");
|
|
9675
9921
|
}
|
|
9676
|
-
function toISOString(keepOffset) {
|
|
9922
|
+
function toISOString$1(keepOffset) {
|
|
9677
9923
|
if (!this.isValid()) {
|
|
9678
9924
|
return null;
|
|
9679
9925
|
}
|
|
@@ -9764,7 +10010,7 @@
|
|
|
9764
10010
|
return this._locale;
|
|
9765
10011
|
}
|
|
9766
10012
|
var MS_PER_SECOND = 1e3, MS_PER_MINUTE = 60 * MS_PER_SECOND, MS_PER_HOUR = 60 * MS_PER_MINUTE, MS_PER_400_YEARS = (365 * 400 + 97) * 24 * MS_PER_HOUR;
|
|
9767
|
-
function mod
|
|
10013
|
+
function mod(dividend, divisor) {
|
|
9768
10014
|
return (dividend % divisor + divisor) % divisor;
|
|
9769
10015
|
}
|
|
9770
10016
|
function localStartOfDate(y, m, d) {
|
|
@@ -9822,18 +10068,18 @@
|
|
|
9822
10068
|
break;
|
|
9823
10069
|
case "hour":
|
|
9824
10070
|
time = this._d.valueOf();
|
|
9825
|
-
time -= mod
|
|
10071
|
+
time -= mod(
|
|
9826
10072
|
time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
|
|
9827
10073
|
MS_PER_HOUR
|
|
9828
10074
|
);
|
|
9829
10075
|
break;
|
|
9830
10076
|
case "minute":
|
|
9831
10077
|
time = this._d.valueOf();
|
|
9832
|
-
time -= mod
|
|
10078
|
+
time -= mod(time, MS_PER_MINUTE);
|
|
9833
10079
|
break;
|
|
9834
10080
|
case "second":
|
|
9835
10081
|
time = this._d.valueOf();
|
|
9836
|
-
time -= mod
|
|
10082
|
+
time -= mod(time, MS_PER_SECOND);
|
|
9837
10083
|
break;
|
|
9838
10084
|
}
|
|
9839
10085
|
this._d.setTime(time);
|
|
@@ -9881,25 +10127,25 @@
|
|
|
9881
10127
|
break;
|
|
9882
10128
|
case "hour":
|
|
9883
10129
|
time = this._d.valueOf();
|
|
9884
|
-
time += MS_PER_HOUR - mod
|
|
10130
|
+
time += MS_PER_HOUR - mod(
|
|
9885
10131
|
time + (this._isUTC ? 0 : this.utcOffset() * MS_PER_MINUTE),
|
|
9886
10132
|
MS_PER_HOUR
|
|
9887
10133
|
) - 1;
|
|
9888
10134
|
break;
|
|
9889
10135
|
case "minute":
|
|
9890
10136
|
time = this._d.valueOf();
|
|
9891
|
-
time += MS_PER_MINUTE - mod
|
|
10137
|
+
time += MS_PER_MINUTE - mod(time, MS_PER_MINUTE) - 1;
|
|
9892
10138
|
break;
|
|
9893
10139
|
case "second":
|
|
9894
10140
|
time = this._d.valueOf();
|
|
9895
|
-
time += MS_PER_SECOND - mod
|
|
10141
|
+
time += MS_PER_SECOND - mod(time, MS_PER_SECOND) - 1;
|
|
9896
10142
|
break;
|
|
9897
10143
|
}
|
|
9898
10144
|
this._d.setTime(time);
|
|
9899
10145
|
hooks2.updateOffset(this, true);
|
|
9900
10146
|
return this;
|
|
9901
10147
|
}
|
|
9902
|
-
function valueOf() {
|
|
10148
|
+
function valueOf$1() {
|
|
9903
10149
|
return this._d.valueOf() - (this._offset || 0) * 6e4;
|
|
9904
10150
|
}
|
|
9905
10151
|
function unix() {
|
|
@@ -9935,8 +10181,8 @@
|
|
|
9935
10181
|
function toJSON() {
|
|
9936
10182
|
return this.isValid() ? this.toISOString() : null;
|
|
9937
10183
|
}
|
|
9938
|
-
function isValid
|
|
9939
|
-
return isValid(this);
|
|
10184
|
+
function isValid() {
|
|
10185
|
+
return isValid$2(this);
|
|
9940
10186
|
}
|
|
9941
10187
|
function parsingFlags() {
|
|
9942
10188
|
return extend({}, getParsingFlags(this));
|
|
@@ -10137,14 +10383,17 @@
|
|
|
10137
10383
|
return locale2._eraYearOrdinalRegex || matchUnsigned;
|
|
10138
10384
|
}
|
|
10139
10385
|
function computeErasParse() {
|
|
10140
|
-
var abbrPieces = [], namePieces = [], narrowPieces = [], mixedPieces = [], i, l, eras = this.eras();
|
|
10386
|
+
var abbrPieces = [], namePieces = [], narrowPieces = [], mixedPieces = [], i, l, erasName, erasAbbr, erasNarrow, eras = this.eras();
|
|
10141
10387
|
for (i = 0, l = eras.length; i < l; ++i) {
|
|
10142
|
-
|
|
10143
|
-
|
|
10144
|
-
|
|
10145
|
-
|
|
10146
|
-
|
|
10147
|
-
|
|
10388
|
+
erasName = regexEscape(eras[i].name);
|
|
10389
|
+
erasAbbr = regexEscape(eras[i].abbr);
|
|
10390
|
+
erasNarrow = regexEscape(eras[i].narrow);
|
|
10391
|
+
namePieces.push(erasName);
|
|
10392
|
+
abbrPieces.push(erasAbbr);
|
|
10393
|
+
narrowPieces.push(erasNarrow);
|
|
10394
|
+
mixedPieces.push(erasName);
|
|
10395
|
+
mixedPieces.push(erasAbbr);
|
|
10396
|
+
mixedPieces.push(erasNarrow);
|
|
10148
10397
|
}
|
|
10149
10398
|
this._erasRegex = new RegExp("^(" + mixedPieces.join("|") + ")", "i");
|
|
10150
10399
|
this._erasNameRegex = new RegExp("^(" + namePieces.join("|") + ")", "i");
|
|
@@ -10167,10 +10416,6 @@
|
|
|
10167
10416
|
addWeekYearFormatToken("ggggg", "weekYear");
|
|
10168
10417
|
addWeekYearFormatToken("GGGG", "isoWeekYear");
|
|
10169
10418
|
addWeekYearFormatToken("GGGGG", "isoWeekYear");
|
|
10170
|
-
addUnitAlias("weekYear", "gg");
|
|
10171
|
-
addUnitAlias("isoWeekYear", "GG");
|
|
10172
|
-
addUnitPriority("weekYear", 1);
|
|
10173
|
-
addUnitPriority("isoWeekYear", 1);
|
|
10174
10419
|
addRegexToken("G", matchSigned);
|
|
10175
10420
|
addRegexToken("g", matchSigned);
|
|
10176
10421
|
addRegexToken("GG", match1to2, match2);
|
|
@@ -10193,7 +10438,7 @@
|
|
|
10193
10438
|
this,
|
|
10194
10439
|
input,
|
|
10195
10440
|
this.week(),
|
|
10196
|
-
this.weekday(),
|
|
10441
|
+
this.weekday() + this.localeData()._week.dow,
|
|
10197
10442
|
this.localeData()._week.dow,
|
|
10198
10443
|
this.localeData()._week.doy
|
|
10199
10444
|
);
|
|
@@ -10242,8 +10487,6 @@
|
|
|
10242
10487
|
return this;
|
|
10243
10488
|
}
|
|
10244
10489
|
addFormatToken("Q", 0, "Qo", "quarter");
|
|
10245
|
-
addUnitAlias("quarter", "Q");
|
|
10246
|
-
addUnitPriority("quarter", 7);
|
|
10247
10490
|
addRegexToken("Q", match1);
|
|
10248
10491
|
addParseToken("Q", function(input, array) {
|
|
10249
10492
|
array[MONTH] = (toInt(input) - 1) * 3;
|
|
@@ -10252,9 +10495,7 @@
|
|
|
10252
10495
|
return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3);
|
|
10253
10496
|
}
|
|
10254
10497
|
addFormatToken("D", ["DD", 2], "Do", "date");
|
|
10255
|
-
|
|
10256
|
-
addUnitPriority("date", 9);
|
|
10257
|
-
addRegexToken("D", match1to2);
|
|
10498
|
+
addRegexToken("D", match1to2, match1to2NoLeadingZero);
|
|
10258
10499
|
addRegexToken("DD", match1to2, match2);
|
|
10259
10500
|
addRegexToken("Do", function(isStrict, locale2) {
|
|
10260
10501
|
return isStrict ? locale2._dayOfMonthOrdinalParse || locale2._ordinalParse : locale2._dayOfMonthOrdinalParseLenient;
|
|
@@ -10265,8 +10506,6 @@
|
|
|
10265
10506
|
});
|
|
10266
10507
|
var getSetDayOfMonth = makeGetSet("Date", true);
|
|
10267
10508
|
addFormatToken("DDD", ["DDDD", 3], "DDDo", "dayOfYear");
|
|
10268
|
-
addUnitAlias("dayOfYear", "DDD");
|
|
10269
|
-
addUnitPriority("dayOfYear", 4);
|
|
10270
10509
|
addRegexToken("DDD", match1to3);
|
|
10271
10510
|
addRegexToken("DDDD", match3);
|
|
10272
10511
|
addParseToken(["DDD", "DDDD"], function(input, array, config) {
|
|
@@ -10279,16 +10518,12 @@
|
|
|
10279
10518
|
return input == null ? dayOfYear : this.add(input - dayOfYear, "d");
|
|
10280
10519
|
}
|
|
10281
10520
|
addFormatToken("m", ["mm", 2], 0, "minute");
|
|
10282
|
-
|
|
10283
|
-
addUnitPriority("minute", 14);
|
|
10284
|
-
addRegexToken("m", match1to2);
|
|
10521
|
+
addRegexToken("m", match1to2, match1to2HasZero);
|
|
10285
10522
|
addRegexToken("mm", match1to2, match2);
|
|
10286
10523
|
addParseToken(["m", "mm"], MINUTE);
|
|
10287
10524
|
var getSetMinute = makeGetSet("Minutes", false);
|
|
10288
10525
|
addFormatToken("s", ["ss", 2], 0, "second");
|
|
10289
|
-
|
|
10290
|
-
addUnitPriority("second", 15);
|
|
10291
|
-
addRegexToken("s", match1to2);
|
|
10526
|
+
addRegexToken("s", match1to2, match1to2HasZero);
|
|
10292
10527
|
addRegexToken("ss", match1to2, match2);
|
|
10293
10528
|
addParseToken(["s", "ss"], SECOND);
|
|
10294
10529
|
var getSetSecond = makeGetSet("Seconds", false);
|
|
@@ -10317,8 +10552,6 @@
|
|
|
10317
10552
|
addFormatToken(0, ["SSSSSSSSS", 9], 0, function() {
|
|
10318
10553
|
return this.millisecond() * 1e6;
|
|
10319
10554
|
});
|
|
10320
|
-
addUnitAlias("millisecond", "ms");
|
|
10321
|
-
addUnitPriority("millisecond", 16);
|
|
10322
10555
|
addRegexToken("S", match1to3, match1);
|
|
10323
10556
|
addRegexToken("SS", match1to3, match2);
|
|
10324
10557
|
addRegexToken("SSS", match1to3, match3);
|
|
@@ -10341,105 +10574,105 @@
|
|
|
10341
10574
|
function getZoneName() {
|
|
10342
10575
|
return this._isUTC ? "Coordinated Universal Time" : "";
|
|
10343
10576
|
}
|
|
10344
|
-
var proto = Moment.prototype;
|
|
10345
|
-
proto.add = add;
|
|
10346
|
-
proto.calendar = calendar
|
|
10347
|
-
proto.clone = clone;
|
|
10348
|
-
proto.diff = diff;
|
|
10349
|
-
proto.endOf = endOf;
|
|
10350
|
-
proto.format = format;
|
|
10351
|
-
proto.from = from;
|
|
10352
|
-
proto.fromNow = fromNow;
|
|
10353
|
-
proto.to = to;
|
|
10354
|
-
proto.toNow = toNow;
|
|
10355
|
-
proto.get = stringGet;
|
|
10356
|
-
proto.invalidAt = invalidAt;
|
|
10357
|
-
proto.isAfter = isAfter;
|
|
10358
|
-
proto.isBefore = isBefore;
|
|
10359
|
-
proto.isBetween = isBetween;
|
|
10360
|
-
proto.isSame = isSame;
|
|
10361
|
-
proto.isSameOrAfter = isSameOrAfter;
|
|
10362
|
-
proto.isSameOrBefore = isSameOrBefore;
|
|
10363
|
-
proto.isValid = isValid
|
|
10364
|
-
proto.lang = lang;
|
|
10365
|
-
proto.locale = locale;
|
|
10366
|
-
proto.localeData = localeData;
|
|
10367
|
-
proto.max = prototypeMax;
|
|
10368
|
-
proto.min = prototypeMin;
|
|
10369
|
-
proto.parsingFlags = parsingFlags;
|
|
10370
|
-
proto.set = stringSet;
|
|
10371
|
-
proto.startOf = startOf;
|
|
10372
|
-
proto.subtract = subtract;
|
|
10373
|
-
proto.toArray = toArray;
|
|
10374
|
-
proto.toObject = toObject;
|
|
10375
|
-
proto.toDate = toDate;
|
|
10376
|
-
proto.toISOString = toISOString;
|
|
10377
|
-
proto.inspect = inspect;
|
|
10577
|
+
var proto$2 = Moment.prototype;
|
|
10578
|
+
proto$2.add = add$1;
|
|
10579
|
+
proto$2.calendar = calendar;
|
|
10580
|
+
proto$2.clone = clone$1;
|
|
10581
|
+
proto$2.diff = diff;
|
|
10582
|
+
proto$2.endOf = endOf;
|
|
10583
|
+
proto$2.format = format;
|
|
10584
|
+
proto$2.from = from;
|
|
10585
|
+
proto$2.fromNow = fromNow;
|
|
10586
|
+
proto$2.to = to;
|
|
10587
|
+
proto$2.toNow = toNow;
|
|
10588
|
+
proto$2.get = stringGet;
|
|
10589
|
+
proto$2.invalidAt = invalidAt;
|
|
10590
|
+
proto$2.isAfter = isAfter;
|
|
10591
|
+
proto$2.isBefore = isBefore;
|
|
10592
|
+
proto$2.isBetween = isBetween;
|
|
10593
|
+
proto$2.isSame = isSame;
|
|
10594
|
+
proto$2.isSameOrAfter = isSameOrAfter;
|
|
10595
|
+
proto$2.isSameOrBefore = isSameOrBefore;
|
|
10596
|
+
proto$2.isValid = isValid;
|
|
10597
|
+
proto$2.lang = lang;
|
|
10598
|
+
proto$2.locale = locale;
|
|
10599
|
+
proto$2.localeData = localeData;
|
|
10600
|
+
proto$2.max = prototypeMax;
|
|
10601
|
+
proto$2.min = prototypeMin;
|
|
10602
|
+
proto$2.parsingFlags = parsingFlags;
|
|
10603
|
+
proto$2.set = stringSet;
|
|
10604
|
+
proto$2.startOf = startOf;
|
|
10605
|
+
proto$2.subtract = subtract$1;
|
|
10606
|
+
proto$2.toArray = toArray;
|
|
10607
|
+
proto$2.toObject = toObject;
|
|
10608
|
+
proto$2.toDate = toDate;
|
|
10609
|
+
proto$2.toISOString = toISOString$1;
|
|
10610
|
+
proto$2.inspect = inspect;
|
|
10378
10611
|
if (typeof Symbol !== "undefined" && Symbol.for != null) {
|
|
10379
|
-
proto[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = function() {
|
|
10612
|
+
proto$2[/* @__PURE__ */ Symbol.for("nodejs.util.inspect.custom")] = function() {
|
|
10380
10613
|
return "Moment<" + this.format() + ">";
|
|
10381
10614
|
};
|
|
10382
10615
|
}
|
|
10383
|
-
proto.toJSON = toJSON;
|
|
10384
|
-
proto.toString = toString;
|
|
10385
|
-
proto.unix = unix;
|
|
10386
|
-
proto.valueOf = valueOf;
|
|
10387
|
-
proto.creationData = creationData;
|
|
10388
|
-
proto.eraName = getEraName;
|
|
10389
|
-
proto.eraNarrow = getEraNarrow;
|
|
10390
|
-
proto.eraAbbr = getEraAbbr;
|
|
10391
|
-
proto.eraYear = getEraYear;
|
|
10392
|
-
proto.year = getSetYear;
|
|
10393
|
-
proto.isLeapYear = getIsLeapYear;
|
|
10394
|
-
proto.weekYear = getSetWeekYear;
|
|
10395
|
-
proto.isoWeekYear = getSetISOWeekYear;
|
|
10396
|
-
proto.quarter = proto.quarters = getSetQuarter;
|
|
10397
|
-
proto.month = getSetMonth;
|
|
10398
|
-
proto.daysInMonth = getDaysInMonth;
|
|
10399
|
-
proto.week = proto.weeks = getSetWeek;
|
|
10400
|
-
proto.isoWeek = proto.isoWeeks = getSetISOWeek;
|
|
10401
|
-
proto.weeksInYear = getWeeksInYear;
|
|
10402
|
-
proto.weeksInWeekYear = getWeeksInWeekYear;
|
|
10403
|
-
proto.isoWeeksInYear = getISOWeeksInYear;
|
|
10404
|
-
proto.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;
|
|
10405
|
-
proto.date = getSetDayOfMonth;
|
|
10406
|
-
proto.day = proto.days = getSetDayOfWeek;
|
|
10407
|
-
proto.weekday = getSetLocaleDayOfWeek;
|
|
10408
|
-
proto.isoWeekday = getSetISODayOfWeek;
|
|
10409
|
-
proto.dayOfYear = getSetDayOfYear;
|
|
10410
|
-
proto.hour = proto.hours = getSetHour;
|
|
10411
|
-
proto.minute = proto.minutes = getSetMinute;
|
|
10412
|
-
proto.second = proto.seconds = getSetSecond;
|
|
10413
|
-
proto.millisecond = proto.milliseconds = getSetMillisecond;
|
|
10414
|
-
proto.utcOffset = getSetOffset;
|
|
10415
|
-
proto.utc = setOffsetToUTC;
|
|
10416
|
-
proto.local = setOffsetToLocal;
|
|
10417
|
-
proto.parseZone = setOffsetToParsedOffset;
|
|
10418
|
-
proto.hasAlignedHourOffset = hasAlignedHourOffset;
|
|
10419
|
-
proto.isDST = isDaylightSavingTime;
|
|
10420
|
-
proto.isLocal = isLocal;
|
|
10421
|
-
proto.isUtcOffset = isUtcOffset;
|
|
10422
|
-
proto.isUtc = isUtc;
|
|
10423
|
-
proto.isUTC = isUtc;
|
|
10424
|
-
proto.zoneAbbr = getZoneAbbr;
|
|
10425
|
-
proto.zoneName = getZoneName;
|
|
10426
|
-
proto.dates = deprecate(
|
|
10616
|
+
proto$2.toJSON = toJSON;
|
|
10617
|
+
proto$2.toString = toString;
|
|
10618
|
+
proto$2.unix = unix;
|
|
10619
|
+
proto$2.valueOf = valueOf$1;
|
|
10620
|
+
proto$2.creationData = creationData;
|
|
10621
|
+
proto$2.eraName = getEraName;
|
|
10622
|
+
proto$2.eraNarrow = getEraNarrow;
|
|
10623
|
+
proto$2.eraAbbr = getEraAbbr;
|
|
10624
|
+
proto$2.eraYear = getEraYear;
|
|
10625
|
+
proto$2.year = getSetYear;
|
|
10626
|
+
proto$2.isLeapYear = getIsLeapYear;
|
|
10627
|
+
proto$2.weekYear = getSetWeekYear;
|
|
10628
|
+
proto$2.isoWeekYear = getSetISOWeekYear;
|
|
10629
|
+
proto$2.quarter = proto$2.quarters = getSetQuarter;
|
|
10630
|
+
proto$2.month = getSetMonth;
|
|
10631
|
+
proto$2.daysInMonth = getDaysInMonth;
|
|
10632
|
+
proto$2.week = proto$2.weeks = getSetWeek;
|
|
10633
|
+
proto$2.isoWeek = proto$2.isoWeeks = getSetISOWeek;
|
|
10634
|
+
proto$2.weeksInYear = getWeeksInYear;
|
|
10635
|
+
proto$2.weeksInWeekYear = getWeeksInWeekYear;
|
|
10636
|
+
proto$2.isoWeeksInYear = getISOWeeksInYear;
|
|
10637
|
+
proto$2.isoWeeksInISOWeekYear = getISOWeeksInISOWeekYear;
|
|
10638
|
+
proto$2.date = getSetDayOfMonth;
|
|
10639
|
+
proto$2.day = proto$2.days = getSetDayOfWeek;
|
|
10640
|
+
proto$2.weekday = getSetLocaleDayOfWeek;
|
|
10641
|
+
proto$2.isoWeekday = getSetISODayOfWeek;
|
|
10642
|
+
proto$2.dayOfYear = getSetDayOfYear;
|
|
10643
|
+
proto$2.hour = proto$2.hours = getSetHour;
|
|
10644
|
+
proto$2.minute = proto$2.minutes = getSetMinute;
|
|
10645
|
+
proto$2.second = proto$2.seconds = getSetSecond;
|
|
10646
|
+
proto$2.millisecond = proto$2.milliseconds = getSetMillisecond;
|
|
10647
|
+
proto$2.utcOffset = getSetOffset;
|
|
10648
|
+
proto$2.utc = setOffsetToUTC;
|
|
10649
|
+
proto$2.local = setOffsetToLocal;
|
|
10650
|
+
proto$2.parseZone = setOffsetToParsedOffset;
|
|
10651
|
+
proto$2.hasAlignedHourOffset = hasAlignedHourOffset;
|
|
10652
|
+
proto$2.isDST = isDaylightSavingTime;
|
|
10653
|
+
proto$2.isLocal = isLocal;
|
|
10654
|
+
proto$2.isUtcOffset = isUtcOffset;
|
|
10655
|
+
proto$2.isUtc = isUtc;
|
|
10656
|
+
proto$2.isUTC = isUtc;
|
|
10657
|
+
proto$2.zoneAbbr = getZoneAbbr;
|
|
10658
|
+
proto$2.zoneName = getZoneName;
|
|
10659
|
+
proto$2.dates = deprecate(
|
|
10427
10660
|
"dates accessor is deprecated. Use date instead.",
|
|
10428
10661
|
getSetDayOfMonth
|
|
10429
10662
|
);
|
|
10430
|
-
proto.months = deprecate(
|
|
10663
|
+
proto$2.months = deprecate(
|
|
10431
10664
|
"months accessor is deprecated. Use month instead",
|
|
10432
10665
|
getSetMonth
|
|
10433
10666
|
);
|
|
10434
|
-
proto.years = deprecate(
|
|
10667
|
+
proto$2.years = deprecate(
|
|
10435
10668
|
"years accessor is deprecated. Use year instead",
|
|
10436
10669
|
getSetYear
|
|
10437
10670
|
);
|
|
10438
|
-
proto.zone = deprecate(
|
|
10671
|
+
proto$2.zone = deprecate(
|
|
10439
10672
|
"moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",
|
|
10440
10673
|
getSetZone
|
|
10441
10674
|
);
|
|
10442
|
-
proto.isDSTShifted = deprecate(
|
|
10675
|
+
proto$2.isDSTShifted = deprecate(
|
|
10443
10676
|
"isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",
|
|
10444
10677
|
isDaylightSavingTimeShifted
|
|
10445
10678
|
);
|
|
@@ -10453,13 +10686,13 @@
|
|
|
10453
10686
|
return string;
|
|
10454
10687
|
}
|
|
10455
10688
|
var proto$1 = Locale.prototype;
|
|
10456
|
-
proto$1.calendar = calendar;
|
|
10689
|
+
proto$1.calendar = calendar$1;
|
|
10457
10690
|
proto$1.longDateFormat = longDateFormat;
|
|
10458
10691
|
proto$1.invalidDate = invalidDate;
|
|
10459
10692
|
proto$1.ordinal = ordinal;
|
|
10460
10693
|
proto$1.preparse = preParsePostFormat;
|
|
10461
10694
|
proto$1.postformat = preParsePostFormat;
|
|
10462
|
-
proto$1.relativeTime = relativeTime;
|
|
10695
|
+
proto$1.relativeTime = relativeTime$1;
|
|
10463
10696
|
proto$1.pastFuture = pastFuture;
|
|
10464
10697
|
proto$1.set = set;
|
|
10465
10698
|
proto$1.eras = localeEras;
|
|
@@ -10579,7 +10812,7 @@
|
|
|
10579
10812
|
getLocale
|
|
10580
10813
|
);
|
|
10581
10814
|
var mathAbs = Math.abs;
|
|
10582
|
-
function abs() {
|
|
10815
|
+
function abs$1() {
|
|
10583
10816
|
var data = this._data;
|
|
10584
10817
|
this._milliseconds = mathAbs(this._milliseconds);
|
|
10585
10818
|
this._days = mathAbs(this._days);
|
|
@@ -10592,18 +10825,18 @@
|
|
|
10592
10825
|
data.years = mathAbs(data.years);
|
|
10593
10826
|
return this;
|
|
10594
10827
|
}
|
|
10595
|
-
function addSubtract
|
|
10828
|
+
function addSubtract(duration, input, value, direction) {
|
|
10596
10829
|
var other = createDuration(input, value);
|
|
10597
10830
|
duration._milliseconds += direction * other._milliseconds;
|
|
10598
10831
|
duration._days += direction * other._days;
|
|
10599
10832
|
duration._months += direction * other._months;
|
|
10600
10833
|
return duration._bubble();
|
|
10601
10834
|
}
|
|
10602
|
-
function add
|
|
10603
|
-
return addSubtract
|
|
10835
|
+
function add(input, value) {
|
|
10836
|
+
return addSubtract(this, input, value, 1);
|
|
10604
10837
|
}
|
|
10605
|
-
function subtract
|
|
10606
|
-
return addSubtract
|
|
10838
|
+
function subtract(input, value) {
|
|
10839
|
+
return addSubtract(this, input, value, -1);
|
|
10607
10840
|
}
|
|
10608
10841
|
function absCeil(number) {
|
|
10609
10842
|
if (number < 0) {
|
|
@@ -10681,22 +10914,16 @@
|
|
|
10681
10914
|
}
|
|
10682
10915
|
}
|
|
10683
10916
|
}
|
|
10684
|
-
function valueOf$1() {
|
|
10685
|
-
if (!this.isValid()) {
|
|
10686
|
-
return NaN;
|
|
10687
|
-
}
|
|
10688
|
-
return this._milliseconds + this._days * 864e5 + this._months % 12 * 2592e6 + toInt(this._months / 12) * 31536e6;
|
|
10689
|
-
}
|
|
10690
10917
|
function makeAs(alias) {
|
|
10691
10918
|
return function() {
|
|
10692
10919
|
return this.as(alias);
|
|
10693
10920
|
};
|
|
10694
10921
|
}
|
|
10695
|
-
var asMilliseconds = makeAs("ms"), asSeconds = makeAs("s"), asMinutes = makeAs("m"), asHours = makeAs("h"), asDays = makeAs("d"), asWeeks = makeAs("w"), asMonths = makeAs("M"), asQuarters = makeAs("Q"), asYears = makeAs("y");
|
|
10696
|
-
function clone
|
|
10922
|
+
var asMilliseconds = makeAs("ms"), asSeconds = makeAs("s"), asMinutes = makeAs("m"), asHours = makeAs("h"), asDays = makeAs("d"), asWeeks = makeAs("w"), asMonths = makeAs("M"), asQuarters = makeAs("Q"), asYears = makeAs("y"), valueOf = asMilliseconds;
|
|
10923
|
+
function clone() {
|
|
10697
10924
|
return createDuration(this);
|
|
10698
10925
|
}
|
|
10699
|
-
function get
|
|
10926
|
+
function get(units) {
|
|
10700
10927
|
units = normalizeUnits(units);
|
|
10701
10928
|
return this.isValid() ? this[units + "s"]() : NaN;
|
|
10702
10929
|
}
|
|
@@ -10726,9 +10953,15 @@
|
|
|
10726
10953
|
// months to year
|
|
10727
10954
|
};
|
|
10728
10955
|
function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale2) {
|
|
10729
|
-
return
|
|
10956
|
+
return relativeTimeWithoutPostformat.call(
|
|
10957
|
+
locale2,
|
|
10958
|
+
number || 1,
|
|
10959
|
+
!!withoutSuffix,
|
|
10960
|
+
string,
|
|
10961
|
+
isFuture
|
|
10962
|
+
);
|
|
10730
10963
|
}
|
|
10731
|
-
function relativeTime
|
|
10964
|
+
function relativeTime(posNegDuration, withoutSuffix, thresholds2, locale2) {
|
|
10732
10965
|
var duration = createDuration(posNegDuration).abs(), seconds2 = round(duration.as("s")), minutes2 = round(duration.as("m")), hours2 = round(duration.as("h")), days2 = round(duration.as("d")), months2 = round(duration.as("M")), weeks2 = round(duration.as("w")), years2 = round(duration.as("y")), a = seconds2 <= thresholds2.ss && ["s", seconds2] || seconds2 < thresholds2.s && ["ss", seconds2] || minutes2 <= 1 && ["m"] || minutes2 < thresholds2.m && ["mm", minutes2] || hours2 <= 1 && ["h"] || hours2 < thresholds2.h && ["hh", hours2] || days2 <= 1 && ["d"] || days2 < thresholds2.d && ["dd", days2];
|
|
10733
10966
|
if (thresholds2.w != null) {
|
|
10734
10967
|
a = a || weeks2 <= 1 && ["w"] || weeks2 < thresholds2.w && ["ww", weeks2];
|
|
@@ -10775,27 +11008,27 @@
|
|
|
10775
11008
|
withSuffix = argWithSuffix;
|
|
10776
11009
|
}
|
|
10777
11010
|
if (typeof argThresholds === "object") {
|
|
10778
|
-
th =
|
|
11011
|
+
th = extend(extend({}, thresholds), argThresholds || {});
|
|
10779
11012
|
if (argThresholds.s != null && argThresholds.ss == null) {
|
|
10780
11013
|
th.ss = argThresholds.s - 1;
|
|
10781
11014
|
}
|
|
10782
11015
|
}
|
|
10783
11016
|
locale2 = this.localeData();
|
|
10784
|
-
output = relativeTime
|
|
11017
|
+
output = relativeTime(this, !withSuffix, th, locale2);
|
|
10785
11018
|
if (withSuffix) {
|
|
10786
|
-
output =
|
|
11019
|
+
output = pastFutureWithoutPostformat.call(locale2, +this, output);
|
|
10787
11020
|
}
|
|
10788
11021
|
return locale2.postformat(output);
|
|
10789
11022
|
}
|
|
10790
|
-
var abs
|
|
11023
|
+
var abs = Math.abs;
|
|
10791
11024
|
function sign(x) {
|
|
10792
11025
|
return (x > 0) - (x < 0) || +x;
|
|
10793
11026
|
}
|
|
10794
|
-
function toISOString
|
|
11027
|
+
function toISOString() {
|
|
10795
11028
|
if (!this.isValid()) {
|
|
10796
11029
|
return this.localeData().invalidDate();
|
|
10797
11030
|
}
|
|
10798
|
-
var seconds2 = abs
|
|
11031
|
+
var seconds2 = abs(this._milliseconds) / 1e3, days2 = abs(this._days), months2 = abs(this._months), minutes2, hours2, years2, s, total = this.asSeconds(), totalSign, ymSign, daysSign, hmsSign;
|
|
10799
11032
|
if (!total) {
|
|
10800
11033
|
return "P0D";
|
|
10801
11034
|
}
|
|
@@ -10812,44 +11045,44 @@
|
|
|
10812
11045
|
hmsSign = sign(this._milliseconds) !== sign(total) ? "-" : "";
|
|
10813
11046
|
return totalSign + "P" + (years2 ? ymSign + years2 + "Y" : "") + (months2 ? ymSign + months2 + "M" : "") + (days2 ? daysSign + days2 + "D" : "") + (hours2 || minutes2 || seconds2 ? "T" : "") + (hours2 ? hmsSign + hours2 + "H" : "") + (minutes2 ? hmsSign + minutes2 + "M" : "") + (seconds2 ? hmsSign + s + "S" : "");
|
|
10814
11047
|
}
|
|
10815
|
-
var proto
|
|
10816
|
-
proto
|
|
10817
|
-
proto
|
|
10818
|
-
proto
|
|
10819
|
-
proto
|
|
10820
|
-
proto
|
|
10821
|
-
proto
|
|
10822
|
-
proto
|
|
10823
|
-
proto
|
|
10824
|
-
proto
|
|
10825
|
-
proto
|
|
10826
|
-
proto
|
|
10827
|
-
proto
|
|
10828
|
-
proto
|
|
10829
|
-
proto
|
|
10830
|
-
proto
|
|
10831
|
-
proto
|
|
10832
|
-
proto
|
|
10833
|
-
proto
|
|
10834
|
-
proto
|
|
10835
|
-
proto
|
|
10836
|
-
proto
|
|
10837
|
-
proto
|
|
10838
|
-
proto
|
|
10839
|
-
proto
|
|
10840
|
-
proto
|
|
10841
|
-
proto
|
|
10842
|
-
proto
|
|
10843
|
-
proto
|
|
10844
|
-
proto
|
|
10845
|
-
proto
|
|
10846
|
-
proto
|
|
10847
|
-
proto
|
|
10848
|
-
proto
|
|
11048
|
+
var proto = Duration.prototype;
|
|
11049
|
+
proto.isValid = isValid$1;
|
|
11050
|
+
proto.abs = abs$1;
|
|
11051
|
+
proto.add = add;
|
|
11052
|
+
proto.subtract = subtract;
|
|
11053
|
+
proto.as = as;
|
|
11054
|
+
proto.asMilliseconds = asMilliseconds;
|
|
11055
|
+
proto.asSeconds = asSeconds;
|
|
11056
|
+
proto.asMinutes = asMinutes;
|
|
11057
|
+
proto.asHours = asHours;
|
|
11058
|
+
proto.asDays = asDays;
|
|
11059
|
+
proto.asWeeks = asWeeks;
|
|
11060
|
+
proto.asMonths = asMonths;
|
|
11061
|
+
proto.asQuarters = asQuarters;
|
|
11062
|
+
proto.asYears = asYears;
|
|
11063
|
+
proto.valueOf = valueOf;
|
|
11064
|
+
proto._bubble = bubble;
|
|
11065
|
+
proto.clone = clone;
|
|
11066
|
+
proto.get = get;
|
|
11067
|
+
proto.milliseconds = milliseconds;
|
|
11068
|
+
proto.seconds = seconds;
|
|
11069
|
+
proto.minutes = minutes;
|
|
11070
|
+
proto.hours = hours;
|
|
11071
|
+
proto.days = days;
|
|
11072
|
+
proto.weeks = weeks;
|
|
11073
|
+
proto.months = months;
|
|
11074
|
+
proto.years = years;
|
|
11075
|
+
proto.humanize = humanize;
|
|
11076
|
+
proto.toISOString = toISOString;
|
|
11077
|
+
proto.toString = toISOString;
|
|
11078
|
+
proto.toJSON = toISOString;
|
|
11079
|
+
proto.locale = locale;
|
|
11080
|
+
proto.localeData = localeData;
|
|
11081
|
+
proto.toIsoString = deprecate(
|
|
10849
11082
|
"toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",
|
|
10850
|
-
toISOString
|
|
11083
|
+
toISOString
|
|
10851
11084
|
);
|
|
10852
|
-
proto
|
|
11085
|
+
proto.lang = lang;
|
|
10853
11086
|
addFormatToken("X", 0, 0, "unix");
|
|
10854
11087
|
addFormatToken("x", 0, 0, "valueOf");
|
|
10855
11088
|
addRegexToken("x", matchSigned);
|
|
@@ -10860,9 +11093,9 @@
|
|
|
10860
11093
|
addParseToken("x", function(input, array, config) {
|
|
10861
11094
|
config._d = new Date(toInt(input));
|
|
10862
11095
|
});
|
|
10863
|
-
hooks2.version = "2.
|
|
11096
|
+
hooks2.version = "2.31.0";
|
|
10864
11097
|
setHookCallback(createLocal);
|
|
10865
|
-
hooks2.fn = proto;
|
|
11098
|
+
hooks2.fn = proto$2;
|
|
10866
11099
|
hooks2.min = min;
|
|
10867
11100
|
hooks2.max = max;
|
|
10868
11101
|
hooks2.now = now;
|
|
@@ -10871,7 +11104,7 @@
|
|
|
10871
11104
|
hooks2.months = listMonths;
|
|
10872
11105
|
hooks2.isDate = isDate;
|
|
10873
11106
|
hooks2.locale = getSetGlobalLocale;
|
|
10874
|
-
hooks2.invalid = createInvalid;
|
|
11107
|
+
hooks2.invalid = createInvalid$1;
|
|
10875
11108
|
hooks2.duration = createDuration;
|
|
10876
11109
|
hooks2.isMoment = isMoment;
|
|
10877
11110
|
hooks2.weekdays = listWeekdays;
|
|
@@ -10888,7 +11121,7 @@
|
|
|
10888
11121
|
hooks2.relativeTimeRounding = getSetRelativeTimeRounding;
|
|
10889
11122
|
hooks2.relativeTimeThreshold = getSetRelativeTimeThreshold;
|
|
10890
11123
|
hooks2.calendarFormat = getCalendarFormat;
|
|
10891
|
-
hooks2.prototype = proto;
|
|
11124
|
+
hooks2.prototype = proto$2;
|
|
10892
11125
|
hooks2.HTML5_FMT = {
|
|
10893
11126
|
DATETIME_LOCAL: "YYYY-MM-DDTHH:mm",
|
|
10894
11127
|
// <input type="datetime-local" />
|
|
@@ -11046,9 +11279,9 @@
|
|
|
11046
11279
|
}
|
|
11047
11280
|
function map(array, fn) {
|
|
11048
11281
|
var result = [];
|
|
11049
|
-
var
|
|
11050
|
-
while (
|
|
11051
|
-
result[
|
|
11282
|
+
var length = array.length;
|
|
11283
|
+
while (length--) {
|
|
11284
|
+
result[length] = fn(array[length]);
|
|
11052
11285
|
}
|
|
11053
11286
|
return result;
|
|
11054
11287
|
}
|
|
@@ -11067,10 +11300,10 @@
|
|
|
11067
11300
|
function ucs2decode(string) {
|
|
11068
11301
|
var output = [];
|
|
11069
11302
|
var counter = 0;
|
|
11070
|
-
var
|
|
11071
|
-
while (counter <
|
|
11303
|
+
var length = string.length;
|
|
11304
|
+
while (counter < length) {
|
|
11072
11305
|
var value = string.charCodeAt(counter++);
|
|
11073
|
-
if (value >= 55296 && value <= 56319 && counter <
|
|
11306
|
+
if (value >= 55296 && value <= 56319 && counter < length) {
|
|
11074
11307
|
var extra = string.charCodeAt(counter++);
|
|
11075
11308
|
if ((extra & 64512) == 56320) {
|
|
11076
11309
|
output.push(((value & 1023) << 10) + (extra & 1023) + 65536);
|
|
@@ -11941,11 +12174,11 @@
|
|
|
11941
12174
|
if (a === b) return true;
|
|
11942
12175
|
if (a && b && typeof a == "object" && typeof b == "object") {
|
|
11943
12176
|
if (a.constructor !== b.constructor) return false;
|
|
11944
|
-
var
|
|
12177
|
+
var length, i, keys;
|
|
11945
12178
|
if (Array.isArray(a)) {
|
|
11946
|
-
|
|
11947
|
-
if (
|
|
11948
|
-
for (i =
|
|
12179
|
+
length = a.length;
|
|
12180
|
+
if (length != b.length) return false;
|
|
12181
|
+
for (i = length; i-- !== 0; )
|
|
11949
12182
|
if (!equal(a[i], b[i])) return false;
|
|
11950
12183
|
return true;
|
|
11951
12184
|
}
|
|
@@ -11953,11 +12186,11 @@
|
|
|
11953
12186
|
if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
|
|
11954
12187
|
if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();
|
|
11955
12188
|
keys = Object.keys(a);
|
|
11956
|
-
|
|
11957
|
-
if (
|
|
11958
|
-
for (i =
|
|
12189
|
+
length = keys.length;
|
|
12190
|
+
if (length !== Object.keys(b).length) return false;
|
|
12191
|
+
for (i = length; i-- !== 0; )
|
|
11959
12192
|
if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
|
|
11960
|
-
for (i =
|
|
12193
|
+
for (i = length; i-- !== 0; ) {
|
|
11961
12194
|
var key2 = keys[i];
|
|
11962
12195
|
if (!equal(a[key2], b[key2])) return false;
|
|
11963
12196
|
}
|
|
@@ -11974,16 +12207,16 @@
|
|
|
11974
12207
|
"use strict";
|
|
11975
12208
|
init_process_global();
|
|
11976
12209
|
module.exports = function ucs2length(str) {
|
|
11977
|
-
var
|
|
12210
|
+
var length = 0, len = str.length, pos = 0, value;
|
|
11978
12211
|
while (pos < len) {
|
|
11979
|
-
|
|
12212
|
+
length++;
|
|
11980
12213
|
value = str.charCodeAt(pos++);
|
|
11981
12214
|
if (value >= 55296 && value <= 56319 && pos < len) {
|
|
11982
12215
|
value = str.charCodeAt(pos);
|
|
11983
12216
|
if ((value & 64512) == 56320) pos++;
|
|
11984
12217
|
}
|
|
11985
12218
|
}
|
|
11986
|
-
return
|
|
12219
|
+
return length;
|
|
11987
12220
|
};
|
|
11988
12221
|
}
|
|
11989
12222
|
});
|
|
@@ -13251,8 +13484,8 @@
|
|
|
13251
13484
|
throw new Error("parent schema must have all required keywords: " + deps.join(","));
|
|
13252
13485
|
var validateSchema = rule.definition.validateSchema;
|
|
13253
13486
|
if (validateSchema) {
|
|
13254
|
-
var
|
|
13255
|
-
if (!
|
|
13487
|
+
var valid = validateSchema(schema2);
|
|
13488
|
+
if (!valid) {
|
|
13256
13489
|
var message = "keyword schema is invalid: " + self2.errorsText(validateSchema.errors);
|
|
13257
13490
|
if (self2._opts.validateSchema == "log") self2.logger.error(message);
|
|
13258
13491
|
else throw new Error(message);
|
|
@@ -16906,9 +17139,9 @@
|
|
|
16906
17139
|
var schemaObj = this._addSchema(schemaKeyRef);
|
|
16907
17140
|
v = schemaObj.validate || this._compile(schemaObj);
|
|
16908
17141
|
}
|
|
16909
|
-
var
|
|
17142
|
+
var valid = v(data);
|
|
16910
17143
|
if (v.$async !== true) this.errors = v.errors;
|
|
16911
|
-
return
|
|
17144
|
+
return valid;
|
|
16912
17145
|
}
|
|
16913
17146
|
function compile(schema, _meta) {
|
|
16914
17147
|
var schemaObj = this._addSchema(schema, void 0, _meta);
|
|
@@ -16941,13 +17174,13 @@
|
|
|
16941
17174
|
this.errors = null;
|
|
16942
17175
|
return true;
|
|
16943
17176
|
}
|
|
16944
|
-
var
|
|
16945
|
-
if (!
|
|
17177
|
+
var valid = this.validate($schema, schema);
|
|
17178
|
+
if (!valid && throwOrLogError) {
|
|
16946
17179
|
var message = "schema is invalid: " + this.errorsText();
|
|
16947
17180
|
if (this._opts.validateSchema == "log") this.logger.error(message);
|
|
16948
17181
|
else throw new Error(message);
|
|
16949
17182
|
}
|
|
16950
|
-
return
|
|
17183
|
+
return valid;
|
|
16951
17184
|
}
|
|
16952
17185
|
function defaultMeta(self2) {
|
|
16953
17186
|
var meta = self2._opts.meta;
|
|
@@ -17321,11 +17554,11 @@
|
|
|
17321
17554
|
]);
|
|
17322
17555
|
}
|
|
17323
17556
|
},
|
|
17324
|
-
_checkStringAndLength: function(parameter,
|
|
17325
|
-
if (typeof parameter !== "string" || parameter.length >
|
|
17557
|
+
_checkStringAndLength: function(parameter, length, name) {
|
|
17558
|
+
if (typeof parameter !== "string" || parameter.length > length) {
|
|
17326
17559
|
throw checkError([
|
|
17327
17560
|
{ message: "OGAPI_STRING_PARAMETER", parameter: name },
|
|
17328
|
-
{ message: "OGAPI_MAX_LENGTH", parameter:
|
|
17561
|
+
{ message: "OGAPI_MAX_LENGTH", parameter: length }
|
|
17329
17562
|
]);
|
|
17330
17563
|
}
|
|
17331
17564
|
},
|
|
@@ -26076,18 +26309,18 @@
|
|
|
26076
26309
|
}
|
|
26077
26310
|
var toEnd = to.length;
|
|
26078
26311
|
var toLen = toEnd - toStart;
|
|
26079
|
-
var
|
|
26312
|
+
var length = fromLen < toLen ? fromLen : toLen;
|
|
26080
26313
|
var lastCommonSep = -1;
|
|
26081
26314
|
var i = 0;
|
|
26082
|
-
for (; i <=
|
|
26083
|
-
if (i ===
|
|
26084
|
-
if (toLen >
|
|
26315
|
+
for (; i <= length; ++i) {
|
|
26316
|
+
if (i === length) {
|
|
26317
|
+
if (toLen > length) {
|
|
26085
26318
|
if (to.charCodeAt(toStart + i) === 47) {
|
|
26086
26319
|
return to.slice(toStart + i + 1);
|
|
26087
26320
|
} else if (i === 0) {
|
|
26088
26321
|
return to.slice(toStart + i);
|
|
26089
26322
|
}
|
|
26090
|
-
} else if (fromLen >
|
|
26323
|
+
} else if (fromLen > length) {
|
|
26091
26324
|
if (from.charCodeAt(fromStart + i) === 47) {
|
|
26092
26325
|
lastCommonSep = i;
|
|
26093
26326
|
} else if (i === 0) {
|
|
@@ -26643,15 +26876,15 @@
|
|
|
26643
26876
|
return this.byteOffset;
|
|
26644
26877
|
}
|
|
26645
26878
|
});
|
|
26646
|
-
function createBuffer(
|
|
26647
|
-
if (
|
|
26648
|
-
throw new RangeError('The value "' +
|
|
26879
|
+
function createBuffer(length) {
|
|
26880
|
+
if (length > K_MAX_LENGTH) {
|
|
26881
|
+
throw new RangeError('The value "' + length + '" is invalid for option "size"');
|
|
26649
26882
|
}
|
|
26650
|
-
const buf = new Uint8Array(
|
|
26883
|
+
const buf = new Uint8Array(length);
|
|
26651
26884
|
Object.setPrototypeOf(buf, Buffer2.prototype);
|
|
26652
26885
|
return buf;
|
|
26653
26886
|
}
|
|
26654
|
-
function Buffer2(arg, encodingOrOffset,
|
|
26887
|
+
function Buffer2(arg, encodingOrOffset, length) {
|
|
26655
26888
|
if (typeof arg === "number") {
|
|
26656
26889
|
if (typeof encodingOrOffset === "string") {
|
|
26657
26890
|
throw new TypeError(
|
|
@@ -26660,10 +26893,10 @@
|
|
|
26660
26893
|
}
|
|
26661
26894
|
return allocUnsafe(arg);
|
|
26662
26895
|
}
|
|
26663
|
-
return from(arg, encodingOrOffset,
|
|
26896
|
+
return from(arg, encodingOrOffset, length);
|
|
26664
26897
|
}
|
|
26665
26898
|
Buffer2.poolSize = 8192;
|
|
26666
|
-
function from(value, encodingOrOffset,
|
|
26899
|
+
function from(value, encodingOrOffset, length) {
|
|
26667
26900
|
if (typeof value === "string") {
|
|
26668
26901
|
return fromString(value, encodingOrOffset);
|
|
26669
26902
|
}
|
|
@@ -26676,10 +26909,10 @@
|
|
|
26676
26909
|
);
|
|
26677
26910
|
}
|
|
26678
26911
|
if (isInstance(value, ArrayBuffer) || value && isInstance(value.buffer, ArrayBuffer)) {
|
|
26679
|
-
return fromArrayBuffer(value, encodingOrOffset,
|
|
26912
|
+
return fromArrayBuffer(value, encodingOrOffset, length);
|
|
26680
26913
|
}
|
|
26681
26914
|
if (typeof SharedArrayBuffer !== "undefined" && (isInstance(value, SharedArrayBuffer) || value && isInstance(value.buffer, SharedArrayBuffer))) {
|
|
26682
|
-
return fromArrayBuffer(value, encodingOrOffset,
|
|
26915
|
+
return fromArrayBuffer(value, encodingOrOffset, length);
|
|
26683
26916
|
}
|
|
26684
26917
|
if (typeof value === "number") {
|
|
26685
26918
|
throw new TypeError(
|
|
@@ -26688,19 +26921,19 @@
|
|
|
26688
26921
|
}
|
|
26689
26922
|
const valueOf = value.valueOf && value.valueOf();
|
|
26690
26923
|
if (valueOf != null && valueOf !== value) {
|
|
26691
|
-
return Buffer2.from(valueOf, encodingOrOffset,
|
|
26924
|
+
return Buffer2.from(valueOf, encodingOrOffset, length);
|
|
26692
26925
|
}
|
|
26693
26926
|
const b = fromObject(value);
|
|
26694
26927
|
if (b) return b;
|
|
26695
26928
|
if (typeof Symbol !== "undefined" && Symbol.toPrimitive != null && typeof value[Symbol.toPrimitive] === "function") {
|
|
26696
|
-
return Buffer2.from(value[Symbol.toPrimitive]("string"), encodingOrOffset,
|
|
26929
|
+
return Buffer2.from(value[Symbol.toPrimitive]("string"), encodingOrOffset, length);
|
|
26697
26930
|
}
|
|
26698
26931
|
throw new TypeError(
|
|
26699
26932
|
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value
|
|
26700
26933
|
);
|
|
26701
26934
|
}
|
|
26702
|
-
Buffer2.from = function(value, encodingOrOffset,
|
|
26703
|
-
return from(value, encodingOrOffset,
|
|
26935
|
+
Buffer2.from = function(value, encodingOrOffset, length) {
|
|
26936
|
+
return from(value, encodingOrOffset, length);
|
|
26704
26937
|
};
|
|
26705
26938
|
Object.setPrototypeOf(Buffer2.prototype, Uint8Array.prototype);
|
|
26706
26939
|
Object.setPrototypeOf(Buffer2, Uint8Array);
|
|
@@ -26741,18 +26974,18 @@
|
|
|
26741
26974
|
if (!Buffer2.isEncoding(encoding)) {
|
|
26742
26975
|
throw new TypeError("Unknown encoding: " + encoding);
|
|
26743
26976
|
}
|
|
26744
|
-
const
|
|
26745
|
-
let buf = createBuffer(
|
|
26977
|
+
const length = byteLength(string, encoding) | 0;
|
|
26978
|
+
let buf = createBuffer(length);
|
|
26746
26979
|
const actual = buf.write(string, encoding);
|
|
26747
|
-
if (actual !==
|
|
26980
|
+
if (actual !== length) {
|
|
26748
26981
|
buf = buf.slice(0, actual);
|
|
26749
26982
|
}
|
|
26750
26983
|
return buf;
|
|
26751
26984
|
}
|
|
26752
26985
|
function fromArrayLike(array) {
|
|
26753
|
-
const
|
|
26754
|
-
const buf = createBuffer(
|
|
26755
|
-
for (let i = 0; i <
|
|
26986
|
+
const length = array.length < 0 ? 0 : checked(array.length) | 0;
|
|
26987
|
+
const buf = createBuffer(length);
|
|
26988
|
+
for (let i = 0; i < length; i += 1) {
|
|
26756
26989
|
buf[i] = array[i] & 255;
|
|
26757
26990
|
}
|
|
26758
26991
|
return buf;
|
|
@@ -26764,20 +26997,20 @@
|
|
|
26764
26997
|
}
|
|
26765
26998
|
return fromArrayLike(arrayView);
|
|
26766
26999
|
}
|
|
26767
|
-
function fromArrayBuffer(array, byteOffset,
|
|
27000
|
+
function fromArrayBuffer(array, byteOffset, length) {
|
|
26768
27001
|
if (byteOffset < 0 || array.byteLength < byteOffset) {
|
|
26769
27002
|
throw new RangeError('"offset" is outside of buffer bounds');
|
|
26770
27003
|
}
|
|
26771
|
-
if (array.byteLength < byteOffset + (
|
|
27004
|
+
if (array.byteLength < byteOffset + (length || 0)) {
|
|
26772
27005
|
throw new RangeError('"length" is outside of buffer bounds');
|
|
26773
27006
|
}
|
|
26774
27007
|
let buf;
|
|
26775
|
-
if (byteOffset === void 0 &&
|
|
27008
|
+
if (byteOffset === void 0 && length === void 0) {
|
|
26776
27009
|
buf = new Uint8Array(array);
|
|
26777
|
-
} else if (
|
|
27010
|
+
} else if (length === void 0) {
|
|
26778
27011
|
buf = new Uint8Array(array, byteOffset);
|
|
26779
27012
|
} else {
|
|
26780
|
-
buf = new Uint8Array(array, byteOffset,
|
|
27013
|
+
buf = new Uint8Array(array, byteOffset, length);
|
|
26781
27014
|
}
|
|
26782
27015
|
Object.setPrototypeOf(buf, Buffer2.prototype);
|
|
26783
27016
|
return buf;
|
|
@@ -26802,17 +27035,17 @@
|
|
|
26802
27035
|
return fromArrayLike(obj.data);
|
|
26803
27036
|
}
|
|
26804
27037
|
}
|
|
26805
|
-
function checked(
|
|
26806
|
-
if (
|
|
27038
|
+
function checked(length) {
|
|
27039
|
+
if (length >= K_MAX_LENGTH) {
|
|
26807
27040
|
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + K_MAX_LENGTH.toString(16) + " bytes");
|
|
26808
27041
|
}
|
|
26809
|
-
return
|
|
27042
|
+
return length | 0;
|
|
26810
27043
|
}
|
|
26811
|
-
function SlowBuffer(
|
|
26812
|
-
if (+
|
|
26813
|
-
|
|
27044
|
+
function SlowBuffer(length) {
|
|
27045
|
+
if (+length != length) {
|
|
27046
|
+
length = 0;
|
|
26814
27047
|
}
|
|
26815
|
-
return Buffer2.alloc(+
|
|
27048
|
+
return Buffer2.alloc(+length);
|
|
26816
27049
|
}
|
|
26817
27050
|
Buffer2.isBuffer = function isBuffer(b) {
|
|
26818
27051
|
return b != null && b._isBuffer === true && b !== Buffer2.prototype;
|
|
@@ -26857,7 +27090,7 @@
|
|
|
26857
27090
|
return false;
|
|
26858
27091
|
}
|
|
26859
27092
|
};
|
|
26860
|
-
Buffer2.concat = function concat(list,
|
|
27093
|
+
Buffer2.concat = function concat(list, length) {
|
|
26861
27094
|
if (!Array.isArray(list)) {
|
|
26862
27095
|
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
26863
27096
|
}
|
|
@@ -26865,13 +27098,13 @@
|
|
|
26865
27098
|
return Buffer2.alloc(0);
|
|
26866
27099
|
}
|
|
26867
27100
|
let i;
|
|
26868
|
-
if (
|
|
26869
|
-
|
|
27101
|
+
if (length === void 0) {
|
|
27102
|
+
length = 0;
|
|
26870
27103
|
for (i = 0; i < list.length; ++i) {
|
|
26871
|
-
|
|
27104
|
+
length += list[i].length;
|
|
26872
27105
|
}
|
|
26873
27106
|
}
|
|
26874
|
-
const buffer = Buffer2.allocUnsafe(
|
|
27107
|
+
const buffer = Buffer2.allocUnsafe(length);
|
|
26875
27108
|
let pos = 0;
|
|
26876
27109
|
for (i = 0; i < list.length; ++i) {
|
|
26877
27110
|
let buf = list[i];
|
|
@@ -27026,9 +27259,9 @@
|
|
|
27026
27259
|
return this;
|
|
27027
27260
|
};
|
|
27028
27261
|
Buffer2.prototype.toString = function toString() {
|
|
27029
|
-
const
|
|
27030
|
-
if (
|
|
27031
|
-
if (arguments.length === 0) return utf8Slice(this, 0,
|
|
27262
|
+
const length = this.length;
|
|
27263
|
+
if (length === 0) return "";
|
|
27264
|
+
if (arguments.length === 0) return utf8Slice(this, 0, length);
|
|
27032
27265
|
return slowToString.apply(this, arguments);
|
|
27033
27266
|
};
|
|
27034
27267
|
Buffer2.prototype.toLocaleString = Buffer2.prototype.toString;
|
|
@@ -27203,58 +27436,58 @@
|
|
|
27203
27436
|
Buffer2.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {
|
|
27204
27437
|
return bidirectionalIndexOf(this, val, byteOffset, encoding, false);
|
|
27205
27438
|
};
|
|
27206
|
-
function hexWrite(buf, string, offset,
|
|
27439
|
+
function hexWrite(buf, string, offset, length) {
|
|
27207
27440
|
offset = Number(offset) || 0;
|
|
27208
27441
|
const remaining = buf.length - offset;
|
|
27209
|
-
if (!
|
|
27210
|
-
|
|
27442
|
+
if (!length) {
|
|
27443
|
+
length = remaining;
|
|
27211
27444
|
} else {
|
|
27212
|
-
|
|
27213
|
-
if (
|
|
27214
|
-
|
|
27445
|
+
length = Number(length);
|
|
27446
|
+
if (length > remaining) {
|
|
27447
|
+
length = remaining;
|
|
27215
27448
|
}
|
|
27216
27449
|
}
|
|
27217
27450
|
const strLen = string.length;
|
|
27218
|
-
if (
|
|
27219
|
-
|
|
27451
|
+
if (length > strLen / 2) {
|
|
27452
|
+
length = strLen / 2;
|
|
27220
27453
|
}
|
|
27221
27454
|
let i;
|
|
27222
|
-
for (i = 0; i <
|
|
27455
|
+
for (i = 0; i < length; ++i) {
|
|
27223
27456
|
const parsed = parseInt(string.substr(i * 2, 2), 16);
|
|
27224
27457
|
if (numberIsNaN(parsed)) return i;
|
|
27225
27458
|
buf[offset + i] = parsed;
|
|
27226
27459
|
}
|
|
27227
27460
|
return i;
|
|
27228
27461
|
}
|
|
27229
|
-
function utf8Write(buf, string, offset,
|
|
27230
|
-
return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset,
|
|
27462
|
+
function utf8Write(buf, string, offset, length) {
|
|
27463
|
+
return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);
|
|
27231
27464
|
}
|
|
27232
|
-
function asciiWrite(buf, string, offset,
|
|
27233
|
-
return blitBuffer(asciiToBytes(string), buf, offset,
|
|
27465
|
+
function asciiWrite(buf, string, offset, length) {
|
|
27466
|
+
return blitBuffer(asciiToBytes(string), buf, offset, length);
|
|
27234
27467
|
}
|
|
27235
|
-
function base64Write(buf, string, offset,
|
|
27236
|
-
return blitBuffer(base64ToBytes(string), buf, offset,
|
|
27468
|
+
function base64Write(buf, string, offset, length) {
|
|
27469
|
+
return blitBuffer(base64ToBytes(string), buf, offset, length);
|
|
27237
27470
|
}
|
|
27238
|
-
function ucs2Write(buf, string, offset,
|
|
27239
|
-
return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset,
|
|
27471
|
+
function ucs2Write(buf, string, offset, length) {
|
|
27472
|
+
return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);
|
|
27240
27473
|
}
|
|
27241
|
-
Buffer2.prototype.write = function write(string, offset,
|
|
27474
|
+
Buffer2.prototype.write = function write(string, offset, length, encoding) {
|
|
27242
27475
|
if (offset === void 0) {
|
|
27243
27476
|
encoding = "utf8";
|
|
27244
|
-
|
|
27477
|
+
length = this.length;
|
|
27245
27478
|
offset = 0;
|
|
27246
|
-
} else if (
|
|
27479
|
+
} else if (length === void 0 && typeof offset === "string") {
|
|
27247
27480
|
encoding = offset;
|
|
27248
|
-
|
|
27481
|
+
length = this.length;
|
|
27249
27482
|
offset = 0;
|
|
27250
27483
|
} else if (isFinite(offset)) {
|
|
27251
27484
|
offset = offset >>> 0;
|
|
27252
|
-
if (isFinite(
|
|
27253
|
-
|
|
27485
|
+
if (isFinite(length)) {
|
|
27486
|
+
length = length >>> 0;
|
|
27254
27487
|
if (encoding === void 0) encoding = "utf8";
|
|
27255
27488
|
} else {
|
|
27256
|
-
encoding =
|
|
27257
|
-
|
|
27489
|
+
encoding = length;
|
|
27490
|
+
length = void 0;
|
|
27258
27491
|
}
|
|
27259
27492
|
} else {
|
|
27260
27493
|
throw new Error(
|
|
@@ -27262,8 +27495,8 @@
|
|
|
27262
27495
|
);
|
|
27263
27496
|
}
|
|
27264
27497
|
const remaining = this.length - offset;
|
|
27265
|
-
if (
|
|
27266
|
-
if (string.length > 0 && (
|
|
27498
|
+
if (length === void 0 || length > remaining) length = remaining;
|
|
27499
|
+
if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) {
|
|
27267
27500
|
throw new RangeError("Attempt to write outside buffer bounds");
|
|
27268
27501
|
}
|
|
27269
27502
|
if (!encoding) encoding = "utf8";
|
|
@@ -27271,21 +27504,21 @@
|
|
|
27271
27504
|
for (; ; ) {
|
|
27272
27505
|
switch (encoding) {
|
|
27273
27506
|
case "hex":
|
|
27274
|
-
return hexWrite(this, string, offset,
|
|
27507
|
+
return hexWrite(this, string, offset, length);
|
|
27275
27508
|
case "utf8":
|
|
27276
27509
|
case "utf-8":
|
|
27277
|
-
return utf8Write(this, string, offset,
|
|
27510
|
+
return utf8Write(this, string, offset, length);
|
|
27278
27511
|
case "ascii":
|
|
27279
27512
|
case "latin1":
|
|
27280
27513
|
case "binary":
|
|
27281
|
-
return asciiWrite(this, string, offset,
|
|
27514
|
+
return asciiWrite(this, string, offset, length);
|
|
27282
27515
|
case "base64":
|
|
27283
|
-
return base64Write(this, string, offset,
|
|
27516
|
+
return base64Write(this, string, offset, length);
|
|
27284
27517
|
case "ucs2":
|
|
27285
27518
|
case "ucs-2":
|
|
27286
27519
|
case "utf16le":
|
|
27287
27520
|
case "utf-16le":
|
|
27288
|
-
return ucs2Write(this, string, offset,
|
|
27521
|
+
return ucs2Write(this, string, offset, length);
|
|
27289
27522
|
default:
|
|
27290
27523
|
if (loweredCase) throw new TypeError("Unknown encoding: " + encoding);
|
|
27291
27524
|
encoding = ("" + encoding).toLowerCase();
|
|
@@ -27437,9 +27670,9 @@
|
|
|
27437
27670
|
Object.setPrototypeOf(newBuf, Buffer2.prototype);
|
|
27438
27671
|
return newBuf;
|
|
27439
27672
|
};
|
|
27440
|
-
function checkOffset(offset, ext,
|
|
27673
|
+
function checkOffset(offset, ext, length) {
|
|
27441
27674
|
if (offset % 1 !== 0 || offset < 0) throw new RangeError("offset is not uint");
|
|
27442
|
-
if (offset + ext >
|
|
27675
|
+
if (offset + ext > length) throw new RangeError("Trying to access beyond buffer length");
|
|
27443
27676
|
}
|
|
27444
27677
|
Buffer2.prototype.readUintLE = Buffer2.prototype.readUIntLE = function readUIntLE(offset, byteLength2, noAssert) {
|
|
27445
27678
|
offset = offset >>> 0;
|
|
@@ -28049,17 +28282,17 @@
|
|
|
28049
28282
|
throw new errors.ERR_INVALID_ARG_TYPE(name, "number", value);
|
|
28050
28283
|
}
|
|
28051
28284
|
}
|
|
28052
|
-
function boundsError(value,
|
|
28285
|
+
function boundsError(value, length, type) {
|
|
28053
28286
|
if (Math.floor(value) !== value) {
|
|
28054
28287
|
validateNumber(value, type);
|
|
28055
28288
|
throw new errors.ERR_OUT_OF_RANGE(type || "offset", "an integer", value);
|
|
28056
28289
|
}
|
|
28057
|
-
if (
|
|
28290
|
+
if (length < 0) {
|
|
28058
28291
|
throw new errors.ERR_BUFFER_OUT_OF_BOUNDS();
|
|
28059
28292
|
}
|
|
28060
28293
|
throw new errors.ERR_OUT_OF_RANGE(
|
|
28061
28294
|
type || "offset",
|
|
28062
|
-
`>= ${type ? 1 : 0} and <= ${
|
|
28295
|
+
`>= ${type ? 1 : 0} and <= ${length}`,
|
|
28063
28296
|
value
|
|
28064
28297
|
);
|
|
28065
28298
|
}
|
|
@@ -28076,17 +28309,17 @@
|
|
|
28076
28309
|
function utf8ToBytes(string, units) {
|
|
28077
28310
|
units = units || Infinity;
|
|
28078
28311
|
let codePoint;
|
|
28079
|
-
const
|
|
28312
|
+
const length = string.length;
|
|
28080
28313
|
let leadSurrogate = null;
|
|
28081
28314
|
const bytes = [];
|
|
28082
|
-
for (let i = 0; i <
|
|
28315
|
+
for (let i = 0; i < length; ++i) {
|
|
28083
28316
|
codePoint = string.charCodeAt(i);
|
|
28084
28317
|
if (codePoint > 55295 && codePoint < 57344) {
|
|
28085
28318
|
if (!leadSurrogate) {
|
|
28086
28319
|
if (codePoint > 56319) {
|
|
28087
28320
|
if ((units -= 3) > -1) bytes.push(239, 191, 189);
|
|
28088
28321
|
continue;
|
|
28089
|
-
} else if (i + 1 ===
|
|
28322
|
+
} else if (i + 1 === length) {
|
|
28090
28323
|
if ((units -= 3) > -1) bytes.push(239, 191, 189);
|
|
28091
28324
|
continue;
|
|
28092
28325
|
}
|
|
@@ -28156,9 +28389,9 @@
|
|
|
28156
28389
|
function base64ToBytes(str) {
|
|
28157
28390
|
return base64.toByteArray(base64clean(str));
|
|
28158
28391
|
}
|
|
28159
|
-
function blitBuffer(src, dst, offset,
|
|
28392
|
+
function blitBuffer(src, dst, offset, length) {
|
|
28160
28393
|
let i;
|
|
28161
|
-
for (i = 0; i <
|
|
28394
|
+
for (i = 0; i < length; ++i) {
|
|
28162
28395
|
if (i + offset >= dst.length || i >= src.length) break;
|
|
28163
28396
|
dst[i + offset] = src[i];
|
|
28164
28397
|
}
|
|
@@ -28212,14 +28445,14 @@
|
|
|
28212
28445
|
}
|
|
28213
28446
|
safer.Buffer.prototype = Buffer2.prototype;
|
|
28214
28447
|
if (!Safer.from || Safer.from === Uint8Array.from) {
|
|
28215
|
-
Safer.from = function(value, encodingOrOffset,
|
|
28448
|
+
Safer.from = function(value, encodingOrOffset, length) {
|
|
28216
28449
|
if (typeof value === "number") {
|
|
28217
28450
|
throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof value);
|
|
28218
28451
|
}
|
|
28219
28452
|
if (value && typeof value.length === "undefined") {
|
|
28220
28453
|
throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof value);
|
|
28221
28454
|
}
|
|
28222
|
-
return Buffer2(value, encodingOrOffset,
|
|
28455
|
+
return Buffer2(value, encodingOrOffset, length);
|
|
28223
28456
|
};
|
|
28224
28457
|
}
|
|
28225
28458
|
if (!Safer.alloc) {
|
|
@@ -28321,16 +28554,16 @@
|
|
|
28321
28554
|
copyProps(buffer, exports);
|
|
28322
28555
|
exports.Buffer = SafeBuffer;
|
|
28323
28556
|
}
|
|
28324
|
-
function SafeBuffer(arg, encodingOrOffset,
|
|
28325
|
-
return Buffer2(arg, encodingOrOffset,
|
|
28557
|
+
function SafeBuffer(arg, encodingOrOffset, length) {
|
|
28558
|
+
return Buffer2(arg, encodingOrOffset, length);
|
|
28326
28559
|
}
|
|
28327
28560
|
SafeBuffer.prototype = Object.create(Buffer2.prototype);
|
|
28328
28561
|
copyProps(Buffer2, SafeBuffer);
|
|
28329
|
-
SafeBuffer.from = function(arg, encodingOrOffset,
|
|
28562
|
+
SafeBuffer.from = function(arg, encodingOrOffset, length) {
|
|
28330
28563
|
if (typeof arg === "number") {
|
|
28331
28564
|
throw new TypeError("Argument must not be a number");
|
|
28332
28565
|
}
|
|
28333
|
-
return Buffer2(arg, encodingOrOffset,
|
|
28566
|
+
return Buffer2(arg, encodingOrOffset, length);
|
|
28334
28567
|
};
|
|
28335
28568
|
SafeBuffer.alloc = function(size, fill, encoding) {
|
|
28336
28569
|
if (typeof size !== "number") {
|
|
@@ -33091,8 +33324,8 @@
|
|
|
33091
33324
|
_checkMandatoryParameters() {
|
|
33092
33325
|
if (this._config.parameters && this._config.parameters.schema) {
|
|
33093
33326
|
const validate2 = this._ajv.compile(this._config.parameters.schema);
|
|
33094
|
-
const
|
|
33095
|
-
if (!
|
|
33327
|
+
const valid = validate2(this._build.parameters);
|
|
33328
|
+
if (!valid) {
|
|
33096
33329
|
throw new Error(validate2.errors);
|
|
33097
33330
|
}
|
|
33098
33331
|
}
|
|
@@ -34154,19 +34387,6 @@
|
|
|
34154
34387
|
this._usages = usages;
|
|
34155
34388
|
return this;
|
|
34156
34389
|
}
|
|
34157
|
-
_checkHardware(hardware) {
|
|
34158
|
-
if (typeof hardware === "string") {
|
|
34159
|
-
hardware = eval("(" + hardware + ")");
|
|
34160
|
-
}
|
|
34161
|
-
let length = Object.keys(hardware).length;
|
|
34162
|
-
let valid = false;
|
|
34163
|
-
if (length === 1 && hardware.hardwareId && typeof hardware.hardwareId === "string" && hardware.hardwareId.length > 0) {
|
|
34164
|
-
valid = true;
|
|
34165
|
-
} else if (length === 3 && hardware.manufacturer && hardware.model && hardware.modelVersion && typeof hardware.manufacturer === "string" && typeof hardware.model === "string" && typeof hardware.modelVersion === "string" && hardware.manufacturer.length > 0 && hardware.model.length > 0 && hardware.modelVersion.length > 0) {
|
|
34166
|
-
valid = true;
|
|
34167
|
-
}
|
|
34168
|
-
return valid;
|
|
34169
|
-
}
|
|
34170
34390
|
/**
|
|
34171
34391
|
* Set the tags attribute
|
|
34172
34392
|
* @param {Array} tags
|
|
@@ -34235,7 +34455,6 @@
|
|
|
34235
34455
|
description: this._description || void 0,
|
|
34236
34456
|
administrativeState: this._administrativeState || void 0,
|
|
34237
34457
|
usages: this._usages || void 0,
|
|
34238
|
-
hardware: this._hardware || void 0,
|
|
34239
34458
|
tags: this._tags || void 0,
|
|
34240
34459
|
parameters: this._parameters || void 0,
|
|
34241
34460
|
domains: this._domains || void 0
|
|
@@ -35141,7 +35360,7 @@
|
|
|
35141
35360
|
execute() {
|
|
35142
35361
|
var defered = import_q9.default.defer();
|
|
35143
35362
|
var promise = defered.promise;
|
|
35144
|
-
this._ogapi.Napi.
|
|
35363
|
+
this._ogapi.Napi._searchPost(
|
|
35145
35364
|
this._resource,
|
|
35146
35365
|
this._filter(),
|
|
35147
35366
|
this._timeout,
|
|
@@ -35204,7 +35423,7 @@
|
|
|
35204
35423
|
this._setExtraHeaders({
|
|
35205
35424
|
Accept: "text/plain"
|
|
35206
35425
|
});
|
|
35207
|
-
this._ogapi.Napi.
|
|
35426
|
+
this._ogapi.Napi._searchPost(
|
|
35208
35427
|
this._resource,
|
|
35209
35428
|
filter,
|
|
35210
35429
|
this._timeout,
|
|
@@ -35256,7 +35475,7 @@
|
|
|
35256
35475
|
statusCode: 403
|
|
35257
35476
|
});
|
|
35258
35477
|
} else {
|
|
35259
|
-
_this._ogapi.Napi.
|
|
35478
|
+
_this._ogapi.Napi._searchPost(
|
|
35260
35479
|
_this._resource,
|
|
35261
35480
|
filter,
|
|
35262
35481
|
_this._timeout,
|
|
@@ -36792,7 +37011,7 @@
|
|
|
36792
37011
|
statusCode: 403
|
|
36793
37012
|
});
|
|
36794
37013
|
} else {
|
|
36795
|
-
_this._ogapi.Napi.
|
|
37014
|
+
_this._ogapi.Napi._searchPost(_this._resource, filter, _this._timeout, _this._getExtraHeaders(), _this._getUrlParameters()).then((response) => {
|
|
36796
37015
|
let statusCode = response.statusCode;
|
|
36797
37016
|
let body = response.body;
|
|
36798
37017
|
if (!body && response.text) {
|
|
@@ -40153,7 +40372,7 @@
|
|
|
40153
40372
|
var defered = import_q25.default.defer();
|
|
40154
40373
|
var promise = defered.promise;
|
|
40155
40374
|
var parameters = this._getUrlParameters();
|
|
40156
|
-
this._ogapi.Napi.
|
|
40375
|
+
this._ogapi.Napi._searchPost(this._resource, this._filter(), this._timeout, this._getExtraHeaders(), parameters).then((response) => {
|
|
40157
40376
|
let resultQuery = response.body;
|
|
40158
40377
|
let statusCode = response.statusCode;
|
|
40159
40378
|
if (statusCode === 200 && resultQuery.entities) {
|
|
@@ -40499,7 +40718,7 @@
|
|
|
40499
40718
|
var defered = import_q26.default.defer();
|
|
40500
40719
|
var promise = defered.promise;
|
|
40501
40720
|
var parameters = this._getUrlParameters();
|
|
40502
|
-
this._ogapi.Napi.
|
|
40721
|
+
this._ogapi.Napi._searchPost(this._resource, this._filter(), this._timeout, this._getExtraHeaders(), parameters).then((response) => {
|
|
40503
40722
|
let resultQuery = response.body;
|
|
40504
40723
|
let statusCode = response.statusCode;
|
|
40505
40724
|
if (statusCode === 200) {
|
|
@@ -46886,9 +47105,9 @@
|
|
|
46886
47105
|
* @param {string} hardware
|
|
46887
47106
|
* @return {Bundles}
|
|
46888
47107
|
*/
|
|
46889
|
-
withHardware(
|
|
46890
|
-
if (typeof
|
|
46891
|
-
this._hardware =
|
|
47108
|
+
withHardware(hardware) {
|
|
47109
|
+
if (typeof hardware !== "string") throw new Error("Parameter hardware must be a string");
|
|
47110
|
+
this._hardware = hardware;
|
|
46892
47111
|
return this;
|
|
46893
47112
|
}
|
|
46894
47113
|
/**
|
|
@@ -47714,7 +47933,7 @@
|
|
|
47714
47933
|
return ret;
|
|
47715
47934
|
}
|
|
47716
47935
|
composeElement() {
|
|
47717
|
-
var
|
|
47936
|
+
var hardware = {
|
|
47718
47937
|
serialnumber: this._serialnumber,
|
|
47719
47938
|
manufacturer: {
|
|
47720
47939
|
name: this._manufacturerName,
|
|
@@ -47726,7 +47945,7 @@
|
|
|
47726
47945
|
},
|
|
47727
47946
|
clockDate: this._clockDate
|
|
47728
47947
|
};
|
|
47729
|
-
return
|
|
47948
|
+
return hardware;
|
|
47730
47949
|
}
|
|
47731
47950
|
};
|
|
47732
47951
|
|
|
@@ -48330,11 +48549,11 @@
|
|
|
48330
48549
|
* @param {Hardware} hardware - optionals field
|
|
48331
48550
|
* @return {Subscriber}
|
|
48332
48551
|
*/
|
|
48333
|
-
withHardware(
|
|
48334
|
-
if (!(
|
|
48552
|
+
withHardware(hardware) {
|
|
48553
|
+
if (!(hardware instanceof Hardware)) {
|
|
48335
48554
|
throw new Error("Parameter hardware must be hardware type");
|
|
48336
48555
|
}
|
|
48337
|
-
this._hardware =
|
|
48556
|
+
this._hardware = hardware;
|
|
48338
48557
|
return this;
|
|
48339
48558
|
}
|
|
48340
48559
|
composeElement() {
|
|
@@ -48558,11 +48777,11 @@
|
|
|
48558
48777
|
* @param {Hardware} hardware - optionals field
|
|
48559
48778
|
* @return {CommsModule}
|
|
48560
48779
|
*/
|
|
48561
|
-
withHardware(
|
|
48562
|
-
if (!(
|
|
48780
|
+
withHardware(hardware) {
|
|
48781
|
+
if (!(hardware instanceof Hardware)) {
|
|
48563
48782
|
throw new Error("Parameter hardware must be hardware type");
|
|
48564
48783
|
}
|
|
48565
|
-
this._hardware =
|
|
48784
|
+
this._hardware = hardware;
|
|
48566
48785
|
return this;
|
|
48567
48786
|
}
|
|
48568
48787
|
/**
|
|
@@ -48754,11 +48973,11 @@
|
|
|
48754
48973
|
* @param {Hardware} hardware - optionals field
|
|
48755
48974
|
* @return {Event}
|
|
48756
48975
|
*/
|
|
48757
|
-
withHardware(
|
|
48758
|
-
if (!(
|
|
48976
|
+
withHardware(hardware) {
|
|
48977
|
+
if (!(hardware instanceof Hardware)) {
|
|
48759
48978
|
throw new Error("Parameter hardware must be Hardware type");
|
|
48760
48979
|
}
|
|
48761
|
-
this._hardware =
|
|
48980
|
+
this._hardware = hardware;
|
|
48762
48981
|
return this;
|
|
48763
48982
|
}
|
|
48764
48983
|
/**
|
|
@@ -52194,7 +52413,7 @@
|
|
|
52194
52413
|
var defered = import_q40.default.defer();
|
|
52195
52414
|
var promise = defered.promise;
|
|
52196
52415
|
var parameters = this._getUrlParameters();
|
|
52197
|
-
this._ogapi.Napi.
|
|
52416
|
+
this._ogapi.Napi._searchPost(this._resource, this._filter(), this._timeout, this._getExtraHeaders(), parameters).then((response) => {
|
|
52198
52417
|
let resultQuery = response.body;
|
|
52199
52418
|
let statusCode = response.statusCode;
|
|
52200
52419
|
if (statusCode === 200 && resultQuery.entities && resultQuery.entities.length > 0) {
|
|
@@ -53518,6 +53737,15 @@
|
|
|
53518
53737
|
}
|
|
53519
53738
|
|
|
53520
53739
|
// src/util/http/RequestSpec.js
|
|
53740
|
+
function transportError(message, reason) {
|
|
53741
|
+
const error = new Error(message);
|
|
53742
|
+
error.reason = reason;
|
|
53743
|
+
if (reason === "timeout") {
|
|
53744
|
+
error.timeout = true;
|
|
53745
|
+
error.code = "ECONNABORTED";
|
|
53746
|
+
}
|
|
53747
|
+
return error;
|
|
53748
|
+
}
|
|
53521
53749
|
var beforeStart;
|
|
53522
53750
|
function setBeforeStart(callback) {
|
|
53523
53751
|
beforeStart = callback;
|
|
@@ -53803,7 +54031,7 @@
|
|
|
53803
54031
|
this.aborted = true;
|
|
53804
54032
|
this.clearTimeout();
|
|
53805
54033
|
if (this._xhr) this._xhr.abort();
|
|
53806
|
-
else if (this._controller) this._controller.abort(
|
|
54034
|
+
else if (this._controller) this._controller.abort(transportError("Request aborted", "aborted"));
|
|
53807
54035
|
this.emit("abort");
|
|
53808
54036
|
return this;
|
|
53809
54037
|
}
|
|
@@ -54097,7 +54325,7 @@
|
|
|
54097
54325
|
}
|
|
54098
54326
|
_execute() {
|
|
54099
54327
|
return __async(this, null, function* () {
|
|
54100
|
-
if (this.aborted) throw
|
|
54328
|
+
if (this.aborted) throw transportError("Request aborted", "aborted");
|
|
54101
54329
|
const mocked = match(this.method, this.url);
|
|
54102
54330
|
if (mocked) {
|
|
54103
54331
|
const lowerCased = {};
|
|
@@ -54191,9 +54419,7 @@
|
|
|
54191
54419
|
let expire;
|
|
54192
54420
|
const promise = new Promise((resolve, reject) => {
|
|
54193
54421
|
expire = (message) => {
|
|
54194
|
-
const error =
|
|
54195
|
-
error.timeout = true;
|
|
54196
|
-
error.code = "ECONNABORTED";
|
|
54422
|
+
const error = transportError(message, "timeout");
|
|
54197
54423
|
this.timedout = true;
|
|
54198
54424
|
if (this._xhr) this._xhr.abort();
|
|
54199
54425
|
else if (this._controller) this._controller.abort(error);
|
|
@@ -54215,7 +54441,11 @@
|
|
|
54215
54441
|
if (duplex) init.duplex = duplex;
|
|
54216
54442
|
if (controller) init.signal = controller.signal;
|
|
54217
54443
|
if (this._withCredentials) init.credentials = "include";
|
|
54218
|
-
const
|
|
54444
|
+
const sent = fetch(this.url, init).catch((error) => {
|
|
54445
|
+
if (error && typeof error === "object" && !error.reason) error.reason = "network";
|
|
54446
|
+
throw error;
|
|
54447
|
+
});
|
|
54448
|
+
const raw = yield Promise.race([sent, expiry.promise]);
|
|
54219
54449
|
if (this._responseTimer) {
|
|
54220
54450
|
clearTimeout(this._responseTimer);
|
|
54221
54451
|
this._responseTimer = null;
|
|
@@ -54257,7 +54487,7 @@
|
|
|
54257
54487
|
const xhr = new XMLHttpRequest();
|
|
54258
54488
|
this._xhr = xhr;
|
|
54259
54489
|
if (this.aborted) {
|
|
54260
|
-
reject(
|
|
54490
|
+
reject(transportError("Request aborted", "aborted"));
|
|
54261
54491
|
return;
|
|
54262
54492
|
}
|
|
54263
54493
|
const expiry = this._expiry();
|
|
@@ -54301,9 +54531,9 @@
|
|
|
54301
54531
|
if (!this._isResponseOK(response)) reject(toError(response));
|
|
54302
54532
|
else resolve(response);
|
|
54303
54533
|
};
|
|
54304
|
-
xhr.onerror = () => reject(
|
|
54305
|
-
xhr.ontimeout = () => reject(
|
|
54306
|
-
xhr.onabort = () => reject(
|
|
54534
|
+
xhr.onerror = () => reject(transportError("Network error", "network"));
|
|
54535
|
+
xhr.ontimeout = () => reject(transportError("Timeout of " + this._timeout + "ms exceeded", "timeout"));
|
|
54536
|
+
xhr.onabort = () => reject(transportError("Request aborted", "aborted"));
|
|
54307
54537
|
xhr.send(body === void 0 ? null : body);
|
|
54308
54538
|
});
|
|
54309
54539
|
}
|
|
@@ -56503,6 +56733,16 @@
|
|
|
56503
56733
|
this._reportRetentionDays = reportRetentionDays;
|
|
56504
56734
|
return this;
|
|
56505
56735
|
}
|
|
56736
|
+
/**
|
|
56737
|
+
* Sets the timezone attribute
|
|
56738
|
+
* @param {string} timezone
|
|
56739
|
+
* @return {NotebookScheduler}
|
|
56740
|
+
*/
|
|
56741
|
+
withTimezone(timezone) {
|
|
56742
|
+
import_check_types11.default._checkString(timezone, "timezone");
|
|
56743
|
+
this._timezone = timezone;
|
|
56744
|
+
return this;
|
|
56745
|
+
}
|
|
56506
56746
|
withParams(params) {
|
|
56507
56747
|
import_check_types11.default._checkArray(params, "params");
|
|
56508
56748
|
this._params = params;
|
|
@@ -56517,6 +56757,9 @@
|
|
|
56517
56757
|
generateReport: this._generateReport || false,
|
|
56518
56758
|
params: this._params || []
|
|
56519
56759
|
};
|
|
56760
|
+
if (this._timezone) {
|
|
56761
|
+
notebookData.timeZone = this._timezone;
|
|
56762
|
+
}
|
|
56520
56763
|
return notebookData;
|
|
56521
56764
|
}
|
|
56522
56765
|
create() {
|
|
@@ -57736,8 +57979,9 @@
|
|
|
57736
57979
|
var InternalOpenGateAPI = class _InternalOpenGateAPI {
|
|
57737
57980
|
/**
|
|
57738
57981
|
* Constructor
|
|
57739
|
-
* @param {
|
|
57740
|
-
* @param {
|
|
57982
|
+
* @param {object} northAmpliaREST - the client that sends requests to the North API.
|
|
57983
|
+
* @param {object} southAmpliaREST - the client that sends requests to the South API.
|
|
57984
|
+
* @param {OpenGateOptions & Record<string, unknown>} _options - the client's configuration.
|
|
57741
57985
|
*/
|
|
57742
57986
|
constructor(northAmpliaREST, southAmpliaREST, _options) {
|
|
57743
57987
|
if (this.constructor === _InternalOpenGateAPI) {
|
|
@@ -57755,6 +57999,7 @@
|
|
|
57755
57999
|
if (_options.hooks && _options.hooks.beforeStart && typeof _options.hooks.beforeStart === "function") {
|
|
57756
58000
|
registerBeforeStartHook(_options.hooks.beforeStart);
|
|
57757
58001
|
}
|
|
58002
|
+
Object.defineProperty(this, "_options", { value: Object.freeze(__spreadValues({}, _options)) });
|
|
57758
58003
|
this.Napi = northAmpliaREST;
|
|
57759
58004
|
this.Sapi = southAmpliaREST;
|
|
57760
58005
|
this.EX = Expression;
|
|
@@ -57763,6 +58008,26 @@
|
|
|
57763
58008
|
this.alarms = new AlarmActions(this);
|
|
57764
58009
|
this.entityBuilder = new EntityBuilder(this);
|
|
57765
58010
|
}
|
|
58011
|
+
/**
|
|
58012
|
+
* A new client with this one's options, and the given ones on top. The merge is shallow: an
|
|
58013
|
+
* override of `south` replaces the whole object.
|
|
58014
|
+
*
|
|
58015
|
+
* A clone of a read-only client is read-only too, and asking for `readOnly: false` throws: code
|
|
58016
|
+
* handed a read-only client cannot widen it this way. `logger` and `hooks` are process-wide, so
|
|
58017
|
+
* overriding them in a clone changes them for every client.
|
|
58018
|
+
* @example
|
|
58019
|
+
* const widgetApi = ogapi.clone({ readOnly: true });
|
|
58020
|
+
* @param {Partial<OpenGateOptions> & Record<string, unknown>} [overrides] - the options to change.
|
|
58021
|
+
* @return {this}
|
|
58022
|
+
*/
|
|
58023
|
+
clone(overrides = {}) {
|
|
58024
|
+
if (this._options.readOnly && "readOnly" in overrides && !overrides.readOnly) {
|
|
58025
|
+
throw new Error("OGAPI: a clone of a read-only client is read-only too");
|
|
58026
|
+
}
|
|
58027
|
+
const options = __spreadValues(__spreadValues({}, this._options), overrides);
|
|
58028
|
+
if (this._options.readOnly) options.readOnly = true;
|
|
58029
|
+
return new this.constructor(options);
|
|
58030
|
+
}
|
|
57766
58031
|
/**
|
|
57767
58032
|
* This returns a util to find a user
|
|
57768
58033
|
* @return {UserFinder}
|
|
@@ -58883,6 +59148,8 @@
|
|
|
58883
59148
|
* @return {Promise}
|
|
58884
59149
|
*/
|
|
58885
59150
|
get(url, timeout, headers, parameters, asBlob, serviceBaseURL) {
|
|
59151
|
+
const rejected = this._guard("GET", url, serviceBaseURL);
|
|
59152
|
+
if (rejected) return rejected;
|
|
58886
59153
|
const _url = this._createUrl(url, parameters, serviceBaseURL);
|
|
58887
59154
|
logger_default.info("GET", _url);
|
|
58888
59155
|
var req = new RequestSpec("GET", _url);
|
|
@@ -58899,6 +59166,8 @@
|
|
|
58899
59166
|
* @return {Promise}
|
|
58900
59167
|
*/
|
|
58901
59168
|
patch(url, data, timeout, headers, parameters, serviceBaseURL) {
|
|
59169
|
+
const rejected = this._guard("PATCH", url, serviceBaseURL);
|
|
59170
|
+
if (rejected) return rejected;
|
|
58902
59171
|
const _url = this._createUrl(url, parameters, serviceBaseURL);
|
|
58903
59172
|
logger_default.info("PATCH", _url);
|
|
58904
59173
|
var req = new RequestSpec("PATCH", _url).send(data);
|
|
@@ -58915,6 +59184,8 @@
|
|
|
58915
59184
|
* @return {Promise}
|
|
58916
59185
|
*/
|
|
58917
59186
|
post(url, data, timeout, headers, parameters, serviceBaseURL) {
|
|
59187
|
+
const rejected = this._guard("POST", url, serviceBaseURL);
|
|
59188
|
+
if (rejected) return rejected;
|
|
58918
59189
|
const _url = this._createUrl(url, parameters, serviceBaseURL);
|
|
58919
59190
|
logger_default.info("POST", _url);
|
|
58920
59191
|
var req = new RequestSpec("POST", _url).send(data);
|
|
@@ -58932,6 +59203,8 @@
|
|
|
58932
59203
|
* @return {Promise}
|
|
58933
59204
|
*/
|
|
58934
59205
|
post_multipart(url, formData, events, timeout, headers, parameters, serviceBaseURL) {
|
|
59206
|
+
const rejected = this._guard("POST", url, serviceBaseURL);
|
|
59207
|
+
if (rejected) return rejected;
|
|
58935
59208
|
const _url = this._createUrl(url, parameters, serviceBaseURL);
|
|
58936
59209
|
logger_default.info("POST_MULTIPART", _url);
|
|
58937
59210
|
let req = new RequestSpec("POST", _url);
|
|
@@ -58949,6 +59222,8 @@
|
|
|
58949
59222
|
* @return {Promise}
|
|
58950
59223
|
*/
|
|
58951
59224
|
put(url, data, timeout, headers, parameters, serviceBaseURL) {
|
|
59225
|
+
const rejected = this._guard("PUT", url, serviceBaseURL);
|
|
59226
|
+
if (rejected) return rejected;
|
|
58952
59227
|
const _url = this._createUrl(url, parameters, serviceBaseURL);
|
|
58953
59228
|
logger_default.info("PUT", _url);
|
|
58954
59229
|
var req = new RequestSpec("PUT", _url).send(data);
|
|
@@ -58973,6 +59248,8 @@
|
|
|
58973
59248
|
* @return {Promise}
|
|
58974
59249
|
*/
|
|
58975
59250
|
put_multipart(url, formData, events, timeout, headers, parameters, serviceBaseURL) {
|
|
59251
|
+
const rejected = this._guard("PUT", url, serviceBaseURL);
|
|
59252
|
+
if (rejected) return rejected;
|
|
58976
59253
|
const _url = this._createUrl(url, parameters, serviceBaseURL);
|
|
58977
59254
|
logger_default.info("PUT_MULTIPART", _url);
|
|
58978
59255
|
let req = new RequestSpec("PUT", _url);
|
|
@@ -59046,6 +59323,8 @@
|
|
|
59046
59323
|
* @return {Promise}
|
|
59047
59324
|
*/
|
|
59048
59325
|
delete(url, timeout, headers, parameters, body, serviceBaseURL) {
|
|
59326
|
+
const rejected = this._guard("DELETE", url, serviceBaseURL);
|
|
59327
|
+
if (rejected) return rejected;
|
|
59049
59328
|
const _url = this._createUrl(url, parameters, serviceBaseURL);
|
|
59050
59329
|
logger_default.info("DELETE", _url);
|
|
59051
59330
|
var req;
|
|
@@ -59071,9 +59350,9 @@
|
|
|
59071
59350
|
}
|
|
59072
59351
|
}
|
|
59073
59352
|
var relativeUrlSplit = relativeUrl.split("/");
|
|
59074
|
-
var
|
|
59353
|
+
var length = relativeUrlSplit.length;
|
|
59075
59354
|
relativeUrlSplit.forEach(function(item, index2) {
|
|
59076
|
-
if (index2 ===
|
|
59355
|
+
if (index2 === length - 1 && item.indexOf("?") > 0) {
|
|
59077
59356
|
var parameters2 = item.substring(item.indexOf("?"), item.length);
|
|
59078
59357
|
var _item = item.substring(0, item.indexOf("?"));
|
|
59079
59358
|
encode.push((0, import_urlencode.default)(_item) + parameters2);
|
|
@@ -59083,6 +59362,62 @@
|
|
|
59083
59362
|
});
|
|
59084
59363
|
return this._url(this._options) + "/" + this._getDefaultBaseURL(serviceBaseURL) + "/" + encode.join("/");
|
|
59085
59364
|
}
|
|
59365
|
+
/**
|
|
59366
|
+
* POST for a search, which reads. The search layer calls this instead of `post` so that a
|
|
59367
|
+
* read-only client lets it through; the mark lasts only for the synchronous guard inside `post`.
|
|
59368
|
+
* @return {Promise}
|
|
59369
|
+
*/
|
|
59370
|
+
_searchPost(url, data, timeout, headers, parameters, serviceBaseURL) {
|
|
59371
|
+
this._searchIntent = true;
|
|
59372
|
+
try {
|
|
59373
|
+
return this.post(url, data, timeout, headers, parameters, serviceBaseURL);
|
|
59374
|
+
} finally {
|
|
59375
|
+
this._searchIntent = false;
|
|
59376
|
+
}
|
|
59377
|
+
}
|
|
59378
|
+
/** @return {Promise|null} a rejection to return before sending, or null to go ahead. */
|
|
59379
|
+
_guard(method, url, serviceBaseURL) {
|
|
59380
|
+
return this._rejectDuplicatedBase(url, serviceBaseURL) || this._rejectWrite(method, url);
|
|
59381
|
+
}
|
|
59382
|
+
/**
|
|
59383
|
+
* With `readOnly`, everything but GET and search POSTs is refused before it leaves: the search
|
|
59384
|
+
* builders, and a free `post` to a `search/...` path. It guards against mistakes, not against
|
|
59385
|
+
* code that holds the client and means harm -- `_searchPost` and `fetch` are one call away. The
|
|
59386
|
+
* server, or a proxy in front of it, remains the boundary.
|
|
59387
|
+
* @return {Promise|null}
|
|
59388
|
+
*/
|
|
59389
|
+
_rejectWrite(method, url) {
|
|
59390
|
+
if (!this._options.readOnly || method === "GET") return null;
|
|
59391
|
+
const isSearch = this._searchIntent || typeof url === "string" && /^\/*search\//.test(url);
|
|
59392
|
+
if (method === "POST" && isSearch) return null;
|
|
59393
|
+
const message = "OGAPI: read-only client refused " + method + " " + url;
|
|
59394
|
+
return import_q50.default.reject({
|
|
59395
|
+
statusCode: 403,
|
|
59396
|
+
data: { errors: [{ code: 403, message }] },
|
|
59397
|
+
reason: "read-only",
|
|
59398
|
+
cause: new Error(message)
|
|
59399
|
+
});
|
|
59400
|
+
}
|
|
59401
|
+
/**
|
|
59402
|
+
* The default base (`north/v80`, or `v80` on South) is prepended to every path, so a path that
|
|
59403
|
+
* repeats it, such as `/north/v80/provision/...`, used to reach `north/v80//north/v80/...` and
|
|
59404
|
+
* fail with a misleading error. Such a call never worked, so refusing it breaks nothing. A
|
|
59405
|
+
* caller-given `serviceBaseURL` is left alone: its paths are its own business.
|
|
59406
|
+
* @return {Promise|null} a rejection to return, or null when the path is fine.
|
|
59407
|
+
*/
|
|
59408
|
+
_rejectDuplicatedBase(url, serviceBaseURL) {
|
|
59409
|
+
if (serviceBaseURL || typeof url !== "string") return null;
|
|
59410
|
+
const base = this._getDefaultBaseURL();
|
|
59411
|
+
const firstSegment = base.split("/")[0];
|
|
59412
|
+
if (url.replace(/^\/+/, "").split("/")[0] !== firstSegment) return null;
|
|
59413
|
+
const message = 'OGAPI: the path "' + url + '" already starts with "' + firstSegment + '/", but "' + base + '/" is prepended to every path. Pass the path relative to it, or give a serviceBaseURL.';
|
|
59414
|
+
return import_q50.default.reject({
|
|
59415
|
+
statusCode: 400,
|
|
59416
|
+
data: { errors: [{ code: 400, message }] },
|
|
59417
|
+
reason: "invalid-path",
|
|
59418
|
+
cause: new Error(message)
|
|
59419
|
+
});
|
|
59420
|
+
}
|
|
59086
59421
|
_getDefaultBaseURL(serviceBaseURL) {
|
|
59087
59422
|
if (!serviceBaseURL) {
|
|
59088
59423
|
if (this._isSouth) {
|
|
@@ -59150,11 +59485,16 @@
|
|
|
59150
59485
|
status = 408;
|
|
59151
59486
|
}
|
|
59152
59487
|
}
|
|
59153
|
-
|
|
59488
|
+
const rejection = {
|
|
59154
59489
|
statusCode: status,
|
|
59155
59490
|
data,
|
|
59156
59491
|
headers: headers2
|
|
59157
|
-
}
|
|
59492
|
+
};
|
|
59493
|
+
if (typeof err.response === "undefined") {
|
|
59494
|
+
rejection.reason = err.reason || "unknown";
|
|
59495
|
+
rejection.cause = err;
|
|
59496
|
+
}
|
|
59497
|
+
defered.reject(rejection);
|
|
59158
59498
|
} else {
|
|
59159
59499
|
defered.resolve(res);
|
|
59160
59500
|
}
|
|
@@ -59230,7 +59570,7 @@ q/q.js:
|
|
|
59230
59570
|
|
|
59231
59571
|
moment/moment.js:
|
|
59232
59572
|
(*! moment.js *)
|
|
59233
|
-
(*! version : 2.
|
|
59573
|
+
(*! version : 2.31.0 *)
|
|
59234
59574
|
(*! authors : Tim Wood, Iskren Chernev, Moment.js contributors *)
|
|
59235
59575
|
(*! license : MIT *)
|
|
59236
59576
|
(*! momentjs.com *)
|
|
@@ -59268,4 +59608,4 @@ buffer/index.js:
|
|
|
59268
59608
|
safe-buffer/index.js:
|
|
59269
59609
|
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
|
|
59270
59610
|
*/
|
|
59271
|
-
//# sourceMappingURL=opengate-api-bower-16.
|
|
59611
|
+
//# sourceMappingURL=opengate-api-bower-16.3.0.js.map
|