@docaohuynh/ielts-api-utils 1.0.0 → 1.0.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/index.d.ts +1 -0
- package/dist/index.js +437 -18573
- package/dist/src/utils/crypto/encrypt.d.ts +4 -0
- package/dist/src/utils/crypto/index.d.ts +1 -0
- package/dist/src/utils/decode/decode-signed.util.d.ts +7 -0
- package/dist/src/utils/decode/index.d.ts +1 -0
- package/dist/src/utils/index.d.ts +7 -0
- package/dist/src/utils/language/index.d.ts +1 -0
- package/dist/src/utils/language/language-translate.util.d.ts +2 -0
- package/dist/src/utils/list/index.d.ts +1 -0
- package/dist/src/utils/list/list-string.util.d.ts +1 -0
- package/dist/src/utils/strings/index.d.ts +2 -0
- package/dist/src/utils/strings/normalize.util.d.ts +6 -0
- package/dist/src/utils/strings/split.util.d.ts +2 -0
- package/dist/src/utils/time/index.d.ts +2 -0
- package/dist/src/utils/time/timeout.util.d.ts +1 -0
- package/dist/src/utils/time/timezone.util.d.ts +4 -0
- package/package.json +8 -5
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function encrypt(text: string, es: string): string;
|
|
2
|
+
export declare function encryptText(text: string, es: string): string;
|
|
3
|
+
export declare function decrypt(encryptedText: string, es: string): string;
|
|
4
|
+
export declare function decryptText(encryptedText: string, es: string): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './encrypt';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Decodes a signed payload, such as a JSON Web Token (JWT), into its original payload.
|
|
3
|
+
* @param signedPayload The signed payload to decode.
|
|
4
|
+
* @returns The original payload.
|
|
5
|
+
* @throws {Error} If the signed payload is invalid.
|
|
6
|
+
*/
|
|
7
|
+
export declare function decodeSignedPayload(signedPayload: string): any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './decode-signed.util';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './language-translate.util';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './list-string.util';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const replaceWordInList: (words: string[], word: string, replaceWord: string) => string[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Normalizes text by removing diacritical marks and converting to lowercase
|
|
3
|
+
* Examples: 'ấ' -> 'a', 'ế' -> 'e', 'ồ' -> 'o', 'ứ' -> 'u'
|
|
4
|
+
*/
|
|
5
|
+
export declare const normalizeText: (text: string) => string;
|
|
6
|
+
export declare const fullNameToUsername: (fullName: string) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function withTimeout<T>(promise: Promise<T>, ms: number, fallback: T): Promise<T>;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const getCurrentDateInUserTimezone: (timezone: string, overrideDateISO?: string) => string | null;
|
|
2
|
+
export declare const getCurrentDateFullInUserTimezone: (timezone: string, overrideDateISO?: string) => string | null;
|
|
3
|
+
export declare const getCurrentDate: (overrideDateISO?: string) => Date;
|
|
4
|
+
export declare const getCurrentDateStr: (overrideDateISO?: string) => string | undefined;
|
package/package.json
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docaohuynh/ielts-api-utils",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Utilities for IELTS API",
|
|
5
5
|
"module": "index.ts",
|
|
6
|
-
"main": "index.js",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
7
8
|
"type": "module",
|
|
8
9
|
"scripts": {
|
|
9
|
-
"build": "bun build index.ts --outdir dist"
|
|
10
|
+
"build": "bun build index.ts --outdir dist --target node && tsc -p tsconfig.build.json"
|
|
10
11
|
},
|
|
11
12
|
"files": ["dist"],
|
|
12
13
|
"devDependencies": {
|
|
13
|
-
"@types/bun": "latest"
|
|
14
|
+
"@types/bun": "latest",
|
|
15
|
+
"mockdate": "^3.0.5",
|
|
16
|
+
"vitest": "^3.2.4"
|
|
14
17
|
},
|
|
15
18
|
"peerDependencies": {
|
|
16
|
-
"typescript": "^5"
|
|
19
|
+
"typescript": "^5.9.2"
|
|
17
20
|
},
|
|
18
21
|
"dependencies": {
|
|
19
22
|
"@types/luxon": "^3.7.1",
|