@wzyjs/utils 0.3.28 → 0.3.30

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.
@@ -7,6 +7,7 @@ export declare const options2valueEnum: (options: string[]) => {
7
7
  text: string;
8
8
  };
9
9
  };
10
+ export declare const optionsToEnum: (options: any[], text: string, key: string) => any;
10
11
  export declare const transformOptions: (inputArray?: string[] | Option[]) => Option[];
11
12
  export declare const getColumns: (dataSource: any) => {
12
13
  title: string;
@@ -1,3 +1 @@
1
- export declare const shuffleArray: <T>(array: T[]) => T[];
2
1
  export declare const removeSimilarDuplicates: (arr: string[], threshold: number, isLog?: boolean) => string[];
3
- export declare const getTotal: (arr?: any[], key?: string) => number;
@@ -1,5 +1,4 @@
1
1
  export * from './array';
2
- export * from './number';
3
2
  export * from './object';
4
3
  export * from './other';
5
4
  export * from './promise';
@@ -1,10 +1,4 @@
1
- export declare const findItem: <I>(list: I[], attr: keyof I, value?: I[keyof I]) => I | undefined;
1
+ export declare const findAttr: (data: any, target: string, path?: string) => any;
2
2
  export declare const filterParams: (params: {
3
3
  [key: string]: any;
4
4
  }, deep?: boolean) => any;
5
- export declare const watch: {
6
- observe(obj: {
7
- [key: string]: any;
8
- }, key: string, watchFun: (value: any, val: any) => undefined): void;
9
- setWatcher(data?: {}, watch?: any): void;
10
- };
@@ -1,5 +1,3 @@
1
1
  export declare const delay: (time?: number) => Promise<unknown>;
2
2
  export declare const calcJsText: (expr: string, context: Record<string, any>) => any;
3
- export declare const optionsToEnum: (options: any[], text: string, key: string) => any;
4
- export declare const performDecimalOperation: (num1?: number, num2?: number, operator?: string) => number | undefined;
5
- export declare const printConsoleLog: (type: string, path: string, params: any, response: any) => void;
3
+ export declare const logNetwork: (type: string, path: string, params: any, response: any) => void;
@@ -2,4 +2,4 @@ export declare const executePromise: (promise: Promise<any>) => Promise<{
2
2
  result: any;
3
3
  time: number;
4
4
  }>;
5
- export declare const retryPromise: (promiseFn: () => Promise<any>, retryInterval?: number, retryCount?: number) => Promise<any>;
5
+ export declare const retryPromise: (promiseFn: () => Promise<any>, retryCount?: number, retryInterval?: number) => Promise<any>;
@@ -1,22 +1,22 @@
1
1
  export declare const getChineseByStr: (str: string) => string;
2
2
  export declare const getStrLength: (value: string) => number;
3
- export declare const replaceAll: (str: string, searchValue: string, replaceValue: string) => string;
4
3
  export declare const replaceByRules: (str: string, rules: [string, string][]) => string;
5
4
  export declare const replaceByVariables: (prompt: string, variables?: {
6
5
  [key: string]: string;
7
6
  }) => string;
8
7
  export declare const getType: (value: any) => any;
9
- export declare const amount: (str: string) => string;
10
- export declare const jsonParse: (value: string | object) => object;
11
- export declare const isJson: (str: string) => boolean;
12
- export declare const toString: (value: any) => string;
8
+ export declare const safeJsonParse: <T = any>(value: unknown, fallback: T) => T;
9
+ export declare const isJsonObject: (str: string) => boolean;
13
10
  export declare const getRandomColor: () => string;
11
+ export declare const hexToRgba: (hexColor: string, a?: number) => {
12
+ nums: {
13
+ red: number;
14
+ green: number;
15
+ blue: number;
16
+ };
17
+ text: string;
18
+ };
14
19
  export declare const getRandomString: (length?: number) => string;
15
- export declare const getChinese: (str: string) => string;
16
20
  export declare const getSliceStr: (str: string, before: string, after: string) => string;
17
- export declare const getProxyUrl: (url: string) => string;
18
- export declare const getLength: (value: string) => number;
19
- export declare const getCookie: (name: string) => string;
20
21
  export declare const generateAlphabetArray: (n: number) => string[];
21
22
  export declare const levenshteinDistance: (a: string, b: string) => number;
22
- export declare const generateUniqueFileName: (name: string) => string;
@@ -13,8 +13,6 @@ export declare enum Timezone {
13
13
  EuropeLondon = "Europe/London",
14
14
  EuropeBerlin = "Europe/Berlin"
15
15
  }
16
- export declare const initChinaDayjs: () => typeof dayjs;
17
- export declare const chinaDayjs: typeof dayjs;
18
16
  export type { Dayjs } from 'dayjs';
19
17
  declare const _default: typeof dayjs & {
20
18
  isBetween: typeof isBetween;
@@ -1,6 +1,6 @@
1
1
  export * as ai from './ai';
2
2
  export * from './base';
3
3
  export * from './enum';
4
- export * from './image';
5
4
  export * from './other';
6
- export { default as dayjs, type Dayjs, Timezone, initChinaDayjs, chinaDayjs } from './dayjs';
5
+ export * from './antd';
6
+ export { default as dayjs, type Dayjs, Timezone } from './dayjs';