@discordeno/utils 19.0.0-next.fe00a6f → 19.0.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 +6 -143
- package/dist/esm/Collection.js +112 -0
- package/dist/esm/base64.js +262 -0
- package/dist/esm/bucket.js +81 -0
- package/dist/esm/builders/embeds.js +290 -0
- package/dist/esm/builders.js +5 -0
- package/dist/esm/casing.js +55 -0
- package/dist/esm/colors.js +467 -0
- package/dist/esm/hash.js +19 -0
- package/dist/esm/images.js +179 -0
- package/dist/esm/index.js +19 -0
- package/dist/esm/logger.js +130 -0
- package/dist/esm/oauth2.js +16 -0
- package/dist/esm/permissions.js +17 -0
- package/dist/esm/reactions.js +11 -0
- package/dist/esm/token.js +20 -0
- package/dist/esm/typeguards.js +22 -0
- package/dist/esm/urlToBase64.js +9 -0
- package/dist/esm/urls.js +11 -0
- package/dist/esm/utils.js +12 -0
- package/dist/{Collection.d.ts → types/Collection.d.ts} +2 -3
- package/dist/types/Collection.d.ts.map +1 -0
- package/dist/types/base64.d.ts.map +1 -0
- package/dist/{bucket.d.ts → types/bucket.d.ts} +9 -2
- package/dist/types/bucket.d.ts.map +1 -0
- package/dist/types/builders/embeds.d.ts +142 -0
- package/dist/types/builders/embeds.d.ts.map +1 -0
- package/dist/types/builders.d.ts +4 -0
- package/dist/types/builders.d.ts.map +1 -0
- package/dist/types/casing.d.ts.map +1 -0
- package/dist/types/colors.d.ts.map +1 -0
- package/dist/types/hash.d.ts.map +1 -0
- package/dist/types/images.d.ts +202 -0
- package/dist/types/images.d.ts.map +1 -0
- package/dist/{index.d.ts → types/index.d.ts} +4 -1
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/logger.d.ts.map +1 -0
- package/dist/types/oauth2.d.ts +69 -0
- package/dist/types/oauth2.d.ts.map +1 -0
- package/dist/types/permissions.d.ts.map +1 -0
- package/dist/types/reactions.d.ts.map +1 -0
- package/dist/{token.d.ts → types/token.d.ts} +1 -1
- package/dist/types/token.d.ts.map +1 -0
- package/dist/types/typeguards.d.ts +8 -0
- package/dist/types/typeguards.d.ts.map +1 -0
- package/dist/types/urlToBase64.d.ts.map +1 -0
- package/dist/types/urls.d.ts +5 -0
- package/dist/types/urls.d.ts.map +1 -0
- package/dist/types/utils.d.ts.map +1 -0
- package/package.json +30 -26
- package/dist/Collection.d.ts.map +0 -1
- package/dist/Collection.js +0 -113
- package/dist/Collection.js.map +0 -1
- package/dist/base64.d.ts.map +0 -1
- package/dist/base64.js +0 -262
- package/dist/base64.js.map +0 -1
- package/dist/bucket.d.ts.map +0 -1
- package/dist/bucket.js +0 -74
- package/dist/bucket.js.map +0 -1
- package/dist/casing.d.ts.map +0 -1
- package/dist/casing.js +0 -51
- package/dist/casing.js.map +0 -1
- package/dist/colors.d.ts.map +0 -1
- package/dist/colors.js +0 -467
- package/dist/colors.js.map +0 -1
- package/dist/hash.d.ts.map +0 -1
- package/dist/hash.js +0 -19
- package/dist/hash.js.map +0 -1
- package/dist/images.d.ts +0 -68
- package/dist/images.d.ts.map +0 -1
- package/dist/images.js +0 -66
- package/dist/images.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -16
- package/dist/index.js.map +0 -1
- package/dist/interactions.d.ts +0 -3
- package/dist/interactions.d.ts.map +0 -1
- package/dist/interactions.js +0 -41
- package/dist/interactions.js.map +0 -1
- package/dist/logger.d.ts.map +0 -1
- package/dist/logger.js +0 -130
- package/dist/logger.js.map +0 -1
- package/dist/permissions.d.ts.map +0 -1
- package/dist/permissions.js +0 -17
- package/dist/permissions.js.map +0 -1
- package/dist/reactions.d.ts.map +0 -1
- package/dist/reactions.js +0 -11
- package/dist/reactions.js.map +0 -1
- package/dist/token.d.ts.map +0 -1
- package/dist/token.js +0 -16
- package/dist/token.js.map +0 -1
- package/dist/typeguards.d.ts +0 -6
- package/dist/typeguards.d.ts.map +0 -1
- package/dist/typeguards.js +0 -15
- package/dist/typeguards.js.map +0 -1
- package/dist/urlToBase64.d.ts.map +0 -1
- package/dist/urlToBase64.js +0 -9
- package/dist/urlToBase64.js.map +0 -1
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -15
- package/dist/utils.js.map +0 -1
- /package/dist/{base64.d.ts → types/base64.d.ts} +0 -0
- /package/dist/{casing.d.ts → types/casing.d.ts} +0 -0
- /package/dist/{colors.d.ts → types/colors.d.ts} +0 -0
- /package/dist/{hash.d.ts → types/hash.d.ts} +0 -0
- /package/dist/{logger.d.ts → types/logger.d.ts} +0 -0
- /package/dist/{permissions.d.ts → types/permissions.d.ts} +0 -0
- /package/dist/{reactions.d.ts → types/reactions.d.ts} +0 -0
- /package/dist/{urlToBase64.d.ts → types/urlToBase64.d.ts} +0 -0
- /package/dist/{utils.d.ts → types/utils.d.ts} +0 -0
package/dist/Collection.js
DELETED
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
2
|
-
export class Collection extends Map {
|
|
3
|
-
constructor(entries, options){
|
|
4
|
-
super(entries ?? []);
|
|
5
|
-
this.maxSize = options?.maxSize;
|
|
6
|
-
if (!options?.sweeper) return;
|
|
7
|
-
this.startSweeper(options.sweeper);
|
|
8
|
-
}
|
|
9
|
-
startSweeper(options) {
|
|
10
|
-
if (this.sweeper?.intervalId) clearInterval(this.sweeper.intervalId);
|
|
11
|
-
this.sweeper = options;
|
|
12
|
-
this.sweeper.intervalId = setInterval(()=>{
|
|
13
|
-
this.forEach((value, key)=>{
|
|
14
|
-
if (!this.sweeper?.filter(value, key, options.bot)) return;
|
|
15
|
-
this.delete(key);
|
|
16
|
-
return key;
|
|
17
|
-
});
|
|
18
|
-
}, options.interval);
|
|
19
|
-
return this.sweeper.intervalId;
|
|
20
|
-
}
|
|
21
|
-
stopSweeper() {
|
|
22
|
-
return clearInterval(this.sweeper?.intervalId);
|
|
23
|
-
}
|
|
24
|
-
changeSweeperInterval(newInterval) {
|
|
25
|
-
if (this.sweeper == null) return;
|
|
26
|
-
this.startSweeper({
|
|
27
|
-
filter: this.sweeper.filter,
|
|
28
|
-
interval: newInterval
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
changeSweeperFilter(newFilter) {
|
|
32
|
-
if (this.sweeper == null) return;
|
|
33
|
-
this.startSweeper({
|
|
34
|
-
filter: newFilter,
|
|
35
|
-
interval: this.sweeper.interval
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
/** Add an item to the collection. Makes sure not to go above the maxSize. */ set(key, value) {
|
|
39
|
-
// When this collection is maxSized make sure we can add first
|
|
40
|
-
if ((this.maxSize !== undefined || this.maxSize === 0) && this.size >= this.maxSize) {
|
|
41
|
-
return this;
|
|
42
|
-
}
|
|
43
|
-
return super.set(key, value);
|
|
44
|
-
}
|
|
45
|
-
/** Add an item to the collection, no matter what the maxSize is. */ forceSet(key, value) {
|
|
46
|
-
return super.set(key, value);
|
|
47
|
-
}
|
|
48
|
-
/** Convert the collection to an array. */ array() {
|
|
49
|
-
return [
|
|
50
|
-
...this.values()
|
|
51
|
-
];
|
|
52
|
-
}
|
|
53
|
-
/** Retrieve the value of the first element in this collection. */ first() {
|
|
54
|
-
return this.values().next().value;
|
|
55
|
-
}
|
|
56
|
-
/** Retrieve the value of the last element in this collection. */ last() {
|
|
57
|
-
return [
|
|
58
|
-
...this.values()
|
|
59
|
-
][this.size - 1];
|
|
60
|
-
}
|
|
61
|
-
/** Retrieve the value of a random element in this collection. */ random() {
|
|
62
|
-
const array = [
|
|
63
|
-
...this.values()
|
|
64
|
-
];
|
|
65
|
-
return array[Math.floor(Math.random() * array.length)];
|
|
66
|
-
}
|
|
67
|
-
/** Find a specific element in this collection. */ find(callback) {
|
|
68
|
-
for (const key of this.keys()){
|
|
69
|
-
const value = this.get(key);
|
|
70
|
-
if (callback(value, key)) return value;
|
|
71
|
-
}
|
|
72
|
-
// If nothing matched
|
|
73
|
-
}
|
|
74
|
-
/** Find all elements in this collection that match the given pattern. */ filter(callback) {
|
|
75
|
-
const relevant = new Collection();
|
|
76
|
-
this.forEach((value, key)=>{
|
|
77
|
-
if (callback(value, key)) relevant.set(key, value);
|
|
78
|
-
});
|
|
79
|
-
return relevant;
|
|
80
|
-
}
|
|
81
|
-
/** Converts the collection into an array by running a callback on all items in the collection. */ map(callback) {
|
|
82
|
-
const results = [];
|
|
83
|
-
for (const key of this.keys()){
|
|
84
|
-
const value = this.get(key);
|
|
85
|
-
results.push(callback(value, key));
|
|
86
|
-
}
|
|
87
|
-
return results;
|
|
88
|
-
}
|
|
89
|
-
/** Check if one of the items in the collection matches the pattern. */ some(callback) {
|
|
90
|
-
for (const key of this.keys()){
|
|
91
|
-
const value = this.get(key);
|
|
92
|
-
if (callback(value, key)) return true;
|
|
93
|
-
}
|
|
94
|
-
return false;
|
|
95
|
-
}
|
|
96
|
-
/** Check if all of the items in the collection matches the pattern. */ every(callback) {
|
|
97
|
-
for (const key of this.keys()){
|
|
98
|
-
const value = this.get(key);
|
|
99
|
-
if (!callback(value, key)) return false;
|
|
100
|
-
}
|
|
101
|
-
return true;
|
|
102
|
-
}
|
|
103
|
-
/** Runs a callback on all items in the collection, merging them into a single value. */ reduce(callback, initialValue) {
|
|
104
|
-
let accumulator = initialValue;
|
|
105
|
-
for (const key of this.keys()){
|
|
106
|
-
const value = this.get(key);
|
|
107
|
-
accumulator = callback(accumulator, value, key);
|
|
108
|
-
}
|
|
109
|
-
return accumulator;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
//# sourceMappingURL=Collection.js.map
|
package/dist/Collection.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/Collection.ts"],"sourcesContent":["// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface PlaceHolderBot {}\n\nexport class Collection<K, V> extends Map<K, V> {\n /**\n * The maximum amount of items allowed in this collection. To disable cache, set it 0, set to undefined to make it infinite.\n * @default undefined\n */\n maxSize: number | undefined\n /** Handler to remove items from the collection every so often. */\n sweeper: (CollectionSweeper<K, V> & { intervalId?: NodeJS.Timer }) | undefined\n\n constructor(entries?: (ReadonlyArray<readonly [K, V]> | null) | Map<K, V>, options?: CollectionOptions<K, V>) {\n super(entries ?? [])\n\n this.maxSize = options?.maxSize\n\n if (!options?.sweeper) return\n\n this.startSweeper(options.sweeper)\n }\n\n startSweeper(options: CollectionSweeper<K, V>): NodeJS.Timer {\n if (this.sweeper?.intervalId) clearInterval(this.sweeper.intervalId)\n\n this.sweeper = options\n this.sweeper.intervalId = setInterval(() => {\n this.forEach((value, key) => {\n if (!this.sweeper?.filter(value, key, options.bot)) return\n\n this.delete(key)\n return key\n })\n }, options.interval)\n\n return this.sweeper.intervalId\n }\n\n stopSweeper(): void {\n return clearInterval(this.sweeper?.intervalId)\n }\n\n changeSweeperInterval(newInterval: number): void {\n if (this.sweeper == null) return\n\n this.startSweeper({ filter: this.sweeper.filter, interval: newInterval })\n }\n\n changeSweeperFilter(newFilter: (value: V, key: K, bot: PlaceHolderBot) => boolean): void {\n if (this.sweeper == null) return\n\n this.startSweeper({ filter: newFilter, interval: this.sweeper.interval })\n }\n\n /** Add an item to the collection. Makes sure not to go above the maxSize. */\n set(key: K, value: V): this {\n // When this collection is maxSized make sure we can add first\n if ((this.maxSize !== undefined || this.maxSize === 0) && this.size >= this.maxSize) {\n return this\n }\n\n return super.set(key, value)\n }\n\n /** Add an item to the collection, no matter what the maxSize is. */\n forceSet(key: K, value: V): this {\n return super.set(key, value)\n }\n\n /** Convert the collection to an array. */\n array(): V[] {\n return [...this.values()]\n }\n\n /** Retrieve the value of the first element in this collection. */\n first(): V | undefined {\n return this.values().next().value\n }\n\n /** Retrieve the value of the last element in this collection. */\n last(): V | undefined {\n return [...this.values()][this.size - 1]\n }\n\n /** Retrieve the value of a random element in this collection. */\n random(): V | undefined {\n const array = [...this.values()]\n return array[Math.floor(Math.random() * array.length)]\n }\n\n /** Find a specific element in this collection. */\n find(callback: (value: V, key: K) => boolean): NonNullable<V> | undefined {\n for (const key of this.keys()) {\n const value = this.get(key)!\n if (callback(value, key)) return value\n }\n // If nothing matched\n }\n\n /** Find all elements in this collection that match the given pattern. */\n filter(callback: (value: V, key: K) => boolean): Collection<K, V> {\n const relevant = new Collection<K, V>()\n this.forEach((value, key) => {\n if (callback(value, key)) relevant.set(key, value)\n })\n\n return relevant\n }\n\n /** Converts the collection into an array by running a callback on all items in the collection. */\n map<T>(callback: (value: V, key: K) => T): T[] {\n const results = []\n for (const key of this.keys()) {\n const value = this.get(key)!\n results.push(callback(value, key))\n }\n return results\n }\n\n /** Check if one of the items in the collection matches the pattern. */\n some(callback: (value: V, key: K) => boolean): boolean {\n for (const key of this.keys()) {\n const value = this.get(key)!\n if (callback(value, key)) return true\n }\n\n return false\n }\n\n /** Check if all of the items in the collection matches the pattern. */\n every(callback: (value: V, key: K) => boolean): boolean {\n for (const key of this.keys()) {\n const value = this.get(key)!\n if (!callback(value, key)) return false\n }\n\n return true\n }\n\n /** Runs a callback on all items in the collection, merging them into a single value. */\n reduce<T>(callback: (accumulator: T, value: V, key: K) => T, initialValue?: T): T {\n let accumulator: T = initialValue!\n\n for (const key of this.keys()) {\n const value = this.get(key)!\n accumulator = callback(accumulator, value, key)\n }\n\n return accumulator\n }\n}\n\nexport interface CollectionOptions<K, V> {\n /** Handler to clean out the items in the collection every so often. */\n sweeper?: CollectionSweeper<K, V>\n /** The maximum number of items allowed in the collection. */\n maxSize?: number\n}\n\nexport interface CollectionSweeper<K, V> {\n /** The filter to determine whether an element should be deleted or not */\n filter: (value: V, key: K, ...args: any[]) => boolean\n /** The interval in which the sweeper should run */\n interval: number\n /** The bot object itself */\n bot?: PlaceHolderBot\n}\n"],"names":["Collection","Map","constructor","entries","options","maxSize","sweeper","startSweeper","intervalId","clearInterval","setInterval","forEach","value","key","filter","bot","delete","interval","stopSweeper","changeSweeperInterval","newInterval","changeSweeperFilter","newFilter","set","undefined","size","forceSet","array","values","first","next","last","random","Math","floor","length","find","callback","keys","get","relevant","map","results","push","some","every","reduce","initialValue","accumulator"],"mappings":"AAAA,iEAAiE;AAGjE,OAAO,MAAMA,mBAAyBC;IASpCC,YAAYC,OAA6D,EAAEC,OAAiC,CAAE;QAC5G,KAAK,CAACD,WAAW,EAAE;QAEnB,IAAI,CAACE,OAAO,GAAGD,SAASC;QAExB,IAAI,CAACD,SAASE,SAAS;QAEvB,IAAI,CAACC,YAAY,CAACH,QAAQE,OAAO;IACnC;IAEAC,aAAaH,OAAgC,EAAgB;QAC3D,IAAI,IAAI,CAACE,OAAO,EAAEE,YAAYC,cAAc,IAAI,CAACH,OAAO,CAACE,UAAU;QAEnE,IAAI,CAACF,OAAO,GAAGF;QACf,IAAI,CAACE,OAAO,CAACE,UAAU,GAAGE,YAAY,IAAM;YAC1C,IAAI,CAACC,OAAO,CAAC,CAACC,OAAOC,MAAQ;gBAC3B,IAAI,CAAC,IAAI,CAACP,OAAO,EAAEQ,OAAOF,OAAOC,KAAKT,QAAQW,GAAG,GAAG;gBAEpD,IAAI,CAACC,MAAM,CAACH;gBACZ,OAAOA;YACT;QACF,GAAGT,QAAQa,QAAQ;QAEnB,OAAO,IAAI,CAACX,OAAO,CAACE,UAAU;IAChC;IAEAU,cAAoB;QAClB,OAAOT,cAAc,IAAI,CAACH,OAAO,EAAEE;IACrC;IAEAW,sBAAsBC,WAAmB,EAAQ;QAC/C,IAAI,IAAI,CAACd,OAAO,IAAI,IAAI,EAAE;QAE1B,IAAI,CAACC,YAAY,CAAC;YAAEO,QAAQ,IAAI,CAACR,OAAO,CAACQ,MAAM;YAAEG,UAAUG;QAAY;IACzE;IAEAC,oBAAoBC,SAA6D,EAAQ;QACvF,IAAI,IAAI,CAAChB,OAAO,IAAI,IAAI,EAAE;QAE1B,IAAI,CAACC,YAAY,CAAC;YAAEO,QAAQQ;YAAWL,UAAU,IAAI,CAACX,OAAO,CAACW,QAAQ;QAAC;IACzE;IAEA,2EAA2E,GAC3EM,IAAIV,GAAM,EAAED,KAAQ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AAU,CAuB/C"}
|
package/dist/base64.js
DELETED
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CREDIT: https://gist.github.com/enepomnyaschih/72c423f727d395eeaa09697058238727
|
|
3
|
-
* Encodes a given Uint8Array, ArrayBuffer or string into RFC4648 base64 representation
|
|
4
|
-
* @param data
|
|
5
|
-
*/ export function encode(data) {
|
|
6
|
-
const uint8 = typeof data === 'string' ? new TextEncoder().encode(data) : data instanceof Uint8Array ? data : new Uint8Array(data);
|
|
7
|
-
let result = '';
|
|
8
|
-
let i;
|
|
9
|
-
const l = uint8.length;
|
|
10
|
-
for(i = 2; i < l; i += 3){
|
|
11
|
-
result += base64abc[uint8[i - 2] >> 2];
|
|
12
|
-
result += base64abc[(uint8[i - 2] & 0x03) << 4 | uint8[i - 1] >> 4];
|
|
13
|
-
result += base64abc[(uint8[i - 1] & 0x0f) << 2 | uint8[i] >> 6];
|
|
14
|
-
result += base64abc[uint8[i] & 0x3f];
|
|
15
|
-
}
|
|
16
|
-
if (i === l + 1) {
|
|
17
|
-
// 1 octet yet to write
|
|
18
|
-
result += base64abc[uint8[i - 2] >> 2];
|
|
19
|
-
result += base64abc[(uint8[i - 2] & 0x03) << 4];
|
|
20
|
-
result += '==';
|
|
21
|
-
}
|
|
22
|
-
if (i === l) {
|
|
23
|
-
// 2 octets yet to write
|
|
24
|
-
result += base64abc[uint8[i - 2] >> 2];
|
|
25
|
-
result += base64abc[(uint8[i - 2] & 0x03) << 4 | uint8[i - 1] >> 4];
|
|
26
|
-
result += base64abc[(uint8[i - 1] & 0x0f) << 2];
|
|
27
|
-
result += '=';
|
|
28
|
-
}
|
|
29
|
-
return result;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* CREDIT: https://gist.github.com/enepomnyaschih/72c423f727d395eeaa09697058238727
|
|
33
|
-
* Decodes RFC4648 base64 string into an Uint8Array
|
|
34
|
-
* @param data
|
|
35
|
-
*/ export function decode(data) {
|
|
36
|
-
if (data.length % 4 !== 0) {
|
|
37
|
-
throw new Error('Unable to parse base64 string.');
|
|
38
|
-
}
|
|
39
|
-
const index = data.indexOf('=');
|
|
40
|
-
if (index !== -1 && index < data.length - 2) {
|
|
41
|
-
throw new Error('Unable to parse base64 string.');
|
|
42
|
-
}
|
|
43
|
-
const missingOctets = data.endsWith('==') ? 2 : data.endsWith('=') ? 1 : 0;
|
|
44
|
-
const n = data.length;
|
|
45
|
-
const result = new Uint8Array(3 * (n / 4));
|
|
46
|
-
let buffer;
|
|
47
|
-
for(let i = 0, j = 0; i < n; i += 4, j += 3){
|
|
48
|
-
buffer = getBase64Code(data.charCodeAt(i)) << 18 | getBase64Code(data.charCodeAt(i + 1)) << 12 | getBase64Code(data.charCodeAt(i + 2)) << 6 | getBase64Code(data.charCodeAt(i + 3));
|
|
49
|
-
result[j] = buffer >> 16;
|
|
50
|
-
result[j + 1] = buffer >> 8 & 0xff;
|
|
51
|
-
result[j + 2] = buffer & 0xff;
|
|
52
|
-
}
|
|
53
|
-
return result.subarray(0, result.length - missingOctets);
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* CREDIT: https://gist.github.com/enepomnyaschih/72c423f727d395eeaa09697058238727
|
|
57
|
-
* @param charCode
|
|
58
|
-
*/ function getBase64Code(charCode) {
|
|
59
|
-
if (charCode >= base64codes.length) {
|
|
60
|
-
throw new Error('Unable to parse base64 string.');
|
|
61
|
-
}
|
|
62
|
-
const code = base64codes[charCode];
|
|
63
|
-
if (code === 255) {
|
|
64
|
-
throw new Error('Unable to parse base64 string.');
|
|
65
|
-
}
|
|
66
|
-
return code;
|
|
67
|
-
}
|
|
68
|
-
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
|
|
69
|
-
const base64abc = [
|
|
70
|
-
'A',
|
|
71
|
-
'B',
|
|
72
|
-
'C',
|
|
73
|
-
'D',
|
|
74
|
-
'E',
|
|
75
|
-
'F',
|
|
76
|
-
'G',
|
|
77
|
-
'H',
|
|
78
|
-
'I',
|
|
79
|
-
'J',
|
|
80
|
-
'K',
|
|
81
|
-
'L',
|
|
82
|
-
'M',
|
|
83
|
-
'N',
|
|
84
|
-
'O',
|
|
85
|
-
'P',
|
|
86
|
-
'Q',
|
|
87
|
-
'R',
|
|
88
|
-
'S',
|
|
89
|
-
'T',
|
|
90
|
-
'U',
|
|
91
|
-
'V',
|
|
92
|
-
'W',
|
|
93
|
-
'X',
|
|
94
|
-
'Y',
|
|
95
|
-
'Z',
|
|
96
|
-
'a',
|
|
97
|
-
'b',
|
|
98
|
-
'c',
|
|
99
|
-
'd',
|
|
100
|
-
'e',
|
|
101
|
-
'f',
|
|
102
|
-
'g',
|
|
103
|
-
'h',
|
|
104
|
-
'i',
|
|
105
|
-
'j',
|
|
106
|
-
'k',
|
|
107
|
-
'l',
|
|
108
|
-
'm',
|
|
109
|
-
'n',
|
|
110
|
-
'o',
|
|
111
|
-
'p',
|
|
112
|
-
'q',
|
|
113
|
-
'r',
|
|
114
|
-
's',
|
|
115
|
-
't',
|
|
116
|
-
'u',
|
|
117
|
-
'v',
|
|
118
|
-
'w',
|
|
119
|
-
'x',
|
|
120
|
-
'y',
|
|
121
|
-
'z',
|
|
122
|
-
'0',
|
|
123
|
-
'1',
|
|
124
|
-
'2',
|
|
125
|
-
'3',
|
|
126
|
-
'4',
|
|
127
|
-
'5',
|
|
128
|
-
'6',
|
|
129
|
-
'7',
|
|
130
|
-
'8',
|
|
131
|
-
'9',
|
|
132
|
-
'+',
|
|
133
|
-
'/'
|
|
134
|
-
];
|
|
135
|
-
// CREDIT: https://gist.github.com/enepomnyaschih/72c423f727d395eeaa09697058238727
|
|
136
|
-
const base64codes = [
|
|
137
|
-
255,
|
|
138
|
-
255,
|
|
139
|
-
255,
|
|
140
|
-
255,
|
|
141
|
-
255,
|
|
142
|
-
255,
|
|
143
|
-
255,
|
|
144
|
-
255,
|
|
145
|
-
255,
|
|
146
|
-
255,
|
|
147
|
-
255,
|
|
148
|
-
255,
|
|
149
|
-
255,
|
|
150
|
-
255,
|
|
151
|
-
255,
|
|
152
|
-
255,
|
|
153
|
-
255,
|
|
154
|
-
255,
|
|
155
|
-
255,
|
|
156
|
-
255,
|
|
157
|
-
255,
|
|
158
|
-
255,
|
|
159
|
-
255,
|
|
160
|
-
255,
|
|
161
|
-
255,
|
|
162
|
-
255,
|
|
163
|
-
255,
|
|
164
|
-
255,
|
|
165
|
-
255,
|
|
166
|
-
255,
|
|
167
|
-
255,
|
|
168
|
-
255,
|
|
169
|
-
255,
|
|
170
|
-
255,
|
|
171
|
-
255,
|
|
172
|
-
255,
|
|
173
|
-
255,
|
|
174
|
-
255,
|
|
175
|
-
255,
|
|
176
|
-
255,
|
|
177
|
-
255,
|
|
178
|
-
255,
|
|
179
|
-
255,
|
|
180
|
-
62,
|
|
181
|
-
255,
|
|
182
|
-
255,
|
|
183
|
-
255,
|
|
184
|
-
63,
|
|
185
|
-
52,
|
|
186
|
-
53,
|
|
187
|
-
54,
|
|
188
|
-
55,
|
|
189
|
-
56,
|
|
190
|
-
57,
|
|
191
|
-
58,
|
|
192
|
-
59,
|
|
193
|
-
60,
|
|
194
|
-
61,
|
|
195
|
-
255,
|
|
196
|
-
255,
|
|
197
|
-
255,
|
|
198
|
-
0,
|
|
199
|
-
255,
|
|
200
|
-
255,
|
|
201
|
-
255,
|
|
202
|
-
0,
|
|
203
|
-
1,
|
|
204
|
-
2,
|
|
205
|
-
3,
|
|
206
|
-
4,
|
|
207
|
-
5,
|
|
208
|
-
6,
|
|
209
|
-
7,
|
|
210
|
-
8,
|
|
211
|
-
9,
|
|
212
|
-
10,
|
|
213
|
-
11,
|
|
214
|
-
12,
|
|
215
|
-
13,
|
|
216
|
-
14,
|
|
217
|
-
15,
|
|
218
|
-
16,
|
|
219
|
-
17,
|
|
220
|
-
18,
|
|
221
|
-
19,
|
|
222
|
-
20,
|
|
223
|
-
21,
|
|
224
|
-
22,
|
|
225
|
-
23,
|
|
226
|
-
24,
|
|
227
|
-
25,
|
|
228
|
-
255,
|
|
229
|
-
255,
|
|
230
|
-
255,
|
|
231
|
-
255,
|
|
232
|
-
255,
|
|
233
|
-
255,
|
|
234
|
-
26,
|
|
235
|
-
27,
|
|
236
|
-
28,
|
|
237
|
-
29,
|
|
238
|
-
30,
|
|
239
|
-
31,
|
|
240
|
-
32,
|
|
241
|
-
33,
|
|
242
|
-
34,
|
|
243
|
-
35,
|
|
244
|
-
36,
|
|
245
|
-
37,
|
|
246
|
-
38,
|
|
247
|
-
39,
|
|
248
|
-
40,
|
|
249
|
-
41,
|
|
250
|
-
42,
|
|
251
|
-
43,
|
|
252
|
-
44,
|
|
253
|
-
45,
|
|
254
|
-
46,
|
|
255
|
-
47,
|
|
256
|
-
48,
|
|
257
|
-
49,
|
|
258
|
-
50,
|
|
259
|
-
51
|
|
260
|
-
];
|
|
261
|
-
|
|
262
|
-
//# sourceMappingURL=base64.js.map
|
package/dist/base64.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/base64.ts"],"sourcesContent":["/**\n * CREDIT: https://gist.github.com/enepomnyaschih/72c423f727d395eeaa09697058238727\n * Encodes a given Uint8Array, ArrayBuffer or string into RFC4648 base64 representation\n * @param data\n */\nexport function encode(data: ArrayBuffer | string): string {\n const uint8 = typeof data === 'string' ? new TextEncoder().encode(data) : data instanceof Uint8Array ? data : new Uint8Array(data)\n let result = ''\n let i\n const l = uint8.length\n for (i = 2; i < l; i += 3) {\n result += base64abc[uint8[i - 2] >> 2]\n result += base64abc[((uint8[i - 2] & 0x03) << 4) | (uint8[i - 1] >> 4)]\n result += base64abc[((uint8[i - 1] & 0x0f) << 2) | (uint8[i] >> 6)]\n result += base64abc[uint8[i] & 0x3f]\n }\n if (i === l + 1) {\n // 1 octet yet to write\n result += base64abc[uint8[i - 2] >> 2]\n result += base64abc[(uint8[i - 2] & 0x03) << 4]\n result += '=='\n }\n if (i === l) {\n // 2 octets yet to write\n result += base64abc[uint8[i - 2] >> 2]\n result += base64abc[((uint8[i - 2] & 0x03) << 4) | (uint8[i - 1] >> 4)]\n result += base64abc[(uint8[i - 1] & 0x0f) << 2]\n result += '='\n }\n return result\n}\n\n/**\n * CREDIT: https://gist.github.com/enepomnyaschih/72c423f727d395eeaa09697058238727\n * Decodes RFC4648 base64 string into an Uint8Array\n * @param data\n */\nexport function decode(data: string): Uint8Array {\n if (data.length % 4 !== 0) {\n throw new Error('Unable to parse base64 string.')\n }\n const index = data.indexOf('=')\n if (index !== -1 && index < data.length - 2) {\n throw new Error('Unable to parse base64 string.')\n }\n const missingOctets = data.endsWith('==') ? 2 : data.endsWith('=') ? 1 : 0\n const n = data.length\n const result = new Uint8Array(3 * (n / 4))\n let buffer\n for (let i = 0, j = 0; i < n; i += 4, j += 3) {\n buffer =\n (getBase64Code(data.charCodeAt(i)) << 18) |\n (getBase64Code(data.charCodeAt(i + 1)) << 12) |\n (getBase64Code(data.charCodeAt(i + 2)) << 6) |\n getBase64Code(data.charCodeAt(i + 3))\n result[j] = buffer >> 16\n result[j + 1] = (buffer >> 8) & 0xff\n result[j + 2] = buffer & 0xff\n }\n return result.subarray(0, result.length - missingOctets)\n}\n\n/**\n * CREDIT: https://gist.github.com/enepomnyaschih/72c423f727d395eeaa09697058238727\n * @param charCode\n */\nfunction getBase64Code(charCode: number): number {\n if (charCode >= base64codes.length) {\n throw new Error('Unable to parse base64 string.')\n }\n const code = base64codes[charCode]\n if (code === 255) {\n throw new Error('Unable to parse base64 string.')\n }\n return code\n}\n\n// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.\nconst base64abc = [\n 'A',\n 'B',\n 'C',\n 'D',\n 'E',\n 'F',\n 'G',\n 'H',\n 'I',\n 'J',\n 'K',\n 'L',\n 'M',\n 'N',\n 'O',\n 'P',\n 'Q',\n 'R',\n 'S',\n 'T',\n 'U',\n 'V',\n 'W',\n 'X',\n 'Y',\n 'Z',\n 'a',\n 'b',\n 'c',\n 'd',\n 'e',\n 'f',\n 'g',\n 'h',\n 'i',\n 'j',\n 'k',\n 'l',\n 'm',\n 'n',\n 'o',\n 'p',\n 'q',\n 'r',\n 's',\n 't',\n 'u',\n 'v',\n 'w',\n 'x',\n 'y',\n 'z',\n '0',\n '1',\n '2',\n '3',\n '4',\n '5',\n '6',\n '7',\n '8',\n '9',\n '+',\n '/',\n]\n\n// CREDIT: https://gist.github.com/enepomnyaschih/72c423f727d395eeaa09697058238727\nconst base64codes = [\n 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,\n 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 62, 255, 255, 255, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 255, 255, 255,\n 0, 255, 255, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 255, 255, 255, 255, 255, 255, 26,\n 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,\n]\n"],"names":["encode","data","uint8","TextEncoder","Uint8Array","result","i","l","length","base64abc","decode","Error","index","indexOf","missingOctets","endsWith","n","buffer","j","getBase64Code","charCodeAt","subarray","charCode","base64codes","code"],"mappings":"AAAA;;;;CAIC,GACD,OAAO,SAASA,OAAOC,IAA0B,EAAU;IACzD,MAAMC,QAAQ,OAAOD,SAAS,WAAW,IAAIE,cAAcH,MAAM,CAACC,QAAQA,gBAAgBG,aAAaH,OAAO,IAAIG,WAAWH,KAAK;IAClI,IAAII,SAAS;IACb,IAAIC;IACJ,MAAMC,IAAIL,MAAMM,MAAM;IACtB,IAAKF,IAAI,GAAGA,IAAIC,GAAGD,KAAK,EAAG;QACzBD,UAAUI,SAAS,CAACP,KAAK,CAACI,IAAI,EAAE,IAAI,EAAE;QACtCD,UAAUI,SAAS,CAAC,AAA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UAAU,EAAE,OAAO,CAAQ;IAC3B,oFAAoF;IACpF,SAAS,CAAC,EAAE,MAAM,CAAC,OAAO,CAAA;IAC1B,uEAAuE;IACvE,SAAS,CAAC,EAAE,MAAM,CAAA;gBAEN,OAAO,CAAC,EAAE,kBAAkB;IAMxC,gDAAgD;IAChD,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,oCAAoC;IACpC,YAAY,IAAI,IAAI;IAgBpB,kCAAkC;IAC5B,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IA0CnC,sEAAsE;IAChE,OAAO,CAAC,YAAY,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAWrD;AAED,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB"}
|
package/dist/bucket.js
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import logger from './logger.js';
|
|
2
|
-
import { delay } from './utils.js';
|
|
3
|
-
export class LeakyBucket {
|
|
4
|
-
constructor(options){
|
|
5
|
-
/** The amount of requests that have been used up already. */ this.used = 0;
|
|
6
|
-
/** The queue of requests to acquire an available request. Mapped by <shardId, resolve()> */ this.queue = [];
|
|
7
|
-
/** Whether or not the queue is already processing. */ this.processing = false;
|
|
8
|
-
this.max = options?.max ?? 1;
|
|
9
|
-
this.refillAmount = options?.refillAmount ? options.refillAmount > this.max ? this.max : options.refillAmount : 1;
|
|
10
|
-
this.refillInterval = options?.refillInterval ?? 5000;
|
|
11
|
-
}
|
|
12
|
-
/** The amount of requests that still remain. */ get remaining() {
|
|
13
|
-
return this.max < this.used ? 0 : this.max - this.used;
|
|
14
|
-
}
|
|
15
|
-
/** Refills the bucket as needed. */ refillBucket() {
|
|
16
|
-
logger.debug(`[LeakyBucket] Timeout for leaky bucket requests executed. Refilling bucket.`);
|
|
17
|
-
// Lower the used amount by the refill amount
|
|
18
|
-
this.used = this.refillAmount > this.used ? 0 : this.used - this.refillAmount;
|
|
19
|
-
// Reset the refillsAt timestamp since it just got refilled
|
|
20
|
-
this.refillsAt = undefined;
|
|
21
|
-
if (this.used > 0) {
|
|
22
|
-
if (this.timeoutId) clearTimeout(this.timeoutId);
|
|
23
|
-
this.timeoutId = setTimeout(()=>{
|
|
24
|
-
this.refillBucket();
|
|
25
|
-
}, this.refillInterval);
|
|
26
|
-
this.refillsAt = Date.now() + this.refillInterval;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
/** Begin processing the queue. */ async processQueue() {
|
|
30
|
-
logger.debug('[Gateway] Processing queue');
|
|
31
|
-
// There is already a queue that is processing
|
|
32
|
-
if (this.processing) return logger.debug('[Gateway] Queue is already processing.');
|
|
33
|
-
// Begin going through the queue.
|
|
34
|
-
while(this.queue.length){
|
|
35
|
-
if (this.remaining) {
|
|
36
|
-
logger.debug(`[LeakyBucket] Processing queue. Remaining: ${this.remaining} Length: ${this.queue.length}`);
|
|
37
|
-
// Resolves the promise allowing the paused execution of this request to resolve and continue.
|
|
38
|
-
this.queue.shift()?.();
|
|
39
|
-
// A request can be made
|
|
40
|
-
this.used++;
|
|
41
|
-
// Create a new timeout for this request if none exists.
|
|
42
|
-
if (!this.timeoutId) {
|
|
43
|
-
logger.debug(`[LeakyBucket] Creating new timeout for leaky bucket requests.`);
|
|
44
|
-
this.timeoutId = setTimeout(()=>{
|
|
45
|
-
this.refillBucket();
|
|
46
|
-
}, this.refillInterval);
|
|
47
|
-
// Set the time for when this refill will occur.
|
|
48
|
-
this.refillsAt = Date.now() + this.refillInterval;
|
|
49
|
-
}
|
|
50
|
-
} else if (this.refillsAt) {
|
|
51
|
-
const now = Date.now();
|
|
52
|
-
// If there is time left until next refill, just delay execution.
|
|
53
|
-
if (this.refillsAt > now) {
|
|
54
|
-
logger.debug(`[LeakyBucket] Delaying execution of leaky bucket requests for ${this.refillsAt - now}ms`);
|
|
55
|
-
await delay(this.refillsAt - now);
|
|
56
|
-
logger.debug(`[LeakyBucket] Resuming execution`);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
// Loop has ended mark false so it can restart later when needed
|
|
61
|
-
this.processing = false;
|
|
62
|
-
}
|
|
63
|
-
/** Pauses the execution until the request is available to be made. */ async acquire(highPriority) {
|
|
64
|
-
return await new Promise((resolve)=>{
|
|
65
|
-
// High priority requests get added to the start of the queue
|
|
66
|
-
if (highPriority) this.queue.unshift(resolve);
|
|
67
|
-
else this.queue.push(resolve);
|
|
68
|
-
// Each request should trigger the queue to be processesd.
|
|
69
|
-
void this.processQueue();
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
//# sourceMappingURL=bucket.js.map
|
package/dist/bucket.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/bucket.ts"],"sourcesContent":["import logger from './logger.js'\nimport { delay } from './utils.js'\n\nexport class LeakyBucket implements LeakyBucketOptions {\n max: number\n refillInterval: number\n refillAmount: number\n\n /** The amount of requests that have been used up already. */\n used: number = 0\n /** The queue of requests to acquire an available request. Mapped by <shardId, resolve()> */\n queue: Array<(value: void | PromiseLike<void>) => void> = []\n /** Whether or not the queue is already processing. */\n processing: boolean = false\n /** The timeout id for the timer to reduce the used amount by the refill amount. */\n timeoutId?: NodeJS.Timeout\n /** The timestamp in milliseconds when the next refill is scheduled. */\n refillsAt?: number\n\n constructor(options?: LeakyBucketOptions) {\n this.max = options?.max ?? 1\n this.refillAmount = options?.refillAmount ? (options.refillAmount > this.max ? this.max : options.refillAmount) : 1\n this.refillInterval = options?.refillInterval ?? 5000\n }\n\n /** The amount of requests that still remain. */\n get remaining(): number {\n return this.max < this.used ? 0 : this.max - this.used\n }\n\n /** Refills the bucket as needed. */\n refillBucket(): void {\n logger.debug(`[LeakyBucket] Timeout for leaky bucket requests executed. Refilling bucket.`)\n // Lower the used amount by the refill amount\n this.used = this.refillAmount > this.used ? 0 : this.used - this.refillAmount\n // Reset the refillsAt timestamp since it just got refilled\n this.refillsAt = undefined\n\n if (this.used > 0) {\n if (this.timeoutId) clearTimeout(this.timeoutId)\n this.timeoutId = setTimeout(() => {\n this.refillBucket()\n }, this.refillInterval)\n this.refillsAt = Date.now() + this.refillInterval\n }\n }\n\n /** Begin processing the queue. */\n async processQueue(): Promise<void> {\n logger.debug('[Gateway] Processing queue')\n // There is already a queue that is processing\n if (this.processing) return logger.debug('[Gateway] Queue is already processing.')\n\n // Begin going through the queue.\n while (this.queue.length) {\n if (this.remaining) {\n logger.debug(`[LeakyBucket] Processing queue. Remaining: ${this.remaining} Length: ${this.queue.length}`)\n // Resolves the promise allowing the paused execution of this request to resolve and continue.\n this.queue.shift()?.()\n // A request can be made\n this.used++\n\n // Create a new timeout for this request if none exists.\n if (!this.timeoutId) {\n logger.debug(`[LeakyBucket] Creating new timeout for leaky bucket requests.`)\n\n this.timeoutId = setTimeout(() => {\n this.refillBucket()\n }, this.refillInterval)\n // Set the time for when this refill will occur.\n this.refillsAt = Date.now() + this.refillInterval\n }\n }\n\n // Check if a refill is scheduled, since we have used up all available requests\n else if (this.refillsAt) {\n const now = Date.now()\n // If there is time left until next refill, just delay execution.\n if (this.refillsAt > now) {\n logger.debug(`[LeakyBucket] Delaying execution of leaky bucket requests for ${this.refillsAt - now}ms`)\n await delay(this.refillsAt - now)\n logger.debug(`[LeakyBucket] Resuming execution`)\n }\n }\n }\n\n // Loop has ended mark false so it can restart later when needed\n this.processing = false\n }\n\n /** Pauses the execution until the request is available to be made. */\n async acquire(highPriority?: boolean): Promise<void> {\n return await new Promise((resolve) => {\n // High priority requests get added to the start of the queue\n if (highPriority) this.queue.unshift(resolve)\n // All other requests get pushed to the end.\n else this.queue.push(resolve)\n\n // Each request should trigger the queue to be processesd.\n void this.processQueue()\n })\n }\n}\n\nexport interface LeakyBucketOptions {\n /**\n * Max requests allowed at once.\n * @default 1\n */\n max?: number\n /**\n * Interval in milliseconds between refills.\n * @default 5000\n */\n refillInterval?: number\n /**\n * Amount of requests to refill at each interval.\n * @default 1\n */\n refillAmount?: number\n}\n"],"names":["logger","delay","LeakyBucket","constructor","options","used","queue","processing","max","refillAmount","refillInterval","remaining","refillBucket","debug","refillsAt","undefined","timeoutId","clearTimeout","setTimeout","Date","now","processQueue","length","shift","acquire","highPriority","Promise","resolve","unshift","push"],"mappings":"AAAA,OAAOA,YAAY,cAAa;AAChC,SAASC,KAAK,QAAQ,aAAY;AAElC,OAAO,MAAMC;IAgBXC,YAAYC,OAA4B,CAAE;QAX1C,2DAA2D,QAC3DC,OAAe;QACf,0FAA0F,QAC1FC,QAA0D,EAAE;QAC5D,oDAAoD,QACpDC,aAAsB,KAAK;QAOzB,IAAI,CAACC,GAAG,GAAGJ,SAASI,OAAO;QAC3B,IAAI,CAACC,YAAY,GAAGL,SAASK,eAAgBL,QAAQK,YAAY,GAAG,IAAI,CAACD,GAAG,GAAG,IAAI,CAACA,GAAG,GAAGJ,QAAQK,YAAY,GAAI,CAAC;QACnH,IAAI,CAACC,cAAc,GAAGN,SAASM,kBAAkB;IACnD;IAEA,8CAA8C,GAC9C,IAAIC,YAAoB;QACtB,OAAO,IAAI,CAACH,GAAG,GAAG,IAAI,CAACH,IAAI,GAAG,IAAI,IAAI,CAACG,GAAG,GAAG,IAAI,CAACH,IAAI;IACxD;IAEA,kCAAkC,GAClCO,eAAqB;QACnBZ,OAAOa,KAAK,CAAC,CAAC,2EAA2E,CAAC;QAC1F,6CAA6C;QAC7C,IAAI,CAACR,IAAI,GAAG,IAAI,CAACI,YAAY,GAAG,IAAI,CAACJ,IAAI,GAAG,IAAI,IAAI,CAACA,IAAI,GAAG,IAAI,CAACI,YAAY;QAC7E,2DAA2D;QAC3D,IAAI,CAACK,SAAS,GAAGC;QAEjB,IAAI,IAAI,CAACV,IAAI,GAAG,GAAG;YACjB,IAAI,IAAI,CAAC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tG,MAAMnB,MAAM,IAAI,CAACa,SAAS,GAAGM;oBAC7BpB,OAAOa,KAAK,CAAC,CAAC,gCAAgC,CAAC;gBACjD,CAAC;YACH,CAAC;QACH;QAEA,gEAAgE;QAChE,IAAI,CAACN,UAAU,GAAG,KAAK;IACzB;IAEA,oEAAoE,GACpE,MAAMiB,QAAQC,YAAsB,EAAiB;QACnD,OAAO,MAAM,IAAIC,QAAQ,CAACC,UAAY;YACpC,6DAA6D;YAC7D,IAAIF,cAAc,IAAI,CAACnB,KAAK,CAACsB,OAAO,CAACD;iBAEhC,IAAI,CAACrB,KAAK,CAACuB,IAAI,CAACF;YAErB,0DAA0D;YAC1D,KAAK,IAAI,CAACN,YAAY;QACxB;IACF;AACF,CAAC"}
|
package/dist/casing.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"casing.d.ts","sourceRoot":"","sources":["../src/casing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAE5D,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAclD;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAcpD;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAepD;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAapD"}
|
package/dist/casing.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
export function camelize(object) {
|
|
2
|
-
if (Array.isArray(object)) {
|
|
3
|
-
return object.map((element)=>camelize(element));
|
|
4
|
-
}
|
|
5
|
-
if (typeof object === 'object' && object !== null) {
|
|
6
|
-
const obj = {};
|
|
7
|
-
Object.keys(object).forEach((key)=>{
|
|
8
|
-
obj[snakeToCamelCase(key)] = camelize(object[key]);
|
|
9
|
-
});
|
|
10
|
-
return obj;
|
|
11
|
-
}
|
|
12
|
-
return object;
|
|
13
|
-
}
|
|
14
|
-
export function snakelize(object) {
|
|
15
|
-
if (Array.isArray(object)) {
|
|
16
|
-
return object.map((element)=>snakelize(element));
|
|
17
|
-
}
|
|
18
|
-
if (typeof object === 'object' && object !== null) {
|
|
19
|
-
const obj = {};
|
|
20
|
-
Object.keys(object).forEach((key)=>{
|
|
21
|
-
obj[camelToSnakeCase(key)] = snakelize(object[key]);
|
|
22
|
-
});
|
|
23
|
-
return obj;
|
|
24
|
-
}
|
|
25
|
-
return object;
|
|
26
|
-
}
|
|
27
|
-
export function snakeToCamelCase(str) {
|
|
28
|
-
if (!str.includes('_')) return str;
|
|
29
|
-
let result = '';
|
|
30
|
-
for(let i = 0, len = str.length; i < len; ++i){
|
|
31
|
-
if (str[i] === '_') {
|
|
32
|
-
result += str[++i].toUpperCase();
|
|
33
|
-
continue;
|
|
34
|
-
}
|
|
35
|
-
result += str[i];
|
|
36
|
-
}
|
|
37
|
-
return result;
|
|
38
|
-
}
|
|
39
|
-
export function camelToSnakeCase(str) {
|
|
40
|
-
let result = '';
|
|
41
|
-
for(let i = 0, len = str.length; i < len; ++i){
|
|
42
|
-
if (str[i] >= 'A' && str[i] <= 'Z') {
|
|
43
|
-
result += `_${str[i].toLowerCase()}`;
|
|
44
|
-
continue;
|
|
45
|
-
}
|
|
46
|
-
result += str[i];
|
|
47
|
-
}
|
|
48
|
-
return result;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
//# sourceMappingURL=casing.js.map
|
package/dist/casing.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/casing.ts"],"sourcesContent":["import type { Camelize, Snakelize } from '@discordeno/types'\n\nexport function camelize<T>(object: T): Camelize<T> {\n if (Array.isArray(object)) {\n return object.map((element) => camelize(element)) as Camelize<T>\n }\n\n if (typeof object === 'object' && object !== null) {\n const obj = {} as Camelize<T>\n ;(Object.keys(object) as Array<keyof T>).forEach((key) => {\n // @ts-expect-error js hack\n ;(obj[snakeToCamelCase(key)] as Camelize<(T & object)[keyof T]>) = camelize(object[key])\n })\n return obj\n }\n return object as Camelize<T>\n}\n\nexport function snakelize<T>(object: T): Snakelize<T> {\n if (Array.isArray(object)) {\n return object.map((element) => snakelize(element)) as Snakelize<T>\n }\n\n if (typeof object === 'object' && object !== null) {\n const obj = {} as Snakelize<T>\n ;(Object.keys(object) as Array<keyof T>).forEach((key) => {\n // @ts-expect-error js hack\n ;(obj[camelToSnakeCase(key)] as Snakelize<(T & object)[keyof T]>) = snakelize(object[key])\n })\n return obj\n }\n return object as Snakelize<T>\n}\n\nexport function snakeToCamelCase(str: string): string {\n if (!str.includes('_')) return str\n\n let result = ''\n for (let i = 0, len = str.length; i < len; ++i) {\n if (str[i] === '_') {\n result += str[++i].toUpperCase()\n\n continue\n }\n\n result += str[i]\n }\n\n return result\n}\n\nexport function camelToSnakeCase(str: string): string {\n let result = ''\n for (let i = 0, len = str.length; i < len; ++i) {\n if (str[i] >= 'A' && str[i] <= 'Z') {\n result += `_${str[i].toLowerCase()}`\n\n continue\n }\n\n result += str[i]\n }\n\n return result\n}\n"],"names":["camelize","object","Array","isArray","map","element","obj","Object","keys","forEach","key","snakeToCamelCase","snakelize","camelToSnakeCase","str","includes","result","i","len","length","toUpperCase","toLowerCase"],"mappings":"AAEA,OAAO,SAASA,SAAYC,MAAS,EAAe;IAClD,IAAIC,MAAMC,OAAO,CAACF,SAAS;QACzB,OAAOA,OAAOG,GAAG,CAAC,CAACC,UAAYL,SAASK;IAC1C,CAAC;IAED,IAAI,OAAOJ,WAAW,YAAYA,WAAW,IAAI,EAAE;QACjD,MAAMK,MAAM,CAAC;QACXC,OAAOC,IAAI,CAACP,QAA2BQ,OAAO,CAAC,CAACC,MAAQ;YAEtDJ,GAAG,CAACK,iBAAiBD,KAAK,GAAuCV,SAASC,MAAM,CAACS,IAAI;QAC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