@chainfuse/helpers 4.3.0 → 4.4.1
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/dist/common.d.mts +0 -16
- package/dist/common.mjs +0 -20
- package/package.json +4 -4
package/dist/common.d.mts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import type { Request as CfRequest, WorkerVersionMetadata } from '@cloudflare/workers-types/experimental';
|
|
2
1
|
import type { Chalk } from 'chalk';
|
|
3
|
-
interface QwikCityPlatform<R extends CfRequest | Request = CfRequest | Request> {
|
|
4
|
-
request?: R;
|
|
5
|
-
}
|
|
6
2
|
export declare class Helpers {
|
|
7
3
|
/**
|
|
8
4
|
* Generates a unique RGB color based unique to the provided string ID. The RGB values are clamped to a range that ensures the resulting color is legible
|
|
@@ -21,17 +17,6 @@ export declare class Helpers {
|
|
|
21
17
|
*/
|
|
22
18
|
static getFulfilledResults<T extends unknown>(promises: PromiseLike<T>[]): Promise<Awaited<T>[]>;
|
|
23
19
|
static areArraysEqual<T>(array1: T[], array2: T[]): boolean;
|
|
24
|
-
private static isWorkerVersionMetadata;
|
|
25
|
-
/**
|
|
26
|
-
* Determines if the provided object is running local based on its type and properties.
|
|
27
|
-
*
|
|
28
|
-
* For `WorkerVersionMetadata`, it checks if the `timestamp` property is absent.
|
|
29
|
-
* For `QwikCityPlatform`, it checks if the `request` property is absent.
|
|
30
|
-
*
|
|
31
|
-
* @param metadataOrPlatform - The object to evaluate, which can be either `WorkerVersionMetadata` or `QwikCityPlatform`.
|
|
32
|
-
* @returns `true` if the running local, otherwise `false`.
|
|
33
|
-
*/
|
|
34
|
-
static isLocal<P extends QwikCityPlatform>(metadataOrPlatform: WorkerVersionMetadata | P): boolean;
|
|
35
20
|
/**
|
|
36
21
|
* Pauses execution for a specified number of milliseconds.
|
|
37
22
|
*
|
|
@@ -50,4 +35,3 @@ export declare class Helpers {
|
|
|
50
35
|
*/
|
|
51
36
|
static replaceByIndex(input: string, start: number, end: number, replacement: string): string;
|
|
52
37
|
}
|
|
53
|
-
export {};
|
package/dist/common.mjs
CHANGED
|
@@ -68,26 +68,6 @@ export class Helpers {
|
|
|
68
68
|
}
|
|
69
69
|
return true;
|
|
70
70
|
}
|
|
71
|
-
static isWorkerVersionMetadata(metadata) {
|
|
72
|
-
return 'id' in metadata;
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* Determines if the provided object is running local based on its type and properties.
|
|
76
|
-
*
|
|
77
|
-
* For `WorkerVersionMetadata`, it checks if the `timestamp` property is absent.
|
|
78
|
-
* For `QwikCityPlatform`, it checks if the `request` property is absent.
|
|
79
|
-
*
|
|
80
|
-
* @param metadataOrPlatform - The object to evaluate, which can be either `WorkerVersionMetadata` or `QwikCityPlatform`.
|
|
81
|
-
* @returns `true` if the running local, otherwise `false`.
|
|
82
|
-
*/
|
|
83
|
-
static isLocal(metadataOrPlatform) {
|
|
84
|
-
if (this.isWorkerVersionMetadata(metadataOrPlatform)) {
|
|
85
|
-
return !('timestamp' in metadataOrPlatform);
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
return !('request' in metadataOrPlatform);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
71
|
/**
|
|
92
72
|
* Pauses execution for a specified number of milliseconds.
|
|
93
73
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chainfuse/helpers",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "ChainFuse",
|
|
6
6
|
"homepage": "https://github.com/ChainFuse/packages/tree/main/packages/helpers#readme",
|
|
@@ -80,7 +80,7 @@
|
|
|
80
80
|
},
|
|
81
81
|
"prettier": "@demosjarco/prettier-config",
|
|
82
82
|
"dependencies": {
|
|
83
|
-
"@chainfuse/types": "^4.2.
|
|
83
|
+
"@chainfuse/types": "^4.2.13",
|
|
84
84
|
"@discordjs/rest": "^2.6.0",
|
|
85
85
|
"chalk": "^5.6.2",
|
|
86
86
|
"cloudflare": "^5.2.0",
|
|
@@ -91,8 +91,8 @@
|
|
|
91
91
|
"zod": "^4.3.6"
|
|
92
92
|
},
|
|
93
93
|
"devDependencies": {
|
|
94
|
-
"@cloudflare/workers-types": "^4.
|
|
94
|
+
"@cloudflare/workers-types": "^4.20260210.0",
|
|
95
95
|
"@types/dns-packet": "^5.6.5"
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "9bd65149343461c64349ca164cc3ff983526d6e1"
|
|
98
98
|
}
|