@sapphire/time-utilities 1.4.9 → 1.5.1-next.4bb40df.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 +3 -0
- package/dist/index.js +10 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +10 -6
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +10 -6
- package/dist/index.umd.js.map +1 -1
- package/dist/lib/DurationFormatter.d.ts +5 -1
- package/dist/lib/DurationFormatter.d.ts.map +1 -1
- package/dist/lib/constants.d.ts +2 -1
- package/dist/lib/constants.d.ts.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -90,6 +90,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
|
|
|
90
90
|
<td align="center"><a href="https://github.com/UndiedGamer"><img src="https://avatars.githubusercontent.com/u/84702365?v=4?s=100" width="100px;" alt=""/><br /><sub><b>UndiedGamer</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=UndiedGamer" title="Code">💻</a></td>
|
|
91
91
|
<td align="center"><a href="https://github.com/Lioness100"><img src="https://avatars.githubusercontent.com/u/65814829?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Lioness100</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=Lioness100" title="Documentation">📖</a> <a href="https://github.com/sapphiredev/utilities/commits?author=Lioness100" title="Code">💻</a></td>
|
|
92
92
|
</tr>
|
|
93
|
+
<tr>
|
|
94
|
+
<td align="center"><a href="https://gitlab.com/DavidPH/"><img src="https://avatars.githubusercontent.com/u/44669930?v=4?s=100" width="100px;" alt=""/><br /><sub><b>David</b></sub></a><br /><a href="https://github.com/sapphiredev/utilities/commits?author=DavidPHH" title="Code">💻</a></td>
|
|
95
|
+
</tr>
|
|
93
96
|
</table>
|
|
94
97
|
|
|
95
98
|
<!-- markdownlint-restore -->
|
package/dist/index.js
CHANGED
|
@@ -117,6 +117,10 @@ const DEFAULT_UNITS = {
|
|
|
117
117
|
DEFAULT: 'seconds'
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
|
+
const DEFAULT_SEPARATORS = {
|
|
121
|
+
left: ' ',
|
|
122
|
+
right: ' '
|
|
123
|
+
};
|
|
120
124
|
|
|
121
125
|
/**
|
|
122
126
|
* Compare if both arrays are strictly equal
|
|
@@ -442,7 +446,7 @@ class DurationFormatter {
|
|
|
442
446
|
value: units
|
|
443
447
|
});
|
|
444
448
|
}
|
|
445
|
-
format(duration, precision = 7) {
|
|
449
|
+
format(duration, precision = 7, { left: leftSeparator = DEFAULT_SEPARATORS.left, right: rightSeparator = DEFAULT_SEPARATORS.right } = DEFAULT_SEPARATORS) {
|
|
446
450
|
const output = [];
|
|
447
451
|
const negative = duration < 0;
|
|
448
452
|
if (negative)
|
|
@@ -453,12 +457,12 @@ class DurationFormatter {
|
|
|
453
457
|
continue;
|
|
454
458
|
const floored = Math.floor(substraction);
|
|
455
459
|
duration -= floored * timeDuration;
|
|
456
|
-
output.push(addUnit(floored, this.units[type]));
|
|
460
|
+
output.push(addUnit(floored, this.units[type], leftSeparator));
|
|
457
461
|
// If the output has enough precision, break
|
|
458
462
|
if (output.length >= precision)
|
|
459
463
|
break;
|
|
460
464
|
}
|
|
461
|
-
return `${negative ? '-' : ''}${output.join(
|
|
465
|
+
return `${negative ? '-' : ''}${output.join(rightSeparator) || addUnit(0, this.units.second, leftSeparator)}`;
|
|
462
466
|
}
|
|
463
467
|
}
|
|
464
468
|
/**
|
|
@@ -466,10 +470,10 @@ class DurationFormatter {
|
|
|
466
470
|
* @param time The duration of said unit
|
|
467
471
|
* @param unit The unit language assets
|
|
468
472
|
*/
|
|
469
|
-
function addUnit(time, unit) {
|
|
473
|
+
function addUnit(time, unit, separator) {
|
|
470
474
|
if (Reflect.has(unit, time))
|
|
471
|
-
return `${time}
|
|
472
|
-
return `${time}
|
|
475
|
+
return `${time}${separator}${Reflect.get(unit, time)}`;
|
|
476
|
+
return `${time}${separator}${unit.DEFAULT}`;
|
|
473
477
|
}
|
|
474
478
|
|
|
475
479
|
/**
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/lib/constants.ts","../../utilities/dist/index.mjs","../src/lib/Cron.ts","../src/lib/Duration.ts","../src/lib/DurationFormatter.ts","../src/lib/TimerManager.ts","../src/lib/Timestamp.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport type { DurationFormatAssetsTime } from './DurationFormatter';\n\n/**\n * The supported time types\n */\nexport const enum TimeTypes {\n\tSecond = 'second',\n\tMinute = 'minute',\n\tHour = 'hour',\n\tDay = 'day',\n\tWeek = 'week',\n\tMonth = 'month',\n\tYear = 'year'\n}\n\nexport const enum Time {\n\tMillisecond = 1,\n\tSecond = 1000,\n\tMinute = 1000 * 60,\n\tHour = 1000 * 60 * 60,\n\tDay = 1000 * 60 * 60 * 24,\n\tMonth = 1000 * 60 * 60 * 24 * (365 / 12),\n\tYear = 1000 * 60 * 60 * 24 * 365\n}\n\nexport const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n\nexport const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n\nexport const tokens = new Map<string, number>([\n\t['Y', 4],\n\t['Q', 1],\n\t['M', 4],\n\t['D', 4],\n\t['d', 4],\n\t['X', 1],\n\t['x', 1],\n\t['H', 2],\n\t['h', 2],\n\t['a', 1],\n\t['A', 1],\n\t['m', 2],\n\t['s', 2],\n\t['S', 3],\n\t['Z', 2],\n\t['l', 4],\n\t['L', 4],\n\t['T', 1],\n\t['t', 1]\n]);\n\nexport const partRegex = /^(?:(\\*)|(\\d+)(?:-(\\d+))?)(?:\\/(\\d+))?$/;\n\nexport const wildcardRegex = /\\bh\\b|\\B\\?\\B/g;\n\nexport const allowedNum = [\n\t[0, 59],\n\t[0, 23],\n\t[1, 31],\n\t[1, 12],\n\t[0, 6]\n];\n\nexport const predefined = {\n\t'@annually': '0 0 1 1 *',\n\t'@yearly': '0 0 1 1 *',\n\t'@monthly': '0 0 1 * *',\n\t'@weekly': '0 0 * * 0',\n\t'@daily': '0 0 * * *',\n\t'@hourly': '0 * * * *'\n} as const;\n\nexport const cronTokens = {\n\tjan: 1,\n\tfeb: 2,\n\tmar: 3,\n\tapr: 4,\n\tmay: 5,\n\tjun: 6,\n\tjul: 7,\n\taug: 8,\n\tsep: 9,\n\toct: 10,\n\tnov: 11,\n\tdec: 12,\n\tsun: 0,\n\tmon: 1,\n\ttue: 2,\n\twed: 3,\n\tthu: 4,\n\tfri: 5,\n\tsat: 6\n} as const;\n\nexport const tokensRegex = new RegExp(Object.keys(cronTokens).join('|'), 'g');\n\nexport const DEFAULT_UNITS: DurationFormatAssetsTime = {\n\t[TimeTypes.Year]: {\n\t\t1: 'year',\n\t\tDEFAULT: 'years'\n\t},\n\t[TimeTypes.Month]: {\n\t\t1: 'month',\n\t\tDEFAULT: 'months'\n\t},\n\t[TimeTypes.Week]: {\n\t\t1: 'week',\n\t\tDEFAULT: 'weeks'\n\t},\n\t[TimeTypes.Day]: {\n\t\t1: 'day',\n\t\tDEFAULT: 'days'\n\t},\n\t[TimeTypes.Hour]: {\n\t\t1: 'hour',\n\t\tDEFAULT: 'hours'\n\t},\n\t[TimeTypes.Minute]: {\n\t\t1: 'minute',\n\t\tDEFAULT: 'minutes'\n\t},\n\t[TimeTypes.Second]: {\n\t\t1: 'second',\n\t\tDEFAULT: 'seconds'\n\t}\n};\n","/**\n * Compare if both arrays are strictly equal\n * @param arr1 The array to compare to\n * @param arr2 The array to compare with\n */\nfunction arrayStrictEquals(arr1, arr2) {\n if (arr1 === arr2)\n return true;\n if (arr1.length !== arr2.length)\n return false;\n for (let i = 0; i < arr1.length; i++) {\n if (arr1[i] !== arr2[i] || typeof arr1[i] !== typeof arr2[i])\n return false;\n }\n return true;\n}\n\n/**\n * Splits up an array into chunks\n * @param array The array to chunk up\n * @param chunkSize The size of each individual chunk\n */\nfunction chunk(array, chunkSize) {\n if (!Array.isArray(array))\n throw new TypeError('entries must be an array.');\n if (!Number.isInteger(chunkSize))\n throw new TypeError('chunkSize must be an integer.');\n if (chunkSize < 1)\n throw new RangeError('chunkSize must be 1 or greater.');\n const clone = array.slice();\n const chunks = [];\n while (clone.length)\n chunks.push(clone.splice(0, chunkSize));\n return chunks;\n}\n\n/**\n * Checks whether or not the value class extends the base class.\n * @param value The constructor to be checked against.\n * @param base The base constructor.\n */\nfunction classExtends(value, base) {\n let ctor = value;\n while (ctor !== null) {\n if (ctor === base)\n return true;\n ctor = Object.getPrototypeOf(ctor);\n }\n return false;\n}\n\nconst zws$1 = String.fromCharCode(8203);\n/**\n * Wraps text in a markdown codeblock with optionally a language indicator for syntax highlighting\n * @param language The codeblock language\n * @param expression The expression to be wrapped in the codeblock\n */\nfunction codeBlock(language, expression) {\n if (typeof expression === 'string') {\n if (expression.length === 0)\n return `\\`\\`\\`${zws$1}\\`\\`\\``;\n return `\\`\\`\\`${language}\\n${expression.replace(/```/, `\\`${zws$1}\\`\\``).replace(/`$/g, `\\`${zws$1}`)}\\`\\`\\``;\n }\n return `\\`\\`\\`${language}\\n${expression || zws$1}\\`\\`\\``;\n}\n\n/**\n * Split a string by its latest space character in a range from the character 0 to the selected one.\n * @param str The text to split.\n * @param length The length of the desired string.\n * @param char The character to split with\n * @copyright 2019 Antonio Román\n * @license Apache-2.0\n */\nfunction splitText(str, length, char = ' ') {\n const x = str.substring(0, length).lastIndexOf(char);\n const pos = x === -1 ? length : x;\n return str.substring(0, pos);\n}\n\n/**\n * Split a text by its latest space character in a range from the character 0 to the selected one.\n * @param str The text to split.\n * @param length The length of the desired string.\n * @copyright 2019 Antonio Román\n * @license Apache-2.0\n */\nfunction cutText(str, length) {\n if (str.length < length)\n return str;\n const cut = splitText(str, length - 3);\n if (cut.length < length - 3)\n return `${cut}...`;\n return `${cut.slice(0, length - 3)}...`;\n}\n\n/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n/**\n * Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since\n * the last time the debounced function was invoked. The debounced function comes with a cancel method to\n * cancel delayed invocations and a flush method to immediately invoke them. Provide an options object to\n * indicate that func should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent\n * calls to the debounced function return the result of the last func invocation.\n *\n * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only\n * if the the debounced function is invoked more than once during the wait timeout.\n *\n * See David Corbacho’s article for details over the differences between _.debounce and _.throttle.\n *\n * @param func The function to debounce.\n * @param wait The number of milliseconds to delay.\n * @param options The options object.\n * @return Returns the new debounced function.\n */\nfunction debounce(func, options = {}) {\n var _a;\n let lastArgs;\n let result;\n let timerId;\n let lastCallTime;\n let lastInvokeTime = 0;\n const wait = (_a = options.wait) !== null && _a !== void 0 ? _a : 0;\n const maxWait = typeof options.maxWait === 'number' ? Math.max(options.maxWait, wait) : null;\n function invokeFunc(time) {\n const args = lastArgs;\n lastArgs = undefined;\n lastInvokeTime = time;\n result = func(...args);\n return result;\n }\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return result;\n }\n function remainingWait(time) {\n const timeSinceLastCall = time - lastCallTime;\n const timeSinceLastInvoke = time - lastInvokeTime;\n const result = wait - timeSinceLastCall;\n return maxWait === null ? result : Math.min(result, maxWait - timeSinceLastInvoke);\n }\n function shouldInvoke(time) {\n const timeSinceLastCall = time - lastCallTime;\n const timeSinceLastInvoke = time - lastInvokeTime;\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || //\n timeSinceLastCall >= wait ||\n timeSinceLastCall < 0 ||\n (maxWait !== null && timeSinceLastInvoke >= maxWait));\n }\n function timerExpired() {\n const time = Date.now();\n if (shouldInvoke(time)) {\n trailingEdge(time);\n return;\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n function trailingEdge(time) {\n timerId = undefined;\n return invokeFunc(time);\n }\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = undefined;\n lastCallTime = undefined;\n timerId = undefined;\n }\n function flush() {\n return timerId === undefined ? result : trailingEdge(Date.now());\n }\n function debounced(...args) {\n const time = Date.now();\n const isInvoking = shouldInvoke(time);\n lastArgs = args;\n lastCallTime = time;\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxWait !== null) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nconst primitiveTypes = ['string', 'bigint', 'number', 'boolean'];\n/**\n * Check whether a value is a primitive\n * @param input The input to check\n */\nfunction isPrimitive(input) {\n return primitiveTypes.includes(typeof input);\n}\n\n/**\n * Deep clone an object\n * @param source The object to clone\n */\nfunction deepClone(source) {\n // Check if it's a primitive (with exception of function and null, which is typeof object)\n if (source === null || isPrimitive(source)) {\n return source;\n }\n if (Array.isArray(source)) {\n const output = new source.constructor(source.length);\n for (let i = 0; i < source.length; i++) {\n output[i] = deepClone(source[i]);\n }\n return output;\n }\n if (source instanceof Map) {\n const output = new source.constructor();\n for (const [key, value] of source.entries()) {\n output.set(key, deepClone(value));\n }\n return output;\n }\n if (source instanceof Set) {\n const output = new source.constructor();\n for (const value of source.values()) {\n output.add(deepClone(value));\n }\n return output;\n }\n if (typeof source === 'object') {\n const output = new source.constructor();\n for (const [key, value] of Object.entries(source)) {\n Object.defineProperty(output, key, {\n configurable: true,\n enumerable: true,\n value: deepClone(value),\n writable: true\n });\n }\n return output;\n }\n return source;\n}\n\n/**\n * Checks whether or not a value is `null` or `undefined`\n * @param value The value to check\n */\nfunction isNullOrUndefined(value) {\n return value === undefined || value === null;\n}\n\n/**\n * Checks whether a value is not `null` nor `undefined`.\n * This can be used in {@link Array.filter} to remove `null` and `undefined` from the array type\n * @param value The value to verify that is neither `null` nor `undefined`\n * @returns A boolean that is `true` if the value is neither `null` nor `undefined`, false otherwise.\n * @example\n * ```typescript\n * // TypeScript Type: (string | undefined | null)[]\n * const someArray = ['one', 'two', undefined, null, 'five'];\n *\n * // TypeScript Type: string[]\n * const filteredArray = someArray.filter(filterNullAndUndefined);\n * // Result: ['one', 'two', 'five']\n * ```\n */\nfunction filterNullAndUndefined(value) {\n return !isNullOrUndefined(value);\n}\n\n/**\n * Checks whether or not a value is `null`, `undefined` or `''`, `[]`\n * @param value The value to check\n */\nfunction isNullOrUndefinedOrEmpty(value) {\n return isNullOrUndefined(value) || value.length === 0;\n}\n\n/**\n * Checks whether a value is not `null` nor `undefined` nor `''` (empty string).\n * This can be used in {@link Array.filter} to remove `null`, `undefined` from the array type\n * @param value The value to verify that is neither `null`, `undefined` nor `''` (empty string)\n * @returns A boolean that is `true` if the value is neither `null`, `undefined` nor `''` (empty string), false otherwise.\n * @example\n * ```typescript\n * // TypeScript Type: (string | undefined | null)[]\n * const someArray = ['one', 'two', undefined, null, ''];\n *\n * // TypeScript Type: string[]\n * const filteredArray = someArray.filter(filterNullAndUndefinedAndEmpty);\n * // Result: ['one', 'two']\n * ```\n */\nfunction filterNullAndUndefinedAndEmpty(value) {\n return !isNullOrUndefinedOrEmpty(value);\n}\n\n/**\n * Checks whether or not a value is `null`, `undefined` or `0`\n * @param value The value to check\n */\nfunction isNullOrUndefinedOrZero(value) {\n return value === 0 || isNullOrUndefined(value);\n}\n\n/**\n * Checks whether a value is not `null` nor `undefined` nor `0`.\n * This can be used in {@link Array.filter} to remove `null`, `undefined` from the array type\n * @param value The value to verify that is neither `null`, `undefined` nor `0`\n * @returns A boolean that is `true` if the value is neither `null`, `undefined` nor `0`, false otherwise.\n * @example\n * ```typescript\n * // TypeScript Type: (string | number | undefined | null)[]\n * const someArray = ['one', 'two', undefined, null, 0, 1];\n *\n * // TypeScript Type: (string | number)[]\n * const filteredArray = someArray.filter(filterNullAndUndefinedAndZero);\n * // Result: ['one', 'two', 1]\n * ```\n */\nfunction filterNullAndUndefinedAndZero(value) {\n return !isNullOrUndefinedOrZero(value);\n}\n\n/**\n * Checks whether any of the {@link keys} are in the {@link map}\n * @param map The map to check\n * @param keys The keys to find in the map\n * @returns `true` if at least one of the {@link keys} is in the {@link map}, `false` otherwise.\n */\nfunction hasAtLeastOneKeyInMap(map, keys) {\n return keys.some((key) => map.has(key));\n}\n\nconst zws = String.fromCharCode(8203);\n/**\n * Wraps text in a markdown inline codeblock\n * @param expression The expression to be wrapped in the codeblock\n */\nfunction inlineCodeBlock(input) {\n return `\\`${input.replace(/ /g, '\\u00A0').replace(/`/g, `\\`${zws}`)}\\``;\n}\n\n/**\n * Verify if the input is a class constructor.\n * @param input The function to verify\n */\nfunction isClass(input) {\n return typeof input === 'function' && typeof input.prototype === 'object';\n}\n\n/**\n * Verify if the input is a function.\n * @param input The function to verify\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction isFunction(input) {\n return typeof input === 'function';\n}\n\n/**\n * Verify if a number is a finite number.\n * @param input The number to verify\n */\nfunction isNumber(input) {\n return typeof input === 'number' && !isNaN(input) && Number.isFinite(input);\n}\n\n/* eslint-disable @typescript-eslint/ban-types */\n/**\n * Verify if the input is an object literal (or class).\n * @param input The object to verify\n */\nfunction isObject(input) {\n return typeof input === 'object' && input ? input.constructor === Object : false;\n}\n\n/* eslint-disable @typescript-eslint/ban-types */\nfunction hasThen(input) {\n return Reflect.has(input, 'then') && isFunction(input.then);\n}\nfunction hasCatch(input) {\n return Reflect.has(input, 'catch') && isFunction(input.catch);\n}\n/**\n * Verify if an object is a promise.\n * @param input The promise to verify\n */\nfunction isThenable(input) {\n if (typeof input !== 'object' || input === null)\n return false;\n return input instanceof Promise || (input !== Promise.prototype && hasThen(input) && hasCatch(input));\n}\n\n/**\n * Turn a dotted path into a json object.\n * @param path The dotted path\n * @param value The value\n * @param obj The object to edit\n */\nfunction makeObject(path, value, obj = {}) {\n if (path.includes('.')) {\n const route = path.split('.');\n const lastKey = route.pop();\n let reference = obj;\n for (const key of route) {\n if (!reference[key])\n reference[key] = {};\n reference = reference[key];\n }\n reference[lastKey] = value;\n }\n else {\n obj[path] = value;\n }\n return obj;\n}\n\n/**\n * Deep merges 2 objects. Properties from the second parameter are applied to the first.\n * @remark `overwrites` is also mutated!\n * @remark If the value of a key in `overwrites` is `undefined` then the value of that same key in `base` is used instead!\n * @remark This is essentially `{ ...base, ...overwrites }` but recursively\n * @param base Base object\n * @param overwrites Overwrites to apply\n * @example\n * ```typescript\n * const base = { a: 0, b: 1 };\n * const overwrites = {}; // will be { a: 0, b: 1 } after merge\n * mergeDefault(base, overwrites) // { a: 0, b: 1 }\n * ```\n * @example\n * ```typescript\n * const base = { a: 0, b: 1 };\n * const overwrites = { a: 2, i: 3 };\n * mergeDefault(base, overwrites) // { a: 2, i: 3, b: 1 };\n * ```\n * @example\n * ```typescript\n * const base = { a: 0, b: 1 };\n * const overwrites = { a: null };\n * mergeDefault(base, overwrites) // { a: null, b: 1 };\n * ```\n * @example\n * ```typescript\n * const base = { a: 0, b: 1 };\n * const overwrites = { a: undefined };\n * mergeDefault(base, overwrites) // { a: 0, b: 1 };\n * ```\n * @example\n * ```typescript\n * const base = { a: null };\n * const overwrites = { a: { b: 5 } };\n * mergeDefault(base, overwrites) // { a: { b: 5 } };\n * ```\n */\nfunction mergeDefault(base, overwrites) {\n // If no overwrites are specified then deep clone the base\n if (!overwrites)\n return deepClone(base);\n for (const [baseKey, baseValue] of Object.entries(base)) {\n const overwritesValueAtBaseKey = Reflect.get(overwrites, baseKey);\n if (typeof overwritesValueAtBaseKey === 'undefined') {\n Reflect.set(overwrites, baseKey, deepClone(baseValue));\n }\n else if (isObject(overwritesValueAtBaseKey)) {\n Reflect.set(overwrites, baseKey, mergeDefault((baseValue !== null && baseValue !== void 0 ? baseValue : {}), overwritesValueAtBaseKey));\n }\n }\n return overwrites;\n}\n\n/* eslint-disable @typescript-eslint/ban-types */\n/**\n * Merges two objects\n * @param objTarget The object to be merged\n * @param objSource The object to merge\n */\nfunction mergeObjects(objTarget, objSource) {\n for (const [key, value] of Object.entries(objSource)) {\n const targetValue = Reflect.get(objTarget, key);\n if (isObject(value)) {\n Reflect.set(objTarget, key, isObject(targetValue) ? mergeObjects(targetValue, value) : value);\n }\n else if (!isObject(targetValue)) {\n Reflect.set(objTarget, key, value);\n }\n }\n return objTarget;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nfunction noop() { }\n\n/**\n * Convert an object to a tuple\n * @param value The object to convert\n * @param prefix The prefix for the key\n */\nfunction objectToTuples(original, prefix = '') {\n const entries = [];\n for (const [key, value] of Object.entries(original)) {\n if (isObject(value)) {\n entries.push(...objectToTuples(value, `${prefix}${key}.`));\n }\n else {\n entries.push([`${prefix}${key}`, value]);\n }\n }\n return entries;\n}\n\n/**\n * Parses an URL, returns null if invalid.\n * @param url The url to parse\n */\nfunction parseURL(url) {\n try {\n // @ts-expect-error URL is global in NodeJS and evergreen Browsers\n return new URL(url);\n }\n catch {\n return null;\n }\n}\n\n/**\n * Partitions `array` into a tuple of two arrays,\n * where one array contains all elements that satisfies `predicate`,\n * and the other contains all elements that do not satisfy `predicate`.\n * @param array The array to partition. This array is not mutated.\n * @param predicate The predicate function to determine in which partition the item should be placed.\n * The function should return true for items that should be placed in the first partition, and false for those that should be placed in the second partition.\n * @returns A tuple of two arrays.\n */\nfunction partition(array, predicate) {\n if (!Array.isArray(array))\n throw new TypeError('entries must be an array.');\n if (!isFunction(predicate))\n throw new TypeError('predicate must be an function that returns a boolean value.');\n const partitionOne = [];\n const partitionTwo = [];\n for (let i = 0; i < array.length; i++) {\n if (predicate(array[i], i)) {\n partitionOne.push(array[i]);\n }\n else {\n partitionTwo.push(array[i]);\n }\n }\n return [partitionOne, partitionTwo];\n}\n\n/**\n * Get an array of numbers with the selected range\n * @param min The minimum value\n * @param max The maximum value\n * @param step The step value\n */\nfunction range(min, max, step) {\n return new Array(Math.floor((max - min) / step) + 1).fill(0).map((_val, i) => min + i * step);\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst REGEXPESC = /[-/\\\\^$*+?.()|[\\]{}]/g;\n/**\n * Cleans a string from regex injection\n * @param str The string to clean\n */\nfunction regExpEsc(str) {\n return str.replace(REGEXPESC, '\\\\$&');\n}\n\n/**\n * Properly rounds up or down a number.\n * Also supports strings using an exponent to indicate large or small numbers.\n * @param num The number to round off\n * @param scale The amount of decimals to retain\n */\nfunction roundNumber(num, scale = 0) {\n if (!num.toString().includes('e')) {\n return Number(`${Math.round(Number(`${num}e+${scale}`))}e-${scale}`);\n }\n const arr = `${num}`.split('e');\n let sig = '';\n if (Number(arr[1]) + scale > 0) {\n sig = '+';\n }\n return Number(`${Math.round(Number(`${Number(arr[0])}e${sig}${Number(arr[1]) + scale}`))}e-${scale}`);\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst TOTITLECASE = /[A-Za-zÀ-ÖØ-öø-ÿ]\\S*/g;\nconst titleCaseVariants = {\n textchannel: 'TextChannel',\n voicechannel: 'VoiceChannel',\n categorychannel: 'CategoryChannel',\n guildmember: 'GuildMember'\n};\n/**\n * Converts a string to Title Case\n * @description This is designed to also ensure common Discord PascalCased strings\n * \t\t\t\tare put in their TitleCase titleCaseVariants. See below for the full list.\n * @param str The string to title case\n * @terms\n * This table lists how certain terms are converted, these are case insensitive.\n * Any terms not included are converted to regular Titlecase.\n *\n * | Term | Converted To |\n * |-----------------|-----------------|\n * | textchannel | TextChannel |\n * | voicechannel | VoiceChannel |\n * | categorychannel | CategoryChannel |\n * | guildmember | GuildMember |\n */\nfunction toTitleCase(str) {\n return str.replace(TOTITLECASE, (txt) => titleCaseVariants[txt] || txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase());\n}\n\n/* eslint-disable @typescript-eslint/ban-types */\n/**\n * Try parse a stringified JSON string.\n * @param value The value to parse\n */\nfunction tryParse(value) {\n try {\n return JSON.parse(value);\n }\n catch (err) {\n return value;\n }\n}\n\nexport { arrayStrictEquals, chunk, classExtends, codeBlock, cutText, debounce, deepClone, filterNullAndUndefined, filterNullAndUndefinedAndEmpty, filterNullAndUndefinedAndZero, filterNullAndUndefined as filterNullish, filterNullAndUndefinedAndEmpty as filterNullishOrEmpty, filterNullAndUndefinedAndZero as filterNullishOrZero, hasAtLeastOneKeyInMap, inlineCodeBlock, isClass, isFunction, isNullOrUndefined, isNullOrUndefinedOrEmpty, isNullOrUndefinedOrZero, isNullOrUndefined as isNullish, isNullOrUndefinedOrEmpty as isNullishOrEmpty, isNullOrUndefinedOrZero as isNullishOrZero, isNumber, isObject, isPrimitive, isThenable, makeObject, mergeDefault, mergeObjects, noop, objectToTuples, parseURL, partition, range, regExpEsc, roundNumber, splitText, toTitleCase, tryParse };\n//# sourceMappingURL=index.mjs.map\n","/* eslint-disable @typescript-eslint/restrict-plus-operands */\nimport { range } from '@sapphire/utilities';\nimport { allowedNum, cronTokens, partRegex, predefined, Time, tokensRegex, wildcardRegex } from './constants';\n\n/**\n * Handles Cron strings and generates dates based on the cron string provided.\n * @see https://en.wikipedia.org/wiki/Cron\n */\nexport class Cron {\n\tpublic cron: string;\n\tpublic normalized: string;\n\tpublic minutes: number[];\n\tpublic hours: number[];\n\tpublic days: number[];\n\tpublic months: number[];\n\tpublic dows: number[];\n\n\t/**\n\t * @param cron The cron pattern to use\n\t */\n\tpublic constructor(cron: string) {\n\t\tthis.cron = cron.toLowerCase();\n\t\tthis.normalized = Cron.normalize(this.cron);\n\t\t[this.minutes, this.hours, this.days, this.months, this.dows] = Cron.parseString(this.normalized);\n\t}\n\n\t/**\n\t * Get the next date that matches with the current pattern\n\t * @param outset The Date instance to compare with\n\t * @param origin Whether this next call is origin\n\t */\n\tpublic next(outset: Date = new Date(), origin = true): Date {\n\t\tif (!this.days.includes(outset.getUTCDate()) || !this.months.includes(outset.getUTCMonth() + 1) || !this.dows.includes(outset.getUTCDay())) {\n\t\t\treturn this.next(new Date(outset.getTime() + Time.Day), false);\n\t\t}\n\t\tif (!origin) return new Date(Date.UTC(outset.getUTCFullYear(), outset.getUTCMonth(), outset.getUTCDate(), this.hours[0], this.minutes[0]));\n\n\t\tconst now = new Date(outset.getTime() + 60000);\n\n\t\tfor (const hour of this.hours) {\n\t\t\tif (hour < now.getUTCHours()) continue;\n\t\t\tfor (const minute of this.minutes) {\n\t\t\t\tif (hour === now.getUTCHours() && minute < now.getUTCMinutes()) continue;\n\t\t\t\treturn new Date(Date.UTC(outset.getUTCFullYear(), outset.getUTCMonth(), outset.getUTCDate(), hour, minute));\n\t\t\t}\n\t\t}\n\n\t\treturn this.next(new Date(outset.getTime() + Time.Day), false);\n\t}\n\n\t/**\n\t * Normalize the pattern\n\t * @param cron The pattern to normalize\n\t */\n\tprivate static normalize(cron: string): string {\n\t\tif (Reflect.has(predefined, cron)) return Reflect.get(predefined, cron);\n\t\tconst now = new Date();\n\t\tcron = cron\n\t\t\t.split(' ')\n\t\t\t.map((val, i) =>\n\t\t\t\tval.replace(wildcardRegex, (match) => {\n\t\t\t\t\tif (match === 'h') return (Math.floor(Math.random() * allowedNum[i][1]) + allowedNum[i][0]).toString();\n\n\t\t\t\t\tif (match === '?') {\n\t\t\t\t\t\tswitch (i) {\n\t\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t\treturn now.getUTCMinutes().toString();\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\treturn now.getUTCHours().toString();\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\treturn now.getUTCDate().toString();\n\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\treturn now.getUTCMonth().toString();\n\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\treturn now.getUTCDay().toString();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn match;\n\t\t\t\t})\n\t\t\t)\n\t\t\t.join(' ');\n\t\treturn cron.replace(tokensRegex, (match) => String(Reflect.get(cronTokens, match)));\n\t}\n\n\t/**\n\t * Parse the pattern\n\t * @param cron The pattern to parse\n\t */\n\tprivate static parseString(cron: string): Array<number[]> {\n\t\tconst parts = cron.split(' ');\n\t\tif (parts.length !== 5) throw new Error('Invalid Cron Provided');\n\t\treturn parts.map((part, i) => Cron.parsePart(part, i));\n\t}\n\n\t/**\n\t * Parse the current part\n\t * @param cronPart The part of the pattern to parse\n\t * @param id The id that identifies the current part\n\t */\n\tprivate static parsePart(cronPart: string, id: number): number[] {\n\t\tif (cronPart.includes(',')) {\n\t\t\tconst res: number[] = [];\n\t\t\tfor (const part of cronPart.split(',')) res.push(...Cron.parsePart(part, id));\n\t\t\treturn [...new Set(res)].sort((a, b) => a - b);\n\t\t}\n\n\t\t// eslint-disable-next-line prefer-const\n\t\tconst [, wild, minStr, maxStr, step] = partRegex.exec(cronPart)!;\n\t\tlet [min, max] = [parseInt(minStr, 10), parseInt(maxStr, 10)];\n\n\t\t// If '*', set min and max as the minimum and maximum allowed numbers:\n\t\tif (wild) [min, max] = allowedNum[id];\n\t\t// Else if a number was given, but not a maximum nor a step, return it\n\t\t// as only allowed value:\n\t\telse if (!max && !step) return [min];\n\n\t\t// Set min and max as the given numbers, defaulting max to the maximum\n\t\t// allowed, so min is never bigger than max:\n\t\t// This makes min and max be, in the following cases (considering minutes):\n\t\t// -> 1-2 | 1..2\n\t\t// -> 2-1 | 1..2\n\t\t// -> 1/7 | 1, 8, 15, 22, 29, 36, 43, 50, 57\n\t\t[min, max] = [min, max || allowedNum[id][1]].sort((a, b) => a - b);\n\n\t\t// Generate a range\n\t\treturn range(min, max, parseInt(step, 10) || 1);\n\t}\n}\n","/* eslint-disable @typescript-eslint/restrict-plus-operands */\nconst tokens = new Map([\n\t['nanosecond', 1 / 1e6],\n\t['nanoseconds', 1 / 1e6],\n\t['ns', 1 / 1e6],\n\n\t['millisecond', 1],\n\t['milliseconds', 1],\n\t['ms', 1],\n\n\t['second', 1000],\n\t['seconds', 1000],\n\t['sec', 1000],\n\t['secs', 1000],\n\t['s', 1000],\n\n\t['minute', 1000 * 60],\n\t['minutes', 1000 * 60],\n\t['min', 1000 * 60],\n\t['mins', 1000 * 60],\n\t['m', 1000 * 60],\n\n\t['hour', 1000 * 60 * 60],\n\t['hours', 1000 * 60 * 60],\n\t['hr', 1000 * 60 * 60],\n\t['hrs', 1000 * 60 * 60],\n\t['h', 1000 * 60 * 60],\n\n\t['day', 1000 * 60 * 60 * 24],\n\t['days', 1000 * 60 * 60 * 24],\n\t['d', 1000 * 60 * 60 * 24],\n\n\t['week', 1000 * 60 * 60 * 24 * 7],\n\t['weeks', 1000 * 60 * 60 * 24 * 7],\n\t['wk', 1000 * 60 * 60 * 24 * 7],\n\t['wks', 1000 * 60 * 60 * 24 * 7],\n\t['w', 1000 * 60 * 60 * 24 * 7],\n\n\t['month', 1000 * 60 * 60 * 24 * (365.25 / 12)],\n\t['months', 1000 * 60 * 60 * 24 * (365.25 / 12)],\n\t['b', 1000 * 60 * 60 * 24 * (365.25 / 12)],\n\t['mo', 1000 * 60 * 60 * 24 * (365.25 / 12)],\n\n\t['year', 1000 * 60 * 60 * 24 * 365.25],\n\t['years', 1000 * 60 * 60 * 24 * 365.25],\n\t['yr', 1000 * 60 * 60 * 24 * 365.25],\n\t['yrs', 1000 * 60 * 60 * 24 * 365.25],\n\t['y', 1000 * 60 * 60 * 24 * 365.25]\n]);\n\n/**\n * Converts duration strings into ms and future dates\n */\nexport class Duration {\n\t/**\n\t * The offset\n\t */\n\tpublic offset: number;\n\n\t/**\n\t * Create a new Duration instance\n\t * @param pattern The string to parse\n\t */\n\tpublic constructor(pattern: string) {\n\t\tthis.offset = Duration.parse(pattern.toLowerCase());\n\t}\n\n\t/**\n\t * Get the date from now\n\t */\n\tpublic get fromNow(): Date {\n\t\treturn this.dateFrom(new Date());\n\t}\n\n\t/**\n\t * Get the date from\n\t * @param date The Date instance to get the date from\n\t */\n\tpublic dateFrom(date: Date): Date {\n\t\treturn new Date(date.getTime() + this.offset);\n\t}\n\n\t/**\n\t * The RegExp used for the pattern parsing\n\t */\n\tprivate static readonly kPatternRegex = /(-?\\d*\\.?\\d+(?:e[-+]?\\d+)?)\\s*([a-zμ]*)/gi;\n\n\t/**\n\t * The RegExp used for removing commas\n\t */\n\tprivate static readonly kCommaRegex = /,/g;\n\n\t/**\n\t * The RegExp used for replacing a/an with 1\n\t */\n\tprivate static readonly kAanRegex = /\\ban?\\b/gi;\n\n\t/**\n\t * Parse the pattern\n\t * @param pattern The pattern to parse\n\t */\n\tprivate static parse(pattern: string): number {\n\t\tlet result = 0;\n\t\tlet valid = false;\n\n\t\tpattern\n\t\t\t// ignore commas\n\t\t\t.replace(Duration.kCommaRegex, '')\n\t\t\t// a / an = 1\n\t\t\t.replace(Duration.kAanRegex, '1')\n\t\t\t// do math\n\t\t\t.replace(Duration.kPatternRegex, (_, i, units) => {\n\t\t\t\tconst token = tokens.get(units);\n\t\t\t\tif (token !== undefined) {\n\t\t\t\t\tresult += Number(i) * token;\n\t\t\t\t\tvalid = true;\n\t\t\t\t}\n\t\t\t\treturn '';\n\t\t\t});\n\n\t\treturn valid ? result : NaN;\n\t}\n}\n","import { DEFAULT_UNITS, TimeTypes } from './constants';\n\n/**\n * The duration of each time type in milliseconds\n */\nconst kTimeDurations: readonly [TimeTypes, number][] = [\n\t[TimeTypes.Year, 31536000000],\n\t// 29.53059 days is the official duration of a month: https://en.wikipedia.org/wiki/Month\n\t[TimeTypes.Month, 2628000000],\n\t[TimeTypes.Week, 1000 * 60 * 60 * 24 * 7],\n\t[TimeTypes.Day, 1000 * 60 * 60 * 24],\n\t[TimeTypes.Hour, 1000 * 60 * 60],\n\t[TimeTypes.Minute, 1000 * 60],\n\t[TimeTypes.Second, 1000]\n];\n\n/**\n * Display the duration\n * @param duration The duration in milliseconds to parse and display\n * @param assets The language assets\n */\nexport class DurationFormatter {\n\tpublic constructor(public units: DurationFormatAssetsTime = DEFAULT_UNITS) {}\n\n\tpublic format(duration: number, precision = 7) {\n\t\tconst output: string[] = [];\n\t\tconst negative = duration < 0;\n\t\tif (negative) duration *= -1;\n\n\t\tfor (const [type, timeDuration] of kTimeDurations) {\n\t\t\tconst substraction = duration / timeDuration;\n\t\t\tif (substraction < 1) continue;\n\n\t\t\tconst floored = Math.floor(substraction);\n\t\t\tduration -= floored * timeDuration;\n\t\t\toutput.push(addUnit(floored, this.units[type]));\n\n\t\t\t// If the output has enough precision, break\n\t\t\tif (output.length >= precision) break;\n\t\t}\n\n\t\treturn `${negative ? '-' : ''}${output.join(' ') || addUnit(0, this.units.second)}`;\n\t}\n}\n\n/**\n * Adds an unit, if non zero\n * @param time The duration of said unit\n * @param unit The unit language assets\n */\nfunction addUnit(time: number, unit: DurationFormatAssetsUnit) {\n\tif (Reflect.has(unit, time)) return `${time} ${Reflect.get(unit, time)}`;\n\treturn `${time} ${unit.DEFAULT}`;\n}\n\nexport interface DurationFormatAssetsUnit extends Record<number, string> {\n\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\tDEFAULT: string;\n}\n\nexport interface DurationFormatAssetsTime {\n\t[TimeTypes.Second]: DurationFormatAssetsUnit;\n\t[TimeTypes.Minute]: DurationFormatAssetsUnit;\n\t[TimeTypes.Hour]: DurationFormatAssetsUnit;\n\t[TimeTypes.Day]: DurationFormatAssetsUnit;\n\t[TimeTypes.Week]: DurationFormatAssetsUnit;\n\t[TimeTypes.Month]: DurationFormatAssetsUnit;\n\t[TimeTypes.Year]: DurationFormatAssetsUnit;\n}\n","/**\n * Manages timers so that this application can be cleanly exited\n */\nexport class TimerManager extends null {\n\t/**\n\t * A set of timeouts to clear on destroy\n\t */\n\tprivate static storedTimeouts = new Set<NodeJS.Timeout>();\n\n\t/**\n\t * A set of intervals to clear on destroy\n\t */\n\tprivate static storedIntervals = new Set<NodeJS.Timeout>();\n\n\t/**\n\t * Creates a timeout gets cleared when destroyed\n\t * @param fn callback function\n\t * @param delay amount of time before running the callback\n\t * @param args additional arguments to pass back to the callback\n\t */\n\tpublic static setTimeout<A = unknown>(fn: (...args: A[]) => void, delay: number, ...args: A[]): NodeJS.Timeout {\n\t\tconst timeout = setTimeout(() => {\n\t\t\tthis.storedTimeouts.delete(timeout);\n\t\t\tfn(...args);\n\t\t}, delay);\n\t\tthis.storedTimeouts.add(timeout);\n\t\treturn timeout;\n\t}\n\n\t/**\n\t * Clears a timeout created through this class\n\t * @param timeout The timeout to clear\n\t */\n\tpublic static clearTimeout(timeout: NodeJS.Timeout): void {\n\t\tclearTimeout(timeout);\n\t\tthis.storedTimeouts.delete(timeout);\n\t}\n\n\t/**\n\t * Creates an interval gets cleared when destroyed\n\t * @param fn callback function\n\t * @param delay amount of time before running the callback\n\t * @param args additional arguments to pass back to the callback\n\t */\n\tpublic static setInterval<A = unknown>(fn: (...args: A[]) => void, delay: number, ...args: A[]): NodeJS.Timeout {\n\t\tconst interval = setInterval(fn, delay, ...args);\n\t\tthis.storedIntervals.add(interval);\n\t\treturn interval;\n\t}\n\n\t/**\n\t * Clears an internal created through this class\n\t * @param interval The interval to clear\n\t */\n\tpublic static clearInterval(interval: NodeJS.Timeout): void {\n\t\tclearInterval(interval);\n\t\tthis.storedIntervals.delete(interval);\n\t}\n\n\t/**\n\t * Clears running timeouts and intervals created through this class so NodeJS can gracefully exit\n\t */\n\tpublic static destroy(): void {\n\t\tfor (const i of this.storedTimeouts) clearTimeout(i);\n\t\tfor (const i of this.storedIntervals) clearInterval(i);\n\t\tthis.storedTimeouts.clear();\n\t\tthis.storedIntervals.clear();\n\t}\n}\n","import { days, months, Time, tokens } from './constants';\n\ninterface TokenResolver {\n\t(time: Date): string;\n}\n\nconst tokenResolvers = new Map<string, TokenResolver>([\n\t// Dates\n\t['Y', (time) => String(time.getFullYear()).slice(2)],\n\t['YY', (time) => String(time.getFullYear()).slice(2)],\n\t['YYY', (time) => String(time.getFullYear())],\n\t['YYYY', (time) => String(time.getFullYear())],\n\t['Q', (time) => String((time.getMonth() + 1) / 3)],\n\t['M', (time) => String(time.getMonth() + 1)],\n\t['MM', (time) => String(time.getMonth() + 1).padStart(2, '0')],\n\t['MMM', (time) => months[time.getMonth()]],\n\t['MMMM', (time) => months[time.getMonth()]],\n\t['D', (time) => String(time.getDate())],\n\t['DD', (time) => String(time.getDate()).padStart(2, '0')],\n\t['DDD', (time) => String(Math.floor((time.getTime() - new Date(time.getFullYear(), 0, 0).getTime()) / Time.Day))],\n\t['DDDD', (time) => String(Math.floor((time.getTime() - new Date(time.getFullYear(), 0, 0).getTime()) / Time.Day))],\n\t[\n\t\t'd',\n\t\t(time) => {\n\t\t\tconst day = String(time.getDate());\n\t\t\tif (day !== '11' && day.endsWith('1')) return `${day}st`;\n\t\t\tif (day !== '12' && day.endsWith('2')) return `${day}nd`;\n\t\t\tif (day !== '13' && day.endsWith('3')) return `${day}rd`;\n\t\t\treturn `${day}th`;\n\t\t}\n\t],\n\t['dd', (time) => days[time.getDay()].slice(0, 2)],\n\t['ddd', (time) => days[time.getDay()].slice(0, 3)],\n\t['dddd', (time) => days[time.getDay()]],\n\t['X', (time) => String(time.valueOf() / Time.Second)],\n\t['x', (time) => String(time.valueOf())],\n\n\t// Locales\n\t['H', (time) => String(time.getHours())],\n\t['HH', (time) => String(time.getHours()).padStart(2, '0')],\n\t['h', (time) => String(time.getHours() % 12 || 12)],\n\t['hh', (time) => String(time.getHours() % 12 || 12).padStart(2, '0')],\n\t['a', (time) => (time.getHours() < 12 ? 'am' : 'pm')],\n\t['A', (time) => (time.getHours() < 12 ? 'AM' : 'PM')],\n\t['m', (time) => String(time.getMinutes())],\n\t['mm', (time) => String(time.getMinutes()).padStart(2, '0')],\n\t['s', (time) => String(time.getSeconds())],\n\t['ss', (time) => String(time.getSeconds()).padStart(2, '0')],\n\t['S', (time) => String(time.getMilliseconds())],\n\t['SS', (time) => String(time.getMilliseconds()).padStart(2, '0')],\n\t['SSS', (time) => String(time.getMilliseconds()).padStart(3, '0')],\n\t['T', (time) => `${String(time.getHours() % 12 || 12)}:${String(time.getMinutes()).padStart(2, '0')} ${time.getHours() < 12 ? 'AM' : 'PM'}`],\n\t[\n\t\t't',\n\t\t(time) =>\n\t\t\t`${String(time.getHours() % 12 || 12)}:${String(time.getMinutes()).padStart(2, '0')}:${String(time.getSeconds()).padStart(2, '0')} ${\n\t\t\t\ttime.getHours() < 12 ? 'am' : 'pm'\n\t\t\t}`\n\t],\n\t['L', (time) => `${String(time.getMonth() + 1).padStart(2, '0')}/${String(time.getDate()).padStart(2, '0')}/${String(time.getFullYear())}`],\n\t['l', (time) => `${String(time.getMonth() + 1)}/${String(time.getDate()).padStart(2, '0')}/${String(time.getFullYear())}`],\n\t['LL', (time) => `${months[time.getMonth()]} ${String(time.getDate()).padStart(2, '0')}, ${String(time.getFullYear())}`],\n\t['ll', (time) => `${months[time.getMonth()].slice(0, 3)} ${String(time.getDate()).padStart(2, '0')}, ${String(time.getFullYear())}`],\n\t[\n\t\t'LLL',\n\t\t(time) =>\n\t\t\t`${months[time.getMonth()]} ${String(time.getDate()).padStart(2, '0')}, ${String(time.getFullYear())} ${String(\n\t\t\t\ttime.getHours() % 12 || 12\n\t\t\t)}:${String(time.getMinutes()).padStart(2, '0')} ${time.getHours() < 12 ? 'AM' : 'PM'}`\n\t],\n\t[\n\t\t'lll',\n\t\t(time) =>\n\t\t\t`${months[time.getMonth()].slice(0, 3)} ${String(time.getDate()).padStart(2, '0')}, ${String(time.getFullYear())} ${String(\n\t\t\t\ttime.getHours() % 12 || 12\n\t\t\t)}:${String(time.getMinutes()).padStart(2, '0')} ${time.getHours() < 12 ? 'AM' : 'PM'}`\n\t],\n\t[\n\t\t'LLLL',\n\t\t(time) =>\n\t\t\t`${days[time.getDay()]}, ${months[time.getMonth()]} ${String(time.getDate()).padStart(2, '0')}, ${String(time.getFullYear())} ${String(\n\t\t\t\ttime.getHours() % 12 || 12\n\t\t\t)}:${String(time.getMinutes()).padStart(2, '0')} ${time.getHours() < 12 ? 'AM' : 'PM'}`\n\t],\n\t[\n\t\t'llll',\n\t\t(time) =>\n\t\t\t`${days[time.getDay()].slice(0, 3)} ${months[time.getMonth()].slice(0, 3)} ${String(time.getDate()).padStart(2, '0')}, ${String(\n\t\t\t\ttime.getFullYear()\n\t\t\t)} ${String(time.getHours() % 12 || 12)}:${String(time.getMinutes()).padStart(2, '0')} ${time.getHours() < 12 ? 'AM' : 'PM'}`\n\t],\n\t[\n\t\t'Z',\n\t\t(time) => {\n\t\t\tconst offset = time.getTimezoneOffset();\n\t\t\tconst unsigned = offset >= 0;\n\t\t\tconst absolute = Math.abs(offset);\n\t\t\t/* istanbul ignore next: whether it's signed or unsigned, depends on where the machine is, I cannot control this. */\n\t\t\treturn `${unsigned ? '+' : '-'}${String(Math.floor(absolute / 60)).padStart(2, '0')}:${String(absolute % 60).padStart(2, '0')}`;\n\t\t}\n\t],\n\t[\n\t\t'ZZ',\n\t\t(time) => {\n\t\t\tconst offset = time.getTimezoneOffset();\n\t\t\tconst unsigned = offset >= 0;\n\t\t\tconst absolute = Math.abs(offset);\n\t\t\t/* istanbul ignore next: whether it's signed or unsigned, depends on where the machine is, I cannot control this. */\n\t\t\treturn `${unsigned ? '+' : '-'}${String(Math.floor(absolute / 60)).padStart(2, '0')}:${String(absolute % 60).padStart(2, '0')}`;\n\t\t}\n\t]\n]);\n/* eslint-enable max-len */\n\nexport type TimeResolvable = Date | number | string;\n\nexport interface TimestampTemplateEntry {\n\ttype: string;\n\tcontent: string | null;\n}\n\n/**\n * Timestamp class, parses the pattern once, displays the desired Date or UNIX timestamp with the selected pattern.\n */\nexport class Timestamp {\n\t/**\n\t * The raw pattern\n\t * @since 1.0.0\n\t */\n\tpublic pattern: string;\n\n\t/**\n\t * @since 1.0.0\n\t */\n\tprivate template: TimestampTemplateEntry[];\n\n\t/**\n\t * Starts a new Timestamp and parses the pattern.\n\t * @since 1.0.0\n\t * @param pattern The pattern to parse\n\t */\n\tpublic constructor(pattern: string) {\n\t\tthis.pattern = pattern;\n\t\tthis.template = Timestamp.parse(pattern);\n\t}\n\n\t/**\n\t * Display the current date with the current pattern.\n\t * @since 1.0.0\n\t * @param time The time to display\n\t */\n\tpublic display(time: TimeResolvable = new Date()): string {\n\t\treturn Timestamp.display(this.template, time);\n\t}\n\n\t/**\n\t * Display the current date utc with the current pattern.\n\t * @since 1.0.0\n\t * @param time The time to display in utc\n\t */\n\tpublic displayUTC(time?: TimeResolvable): string {\n\t\treturn Timestamp.display(this.template, Timestamp.utc(time));\n\t}\n\n\t/**\n\t * Edits the current pattern.\n\t * @since 1.0.0\n\t * @param pattern The new pattern for this instance\n\t * @chainable\n\t */\n\tpublic edit(pattern: string): this {\n\t\tthis.pattern = pattern;\n\t\tthis.template = Timestamp.parse(pattern);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Defines the toString behavior of Timestamp.\n\t */\n\tpublic toString(): string {\n\t\treturn this.display();\n\t}\n\n\t/**\n\t * Display the current date with the current pattern.\n\t * @since 1.0.0\n\t * @param pattern The pattern to parse\n\t * @param time The time to display\n\t */\n\tpublic static displayArbitrary(pattern: string, time: TimeResolvable = new Date()): string {\n\t\treturn Timestamp.display(Timestamp.parse(pattern), time);\n\t}\n\n\t/**\n\t * Display the current date utc with the current pattern.\n\t * @since 1.0.0\n\t * @param pattern The pattern to parse\n\t * @param time The time to display\n\t */\n\tpublic static displayUTCArbitrary(pattern: string, time: TimeResolvable = new Date()): string {\n\t\treturn Timestamp.display(Timestamp.parse(pattern), Timestamp.utc(time));\n\t}\n\n\t/**\n\t * Creates a UTC Date object to work with.\n\t * @since 1.0.0\n\t * @param time The date to convert to utc\n\t */\n\tpublic static utc(time: Date | number | string = new Date()): Date {\n\t\ttime = Timestamp.resolveDate(time);\n\t\treturn new Date(time.valueOf() + time.getTimezoneOffset() * 60000);\n\t}\n\n\t/**\n\t * Display the current date with the current pattern.\n\t * @since 1.0.0\n\t * @param template The pattern to parse\n\t * @param time The time to display\n\t */\n\tprivate static display(template: TimestampTemplateEntry[], time: Date | number | string): string {\n\t\tlet output = '';\n\t\tconst parsedTime = Timestamp.resolveDate(time);\n\t\tfor (const { content, type } of template) output += content || tokenResolvers.get(type)!(parsedTime);\n\t\treturn output;\n\t}\n\n\t/**\n\t * Parses the pattern.\n\t * @since 1.0.0\n\t * @param pattern The pattern to parse\n\t */\n\tprivate static parse(pattern: string): TimestampTemplateEntry[] {\n\t\tconst template: TimestampTemplateEntry[] = [];\n\t\tfor (let i = 0; i < pattern.length; i++) {\n\t\t\tlet current = '';\n\t\t\tconst currentChar = pattern[i];\n\t\t\tconst tokenMax = tokens.get(currentChar);\n\t\t\tif (typeof tokenMax === 'number') {\n\t\t\t\tcurrent += currentChar;\n\t\t\t\twhile (pattern[i + 1] === currentChar && current.length < tokenMax) current += pattern[++i];\n\t\t\t\ttemplate.push({ type: current, content: null });\n\t\t\t} else if (currentChar === '[') {\n\t\t\t\twhile (i + 1 < pattern.length && pattern[i + 1] !== ']') current += pattern[++i];\n\t\t\t\ti++;\n\t\t\t\ttemplate.push({ type: 'literal', content: current || '[' });\n\t\t\t} else {\n\t\t\t\tcurrent += currentChar;\n\t\t\t\twhile (i + 1 < pattern.length && !tokens.has(pattern[i + 1]) && pattern[i + 1] !== '[') current += pattern[++i];\n\t\t\t\ttemplate.push({ type: 'literal', content: current });\n\t\t\t}\n\t\t}\n\n\t\treturn template;\n\t}\n\n\t/**\n\t * Resolves a date.\n\t * @since 1.0.0\n\t * @param time The time to parse\n\t */\n\tprivate static resolveDate(time: TimeResolvable): Date {\n\t\treturn time instance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../utilities/dist/index.mjs","../src/lib/Cron.ts","../src/lib/Duration.ts","../src/lib/DurationFormatter.ts","../src/lib/TimerManager.ts","../src/lib/Timestamp.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\nimport type { DurationFormatAssetsTime, DurationFormatSeparators } from './DurationFormatter';\n\n/**\n * The supported time types\n */\nexport const enum TimeTypes {\n\tSecond = 'second',\n\tMinute = 'minute',\n\tHour = 'hour',\n\tDay = 'day',\n\tWeek = 'week',\n\tMonth = 'month',\n\tYear = 'year'\n}\n\nexport const enum Time {\n\tMillisecond = 1,\n\tSecond = 1000,\n\tMinute = 1000 * 60,\n\tHour = 1000 * 60 * 60,\n\tDay = 1000 * 60 * 60 * 24,\n\tMonth = 1000 * 60 * 60 * 24 * (365 / 12),\n\tYear = 1000 * 60 * 60 * 24 * 365\n}\n\nexport const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n\nexport const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n\nexport const tokens = new Map<string, number>([\n\t['Y', 4],\n\t['Q', 1],\n\t['M', 4],\n\t['D', 4],\n\t['d', 4],\n\t['X', 1],\n\t['x', 1],\n\t['H', 2],\n\t['h', 2],\n\t['a', 1],\n\t['A', 1],\n\t['m', 2],\n\t['s', 2],\n\t['S', 3],\n\t['Z', 2],\n\t['l', 4],\n\t['L', 4],\n\t['T', 1],\n\t['t', 1]\n]);\n\nexport const partRegex = /^(?:(\\*)|(\\d+)(?:-(\\d+))?)(?:\\/(\\d+))?$/;\n\nexport const wildcardRegex = /\\bh\\b|\\B\\?\\B/g;\n\nexport const allowedNum = [\n\t[0, 59],\n\t[0, 23],\n\t[1, 31],\n\t[1, 12],\n\t[0, 6]\n];\n\nexport const predefined = {\n\t'@annually': '0 0 1 1 *',\n\t'@yearly': '0 0 1 1 *',\n\t'@monthly': '0 0 1 * *',\n\t'@weekly': '0 0 * * 0',\n\t'@daily': '0 0 * * *',\n\t'@hourly': '0 * * * *'\n} as const;\n\nexport const cronTokens = {\n\tjan: 1,\n\tfeb: 2,\n\tmar: 3,\n\tapr: 4,\n\tmay: 5,\n\tjun: 6,\n\tjul: 7,\n\taug: 8,\n\tsep: 9,\n\toct: 10,\n\tnov: 11,\n\tdec: 12,\n\tsun: 0,\n\tmon: 1,\n\ttue: 2,\n\twed: 3,\n\tthu: 4,\n\tfri: 5,\n\tsat: 6\n} as const;\n\nexport const tokensRegex = new RegExp(Object.keys(cronTokens).join('|'), 'g');\n\nexport const DEFAULT_UNITS: DurationFormatAssetsTime = {\n\t[TimeTypes.Year]: {\n\t\t1: 'year',\n\t\tDEFAULT: 'years'\n\t},\n\t[TimeTypes.Month]: {\n\t\t1: 'month',\n\t\tDEFAULT: 'months'\n\t},\n\t[TimeTypes.Week]: {\n\t\t1: 'week',\n\t\tDEFAULT: 'weeks'\n\t},\n\t[TimeTypes.Day]: {\n\t\t1: 'day',\n\t\tDEFAULT: 'days'\n\t},\n\t[TimeTypes.Hour]: {\n\t\t1: 'hour',\n\t\tDEFAULT: 'hours'\n\t},\n\t[TimeTypes.Minute]: {\n\t\t1: 'minute',\n\t\tDEFAULT: 'minutes'\n\t},\n\t[TimeTypes.Second]: {\n\t\t1: 'second',\n\t\tDEFAULT: 'seconds'\n\t}\n};\n\nexport const DEFAULT_SEPARATORS: DurationFormatSeparators = {\n\tleft: ' ',\n\tright: ' '\n};\n","/**\n * Compare if both arrays are strictly equal\n * @param arr1 The array to compare to\n * @param arr2 The array to compare with\n */\nfunction arrayStrictEquals(arr1, arr2) {\n if (arr1 === arr2)\n return true;\n if (arr1.length !== arr2.length)\n return false;\n for (let i = 0; i < arr1.length; i++) {\n if (arr1[i] !== arr2[i] || typeof arr1[i] !== typeof arr2[i])\n return false;\n }\n return true;\n}\n\n/**\n * Splits up an array into chunks\n * @param array The array to chunk up\n * @param chunkSize The size of each individual chunk\n */\nfunction chunk(array, chunkSize) {\n if (!Array.isArray(array))\n throw new TypeError('entries must be an array.');\n if (!Number.isInteger(chunkSize))\n throw new TypeError('chunkSize must be an integer.');\n if (chunkSize < 1)\n throw new RangeError('chunkSize must be 1 or greater.');\n const clone = array.slice();\n const chunks = [];\n while (clone.length)\n chunks.push(clone.splice(0, chunkSize));\n return chunks;\n}\n\n/**\n * Checks whether or not the value class extends the base class.\n * @param value The constructor to be checked against.\n * @param base The base constructor.\n */\nfunction classExtends(value, base) {\n let ctor = value;\n while (ctor !== null) {\n if (ctor === base)\n return true;\n ctor = Object.getPrototypeOf(ctor);\n }\n return false;\n}\n\nconst zws$1 = String.fromCharCode(8203);\n/**\n * Wraps text in a markdown codeblock with optionally a language indicator for syntax highlighting\n * @param language The codeblock language\n * @param expression The expression to be wrapped in the codeblock\n */\nfunction codeBlock(language, expression) {\n if (typeof expression === 'string') {\n if (expression.length === 0)\n return `\\`\\`\\`${zws$1}\\`\\`\\``;\n return `\\`\\`\\`${language}\\n${expression.replace(/```/, `\\`${zws$1}\\`\\``).replace(/`$/g, `\\`${zws$1}`)}\\`\\`\\``;\n }\n return `\\`\\`\\`${language}\\n${expression || zws$1}\\`\\`\\``;\n}\n\n/**\n * Split a string by its latest space character in a range from the character 0 to the selected one.\n * @param str The text to split.\n * @param length The length of the desired string.\n * @param char The character to split with\n * @copyright 2019 Antonio Román\n * @license Apache-2.0\n */\nfunction splitText(str, length, char = ' ') {\n const x = str.substring(0, length).lastIndexOf(char);\n const pos = x === -1 ? length : x;\n return str.substring(0, pos);\n}\n\n/**\n * Split a text by its latest space character in a range from the character 0 to the selected one.\n * @param str The text to split.\n * @param length The length of the desired string.\n * @copyright 2019 Antonio Román\n * @license Apache-2.0\n */\nfunction cutText(str, length) {\n if (str.length < length)\n return str;\n const cut = splitText(str, length - 3);\n if (cut.length < length - 3)\n return `${cut}...`;\n return `${cut.slice(0, length - 3)}...`;\n}\n\n/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n/**\n * Creates a debounced function that delays invoking func until after wait milliseconds have elapsed since\n * the last time the debounced function was invoked. The debounced function comes with a cancel method to\n * cancel delayed invocations and a flush method to immediately invoke them. Provide an options object to\n * indicate that func should be invoked on the leading and/or trailing edge of the wait timeout. Subsequent\n * calls to the debounced function return the result of the last func invocation.\n *\n * Note: If leading and trailing options are true, func is invoked on the trailing edge of the timeout only\n * if the the debounced function is invoked more than once during the wait timeout.\n *\n * See David Corbacho’s article for details over the differences between _.debounce and _.throttle.\n *\n * @param func The function to debounce.\n * @param wait The number of milliseconds to delay.\n * @param options The options object.\n * @return Returns the new debounced function.\n */\nfunction debounce(func, options = {}) {\n var _a;\n let lastArgs;\n let result;\n let timerId;\n let lastCallTime;\n let lastInvokeTime = 0;\n const wait = (_a = options.wait) !== null && _a !== void 0 ? _a : 0;\n const maxWait = typeof options.maxWait === 'number' ? Math.max(options.maxWait, wait) : null;\n function invokeFunc(time) {\n const args = lastArgs;\n lastArgs = undefined;\n lastInvokeTime = time;\n result = func(...args);\n return result;\n }\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return result;\n }\n function remainingWait(time) {\n const timeSinceLastCall = time - lastCallTime;\n const timeSinceLastInvoke = time - lastInvokeTime;\n const result = wait - timeSinceLastCall;\n return maxWait === null ? result : Math.min(result, maxWait - timeSinceLastInvoke);\n }\n function shouldInvoke(time) {\n const timeSinceLastCall = time - lastCallTime;\n const timeSinceLastInvoke = time - lastInvokeTime;\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || //\n timeSinceLastCall >= wait ||\n timeSinceLastCall < 0 ||\n (maxWait !== null && timeSinceLastInvoke >= maxWait));\n }\n function timerExpired() {\n const time = Date.now();\n if (shouldInvoke(time)) {\n trailingEdge(time);\n return;\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n function trailingEdge(time) {\n timerId = undefined;\n return invokeFunc(time);\n }\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = undefined;\n lastCallTime = undefined;\n timerId = undefined;\n }\n function flush() {\n return timerId === undefined ? result : trailingEdge(Date.now());\n }\n function debounced(...args) {\n const time = Date.now();\n const isInvoking = shouldInvoke(time);\n lastArgs = args;\n lastCallTime = time;\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxWait !== null) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\nconst primitiveTypes = ['string', 'bigint', 'number', 'boolean'];\n/**\n * Check whether a value is a primitive\n * @param input The input to check\n */\nfunction isPrimitive(input) {\n return primitiveTypes.includes(typeof input);\n}\n\n/**\n * Deep clone an object\n * @param source The object to clone\n */\nfunction deepClone(source) {\n // Check if it's a primitive (with exception of function and null, which is typeof object)\n if (source === null || isPrimitive(source)) {\n return source;\n }\n if (Array.isArray(source)) {\n const output = new source.constructor(source.length);\n for (let i = 0; i < source.length; i++) {\n output[i] = deepClone(source[i]);\n }\n return output;\n }\n if (source instanceof Map) {\n const output = new source.constructor();\n for (const [key, value] of source.entries()) {\n output.set(key, deepClone(value));\n }\n return output;\n }\n if (source instanceof Set) {\n const output = new source.constructor();\n for (const value of source.values()) {\n output.add(deepClone(value));\n }\n return output;\n }\n if (typeof source === 'object') {\n const output = new source.constructor();\n for (const [key, value] of Object.entries(source)) {\n Object.defineProperty(output, key, {\n configurable: true,\n enumerable: true,\n value: deepClone(value),\n writable: true\n });\n }\n return output;\n }\n return source;\n}\n\n/**\n * Checks whether or not a value is `null` or `undefined`\n * @param value The value to check\n */\nfunction isNullOrUndefined(value) {\n return value === undefined || value === null;\n}\n\n/**\n * Checks whether a value is not `null` nor `undefined`.\n * This can be used in {@link Array.filter} to remove `null` and `undefined` from the array type\n * @param value The value to verify that is neither `null` nor `undefined`\n * @returns A boolean that is `true` if the value is neither `null` nor `undefined`, false otherwise.\n * @example\n * ```typescript\n * // TypeScript Type: (string | undefined | null)[]\n * const someArray = ['one', 'two', undefined, null, 'five'];\n *\n * // TypeScript Type: string[]\n * const filteredArray = someArray.filter(filterNullAndUndefined);\n * // Result: ['one', 'two', 'five']\n * ```\n */\nfunction filterNullAndUndefined(value) {\n return !isNullOrUndefined(value);\n}\n\n/**\n * Checks whether or not a value is `null`, `undefined` or `''`, `[]`\n * @param value The value to check\n */\nfunction isNullOrUndefinedOrEmpty(value) {\n return isNullOrUndefined(value) || value.length === 0;\n}\n\n/**\n * Checks whether a value is not `null` nor `undefined` nor `''` (empty string).\n * This can be used in {@link Array.filter} to remove `null`, `undefined` from the array type\n * @param value The value to verify that is neither `null`, `undefined` nor `''` (empty string)\n * @returns A boolean that is `true` if the value is neither `null`, `undefined` nor `''` (empty string), false otherwise.\n * @example\n * ```typescript\n * // TypeScript Type: (string | undefined | null)[]\n * const someArray = ['one', 'two', undefined, null, ''];\n *\n * // TypeScript Type: string[]\n * const filteredArray = someArray.filter(filterNullAndUndefinedAndEmpty);\n * // Result: ['one', 'two']\n * ```\n */\nfunction filterNullAndUndefinedAndEmpty(value) {\n return !isNullOrUndefinedOrEmpty(value);\n}\n\n/**\n * Checks whether or not a value is `null`, `undefined` or `0`\n * @param value The value to check\n */\nfunction isNullOrUndefinedOrZero(value) {\n return value === 0 || isNullOrUndefined(value);\n}\n\n/**\n * Checks whether a value is not `null` nor `undefined` nor `0`.\n * This can be used in {@link Array.filter} to remove `null`, `undefined` from the array type\n * @param value The value to verify that is neither `null`, `undefined` nor `0`\n * @returns A boolean that is `true` if the value is neither `null`, `undefined` nor `0`, false otherwise.\n * @example\n * ```typescript\n * // TypeScript Type: (string | number | undefined | null)[]\n * const someArray = ['one', 'two', undefined, null, 0, 1];\n *\n * // TypeScript Type: (string | number)[]\n * const filteredArray = someArray.filter(filterNullAndUndefinedAndZero);\n * // Result: ['one', 'two', 1]\n * ```\n */\nfunction filterNullAndUndefinedAndZero(value) {\n return !isNullOrUndefinedOrZero(value);\n}\n\n/**\n * Checks whether any of the {@link keys} are in the {@link map}\n * @param map The map to check\n * @param keys The keys to find in the map\n * @returns `true` if at least one of the {@link keys} is in the {@link map}, `false` otherwise.\n */\nfunction hasAtLeastOneKeyInMap(map, keys) {\n return keys.some((key) => map.has(key));\n}\n\nconst zws = String.fromCharCode(8203);\n/**\n * Wraps text in a markdown inline codeblock\n * @param expression The expression to be wrapped in the codeblock\n */\nfunction inlineCodeBlock(input) {\n return `\\`${input.replace(/ /g, '\\u00A0').replace(/`/g, `\\`${zws}`)}\\``;\n}\n\n/**\n * Verify if the input is a class constructor.\n * @param input The function to verify\n */\nfunction isClass(input) {\n return typeof input === 'function' && typeof input.prototype === 'object';\n}\n\n/**\n * Verify if the input is a function.\n * @param input The function to verify\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction isFunction(input) {\n return typeof input === 'function';\n}\n\n/**\n * Verify if a number is a finite number.\n * @param input The number to verify\n */\nfunction isNumber(input) {\n return typeof input === 'number' && !isNaN(input) && Number.isFinite(input);\n}\n\nfunction isObject(input, constructorType) {\n return typeof input === 'object' && input ? input.constructor === (constructorType !== null && constructorType !== void 0 ? constructorType : Object) : false;\n}\n\n/* eslint-disable @typescript-eslint/ban-types */\nfunction hasThen(input) {\n return Reflect.has(input, 'then') && isFunction(input.then);\n}\nfunction hasCatch(input) {\n return Reflect.has(input, 'catch') && isFunction(input.catch);\n}\n/**\n * Verify if an object is a promise.\n * @param input The promise to verify\n */\nfunction isThenable(input) {\n if (typeof input !== 'object' || input === null)\n return false;\n return input instanceof Promise || (input !== Promise.prototype && hasThen(input) && hasCatch(input));\n}\n\n/**\n * Turn a dotted path into a json object.\n * @param path The dotted path\n * @param value The value\n * @param obj The object to edit\n */\nfunction makeObject(path, value, obj = {}) {\n if (path.includes('.')) {\n const route = path.split('.');\n const lastKey = route.pop();\n let reference = obj;\n for (const key of route) {\n if (!reference[key])\n reference[key] = {};\n reference = reference[key];\n }\n reference[lastKey] = value;\n }\n else {\n obj[path] = value;\n }\n return obj;\n}\n\n/**\n * Deep merges 2 objects. Properties from the second parameter are applied to the first.\n * @remark `overwrites` is also mutated!\n * @remark If the value of a key in `overwrites` is `undefined` then the value of that same key in `base` is used instead!\n * @remark This is essentially `{ ...base, ...overwrites }` but recursively\n * @param base Base object\n * @param overwrites Overwrites to apply\n * @example\n * ```typescript\n * const base = { a: 0, b: 1 };\n * const overwrites = {}; // will be { a: 0, b: 1 } after merge\n * mergeDefault(base, overwrites) // { a: 0, b: 1 }\n * ```\n * @example\n * ```typescript\n * const base = { a: 0, b: 1 };\n * const overwrites = { a: 2, i: 3 };\n * mergeDefault(base, overwrites) // { a: 2, i: 3, b: 1 };\n * ```\n * @example\n * ```typescript\n * const base = { a: 0, b: 1 };\n * const overwrites = { a: null };\n * mergeDefault(base, overwrites) // { a: null, b: 1 };\n * ```\n * @example\n * ```typescript\n * const base = { a: 0, b: 1 };\n * const overwrites = { a: undefined };\n * mergeDefault(base, overwrites) // { a: 0, b: 1 };\n * ```\n * @example\n * ```typescript\n * const base = { a: null };\n * const overwrites = { a: { b: 5 } };\n * mergeDefault(base, overwrites) // { a: { b: 5 } };\n * ```\n */\nfunction mergeDefault(base, overwrites) {\n // If no overwrites are specified then deep clone the base\n if (!overwrites)\n return deepClone(base);\n for (const [baseKey, baseValue] of Object.entries(base)) {\n const overwritesValueAtBaseKey = Reflect.get(overwrites, baseKey);\n if (typeof overwritesValueAtBaseKey === 'undefined') {\n Reflect.set(overwrites, baseKey, deepClone(baseValue));\n }\n else if (isObject(overwritesValueAtBaseKey)) {\n Reflect.set(overwrites, baseKey, mergeDefault((baseValue !== null && baseValue !== void 0 ? baseValue : {}), overwritesValueAtBaseKey));\n }\n }\n return overwrites;\n}\n\n/* eslint-disable @typescript-eslint/ban-types */\n/**\n * Merges two objects\n * @param objTarget The object to be merged\n * @param objSource The object to merge\n */\nfunction mergeObjects(objTarget, objSource) {\n for (const [key, value] of Object.entries(objSource)) {\n const targetValue = Reflect.get(objTarget, key);\n if (isObject(value)) {\n Reflect.set(objTarget, key, isObject(targetValue) ? mergeObjects(targetValue, value) : value);\n }\n else if (!isObject(targetValue)) {\n Reflect.set(objTarget, key, value);\n }\n }\n return objTarget;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nfunction noop() { }\n\n/**\n * Convert an object to a tuple\n * @param value The object to convert\n * @param prefix The prefix for the key\n */\nfunction objectToTuples(original, prefix = '') {\n const entries = [];\n for (const [key, value] of Object.entries(original)) {\n if (isObject(value)) {\n entries.push(...objectToTuples(value, `${prefix}${key}.`));\n }\n else {\n entries.push([`${prefix}${key}`, value]);\n }\n }\n return entries;\n}\n\n/**\n * Parses an URL, returns null if invalid.\n * @param url The url to parse\n */\nfunction parseURL(url) {\n try {\n // @ts-expect-error URL is global in NodeJS and evergreen Browsers\n return new URL(url);\n }\n catch {\n return null;\n }\n}\n\n/**\n * Partitions `array` into a tuple of two arrays,\n * where one array contains all elements that satisfies `predicate`,\n * and the other contains all elements that do not satisfy `predicate`.\n * @param array The array to partition. This array is not mutated.\n * @param predicate The predicate function to determine in which partition the item should be placed.\n * The function should return true for items that should be placed in the first partition, and false for those that should be placed in the second partition.\n * @returns A tuple of two arrays.\n */\nfunction partition(array, predicate) {\n if (!Array.isArray(array))\n throw new TypeError('entries must be an array.');\n if (!isFunction(predicate))\n throw new TypeError('predicate must be an function that returns a boolean value.');\n const partitionOne = [];\n const partitionTwo = [];\n for (let i = 0; i < array.length; i++) {\n if (predicate(array[i], i)) {\n partitionOne.push(array[i]);\n }\n else {\n partitionTwo.push(array[i]);\n }\n }\n return [partitionOne, partitionTwo];\n}\n\n/**\n * Get an array of numbers with the selected range\n * @param min The minimum value\n * @param max The maximum value\n * @param step The step value\n */\nfunction range(min, max, step) {\n return new Array(Math.floor((max - min) / step) + 1).fill(0).map((_val, i) => min + i * step);\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst REGEXPESC = /[-/\\\\^$*+?.()|[\\]{}]/g;\n/**\n * Cleans a string from regex injection\n * @param str The string to clean\n */\nfunction regExpEsc(str) {\n return str.replace(REGEXPESC, '\\\\$&');\n}\n\n/**\n * Properly rounds up or down a number.\n * Also supports strings using an exponent to indicate large or small numbers.\n * @param num The number to round off\n * @param scale The amount of decimals to retain\n */\nfunction roundNumber(num, scale = 0) {\n if (!num.toString().includes('e')) {\n return Number(`${Math.round(Number(`${num}e+${scale}`))}e-${scale}`);\n }\n const arr = `${num}`.split('e');\n let sig = '';\n if (Number(arr[1]) + scale > 0) {\n sig = '+';\n }\n return Number(`${Math.round(Number(`${Number(arr[0])}e${sig}${Number(arr[1]) + scale}`))}e-${scale}`);\n}\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nconst TOTITLECASE = /[A-Za-zÀ-ÖØ-öø-ÿ]\\S*/g;\nconst titleCaseVariants = {\n textchannel: 'TextChannel',\n voicechannel: 'VoiceChannel',\n categorychannel: 'CategoryChannel',\n guildmember: 'GuildMember'\n};\n/**\n * Converts a string to Title Case\n * @description This is designed to also ensure common Discord PascalCased strings\n * \t\t\t\tare put in their TitleCase titleCaseVariants. See below for the full list.\n * @param str The string to title case\n * @terms\n * This table lists how certain terms are converted, these are case insensitive.\n * Any terms not included are converted to regular Titlecase.\n *\n * | Term | Converted To |\n * |-----------------|-----------------|\n * | textchannel | TextChannel |\n * | voicechannel | VoiceChannel |\n * | categorychannel | CategoryChannel |\n * | guildmember | GuildMember |\n */\nfunction toTitleCase(str) {\n return str.replace(TOTITLECASE, (txt) => titleCaseVariants[txt] || txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase());\n}\n\n/* eslint-disable @typescript-eslint/ban-types */\n/**\n * Try parse a stringified JSON string.\n * @param value The value to parse\n */\nfunction tryParse(value) {\n try {\n return JSON.parse(value);\n }\n catch (err) {\n return value;\n }\n}\n\nexport { arrayStrictEquals, chunk, classExtends, codeBlock, cutText, debounce, deepClone, filterNullAndUndefined, filterNullAndUndefinedAndEmpty, filterNullAndUndefinedAndZero, filterNullAndUndefined as filterNullish, filterNullAndUndefinedAndEmpty as filterNullishOrEmpty, filterNullAndUndefinedAndZero as filterNullishOrZero, hasAtLeastOneKeyInMap, inlineCodeBlock, isClass, isFunction, isNullOrUndefined, isNullOrUndefinedOrEmpty, isNullOrUndefinedOrZero, isNullOrUndefined as isNullish, isNullOrUndefinedOrEmpty as isNullishOrEmpty, isNullOrUndefinedOrZero as isNullishOrZero, isNumber, isObject, isPrimitive, isThenable, makeObject, mergeDefault, mergeObjects, noop, objectToTuples, parseURL, partition, range, regExpEsc, roundNumber, splitText, toTitleCase, tryParse };\n//# sourceMappingURL=index.mjs.map\n","/* eslint-disable @typescript-eslint/restrict-plus-operands */\nimport { range } from '@sapphire/utilities';\nimport { allowedNum, cronTokens, partRegex, predefined, Time, tokensRegex, wildcardRegex } from './constants';\n\n/**\n * Handles Cron strings and generates dates based on the cron string provided.\n * @see https://en.wikipedia.org/wiki/Cron\n */\nexport class Cron {\n\tpublic cron: string;\n\tpublic normalized: string;\n\tpublic minutes: number[];\n\tpublic hours: number[];\n\tpublic days: number[];\n\tpublic months: number[];\n\tpublic dows: number[];\n\n\t/**\n\t * @param cron The cron pattern to use\n\t */\n\tpublic constructor(cron: string) {\n\t\tthis.cron = cron.toLowerCase();\n\t\tthis.normalized = Cron.normalize(this.cron);\n\t\t[this.minutes, this.hours, this.days, this.months, this.dows] = Cron.parseString(this.normalized);\n\t}\n\n\t/**\n\t * Get the next date that matches with the current pattern\n\t * @param outset The Date instance to compare with\n\t * @param origin Whether this next call is origin\n\t */\n\tpublic next(outset: Date = new Date(), origin = true): Date {\n\t\tif (!this.days.includes(outset.getUTCDate()) || !this.months.includes(outset.getUTCMonth() + 1) || !this.dows.includes(outset.getUTCDay())) {\n\t\t\treturn this.next(new Date(outset.getTime() + Time.Day), false);\n\t\t}\n\t\tif (!origin) return new Date(Date.UTC(outset.getUTCFullYear(), outset.getUTCMonth(), outset.getUTCDate(), this.hours[0], this.minutes[0]));\n\n\t\tconst now = new Date(outset.getTime() + 60000);\n\n\t\tfor (const hour of this.hours) {\n\t\t\tif (hour < now.getUTCHours()) continue;\n\t\t\tfor (const minute of this.minutes) {\n\t\t\t\tif (hour === now.getUTCHours() && minute < now.getUTCMinutes()) continue;\n\t\t\t\treturn new Date(Date.UTC(outset.getUTCFullYear(), outset.getUTCMonth(), outset.getUTCDate(), hour, minute));\n\t\t\t}\n\t\t}\n\n\t\treturn this.next(new Date(outset.getTime() + Time.Day), false);\n\t}\n\n\t/**\n\t * Normalize the pattern\n\t * @param cron The pattern to normalize\n\t */\n\tprivate static normalize(cron: string): string {\n\t\tif (Reflect.has(predefined, cron)) return Reflect.get(predefined, cron);\n\t\tconst now = new Date();\n\t\tcron = cron\n\t\t\t.split(' ')\n\t\t\t.map((val, i) =>\n\t\t\t\tval.replace(wildcardRegex, (match) => {\n\t\t\t\t\tif (match === 'h') return (Math.floor(Math.random() * allowedNum[i][1]) + allowedNum[i][0]).toString();\n\n\t\t\t\t\tif (match === '?') {\n\t\t\t\t\t\tswitch (i) {\n\t\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t\treturn now.getUTCMinutes().toString();\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\treturn now.getUTCHours().toString();\n\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\treturn now.getUTCDate().toString();\n\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\treturn now.getUTCMonth().toString();\n\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\treturn now.getUTCDay().toString();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\treturn match;\n\t\t\t\t})\n\t\t\t)\n\t\t\t.join(' ');\n\t\treturn cron.replace(tokensRegex, (match) => String(Reflect.get(cronTokens, match)));\n\t}\n\n\t/**\n\t * Parse the pattern\n\t * @param cron The pattern to parse\n\t */\n\tprivate static parseString(cron: string): Array<number[]> {\n\t\tconst parts = cron.split(' ');\n\t\tif (parts.length !== 5) throw new Error('Invalid Cron Provided');\n\t\treturn parts.map((part, i) => Cron.parsePart(part, i));\n\t}\n\n\t/**\n\t * Parse the current part\n\t * @param cronPart The part of the pattern to parse\n\t * @param id The id that identifies the current part\n\t */\n\tprivate static parsePart(cronPart: string, id: number): number[] {\n\t\tif (cronPart.includes(',')) {\n\t\t\tconst res: number[] = [];\n\t\t\tfor (const part of cronPart.split(',')) res.push(...Cron.parsePart(part, id));\n\t\t\treturn [...new Set(res)].sort((a, b) => a - b);\n\t\t}\n\n\t\t// eslint-disable-next-line prefer-const\n\t\tconst [, wild, minStr, maxStr, step] = partRegex.exec(cronPart)!;\n\t\tlet [min, max] = [parseInt(minStr, 10), parseInt(maxStr, 10)];\n\n\t\t// If '*', set min and max as the minimum and maximum allowed numbers:\n\t\tif (wild) [min, max] = allowedNum[id];\n\t\t// Else if a number was given, but not a maximum nor a step, return it\n\t\t// as only allowed value:\n\t\telse if (!max && !step) return [min];\n\n\t\t// Set min and max as the given numbers, defaulting max to the maximum\n\t\t// allowed, so min is never bigger than max:\n\t\t// This makes min and max be, in the following cases (considering minutes):\n\t\t// -> 1-2 | 1..2\n\t\t// -> 2-1 | 1..2\n\t\t// -> 1/7 | 1, 8, 15, 22, 29, 36, 43, 50, 57\n\t\t[min, max] = [min, max || allowedNum[id][1]].sort((a, b) => a - b);\n\n\t\t// Generate a range\n\t\treturn range(min, max, parseInt(step, 10) || 1);\n\t}\n}\n","/* eslint-disable @typescript-eslint/restrict-plus-operands */\nconst tokens = new Map([\n\t['nanosecond', 1 / 1e6],\n\t['nanoseconds', 1 / 1e6],\n\t['ns', 1 / 1e6],\n\n\t['millisecond', 1],\n\t['milliseconds', 1],\n\t['ms', 1],\n\n\t['second', 1000],\n\t['seconds', 1000],\n\t['sec', 1000],\n\t['secs', 1000],\n\t['s', 1000],\n\n\t['minute', 1000 * 60],\n\t['minutes', 1000 * 60],\n\t['min', 1000 * 60],\n\t['mins', 1000 * 60],\n\t['m', 1000 * 60],\n\n\t['hour', 1000 * 60 * 60],\n\t['hours', 1000 * 60 * 60],\n\t['hr', 1000 * 60 * 60],\n\t['hrs', 1000 * 60 * 60],\n\t['h', 1000 * 60 * 60],\n\n\t['day', 1000 * 60 * 60 * 24],\n\t['days', 1000 * 60 * 60 * 24],\n\t['d', 1000 * 60 * 60 * 24],\n\n\t['week', 1000 * 60 * 60 * 24 * 7],\n\t['weeks', 1000 * 60 * 60 * 24 * 7],\n\t['wk', 1000 * 60 * 60 * 24 * 7],\n\t['wks', 1000 * 60 * 60 * 24 * 7],\n\t['w', 1000 * 60 * 60 * 24 * 7],\n\n\t['month', 1000 * 60 * 60 * 24 * (365.25 / 12)],\n\t['months', 1000 * 60 * 60 * 24 * (365.25 / 12)],\n\t['b', 1000 * 60 * 60 * 24 * (365.25 / 12)],\n\t['mo', 1000 * 60 * 60 * 24 * (365.25 / 12)],\n\n\t['year', 1000 * 60 * 60 * 24 * 365.25],\n\t['years', 1000 * 60 * 60 * 24 * 365.25],\n\t['yr', 1000 * 60 * 60 * 24 * 365.25],\n\t['yrs', 1000 * 60 * 60 * 24 * 365.25],\n\t['y', 1000 * 60 * 60 * 24 * 365.25]\n]);\n\n/**\n * Converts duration strings into ms and future dates\n */\nexport class Duration {\n\t/**\n\t * The offset\n\t */\n\tpublic offset: number;\n\n\t/**\n\t * Create a new Duration instance\n\t * @param pattern The string to parse\n\t */\n\tpublic constructor(pattern: string) {\n\t\tthis.offset = Duration.parse(pattern.toLowerCase());\n\t}\n\n\t/**\n\t * Get the date from now\n\t */\n\tpublic get fromNow(): Date {\n\t\treturn this.dateFrom(new Date());\n\t}\n\n\t/**\n\t * Get the date from\n\t * @param date The Date instance to get the date from\n\t */\n\tpublic dateFrom(date: Date): Date {\n\t\treturn new Date(date.getTime() + this.offset);\n\t}\n\n\t/**\n\t * The RegExp used for the pattern parsing\n\t */\n\tprivate static readonly kPatternRegex = /(-?\\d*\\.?\\d+(?:e[-+]?\\d+)?)\\s*([a-zμ]*)/gi;\n\n\t/**\n\t * The RegExp used for removing commas\n\t */\n\tprivate static readonly kCommaRegex = /,/g;\n\n\t/**\n\t * The RegExp used for replacing a/an with 1\n\t */\n\tprivate static readonly kAanRegex = /\\ban?\\b/gi;\n\n\t/**\n\t * Parse the pattern\n\t * @param pattern The pattern to parse\n\t */\n\tprivate static parse(pattern: string): number {\n\t\tlet result = 0;\n\t\tlet valid = false;\n\n\t\tpattern\n\t\t\t// ignore commas\n\t\t\t.replace(Duration.kCommaRegex, '')\n\t\t\t// a / an = 1\n\t\t\t.replace(Duration.kAanRegex, '1')\n\t\t\t// do math\n\t\t\t.replace(Duration.kPatternRegex, (_, i, units) => {\n\t\t\t\tconst token = tokens.get(units);\n\t\t\t\tif (token !== undefined) {\n\t\t\t\t\tresult += Number(i) * token;\n\t\t\t\t\tvalid = true;\n\t\t\t\t}\n\t\t\t\treturn '';\n\t\t\t});\n\n\t\treturn valid ? result : NaN;\n\t}\n}\n","import { DEFAULT_SEPARATORS, DEFAULT_UNITS, TimeTypes } from './constants';\n\n/**\n * The duration of each time type in milliseconds\n */\nconst kTimeDurations: readonly [TimeTypes, number][] = [\n\t[TimeTypes.Year, 31536000000],\n\t// 29.53059 days is the official duration of a month: https://en.wikipedia.org/wiki/Month\n\t[TimeTypes.Month, 2628000000],\n\t[TimeTypes.Week, 1000 * 60 * 60 * 24 * 7],\n\t[TimeTypes.Day, 1000 * 60 * 60 * 24],\n\t[TimeTypes.Hour, 1000 * 60 * 60],\n\t[TimeTypes.Minute, 1000 * 60],\n\t[TimeTypes.Second, 1000]\n];\n\n/**\n * Display the duration\n * @param duration The duration in milliseconds to parse and display\n * @param assets The language assets\n */\nexport class DurationFormatter {\n\tpublic constructor(public units: DurationFormatAssetsTime = DEFAULT_UNITS) {}\n\n\tpublic format(\n\t\tduration: number,\n\t\tprecision = 7,\n\t\t{\n\t\t\tleft: leftSeparator = DEFAULT_SEPARATORS.left,\n\t\t\tright: rightSeparator = DEFAULT_SEPARATORS.right\n\t\t}: DurationFormatSeparators = DEFAULT_SEPARATORS\n\t) {\n\t\tconst output: string[] = [];\n\t\tconst negative = duration < 0;\n\t\tif (negative) duration *= -1;\n\n\t\tfor (const [type, timeDuration] of kTimeDurations) {\n\t\t\tconst substraction = duration / timeDuration;\n\t\t\tif (substraction < 1) continue;\n\n\t\t\tconst floored = Math.floor(substraction);\n\t\t\tduration -= floored * timeDuration;\n\t\t\toutput.push(addUnit(floored, this.units[type], leftSeparator!));\n\n\t\t\t// If the output has enough precision, break\n\t\t\tif (output.length >= precision) break;\n\t\t}\n\n\t\treturn `${negative ? '-' : ''}${output.join(rightSeparator) || addUnit(0, this.units.second, leftSeparator!)}`;\n\t}\n}\n\n/**\n * Adds an unit, if non zero\n * @param time The duration of said unit\n * @param unit The unit language assets\n */\nfunction addUnit(time: number, unit: DurationFormatAssetsUnit, separator: string) {\n\tif (Reflect.has(unit, time)) return `${time}${separator}${Reflect.get(unit, time)}`;\n\treturn `${time}${separator}${unit.DEFAULT}`;\n}\n\nexport interface DurationFormatSeparators {\n\tleft?: string;\n\tright?: string;\n}\n\nexport interface DurationFormatAssetsUnit extends Record<number, string> {\n\t// eslint-disable-next-line @typescript-eslint/naming-convention\n\tDEFAULT: string;\n}\n\nexport interface DurationFormatAssetsTime {\n\t[TimeTypes.Second]: DurationFormatAssetsUnit;\n\t[TimeTypes.Minute]: DurationFormatAssetsUnit;\n\t[TimeTypes.Hour]: DurationFormatAssetsUnit;\n\t[TimeTypes.Day]: DurationFormatAssetsUnit;\n\t[TimeTypes.Week]: DurationFormatAssetsUnit;\n\t[TimeTypes.Month]: DurationFormatAssetsUnit;\n\t[TimeTypes.Year]: DurationFormatAssetsUnit;\n}\n","/**\n * Manages timers so that this application can be cleanly exited\n */\nexport class TimerManager extends null {\n\t/**\n\t * A set of timeouts to clear on destroy\n\t */\n\tprivate static storedTimeouts = new Set<NodeJS.Timeout>();\n\n\t/**\n\t * A set of intervals to clear on destroy\n\t */\n\tprivate static storedIntervals = new Set<NodeJS.Timeout>();\n\n\t/**\n\t * Creates a timeout gets cleared when destroyed\n\t * @param fn callback function\n\t * @param delay amount of time before running the callback\n\t * @param args additional arguments to pass back to the callback\n\t */\n\tpublic static setTimeout<A = unknown>(fn: (...args: A[]) => void, delay: number, ...args: A[]): NodeJS.Timeout {\n\t\tconst timeout = setTimeout(() => {\n\t\t\tthis.storedTimeouts.delete(timeout);\n\t\t\tfn(...args);\n\t\t}, delay);\n\t\tthis.storedTimeouts.add(timeout);\n\t\treturn timeout;\n\t}\n\n\t/**\n\t * Clears a timeout created through this class\n\t * @param timeout The timeout to clear\n\t */\n\tpublic static clearTimeout(timeout: NodeJS.Timeout): void {\n\t\tclearTimeout(timeout);\n\t\tthis.storedTimeouts.delete(timeout);\n\t}\n\n\t/**\n\t * Creates an interval gets cleared when destroyed\n\t * @param fn callback function\n\t * @param delay amount of time before running the callback\n\t * @param args additional arguments to pass back to the callback\n\t */\n\tpublic static setInterval<A = unknown>(fn: (...args: A[]) => void, delay: number, ...args: A[]): NodeJS.Timeout {\n\t\tconst interval = setInterval(fn, delay, ...args);\n\t\tthis.storedIntervals.add(interval);\n\t\treturn interval;\n\t}\n\n\t/**\n\t * Clears an internal created through this class\n\t * @param interval The interval to clear\n\t */\n\tpublic static clearInterval(interval: NodeJS.Timeout): void {\n\t\tclearInterval(interval);\n\t\tthis.storedIntervals.delete(interval);\n\t}\n\n\t/**\n\t * Clears running timeouts and intervals created through this class so NodeJS can gracefully exit\n\t */\n\tpublic static destroy(): void {\n\t\tfor (const i of this.storedTimeouts) clearTimeout(i);\n\t\tfor (const i of this.storedIntervals) clearInterval(i);\n\t\tthis.storedTimeouts.clear();\n\t\tthis.storedIntervals.clear();\n\t}\n}\n","import { days, months, Time, tokens } from './constants';\n\ninterface TokenResolver {\n\t(time: Date): string;\n}\n\nconst tokenResolvers = new Map<string, TokenResolver>([\n\t// Dates\n\t['Y', (time) => String(time.getFullYear()).slice(2)],\n\t['YY', (time) => String(time.getFullYear()).slice(2)],\n\t['YYY', (time) => String(time.getFullYear())],\n\t['YYYY', (time) => String(time.getFullYear())],\n\t['Q', (time) => String((time.getMonth() + 1) / 3)],\n\t['M', (time) => String(time.getMonth() + 1)],\n\t['MM', (time) => String(time.getMonth() + 1).padStart(2, '0')],\n\t['MMM', (time) => months[time.getMonth()]],\n\t['MMMM', (time) => months[time.getMonth()]],\n\t['D', (time) => String(time.getDate())],\n\t['DD', (time) => String(time.getDate()).padStart(2, '0')],\n\t['DDD', (time) => String(Math.floor((time.getTime() - new Date(time.getFullYear(), 0, 0).getTime()) / Time.Day))],\n\t['DDDD', (time) => String(Math.floor((time.getTime() - new Date(time.getFullYear(), 0, 0).getTime()) / Time.Day))],\n\t[\n\t\t'd',\n\t\t(time) => {\n\t\t\tconst day = String(time.getDate());\n\t\t\tif (day !== '11' && day.endsWith('1')) return `${day}st`;\n\t\t\tif (day !== '12' && day.endsWith('2')) return `${day}nd`;\n\t\t\tif (day !== '13' && day.endsWith('3')) return `${day}rd`;\n\t\t\treturn `${day}th`;\n\t\t}\n\t],\n\t['dd', (time) => days[time.getDay()].slice(0, 2)],\n\t['ddd', (time) => days[time.getDay()].slice(0, 3)],\n\t['dddd', (time) => days[time.getDay()]],\n\t['X', (time) => String(time.valueOf() / Time.Second)],\n\t['x', (time) => String(time.valueOf())],\n\n\t// Locales\n\t['H', (time) => String(time.getHours())],\n\t['HH', (time) => String(time.getHours()).padStart(2, '0')],\n\t['h', (time) => String(time.getHours() % 12 || 12)],\n\t['hh', (time) => String(time.getHours() % 12 || 12).padStart(2, '0')],\n\t['a', (time) => (time.getHours() < 12 ? 'am' : 'pm')],\n\t['A', (time) => (time.getHours() < 12 ? 'AM' : 'PM')],\n\t['m', (time) => String(time.getMinutes())],\n\t['mm', (time) => String(time.getMinutes()).padStart(2, '0')],\n\t['s', (time) => String(time.getSeconds())],\n\t['ss', (time) => String(time.getSeconds()).padStart(2, '0')],\n\t['S', (time) => String(time.getMilliseconds())],\n\t['SS', (time) => String(time.getMilliseconds()).padStart(2, '0')],\n\t['SSS', (time) => String(time.getMilliseconds()).padStart(3, '0')],\n\t['T', (time) => `${String(time.getHours() % 12 || 12)}:${String(time.getMinutes()).padStart(2, '0')} ${time.getHours() < 12 ? 'AM' : 'PM'}`],\n\t[\n\t\t't',\n\t\t(time) =>\n\t\t\t`${String(time.getHours() % 12 || 12)}:${String(time.getMinutes()).padStart(2, '0')}:${String(time.getSeconds()).padStart(2, '0')} ${\n\t\t\t\ttime.getHours() < 12 ? 'am' : 'pm'\n\t\t\t}`\n\t],\n\t['L', (time) => `${String(time.getMonth() + 1).padStart(2, '0')}/${String(time.getDate()).padStart(2, '0')}/${String(time.getFullYear())}`],\n\t['l', (time) => `${String(time.getMonth() + 1)}/${String(time.getDate()).padStart(2, '0')}/${String(time.getFullYear())}`],\n\t['LL', (time) => `${months[time.getMonth()]} ${String(time.getDate()).padStart(2, '0')}, ${String(time.getFullYear())}`],\n\t['ll', (time) => `${months[time.getMonth()].slice(0, 3)} ${String(time.getDate()).padStart(2, '0')}, ${String(time.getFullYear())}`],\n\t[\n\t\t'LLL',\n\t\t(time) =>\n\t\t\t`${months[time.getMonth()]} ${String(time.getDate()).padStart(2, '0')}, ${String(time.getFullYear())} ${String(\n\t\t\t\ttime.getHours() % 12 || 12\n\t\t\t)}:${String(time.getMinutes()).padStart(2, '0')} ${time.getHours() < 12 ? 'AM' : 'PM'}`\n\t],\n\t[\n\t\t'lll',\n\t\t(time) =>\n\t\t\t`${months[time.getMonth()].slice(0, 3)} ${String(time.getDate()).padStart(2, '0')}, ${String(time.getFullYear())} ${String(\n\t\t\t\ttime.getHours() % 12 || 12\n\t\t\t)}:${String(time.getMinutes()).padStart(2, '0')} ${time.getHours() < 12 ? 'AM' : 'PM'}`\n\t],\n\t[\n\t\t'LLLL',\n\t\t(time) =>\n\t\t\t`${days[time.getDay()]}, ${months[time.getMonth()]} ${String(time.getDate()).padStart(2, '0')}, ${String(time.getFullYear())} ${String(\n\t\t\t\ttime.getHours() % 12 || 12\n\t\t\t)}:${String(time.getMinutes()).padStart(2, '0')} ${time.getHours() < 12 ? 'AM' : 'PM'}`\n\t],\n\t[\n\t\t'llll',\n\t\t(time) =>\n\t\t\t`${days[time.getDay()].slice(0, 3)} ${months[time.getMonth()].slice(0, 3)} ${String(time.getDate()).padStart(2, '0')}, ${String(\n\t\t\t\ttime.getFullYear()\n\t\t\t)} ${String(time.getHours() % 12 || 12)}:${String(time.getMinutes()).padStart(2, '0')} ${time.getHours() < 12 ? 'AM' : 'PM'}`\n\t],\n\t[\n\t\t'Z',\n\t\t(time) => {\n\t\t\tconst offset = time.getTimezoneOffset();\n\t\t\tconst unsigned = offset >= 0;\n\t\t\tconst absolute = Math.abs(offset);\n\t\t\t/* istanbul ignore next: whether it's signed or unsigned, depends on where the machine is, I cannot control this. */\n\t\t\treturn `${unsigned ? '+' : '-'}${String(Math.floor(absolute / 60)).padStart(2, '0')}:${String(absolute % 60).padStart(2, '0')}`;\n\t\t}\n\t],\n\t[\n\t\t'ZZ',\n\t\t(time) => {\n\t\t\tconst offset = time.getTimezoneOffset();\n\t\t\tconst unsigned = offset >= 0;\n\t\t\tconst absolute = Math.abs(offset);\n\t\t\t/* istanbul ignore next: whether it's signed or unsigned, depends on where the machine is, I cannot control this. */\n\t\t\treturn `${unsigned ? '+' : '-'}${String(Math.floor(absolute / 60)).padStart(2, '0')}:${String(absolute % 60).padStart(2, '0')}`;\n\t\t}\n\t]\n]);\n/* eslint-enable max-len */\n\nexport type TimeResolvable = Date | number | string;\n\nexport interface TimestampTemplateEntry {\n\ttype: string;\n\tcontent: string | null;\n}\n\n/**\n * Timestamp class, parses the pattern once, displays the desired Date or UNIX timestamp with the selected pattern.\n */\nexport class Timestamp {\n\t/**\n\t * The raw pattern\n\t * @since 1.0.0\n\t */\n\tpublic pattern: string;\n\n\t/**\n\t * @since 1.0.0\n\t */\n\tprivate template: TimestampTemplateEntry[];\n\n\t/**\n\t * Starts a new Timestamp and parses the pattern.\n\t * @since 1.0.0\n\t * @param pattern The pattern to parse\n\t */\n\tpublic constructor(pattern: string) {\n\t\tthis.pattern = pattern;\n\t\tthis.template = Timestamp.parse(pattern);\n\t}\n\n\t/**\n\t * Display the current date with the current pattern.\n\t * @since 1.0.0\n\t * @param time The time to display\n\t */\n\tpublic display(time: TimeResolvable = new Date()): string {\n\t\treturn Timestamp.display(this.template, time);\n\t}\n\n\t/**\n\t * Display the current date utc with the current pattern.\n\t * @since 1.0.0\n\t * @param time The time to display in utc\n\t */\n\tpublic displayUTC(time?: TimeResolvable): string {\n\t\treturn Timestamp.display(this.template, Timestamp.utc(time));\n\t}\n\n\t/**\n\t * Edits the current pattern.\n\t * @since 1.0.0\n\t * @param pattern The new pattern for this instance\n\t * @chainable\n\t */\n\tpublic edit(pattern: string): this {\n\t\tthis.pattern = pattern;\n\t\tthis.template = Timestamp.parse(pattern);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Defines the toString behavior of Timestamp.\n\t */\n\tpublic toString(): string {\n\t\treturn this.display();\n\t}\n\n\t/**\n\t * Display the current date with the current pattern.\n\t * @since 1.0.0\n\t * @param pattern The pattern to parse\n\t * @param time The time to display\n\t */\n\tpublic static displayArbitrary(pattern: string, time: TimeResolvable = new Date()): string {\n\t\treturn Timestamp.display(Timestamp.parse(pattern), time);\n\t}\n\n\t/**\n\t * Display the current date utc with the current pattern.\n\t * @since 1.0.0\n\t * @param pattern The pattern to parse\n\t * @param time The time to display\n\t */\n\tpublic static displayUTCArbitrary(pattern: string, time: TimeResolvable = new Date()): string {\n\t\treturn Timestamp.display(Timestamp.parse(pattern), Timestamp.utc(time));\n\t}\n\n\t/**\n\t * Creates a UTC Date object to work with.\n\t * @since 1.0.0\n\t * @param time The date to convert to utc\n\t */\n\tpublic static utc(time: Date | number | string = new Date()): Date {\n\t\ttime = Timestamp.resolveDate(time);\n\t\treturn new Date(time.valueOf() + time.getTimezoneOffset() * 60000);\n\t}\n\n\t/**\n\t * Display the current date with the current pattern.\n\t * @since 1.0.0\n\t * @param template The pattern to parse\n\t * @param time The time to display\n\t */\n\tprivate static display(template: TimestampTemplateEntry[], time: Date | number | string): string {\n\t\tlet output = '';\n\t\tconst parsedTime = Timestamp.resolveDate(time);\n\t\tfor (const { content, type } of template) output += content || tokenResolvers.get(type)!(parsedTime);\n\t\treturn output;\n\t}\n\n\t/**\n\t * Parses the pattern.\n\t * @since 1.0.0\n\t * @param pattern The pattern to parse\n\t */\n\tprivate static parse(pattern: string): TimestampTemplateEntry[] {\n\t\tconst template: TimestampTemplateEntry[] = [];\n\t\tfor (let i = 0; i < pattern.length; i++) {\n\t\t\tlet current = '';\n\t\t\tconst currentChar = pattern[i];\n\t\t\tconst tokenMax = tokens.get(currentChar);\n\t\t\tif (typeof tokenMax === 'number') {\n\t\t\t\tcurrent += currentChar;\n\t\t\t\twhile (pattern[i + 1] === currentChar && current.length < tokenMax) current += pattern[++i];\n\t\t\t\ttemplate.push({ type: current, content: null });\n\t\t\t} else if (currentChar === '[') {\n\t\t\t\twhile (i + 1 < pattern.length && pattern[i + 1] !== ']') current += pattern[++i];\n\t\t\t\ti++;\n\t\t\t\ttemplate.push({ type: 'literal', content: current || '[' });\n\t\t\t} else {\n\t\t\t\tcurrent += currentChar;\n\t\t\t\twhile (i + 1 < pattern.length && !tokens.has(pattern[i + 1]) && pattern[i + 1] !== '[') current += pattern[++i];\n\t\t\t\ttemplate.push({ type: 'literal', content: current });\n\t\t\t}\n\t\t}\n\n\t\treturn template;\n\t}\n\n\t/**\n\t * Resolves a date.\n\t * @since 1.0.0\n\t * @param time The time to parse\n\t */\n\tprivate static resolveDate(time: TimeResolvable): Date {\n\t\treturn time instanceof Date ? time : new Date(time);\n\t}\n}\n"],"names":["TimeTypes","Time","tokens"],"mappings":";;;;AAGA;;;AAGkBA;AAAlB,WAAkB,SAAS;IAC1B,8BAAiB,CAAA;IACjB,8BAAiB,CAAA;IACjB,0BAAa,CAAA;IACb,wBAAW,CAAA;IACX,0BAAa,CAAA;IACb,4BAAe,CAAA;IACf,0BAAa,CAAA;AACd,CAAC,EARiBA,iBAAS,KAATA,iBAAS,QAQ1B;AAEiBC;AAAlB,WAAkB,IAAI;IACrB,6CAAe,CAAA;IACf,sCAAa,CAAA;IACb,uCAAkB,CAAA;IAClB,qCAAqB,CAAA;IACrB,oCAAyB,CAAA;IACzB,0CAAwC,CAAA;IACxC,yCAAgC,CAAA;AACjC,CAAC,EARiBA,YAAI,KAAJA,YAAI,QAQrB;AAEM,MAAM,IAAI,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;AAE5F,MAAM,MAAM,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AAE1I,MAAMC,QAAM,GAAG,IAAI,GAAG,CAAiB;IAC7C,CAAC,GAAG,EAAE,CAAC,CAAC;IACR,CAAC,GAAG,EAAE,CAAC,CAAC;IACR,CAAC,GAAG,EAAE,CAAC,CAAC;IACR,CAAC,GAAG,EAAE,CAAC,CAAC;IACR,CAAC,GAAG,EAAE,CAAC,CAAC;IACR,CAAC,GAAG,EAAE,CAAC,CAAC;IACR,CAAC,GAAG,EAA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CAAC,GAAG,CAAC,CAAC,KAAK,GAAG;oBAAE,OAAO,IAAI,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;gBAChH,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;aACrD;SACD;QAED,OAAO,QAAQ,CAAC;KAChB;;;;;;IAOO,OAAO,WAAW,CAAC,IAAoB;QAC9C,OAAO,IAAI,YAAY,IAAI,GAAG,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;KACpD;;;;;;;;;"}
|
package/dist/index.mjs
CHANGED
|
@@ -113,6 +113,10 @@ const DEFAULT_UNITS = {
|
|
|
113
113
|
DEFAULT: 'seconds'
|
|
114
114
|
}
|
|
115
115
|
};
|
|
116
|
+
const DEFAULT_SEPARATORS = {
|
|
117
|
+
left: ' ',
|
|
118
|
+
right: ' '
|
|
119
|
+
};
|
|
116
120
|
|
|
117
121
|
/**
|
|
118
122
|
* Compare if both arrays are strictly equal
|
|
@@ -438,7 +442,7 @@ class DurationFormatter {
|
|
|
438
442
|
value: units
|
|
439
443
|
});
|
|
440
444
|
}
|
|
441
|
-
format(duration, precision = 7) {
|
|
445
|
+
format(duration, precision = 7, { left: leftSeparator = DEFAULT_SEPARATORS.left, right: rightSeparator = DEFAULT_SEPARATORS.right } = DEFAULT_SEPARATORS) {
|
|
442
446
|
const output = [];
|
|
443
447
|
const negative = duration < 0;
|
|
444
448
|
if (negative)
|
|
@@ -449,12 +453,12 @@ class DurationFormatter {
|
|
|
449
453
|
continue;
|
|
450
454
|
const floored = Math.floor(substraction);
|
|
451
455
|
duration -= floored * timeDuration;
|
|
452
|
-
output.push(addUnit(floored, this.units[type]));
|
|
456
|
+
output.push(addUnit(floored, this.units[type], leftSeparator));
|
|
453
457
|
// If the output has enough precision, break
|
|
454
458
|
if (output.length >= precision)
|
|
455
459
|
break;
|
|
456
460
|
}
|
|
457
|
-
return `${negative ? '-' : ''}${output.join(
|
|
461
|
+
return `${negative ? '-' : ''}${output.join(rightSeparator) || addUnit(0, this.units.second, leftSeparator)}`;
|
|
458
462
|
}
|
|
459
463
|
}
|
|
460
464
|
/**
|
|
@@ -462,10 +466,10 @@ class DurationFormatter {
|
|
|
462
466
|
* @param time The duration of said unit
|
|
463
467
|
* @param unit The unit language assets
|
|
464
468
|
*/
|
|
465
|
-
function addUnit(time, unit) {
|
|
469
|
+
function addUnit(time, unit, separator) {
|
|
466
470
|
if (Reflect.has(unit, time))
|
|
467
|
-
return `${time}
|
|
468
|
-
return `${time}
|
|
471
|
+
return `${time}${separator}${Reflect.get(unit, time)}`;
|
|
472
|
+
return `${time}${separator}${unit.DEFAULT}`;
|
|
469
473
|
}
|
|
470
474
|
|
|
471
475
|
/**
|