mirror of
https://gitlab.com/upRootNutrition/zookeeper.git
synced 2025-06-16 10:25:12 -05:00
feat: init
This commit is contained in:
parent
8379d09058
commit
2cfa016090
2929 changed files with 299087 additions and 3 deletions
132
node_modules/@discordjs/util/dist/index.d.mts
generated
vendored
Normal file
132
node_modules/@discordjs/util/dist/index.d.mts
generated
vendored
Normal file
|
@ -0,0 +1,132 @@
|
|||
/**
|
||||
* Represents a type that may or may not be a promise
|
||||
*/
|
||||
type Awaitable<Value> = PromiseLike<Value> | Value;
|
||||
|
||||
/**
|
||||
* 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 Value - The type of the value
|
||||
* @example
|
||||
* ```ts
|
||||
* const value = lazy(() => computeExpensiveValue());
|
||||
* ```
|
||||
*/
|
||||
declare function lazy<Value>(cb: () => Value): () => Value;
|
||||
|
||||
/**
|
||||
* Options for creating a range
|
||||
*/
|
||||
interface RangeOptions {
|
||||
/**
|
||||
* The end of the range (exclusive)
|
||||
*/
|
||||
end: number;
|
||||
/**
|
||||
* The start of the range (inclusive)
|
||||
*/
|
||||
start: number;
|
||||
/**
|
||||
* The amount to increment by
|
||||
*
|
||||
* @defaultValue `1`
|
||||
*/
|
||||
step?: number;
|
||||
}
|
||||
/**
|
||||
* A generator to yield numbers in a given range
|
||||
*
|
||||
* @remarks
|
||||
* This method is end-exclusive, for example the last number yielded by `range(5)` is 4. If you
|
||||
* prefer for the end to be included add 1 to the range or `end` option.
|
||||
* @param range - A number representing the range to yield (exclusive) or an object with start, end and step
|
||||
* @example
|
||||
* Basic range
|
||||
* ```ts
|
||||
* for (const number of range(5)) {
|
||||
* console.log(number);
|
||||
* }
|
||||
* // Prints 0, 1, 2, 3, 4
|
||||
* ```
|
||||
* @example
|
||||
* Range with a step
|
||||
* ```ts
|
||||
* for (const number of range({ start: 3, end: 10, step: 2 })) {
|
||||
* console.log(number);
|
||||
* }
|
||||
* // Prints 3, 5, 7, 9
|
||||
* ```
|
||||
*/
|
||||
declare function range(range: RangeOptions | number): Generator<number, void, unknown>;
|
||||
|
||||
/**
|
||||
* Calculates the shard id for a given guild id.
|
||||
*
|
||||
* @param guildId - The guild id to calculate the shard id for
|
||||
* @param shardCount - The total number of shards
|
||||
*/
|
||||
declare function calculateShardId(guildId: string, shardCount: number): number;
|
||||
|
||||
declare function shouldUseGlobalFetchAndWebSocket(): boolean;
|
||||
|
||||
/**
|
||||
* Resolves the user agent appendix string for the current environment.
|
||||
*/
|
||||
declare function getUserAgentAppendix(): string;
|
||||
|
||||
/**
|
||||
* Polyfill for `Symbol.dispose` and `Symbol.asyncDispose` which is used as a part of
|
||||
* {@link https://github.com/tc39/proposal-explicit-resource-management}. Node versions below 18.x
|
||||
* don't have these symbols by default, so we need to polyfill them.
|
||||
*/
|
||||
declare function polyfillDispose(): void;
|
||||
|
||||
/**
|
||||
* Represents an object capable of representing itself as a JSON object
|
||||
*
|
||||
* @typeParam Value - The JSON type corresponding to {@link JSONEncodable.toJSON} outputs.
|
||||
*/
|
||||
interface JSONEncodable<Value> {
|
||||
/**
|
||||
* Transforms this object to its JSON format
|
||||
*/
|
||||
toJSON(): Value;
|
||||
}
|
||||
/**
|
||||
* 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 Value - The type of object to compare the current object to
|
||||
*/
|
||||
interface Equatable<Value> {
|
||||
/**
|
||||
* Whether or not this is equal to another structure
|
||||
*/
|
||||
equals(other: Value): 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>;
|
||||
|
||||
/**
|
||||
* The {@link https://github.com/discordjs/discord.js/blob/main/packages/util#readme | @discordjs/util} version
|
||||
* that you are currently using.
|
||||
*
|
||||
* @privateRemarks This needs to explicitly be `string` so it is not typed as a "const string" that gets injected by esbuild.
|
||||
*/
|
||||
declare const version: string;
|
||||
|
||||
export { type Awaitable, type Equatable, type JSONEncodable, type RangeOptions, calculateShardId, getUserAgentAppendix, isEquatable, isJSONEncodable, lazy, polyfillDispose, range, shouldUseGlobalFetchAndWebSocket, version };
|
132
node_modules/@discordjs/util/dist/index.d.ts
generated
vendored
Normal file
132
node_modules/@discordjs/util/dist/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,132 @@
|
|||
/**
|
||||
* Represents a type that may or may not be a promise
|
||||
*/
|
||||
type Awaitable<Value> = PromiseLike<Value> | Value;
|
||||
|
||||
/**
|
||||
* 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 Value - The type of the value
|
||||
* @example
|
||||
* ```ts
|
||||
* const value = lazy(() => computeExpensiveValue());
|
||||
* ```
|
||||
*/
|
||||
declare function lazy<Value>(cb: () => Value): () => Value;
|
||||
|
||||
/**
|
||||
* Options for creating a range
|
||||
*/
|
||||
interface RangeOptions {
|
||||
/**
|
||||
* The end of the range (exclusive)
|
||||
*/
|
||||
end: number;
|
||||
/**
|
||||
* The start of the range (inclusive)
|
||||
*/
|
||||
start: number;
|
||||
/**
|
||||
* The amount to increment by
|
||||
*
|
||||
* @defaultValue `1`
|
||||
*/
|
||||
step?: number;
|
||||
}
|
||||
/**
|
||||
* A generator to yield numbers in a given range
|
||||
*
|
||||
* @remarks
|
||||
* This method is end-exclusive, for example the last number yielded by `range(5)` is 4. If you
|
||||
* prefer for the end to be included add 1 to the range or `end` option.
|
||||
* @param range - A number representing the range to yield (exclusive) or an object with start, end and step
|
||||
* @example
|
||||
* Basic range
|
||||
* ```ts
|
||||
* for (const number of range(5)) {
|
||||
* console.log(number);
|
||||
* }
|
||||
* // Prints 0, 1, 2, 3, 4
|
||||
* ```
|
||||
* @example
|
||||
* Range with a step
|
||||
* ```ts
|
||||
* for (const number of range({ start: 3, end: 10, step: 2 })) {
|
||||
* console.log(number);
|
||||
* }
|
||||
* // Prints 3, 5, 7, 9
|
||||
* ```
|
||||
*/
|
||||
declare function range(range: RangeOptions | number): Generator<number, void, unknown>;
|
||||
|
||||
/**
|
||||
* Calculates the shard id for a given guild id.
|
||||
*
|
||||
* @param guildId - The guild id to calculate the shard id for
|
||||
* @param shardCount - The total number of shards
|
||||
*/
|
||||
declare function calculateShardId(guildId: string, shardCount: number): number;
|
||||
|
||||
declare function shouldUseGlobalFetchAndWebSocket(): boolean;
|
||||
|
||||
/**
|
||||
* Resolves the user agent appendix string for the current environment.
|
||||
*/
|
||||
declare function getUserAgentAppendix(): string;
|
||||
|
||||
/**
|
||||
* Polyfill for `Symbol.dispose` and `Symbol.asyncDispose` which is used as a part of
|
||||
* {@link https://github.com/tc39/proposal-explicit-resource-management}. Node versions below 18.x
|
||||
* don't have these symbols by default, so we need to polyfill them.
|
||||
*/
|
||||
declare function polyfillDispose(): void;
|
||||
|
||||
/**
|
||||
* Represents an object capable of representing itself as a JSON object
|
||||
*
|
||||
* @typeParam Value - The JSON type corresponding to {@link JSONEncodable.toJSON} outputs.
|
||||
*/
|
||||
interface JSONEncodable<Value> {
|
||||
/**
|
||||
* Transforms this object to its JSON format
|
||||
*/
|
||||
toJSON(): Value;
|
||||
}
|
||||
/**
|
||||
* 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 Value - The type of object to compare the current object to
|
||||
*/
|
||||
interface Equatable<Value> {
|
||||
/**
|
||||
* Whether or not this is equal to another structure
|
||||
*/
|
||||
equals(other: Value): 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>;
|
||||
|
||||
/**
|
||||
* The {@link https://github.com/discordjs/discord.js/blob/main/packages/util#readme | @discordjs/util} version
|
||||
* that you are currently using.
|
||||
*
|
||||
* @privateRemarks This needs to explicitly be `string` so it is not typed as a "const string" that gets injected by esbuild.
|
||||
*/
|
||||
declare const version: string;
|
||||
|
||||
export { type Awaitable, type Equatable, type JSONEncodable, type RangeOptions, calculateShardId, getUserAgentAppendix, isEquatable, isJSONEncodable, lazy, polyfillDispose, range, shouldUseGlobalFetchAndWebSocket, version };
|
144
node_modules/@discordjs/util/dist/index.js
generated
vendored
Normal file
144
node_modules/@discordjs/util/dist/index.js
generated
vendored
Normal file
|
@ -0,0 +1,144 @@
|
|||
"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, {
|
||||
calculateShardId: () => calculateShardId,
|
||||
getUserAgentAppendix: () => getUserAgentAppendix,
|
||||
isEquatable: () => isEquatable,
|
||||
isJSONEncodable: () => isJSONEncodable,
|
||||
lazy: () => lazy,
|
||||
polyfillDispose: () => polyfillDispose,
|
||||
range: () => range,
|
||||
shouldUseGlobalFetchAndWebSocket: () => shouldUseGlobalFetchAndWebSocket,
|
||||
version: () => version
|
||||
});
|
||||
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(range2) {
|
||||
let rangeEnd;
|
||||
let start = 0;
|
||||
let step = 1;
|
||||
if (typeof range2 === "number") {
|
||||
rangeEnd = range2;
|
||||
} else {
|
||||
start = range2.start;
|
||||
rangeEnd = range2.end;
|
||||
step = range2.step ?? 1;
|
||||
}
|
||||
for (let index = start; index < rangeEnd; index += step) {
|
||||
yield index;
|
||||
}
|
||||
}
|
||||
__name(range, "range");
|
||||
|
||||
// src/functions/calculateShardId.ts
|
||||
function calculateShardId(guildId, shardCount) {
|
||||
return Number(BigInt(guildId) >> 22n) % shardCount;
|
||||
}
|
||||
__name(calculateShardId, "calculateShardId");
|
||||
|
||||
// src/functions/runtime.ts
|
||||
function shouldUseGlobalFetchAndWebSocket() {
|
||||
if (typeof globalThis.process === "undefined") {
|
||||
return "fetch" in globalThis && "WebSocket" in globalThis;
|
||||
}
|
||||
if ("versions" in globalThis.process) {
|
||||
return "deno" in globalThis.process.versions || "bun" in globalThis.process.versions;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
__name(shouldUseGlobalFetchAndWebSocket, "shouldUseGlobalFetchAndWebSocket");
|
||||
|
||||
// src/functions/userAgentAppendix.ts
|
||||
function getUserAgentAppendix() {
|
||||
if (typeof globalThis.EdgeRuntime !== "undefined") {
|
||||
return "Vercel-Edge-Functions";
|
||||
}
|
||||
if (typeof globalThis.R2 !== "undefined" && typeof globalThis.WebSocketPair !== "undefined") {
|
||||
return "Cloudflare-Workers";
|
||||
}
|
||||
if (typeof globalThis.Netlify !== "undefined") {
|
||||
return "Netlify-Edge-Functions";
|
||||
}
|
||||
if (typeof globalThis.process !== "object") {
|
||||
if (typeof globalThis.navigator === "object") {
|
||||
return globalThis.navigator.userAgent;
|
||||
}
|
||||
return "UnknownEnvironment";
|
||||
}
|
||||
if ("versions" in globalThis.process) {
|
||||
if ("deno" in globalThis.process.versions) {
|
||||
return `Deno/${globalThis.process.versions.deno}`;
|
||||
}
|
||||
if ("bun" in globalThis.process.versions) {
|
||||
return `Bun/${globalThis.process.versions.bun}`;
|
||||
}
|
||||
if ("node" in globalThis.process.versions) {
|
||||
return `Node.js/${globalThis.process.versions.node}`;
|
||||
}
|
||||
}
|
||||
return "UnknownEnvironment";
|
||||
}
|
||||
__name(getUserAgentAppendix, "getUserAgentAppendix");
|
||||
|
||||
// src/functions/polyfillDispose.ts
|
||||
function polyfillDispose() {
|
||||
Symbol.dispose ??= Symbol("Symbol.dispose");
|
||||
Symbol.asyncDispose ??= Symbol("Symbol.asyncDispose");
|
||||
}
|
||||
__name(polyfillDispose, "polyfillDispose");
|
||||
|
||||
// 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");
|
||||
|
||||
// src/index.ts
|
||||
var version = "1.1.0";
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
calculateShardId,
|
||||
getUserAgentAppendix,
|
||||
isEquatable,
|
||||
isJSONEncodable,
|
||||
lazy,
|
||||
polyfillDispose,
|
||||
range,
|
||||
shouldUseGlobalFetchAndWebSocket,
|
||||
version
|
||||
});
|
||||
//# 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
File diff suppressed because one or more lines are too long
111
node_modules/@discordjs/util/dist/index.mjs
generated
vendored
Normal file
111
node_modules/@discordjs/util/dist/index.mjs
generated
vendored
Normal file
|
@ -0,0 +1,111 @@
|
|||
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(range2) {
|
||||
let rangeEnd;
|
||||
let start = 0;
|
||||
let step = 1;
|
||||
if (typeof range2 === "number") {
|
||||
rangeEnd = range2;
|
||||
} else {
|
||||
start = range2.start;
|
||||
rangeEnd = range2.end;
|
||||
step = range2.step ?? 1;
|
||||
}
|
||||
for (let index = start; index < rangeEnd; index += step) {
|
||||
yield index;
|
||||
}
|
||||
}
|
||||
__name(range, "range");
|
||||
|
||||
// src/functions/calculateShardId.ts
|
||||
function calculateShardId(guildId, shardCount) {
|
||||
return Number(BigInt(guildId) >> 22n) % shardCount;
|
||||
}
|
||||
__name(calculateShardId, "calculateShardId");
|
||||
|
||||
// src/functions/runtime.ts
|
||||
function shouldUseGlobalFetchAndWebSocket() {
|
||||
if (typeof globalThis.process === "undefined") {
|
||||
return "fetch" in globalThis && "WebSocket" in globalThis;
|
||||
}
|
||||
if ("versions" in globalThis.process) {
|
||||
return "deno" in globalThis.process.versions || "bun" in globalThis.process.versions;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
__name(shouldUseGlobalFetchAndWebSocket, "shouldUseGlobalFetchAndWebSocket");
|
||||
|
||||
// src/functions/userAgentAppendix.ts
|
||||
function getUserAgentAppendix() {
|
||||
if (typeof globalThis.EdgeRuntime !== "undefined") {
|
||||
return "Vercel-Edge-Functions";
|
||||
}
|
||||
if (typeof globalThis.R2 !== "undefined" && typeof globalThis.WebSocketPair !== "undefined") {
|
||||
return "Cloudflare-Workers";
|
||||
}
|
||||
if (typeof globalThis.Netlify !== "undefined") {
|
||||
return "Netlify-Edge-Functions";
|
||||
}
|
||||
if (typeof globalThis.process !== "object") {
|
||||
if (typeof globalThis.navigator === "object") {
|
||||
return globalThis.navigator.userAgent;
|
||||
}
|
||||
return "UnknownEnvironment";
|
||||
}
|
||||
if ("versions" in globalThis.process) {
|
||||
if ("deno" in globalThis.process.versions) {
|
||||
return `Deno/${globalThis.process.versions.deno}`;
|
||||
}
|
||||
if ("bun" in globalThis.process.versions) {
|
||||
return `Bun/${globalThis.process.versions.bun}`;
|
||||
}
|
||||
if ("node" in globalThis.process.versions) {
|
||||
return `Node.js/${globalThis.process.versions.node}`;
|
||||
}
|
||||
}
|
||||
return "UnknownEnvironment";
|
||||
}
|
||||
__name(getUserAgentAppendix, "getUserAgentAppendix");
|
||||
|
||||
// src/functions/polyfillDispose.ts
|
||||
function polyfillDispose() {
|
||||
Symbol.dispose ??= Symbol("Symbol.dispose");
|
||||
Symbol.asyncDispose ??= Symbol("Symbol.asyncDispose");
|
||||
}
|
||||
__name(polyfillDispose, "polyfillDispose");
|
||||
|
||||
// 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");
|
||||
|
||||
// src/index.ts
|
||||
var version = "1.1.0";
|
||||
export {
|
||||
calculateShardId,
|
||||
getUserAgentAppendix,
|
||||
isEquatable,
|
||||
isJSONEncodable,
|
||||
lazy,
|
||||
polyfillDispose,
|
||||
range,
|
||||
shouldUseGlobalFetchAndWebSocket,
|
||||
version
|
||||
};
|
||||
//# 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
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue