mixlea-utils-js 0.1.29 → 0.1.31

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.
@@ -273,6 +273,13 @@ declare interface CommonEvent_2 {
273
273
 
274
274
  export declare function compareSetDifference<T>(setA: Set<T>, setB: Set<T>): Set<T>;
275
275
 
276
+ /**
277
+ * 异步压缩文本为 base64 字符串,适合存数据库
278
+ */
279
+ export declare function compressData(input: any, opts?: {
280
+ encryptKey: string;
281
+ }): Promise<string>;
282
+
276
283
  declare type ConfigStore = Record<string, any>;
277
284
 
278
285
  export declare function convertWeightUnitToStandard(chineseWeight: string): string;
@@ -339,6 +346,21 @@ declare interface DebouncedFunc<T extends (...args: any[]) => any> {
339
346
  flush: () => ReturnType<T> | undefined;
340
347
  }
341
348
 
349
+ /**
350
+ * 异步从 base64 解压为原始文本
351
+ */
352
+ export declare function decompressData(base64: string, opts?: {
353
+ encryptKey: string;
354
+ }): Promise<string>;
355
+
356
+ /**
357
+ * XOR 解密(稳定输出原始内容)
358
+ * @param {string} encrypted - Base64 加密字符串
359
+ * @param {string} pwd - 密码
360
+ * @returns {string} 解密后的原始字符串
361
+ */
362
+ export declare function decrypt(encrypted: string, pwd: string): string;
363
+
342
364
  export declare function deepAssign<T = unknown>(target: T, assignment: Record<string, unknown>): T;
343
365
 
344
366
  export declare function deepClone<T = any>(value: T): T;
@@ -401,6 +423,14 @@ export declare function emptyCoalescing(...params: any[]): any;
401
423
 
402
424
  export declare function emptyFunction(): void;
403
425
 
426
+ /**
427
+ * XOR 加密(支持 Unicode,解密稳定)
428
+ * @param {string} input - 要加密的字符串
429
+ * @param {string} pwd - 密码
430
+ * @returns {string} Base64 加密结果
431
+ */
432
+ export declare function encrypt(input: string, pwd: string): string;
433
+
404
434
  declare type EnsureArray<T> = T extends any[] ? T : T extends null | undefined ? [] : T[];
405
435
 
406
436
  export declare function ensureArray(arr: any, defaultArr?: any[]): any[];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mixlea-utils-js",
3
3
  "type": "module",
4
- "version": "0.1.29",
4
+ "version": "0.1.31",
5
5
  "private": false,
6
6
  "license": "Apache-2.0",
7
7
  "exports": {
@@ -43,6 +43,7 @@
43
43
  "eslint-plugin-import": "^2.31.0",
44
44
  "eslint-plugin-prettier": "^5.2.5",
45
45
  "eslint-plugin-vue": "^9.33.0",
46
+ "fflate": "^0.8.2",
46
47
  "prettier": "^3.5.3",
47
48
  "terser": "^5.36.0",
48
49
  "typescript": "5.3.3",