commit
This commit is contained in:
parent
a15c733e45
commit
2a5130cbda
2838 changed files with 288613 additions and 0 deletions
76
node_modules/@discordjs/util/dist/index.d.ts
generated
vendored
Normal file
76
node_modules/@discordjs/util/dist/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,76 @@
|
|||
/**
|
||||
* Represents a type that may or may not be a promise
|
||||
*/
|
||||
declare type Awaitable<T> = PromiseLike<T> | T;
|
||||
|
||||
/**
|
||||
* Lazy is a wrapper around a value that is computed lazily. It is useful for
|
||||
* cases where the value is expensive to compute and the computation may not
|
||||
* be needed at all.
|
||||
*
|
||||
* @param cb - The callback to lazily evaluate
|
||||
* @typeParam T - The type of the value
|
||||
* @example
|
||||
* ```ts
|
||||
* const value = lazy(() => computeExpensiveValue());
|
||||
* ```
|
||||
*/
|
||||
declare function lazy<T>(cb: () => T): () => T;
|
||||
|
||||
/**
|
||||
* Yields the numbers in the given range as an array
|
||||
*
|
||||
* @param start - The start of the range
|
||||
* @param end - The end of the range (inclusive)
|
||||
* @param step - The amount to increment between each number
|
||||
* @example
|
||||
* Basic range
|
||||
* ```ts
|
||||
* range(3, 5); // [3, 4, 5]
|
||||
* ```
|
||||
* @example
|
||||
* Range with a step
|
||||
* ```ts
|
||||
* range(3, 10, 2); // [3, 5, 7, 9]
|
||||
* ```
|
||||
*/
|
||||
declare function range(start: number, end: number, step?: number): number[];
|
||||
|
||||
/**
|
||||
* Represents an object capable of representing itself as a JSON object
|
||||
*
|
||||
* @typeParam T - The JSON type corresponding to {@link JSONEncodable.toJSON} outputs.
|
||||
*/
|
||||
interface JSONEncodable<T> {
|
||||
/**
|
||||
* Transforms this object to its JSON format
|
||||
*/
|
||||
toJSON(): T;
|
||||
}
|
||||
/**
|
||||
* Indicates if an object is encodable or not.
|
||||
*
|
||||
* @param maybeEncodable - The object to check against
|
||||
*/
|
||||
declare function isJSONEncodable(maybeEncodable: unknown): maybeEncodable is JSONEncodable<unknown>;
|
||||
|
||||
/**
|
||||
* Represents a structure that can be checked against another
|
||||
* given structure for equality
|
||||
*
|
||||
* @typeParam T - The type of object to compare the current object to
|
||||
*/
|
||||
interface Equatable<T> {
|
||||
/**
|
||||
* Whether or not this is equal to another structure
|
||||
*/
|
||||
equals(other: T): boolean;
|
||||
}
|
||||
/**
|
||||
* Indicates if an object is equatable or not.
|
||||
*
|
||||
* @param maybeEquatable - The object to check against
|
||||
*/
|
||||
declare function isEquatable(maybeEquatable: unknown): maybeEquatable is Equatable<unknown>;
|
||||
|
||||
export { Awaitable, Equatable, JSONEncodable, isEquatable, isJSONEncodable, lazy, range };
|
62
node_modules/@discordjs/util/dist/index.js
generated
vendored
Normal file
62
node_modules/@discordjs/util/dist/index.js
generated
vendored
Normal file
|
@ -0,0 +1,62 @@
|
|||
"use strict";
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// src/index.ts
|
||||
var src_exports = {};
|
||||
__export(src_exports, {
|
||||
isEquatable: () => isEquatable,
|
||||
isJSONEncodable: () => isJSONEncodable,
|
||||
lazy: () => lazy,
|
||||
range: () => range
|
||||
});
|
||||
module.exports = __toCommonJS(src_exports);
|
||||
|
||||
// src/functions/lazy.ts
|
||||
function lazy(cb) {
|
||||
let defaultValue;
|
||||
return () => defaultValue ??= cb();
|
||||
}
|
||||
__name(lazy, "lazy");
|
||||
|
||||
// src/functions/range.ts
|
||||
function range(start, end, step = 1) {
|
||||
return Array.from({ length: (end - start) / step + 1 }, (_, index) => start + index * step);
|
||||
}
|
||||
__name(range, "range");
|
||||
|
||||
// src/JSONEncodable.ts
|
||||
function isJSONEncodable(maybeEncodable) {
|
||||
return maybeEncodable !== null && typeof maybeEncodable === "object" && "toJSON" in maybeEncodable;
|
||||
}
|
||||
__name(isJSONEncodable, "isJSONEncodable");
|
||||
|
||||
// src/Equatable.ts
|
||||
function isEquatable(maybeEquatable) {
|
||||
return maybeEquatable !== null && typeof maybeEquatable === "object" && "equals" in maybeEquatable;
|
||||
}
|
||||
__name(isEquatable, "isEquatable");
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
isEquatable,
|
||||
isJSONEncodable,
|
||||
lazy,
|
||||
range
|
||||
});
|
||||
//# sourceMappingURL=index.js.map
|
1
node_modules/@discordjs/util/dist/index.js.map
generated
vendored
Normal file
1
node_modules/@discordjs/util/dist/index.js.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../src/index.ts","../src/functions/lazy.ts","../src/functions/range.ts","../src/JSONEncodable.ts","../src/Equatable.ts"],"sourcesContent":["export * from './types.js';\nexport * from './functions/index.js';\nexport * from './JSONEncodable.js';\nexport * from './Equatable.js';\n","/**\n * Lazy is a wrapper around a value that is computed lazily. It is useful for\n * cases where the value is expensive to compute and the computation may not\n * be needed at all.\n *\n * @param cb - The callback to lazily evaluate\n * @typeParam T - The type of the value\n * @example\n * ```ts\n * const value = lazy(() => computeExpensiveValue());\n * ```\n */\n// eslint-disable-next-line promise/prefer-await-to-callbacks\nexport function lazy<T>(cb: () => T): () => T {\n\tlet defaultValue: T;\n\t// eslint-disable-next-line promise/prefer-await-to-callbacks\n\treturn () => (defaultValue ??= cb());\n}\n","/**\n * Yields the numbers in the given range as an array\n *\n * @param start - The start of the range\n * @param end - The end of the range (inclusive)\n * @param step - The amount to increment between each number\n * @example\n * Basic range\n * ```ts\n * range(3, 5); // [3, 4, 5]\n * ```\n * @example\n * Range with a step\n * ```ts\n * range(3, 10, 2); // [3, 5, 7, 9]\n * ```\n */\nexport function range(start: number, end: number, step = 1): number[] {\n\treturn Array.from({ length: (end - start) / step + 1 }, (_, index) => start + index * step);\n}\n","/**\n * Represents an object capable of representing itself as a JSON object\n *\n * @typeParam T - The JSON type corresponding to {@link JSONEncodable.toJSON} outputs.\n */\nexport interface JSONEncodable<T> {\n\t/**\n\t * Transforms this object to its JSON format\n\t */\n\ttoJSON(): T;\n}\n\n/**\n * Indicates if an object is encodable or not.\n *\n * @param maybeEncodable - The object to check against\n */\nexport function isJSONEncodable(maybeEncodable: unknown): maybeEncodable is JSONEncodable<unknown> {\n\treturn maybeEncodable !== null && typeof maybeEncodable === 'object' && 'toJSON' in maybeEncodable;\n}\n","/**\n * Represents a structure that can be checked against another\n * given structure for equality\n *\n * @typeParam T - The type of object to compare the current object to\n */\nexport interface Equatable<T> {\n\t/**\n\t * Whether or not this is equal to another structure\n\t */\n\tequals(other: T): boolean;\n}\n\n/**\n * Indicates if an object is equatable or not.\n *\n * @param maybeEquatable - The object to check against\n */\nexport function isEquatable(maybeEquatable: unknown): maybeEquatable is Equatable<unknown> {\n\treturn maybeEquatable !== null && typeof maybeEquatable === 'object' && 'equals' in maybeEquatable;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACaO,SAAS,KAAQ,IAAsB;AAC7C,MAAI;AAEJ,SAAO,MAAO,iBAAiB,GAAG;AACnC;AAJgB;;;ACIT,SAAS,MAAM,OAAe,KAAa,OAAO,GAAa;AACrE,SAAO,MAAM,KAAK,EAAE,SAAS,MAAM,SAAS,OAAO,EAAE,GAAG,CAAC,GAAG,UAAU,QAAQ,QAAQ,IAAI;AAC3F;AAFgB;;;ACAT,SAAS,gBAAgB,gBAAmE;AAClG,SAAO,mBAAmB,QAAQ,OAAO,mBAAmB,YAAY,YAAY;AACrF;AAFgB;;;ACCT,SAAS,YAAY,gBAA+D;AAC1F,SAAO,mBAAmB,QAAQ,OAAO,mBAAmB,YAAY,YAAY;AACrF;AAFgB;","names":[]}
|
34
node_modules/@discordjs/util/dist/index.mjs
generated
vendored
Normal file
34
node_modules/@discordjs/util/dist/index.mjs
generated
vendored
Normal file
|
@ -0,0 +1,34 @@
|
|||
var __defProp = Object.defineProperty;
|
||||
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
||||
|
||||
// src/functions/lazy.ts
|
||||
function lazy(cb) {
|
||||
let defaultValue;
|
||||
return () => defaultValue ??= cb();
|
||||
}
|
||||
__name(lazy, "lazy");
|
||||
|
||||
// src/functions/range.ts
|
||||
function range(start, end, step = 1) {
|
||||
return Array.from({ length: (end - start) / step + 1 }, (_, index) => start + index * step);
|
||||
}
|
||||
__name(range, "range");
|
||||
|
||||
// src/JSONEncodable.ts
|
||||
function isJSONEncodable(maybeEncodable) {
|
||||
return maybeEncodable !== null && typeof maybeEncodable === "object" && "toJSON" in maybeEncodable;
|
||||
}
|
||||
__name(isJSONEncodable, "isJSONEncodable");
|
||||
|
||||
// src/Equatable.ts
|
||||
function isEquatable(maybeEquatable) {
|
||||
return maybeEquatable !== null && typeof maybeEquatable === "object" && "equals" in maybeEquatable;
|
||||
}
|
||||
__name(isEquatable, "isEquatable");
|
||||
export {
|
||||
isEquatable,
|
||||
isJSONEncodable,
|
||||
lazy,
|
||||
range
|
||||
};
|
||||
//# sourceMappingURL=index.mjs.map
|
1
node_modules/@discordjs/util/dist/index.mjs.map
generated
vendored
Normal file
1
node_modules/@discordjs/util/dist/index.mjs.map
generated
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
{"version":3,"sources":["../src/functions/lazy.ts","../src/functions/range.ts","../src/JSONEncodable.ts","../src/Equatable.ts"],"sourcesContent":["/**\n * Lazy is a wrapper around a value that is computed lazily. It is useful for\n * cases where the value is expensive to compute and the computation may not\n * be needed at all.\n *\n * @param cb - The callback to lazily evaluate\n * @typeParam T - The type of the value\n * @example\n * ```ts\n * const value = lazy(() => computeExpensiveValue());\n * ```\n */\n// eslint-disable-next-line promise/prefer-await-to-callbacks\nexport function lazy<T>(cb: () => T): () => T {\n\tlet defaultValue: T;\n\t// eslint-disable-next-line promise/prefer-await-to-callbacks\n\treturn () => (defaultValue ??= cb());\n}\n","/**\n * Yields the numbers in the given range as an array\n *\n * @param start - The start of the range\n * @param end - The end of the range (inclusive)\n * @param step - The amount to increment between each number\n * @example\n * Basic range\n * ```ts\n * range(3, 5); // [3, 4, 5]\n * ```\n * @example\n * Range with a step\n * ```ts\n * range(3, 10, 2); // [3, 5, 7, 9]\n * ```\n */\nexport function range(start: number, end: number, step = 1): number[] {\n\treturn Array.from({ length: (end - start) / step + 1 }, (_, index) => start + index * step);\n}\n","/**\n * Represents an object capable of representing itself as a JSON object\n *\n * @typeParam T - The JSON type corresponding to {@link JSONEncodable.toJSON} outputs.\n */\nexport interface JSONEncodable<T> {\n\t/**\n\t * Transforms this object to its JSON format\n\t */\n\ttoJSON(): T;\n}\n\n/**\n * Indicates if an object is encodable or not.\n *\n * @param maybeEncodable - The object to check against\n */\nexport function isJSONEncodable(maybeEncodable: unknown): maybeEncodable is JSONEncodable<unknown> {\n\treturn maybeEncodable !== null && typeof maybeEncodable === 'object' && 'toJSON' in maybeEncodable;\n}\n","/**\n * Represents a structure that can be checked against another\n * given structure for equality\n *\n * @typeParam T - The type of object to compare the current object to\n */\nexport interface Equatable<T> {\n\t/**\n\t * Whether or not this is equal to another structure\n\t */\n\tequals(other: T): boolean;\n}\n\n/**\n * Indicates if an object is equatable or not.\n *\n * @param maybeEquatable - The object to check against\n */\nexport function isEquatable(maybeEquatable: unknown): maybeEquatable is Equatable<unknown> {\n\treturn maybeEquatable !== null && typeof maybeEquatable === 'object' && 'equals' in maybeEquatable;\n}\n"],"mappings":";;;;AAaO,SAAS,KAAQ,IAAsB;AAC7C,MAAI;AAEJ,SAAO,MAAO,iBAAiB,GAAG;AACnC;AAJgB;;;ACIT,SAAS,MAAM,OAAe,KAAa,OAAO,GAAa;AACrE,SAAO,MAAM,KAAK,EAAE,SAAS,MAAM,SAAS,OAAO,EAAE,GAAG,CAAC,GAAG,UAAU,QAAQ,QAAQ,IAAI;AAC3F;AAFgB;;;ACAT,SAAS,gBAAgB,gBAAmE;AAClG,SAAO,mBAAmB,QAAQ,OAAO,mBAAmB,YAAY,YAAY;AACrF;AAFgB;;;ACCT,SAAS,YAAY,gBAA+D;AAC1F,SAAO,mBAAmB,QAAQ,OAAO,mBAAmB,YAAY,YAAY;AACrF;AAFgB;","names":[]}
|
Loading…
Add table
Add a link
Reference in a new issue