commit
This commit is contained in:
parent
68f4b60012
commit
41ae7ff4bd
1010 changed files with 38622 additions and 17071 deletions
24
node_modules/@discordjs/util/dist/index.js
generated
vendored
24
node_modules/@discordjs/util/dist/index.js
generated
vendored
|
@ -21,6 +21,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|||
// src/index.ts
|
||||
var src_exports = {};
|
||||
__export(src_exports, {
|
||||
calculateShardId: () => calculateShardId,
|
||||
isEquatable: () => isEquatable,
|
||||
isJSONEncodable: () => isJSONEncodable,
|
||||
lazy: () => lazy,
|
||||
|
@ -36,11 +37,29 @@ function lazy(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);
|
||||
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/JSONEncodable.ts
|
||||
function isJSONEncodable(maybeEncodable) {
|
||||
return maybeEncodable !== null && typeof maybeEncodable === "object" && "toJSON" in maybeEncodable;
|
||||
|
@ -54,6 +73,7 @@ function isEquatable(maybeEquatable) {
|
|||
__name(isEquatable, "isEquatable");
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
calculateShardId,
|
||||
isEquatable,
|
||||
isJSONEncodable,
|
||||
lazy,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue