aboutsummaryrefslogtreecommitdiff
path: root/node_modules/moment/src/lib/utils
diff options
context:
space:
mode:
authorScoots Dash <contact@minteck.org>2022-04-23 14:12:30 +0000
committerScoots Dash <contact@minteck.org>2022-04-23 14:12:30 +0000
commita927497b43cbe1438f3d7478932f3f7d03ea347c (patch)
tree0a3c88978b4294fb30afad58daa86c46fbedc2f6 /node_modules/moment/src/lib/utils
parentba5fa694351774f2684c1aefdc215da5c6f39ba6 (diff)
parentf0db5bbbcd623812a391862d217519afafe197c6 (diff)
downloadtwilight-a927497b43cbe1438f3d7478932f3f7d03ea347c.tar.gz
twilight-a927497b43cbe1438f3d7478932f3f7d03ea347c.tar.bz2
twilight-a927497b43cbe1438f3d7478932f3f7d03ea347c.zip
Merge branch 'deprecation' into 'trunk'HEADtrunk
Disable the Twilight Package Manager See merge request minteck/twilight!1
Diffstat (limited to 'node_modules/moment/src/lib/utils')
-rw-r--r--node_modules/moment/src/lib/utils/abs-ceil.js7
-rw-r--r--node_modules/moment/src/lib/utils/abs-floor.js8
-rw-r--r--node_modules/moment/src/lib/utils/abs-round.js7
-rw-r--r--node_modules/moment/src/lib/utils/compare-arrays.js18
-rw-r--r--node_modules/moment/src/lib/utils/defaults.js10
-rw-r--r--node_modules/moment/src/lib/utils/deprecate.js68
-rw-r--r--node_modules/moment/src/lib/utils/extend.js19
-rw-r--r--node_modules/moment/src/lib/utils/has-own-prop.js3
-rw-r--r--node_modules/moment/src/lib/utils/hooks.js13
-rw-r--r--node_modules/moment/src/lib/utils/index-of.js18
-rw-r--r--node_modules/moment/src/lib/utils/is-array.js6
-rw-r--r--node_modules/moment/src/lib/utils/is-calendar-spec.js25
-rw-r--r--node_modules/moment/src/lib/utils/is-date.js6
-rw-r--r--node_modules/moment/src/lib/utils/is-function.js6
-rw-r--r--node_modules/moment/src/lib/utils/is-leap-year.js3
-rw-r--r--node_modules/moment/src/lib/utils/is-moment-input.js74
-rw-r--r--node_modules/moment/src/lib/utils/is-number.js6
-rw-r--r--node_modules/moment/src/lib/utils/is-object-empty.js15
-rw-r--r--node_modules/moment/src/lib/utils/is-object.js8
-rw-r--r--node_modules/moment/src/lib/utils/is-string.js3
-rw-r--r--node_modules/moment/src/lib/utils/is-undefined.js3
-rw-r--r--node_modules/moment/src/lib/utils/keys.js20
-rw-r--r--node_modules/moment/src/lib/utils/map.js8
-rw-r--r--node_modules/moment/src/lib/utils/mod.js3
-rw-r--r--node_modules/moment/src/lib/utils/some.js20
-rw-r--r--node_modules/moment/src/lib/utils/to-int.js12
-rw-r--r--node_modules/moment/src/lib/utils/zero-fill.js10
27 files changed, 0 insertions, 399 deletions
diff --git a/node_modules/moment/src/lib/utils/abs-ceil.js b/node_modules/moment/src/lib/utils/abs-ceil.js
deleted file mode 100644
index e4c7bc2..0000000
--- a/node_modules/moment/src/lib/utils/abs-ceil.js
+++ /dev/null
@@ -1,7 +0,0 @@
-export default function absCeil(number) {
- if (number < 0) {
- return Math.floor(number);
- } else {
- return Math.ceil(number);
- }
-}
diff --git a/node_modules/moment/src/lib/utils/abs-floor.js b/node_modules/moment/src/lib/utils/abs-floor.js
deleted file mode 100644
index 7c2ed24..0000000
--- a/node_modules/moment/src/lib/utils/abs-floor.js
+++ /dev/null
@@ -1,8 +0,0 @@
-export default function absFloor(number) {
- if (number < 0) {
- // -0 -> 0
- return Math.ceil(number) || 0;
- } else {
- return Math.floor(number);
- }
-}
diff --git a/node_modules/moment/src/lib/utils/abs-round.js b/node_modules/moment/src/lib/utils/abs-round.js
deleted file mode 100644
index 175fea2..0000000
--- a/node_modules/moment/src/lib/utils/abs-round.js
+++ /dev/null
@@ -1,7 +0,0 @@
-export default function absRound(number) {
- if (number < 0) {
- return Math.round(-1 * number) * -1;
- } else {
- return Math.round(number);
- }
-}
diff --git a/node_modules/moment/src/lib/utils/compare-arrays.js b/node_modules/moment/src/lib/utils/compare-arrays.js
deleted file mode 100644
index 3e37b53..0000000
--- a/node_modules/moment/src/lib/utils/compare-arrays.js
+++ /dev/null
@@ -1,18 +0,0 @@
-import toInt from './to-int';
-
-// compare two arrays, return the number of differences
-export default function compareArrays(array1, array2, dontConvert) {
- var len = Math.min(array1.length, array2.length),
- lengthDiff = Math.abs(array1.length - array2.length),
- diffs = 0,
- i;
- for (i = 0; i < len; i++) {
- if (
- (dontConvert && array1[i] !== array2[i]) ||
- (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))
- ) {
- diffs++;
- }
- }
- return diffs + lengthDiff;
-}
diff --git a/node_modules/moment/src/lib/utils/defaults.js b/node_modules/moment/src/lib/utils/defaults.js
deleted file mode 100644
index 45c5e87..0000000
--- a/node_modules/moment/src/lib/utils/defaults.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// Pick the first defined of two or three arguments.
-export default function defaults(a, b, c) {
- if (a != null) {
- return a;
- }
- if (b != null) {
- return b;
- }
- return c;
-}
diff --git a/node_modules/moment/src/lib/utils/deprecate.js b/node_modules/moment/src/lib/utils/deprecate.js
deleted file mode 100644
index b2a8cfc..0000000
--- a/node_modules/moment/src/lib/utils/deprecate.js
+++ /dev/null
@@ -1,68 +0,0 @@
-import extend from './extend';
-import { hooks } from './hooks';
-import hasOwnProp from './has-own-prop';
-
-function warn(msg) {
- if (
- hooks.suppressDeprecationWarnings === false &&
- typeof console !== 'undefined' &&
- console.warn
- ) {
- console.warn('Deprecation warning: ' + msg);
- }
-}
-
-export function deprecate(msg, fn) {
- var firstTime = true;
-
- return extend(function () {
- if (hooks.deprecationHandler != null) {
- hooks.deprecationHandler(null, msg);
- }
- if (firstTime) {
- var args = [],
- arg,
- i,
- key;
- for (i = 0; i < arguments.length; i++) {
- arg = '';
- if (typeof arguments[i] === 'object') {
- arg += '\n[' + i + '] ';
- for (key in arguments[0]) {
- if (hasOwnProp(arguments[0], key)) {
- arg += key + ': ' + arguments[0][key] + ', ';
- }
- }
- arg = arg.slice(0, -2); // Remove trailing comma and space
- } else {
- arg = arguments[i];
- }
- args.push(arg);
- }
- warn(
- msg +
- '\nArguments: ' +
- Array.prototype.slice.call(args).join('') +
- '\n' +
- new Error().stack
- );
- firstTime = false;
- }
- return fn.apply(this, arguments);
- }, fn);
-}
-
-var deprecations = {};
-
-export function deprecateSimple(name, msg) {
- if (hooks.deprecationHandler != null) {
- hooks.deprecationHandler(name, msg);
- }
- if (!deprecations[name]) {
- warn(msg);
- deprecations[name] = true;
- }
-}
-
-hooks.suppressDeprecationWarnings = false;
-hooks.deprecationHandler = null;
diff --git a/node_modules/moment/src/lib/utils/extend.js b/node_modules/moment/src/lib/utils/extend.js
deleted file mode 100644
index ba74a0b..0000000
--- a/node_modules/moment/src/lib/utils/extend.js
+++ /dev/null
@@ -1,19 +0,0 @@
-import hasOwnProp from './has-own-prop';
-
-export default function extend(a, b) {
- for (var i in b) {
- if (hasOwnProp(b, i)) {
- a[i] = b[i];
- }
- }
-
- if (hasOwnProp(b, 'toString')) {
- a.toString = b.toString;
- }
-
- if (hasOwnProp(b, 'valueOf')) {
- a.valueOf = b.valueOf;
- }
-
- return a;
-}
diff --git a/node_modules/moment/src/lib/utils/has-own-prop.js b/node_modules/moment/src/lib/utils/has-own-prop.js
deleted file mode 100644
index 4d2403c..0000000
--- a/node_modules/moment/src/lib/utils/has-own-prop.js
+++ /dev/null
@@ -1,3 +0,0 @@
-export default function hasOwnProp(a, b) {
- return Object.prototype.hasOwnProperty.call(a, b);
-}
diff --git a/node_modules/moment/src/lib/utils/hooks.js b/node_modules/moment/src/lib/utils/hooks.js
deleted file mode 100644
index 2e86836..0000000
--- a/node_modules/moment/src/lib/utils/hooks.js
+++ /dev/null
@@ -1,13 +0,0 @@
-export { hooks, setHookCallback };
-
-var hookCallback;
-
-function hooks() {
- return hookCallback.apply(null, arguments);
-}
-
-// This is done to register the method called with moment()
-// without creating circular dependencies.
-function setHookCallback(callback) {
- hookCallback = callback;
-}
diff --git a/node_modules/moment/src/lib/utils/index-of.js b/node_modules/moment/src/lib/utils/index-of.js
deleted file mode 100644
index 92298cf..0000000
--- a/node_modules/moment/src/lib/utils/index-of.js
+++ /dev/null
@@ -1,18 +0,0 @@
-var indexOf;
-
-if (Array.prototype.indexOf) {
- indexOf = Array.prototype.indexOf;
-} else {
- indexOf = function (o) {
- // I know
- var i;
- for (i = 0; i < this.length; ++i) {
- if (this[i] === o) {
- return i;
- }
- }
- return -1;
- };
-}
-
-export { indexOf as default };
diff --git a/node_modules/moment/src/lib/utils/is-array.js b/node_modules/moment/src/lib/utils/is-array.js
deleted file mode 100644
index d57c875..0000000
--- a/node_modules/moment/src/lib/utils/is-array.js
+++ /dev/null
@@ -1,6 +0,0 @@
-export default function isArray(input) {
- return (
- input instanceof Array ||
- Object.prototype.toString.call(input) === '[object Array]'
- );
-}
diff --git a/node_modules/moment/src/lib/utils/is-calendar-spec.js b/node_modules/moment/src/lib/utils/is-calendar-spec.js
deleted file mode 100644
index e8b6d38..0000000
--- a/node_modules/moment/src/lib/utils/is-calendar-spec.js
+++ /dev/null
@@ -1,25 +0,0 @@
-import isObjectEmpty from './is-object-empty';
-import hasOwnProp from './has-own-prop';
-import isObject from './is-object';
-
-export default function isCalendarSpec(input) {
- var objectTest = isObject(input) && !isObjectEmpty(input),
- propertyTest = false,
- properties = [
- 'sameDay',
- 'nextDay',
- 'lastDay',
- 'nextWeek',
- 'lastWeek',
- 'sameElse',
- ],
- i,
- property;
-
- for (i = 0; i < properties.length; i += 1) {
- property = properties[i];
- propertyTest = propertyTest || hasOwnProp(input, property);
- }
-
- return objectTest && propertyTest;
-}
diff --git a/node_modules/moment/src/lib/utils/is-date.js b/node_modules/moment/src/lib/utils/is-date.js
deleted file mode 100644
index 378924b..0000000
--- a/node_modules/moment/src/lib/utils/is-date.js
+++ /dev/null
@@ -1,6 +0,0 @@
-export default function isDate(input) {
- return (
- input instanceof Date ||
- Object.prototype.toString.call(input) === '[object Date]'
- );
-}
diff --git a/node_modules/moment/src/lib/utils/is-function.js b/node_modules/moment/src/lib/utils/is-function.js
deleted file mode 100644
index 4549686..0000000
--- a/node_modules/moment/src/lib/utils/is-function.js
+++ /dev/null
@@ -1,6 +0,0 @@
-export default function isFunction(input) {
- return (
- (typeof Function !== 'undefined' && input instanceof Function) ||
- Object.prototype.toString.call(input) === '[object Function]'
- );
-}
diff --git a/node_modules/moment/src/lib/utils/is-leap-year.js b/node_modules/moment/src/lib/utils/is-leap-year.js
deleted file mode 100644
index e399d93..0000000
--- a/node_modules/moment/src/lib/utils/is-leap-year.js
+++ /dev/null
@@ -1,3 +0,0 @@
-export function isLeapYear(year) {
- return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;
-}
diff --git a/node_modules/moment/src/lib/utils/is-moment-input.js b/node_modules/moment/src/lib/utils/is-moment-input.js
deleted file mode 100644
index c32b3d4..0000000
--- a/node_modules/moment/src/lib/utils/is-moment-input.js
+++ /dev/null
@@ -1,74 +0,0 @@
-import isObjectEmpty from './is-object-empty';
-import hasOwnProp from './has-own-prop';
-import isObject from './is-object';
-import isDate from './is-date';
-import isNumber from './is-number';
-import isString from './is-string';
-import { isMoment } from '../moment/constructor';
-import isArray from './is-array';
-
-// type MomentInput = Moment | Date | string | number | (number | string)[] | MomentInputObject | void; // null | undefined
-export function isMomentInput(input) {
- return (
- isMoment(input) ||
- isDate(input) ||
- isString(input) ||
- isNumber(input) ||
- isNumberOrStringArray(input) ||
- isMomentInputObject(input) ||
- input === null ||
- input === undefined
- );
-}
-
-export function isMomentInputObject(input) {
- var objectTest = isObject(input) && !isObjectEmpty(input),
- propertyTest = false,
- properties = [
- 'years',
- 'year',
- 'y',
- 'months',
- 'month',
- 'M',
- 'days',
- 'day',
- 'd',
- 'dates',
- 'date',
- 'D',
- 'hours',
- 'hour',
- 'h',
- 'minutes',
- 'minute',
- 'm',
- 'seconds',
- 'second',
- 's',
- 'milliseconds',
- 'millisecond',
- 'ms',
- ],
- i,
- property;
-
- for (i = 0; i < properties.length; i += 1) {
- property = properties[i];
- propertyTest = propertyTest || hasOwnProp(input, property);
- }
-
- return objectTest && propertyTest;
-}
-
-function isNumberOrStringArray(input) {
- var arrayTest = isArray(input),
- dataTypeTest = false;
- if (arrayTest) {
- dataTypeTest =
- input.filter(function (item) {
- return !isNumber(item) && isString(input);
- }).length === 0;
- }
- return arrayTest && dataTypeTest;
-}
diff --git a/node_modules/moment/src/lib/utils/is-number.js b/node_modules/moment/src/lib/utils/is-number.js
deleted file mode 100644
index 4a73753..0000000
--- a/node_modules/moment/src/lib/utils/is-number.js
+++ /dev/null
@@ -1,6 +0,0 @@
-export default function isNumber(input) {
- return (
- typeof input === 'number' ||
- Object.prototype.toString.call(input) === '[object Number]'
- );
-}
diff --git a/node_modules/moment/src/lib/utils/is-object-empty.js b/node_modules/moment/src/lib/utils/is-object-empty.js
deleted file mode 100644
index 62f4e69..0000000
--- a/node_modules/moment/src/lib/utils/is-object-empty.js
+++ /dev/null
@@ -1,15 +0,0 @@
-import hasOwnProp from './has-own-prop';
-
-export default function isObjectEmpty(obj) {
- if (Object.getOwnPropertyNames) {
- return Object.getOwnPropertyNames(obj).length === 0;
- } else {
- var k;
- for (k in obj) {
- if (hasOwnProp(obj, k)) {
- return false;
- }
- }
- return true;
- }
-}
diff --git a/node_modules/moment/src/lib/utils/is-object.js b/node_modules/moment/src/lib/utils/is-object.js
deleted file mode 100644
index a1b2d42..0000000
--- a/node_modules/moment/src/lib/utils/is-object.js
+++ /dev/null
@@ -1,8 +0,0 @@
-export default function isObject(input) {
- // IE8 will treat undefined and null as object if it wasn't for
- // input != null
- return (
- input != null &&
- Object.prototype.toString.call(input) === '[object Object]'
- );
-}
diff --git a/node_modules/moment/src/lib/utils/is-string.js b/node_modules/moment/src/lib/utils/is-string.js
deleted file mode 100644
index 34b8dcc..0000000
--- a/node_modules/moment/src/lib/utils/is-string.js
+++ /dev/null
@@ -1,3 +0,0 @@
-export default function isString(input) {
- return typeof input === 'string' || input instanceof String;
-}
diff --git a/node_modules/moment/src/lib/utils/is-undefined.js b/node_modules/moment/src/lib/utils/is-undefined.js
deleted file mode 100644
index de57a8b..0000000
--- a/node_modules/moment/src/lib/utils/is-undefined.js
+++ /dev/null
@@ -1,3 +0,0 @@
-export default function isUndefined(input) {
- return input === void 0;
-}
diff --git a/node_modules/moment/src/lib/utils/keys.js b/node_modules/moment/src/lib/utils/keys.js
deleted file mode 100644
index 1996e64..0000000
--- a/node_modules/moment/src/lib/utils/keys.js
+++ /dev/null
@@ -1,20 +0,0 @@
-import hasOwnProp from './has-own-prop';
-
-var keys;
-
-if (Object.keys) {
- keys = Object.keys;
-} else {
- keys = function (obj) {
- var i,
- res = [];
- for (i in obj) {
- if (hasOwnProp(obj, i)) {
- res.push(i);
- }
- }
- return res;
- };
-}
-
-export { keys as default };
diff --git a/node_modules/moment/src/lib/utils/map.js b/node_modules/moment/src/lib/utils/map.js
deleted file mode 100644
index 027458c..0000000
--- a/node_modules/moment/src/lib/utils/map.js
+++ /dev/null
@@ -1,8 +0,0 @@
-export default function map(arr, fn) {
- var res = [],
- i;
- for (i = 0; i < arr.length; ++i) {
- res.push(fn(arr[i], i));
- }
- return res;
-}
diff --git a/node_modules/moment/src/lib/utils/mod.js b/node_modules/moment/src/lib/utils/mod.js
deleted file mode 100644
index 8046cda..0000000
--- a/node_modules/moment/src/lib/utils/mod.js
+++ /dev/null
@@ -1,3 +0,0 @@
-export default function mod(n, x) {
- return ((n % x) + x) % x;
-}
diff --git a/node_modules/moment/src/lib/utils/some.js b/node_modules/moment/src/lib/utils/some.js
deleted file mode 100644
index 7c0dd39..0000000
--- a/node_modules/moment/src/lib/utils/some.js
+++ /dev/null
@@ -1,20 +0,0 @@
-var some;
-if (Array.prototype.some) {
- some = Array.prototype.some;
-} else {
- some = function (fun) {
- var t = Object(this),
- len = t.length >>> 0,
- i;
-
- for (i = 0; i < len; i++) {
- if (i in t && fun.call(this, t[i], i, t)) {
- return true;
- }
- }
-
- return false;
- };
-}
-
-export { some as default };
diff --git a/node_modules/moment/src/lib/utils/to-int.js b/node_modules/moment/src/lib/utils/to-int.js
deleted file mode 100644
index fb48941..0000000
--- a/node_modules/moment/src/lib/utils/to-int.js
+++ /dev/null
@@ -1,12 +0,0 @@
-import absFloor from './abs-floor';
-
-export default function toInt(argumentForCoercion) {
- var coercedNumber = +argumentForCoercion,
- value = 0;
-
- if (coercedNumber !== 0 && isFinite(coercedNumber)) {
- value = absFloor(coercedNumber);
- }
-
- return value;
-}
diff --git a/node_modules/moment/src/lib/utils/zero-fill.js b/node_modules/moment/src/lib/utils/zero-fill.js
deleted file mode 100644
index e2d2f6e..0000000
--- a/node_modules/moment/src/lib/utils/zero-fill.js
+++ /dev/null
@@ -1,10 +0,0 @@
-export default function zeroFill(number, targetLength, forceSign) {
- var absNumber = '' + Math.abs(number),
- zerosToFill = targetLength - absNumber.length,
- sign = number >= 0;
- return (
- (sign ? (forceSign ? '+' : '') : '-') +
- Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) +
- absNumber
- );
-}