@byteluck-fe/model-driven-shared 3.0.0-beta.7 → 5.5.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.
@@ -1,5 +1,5 @@
1
- export declare function warn(...data: any[]): void;
2
- export declare function log(...data: any[]): void;
3
- export declare function error(error: string): never;
4
- export declare function referenceError(error: string): never;
5
- export declare function logerror(error: string): void;
1
+ export declare function warn(...data: any[]): void;
2
+ export declare function log(...data: any[]): void;
3
+ export declare function error(error: string): never;
4
+ export declare function referenceError(error: string): never;
5
+ export declare function logerror(error: string): void;
@@ -1 +1 @@
1
- export declare function loopFormSchema(schema: any[], callback: (item: any) => any): void;
1
+ export declare function loopFormSchema(schema: any[], callback: (item: any) => any): void;
@@ -1,8 +1,8 @@
1
- /**
2
- * 通过key字符串类修改对象上边的属性
3
- * @param obj 执行修改的对象
4
- * @param key 修改的key,可以是 name,可以是0,可以是深层嵌套的obj.0,obj[0].name等等
5
- * @param value 修改的值
6
- * @return boolean 是否修改成功
7
- * */
8
- export declare function updateValueFromKeys(obj: object, key: string, value: unknown): boolean;
1
+ /**
2
+ * 通过key字符串类修改对象上边的属性
3
+ * @param obj 执行修改的对象
4
+ * @param key 修改的key,可以是 name,可以是0,可以是深层嵌套的obj.0,obj[0].name等等
5
+ * @param value 修改的值
6
+ * @return boolean 是否修改成功
7
+ * */
8
+ export declare function updateValueFromKeys(obj: object, key: string, value: unknown): boolean;
@@ -1,53 +1,53 @@
1
- export declare function JSONCopy(value: any): any;
2
- export declare function isLanguageObject(arg: unknown): arg is Record<'zh', string>;
3
- export declare function isPlainObject(arg: unknown): arg is Record<string, unknown>;
4
- export declare function isObject(val: unknown): boolean;
5
- export declare function isArray(val: unknown): val is Array<unknown>;
6
- export declare function isString(val: unknown): val is string;
7
- export declare function isNumber(val: unknown): val is number;
8
- export declare function isFunction(val: unknown): val is Function;
9
- export declare function isStringArray(value: unknown): value is string[];
10
- export declare function isNumberArray(value: unknown): value is number[];
11
- export declare function isNumberAndEmptyStringArray(value: unknown): value is (number | '')[];
12
- export declare function isJSONArray(value: string): boolean;
13
- export declare function isJSONObject(value: string): boolean;
14
- export declare function toNumberOrEmpty(value: string): number | "";
15
- export declare function getNotRepeatItems(arr: string[]): string[];
16
- export declare function debounce(func: Function, wait?: number): (...args: any[]) => void;
17
- export declare function wait(time?: number): Promise<unknown>;
18
- /**
19
- * schema逐个遍历,提供转换回调
20
- * @author qiyu
21
- * @param schemaItems
22
- * @param convertion
23
- * @example
24
- import { loop, camelizeKeys } from 'model-driven-front/lib/utils/dataCleaner'
25
- new_model = loop(new_model, (item: any) => {
26
- return camelizeKeys(item)
27
- })
28
- */
29
- export declare function loop(schemaItems: any[], convertion: (item: any) => any): any;
30
- /**
31
- * @description: key转小驼峰
32
- * @param {object} arg
33
- * @return {*}
34
- */
35
- export declare function camelizeKeys(arg: object[]): object[];
36
- export declare function camelizeKeys(arg: object): object;
37
- /**
38
- * @description: key转下划线
39
- * @param {object} arg
40
- * @return {*}
41
- */
42
- export declare function decamelizeKeys(arg: object[]): object[];
43
- export declare function decamelizeKeys(arg: object): object;
44
- export type CamelizeToDecamelizeKeys<T> = T extends object ? {
45
- [K in keyof T as DecamelizeKeysType<K & string>]: CamelizeToDecamelizeKeys<T[K]>;
46
- } : T;
47
- type DecamelizeKeysType<S extends string> = S extends `${infer T}${infer U}` ? `${T extends Capitalize<T> ? '_' : ''}${Lowercase<T>}${DecamelizeKeysType<U>}` : S;
48
- export type DecamelizeToCamelizeKeys<T> = {
49
- [K in keyof T as CamelizeKeysType<K & string>]: T[K] extends object ? T[K] extends Array<infer U> ? U extends object ? DecamelizeToCamelizeKeys<U>[] : U[] : DecamelizeToCamelizeKeys<T[K]> : T[K];
50
- };
51
- type CamelizeKeysType<S extends string> = S extends `${infer First}_${infer Rest}` ? `${First}${Capitalize<CamelizeKeysType<Rest>>}` : S;
52
- export declare function isBuiltInControls(type: string): boolean;
53
- export {};
1
+ export declare function JSONCopy(value: any): any;
2
+ export declare function isLanguageObject(arg: unknown): arg is Record<'zh', string>;
3
+ export declare function isPlainObject(arg: unknown): arg is Record<string, unknown>;
4
+ export declare function isObject(val: unknown): boolean;
5
+ export declare function isArray(val: unknown): val is Array<unknown>;
6
+ export declare function isString(val: unknown): val is string;
7
+ export declare function isNumber(val: unknown): val is number;
8
+ export declare function isFunction(val: unknown): val is Function;
9
+ export declare function isStringArray(value: unknown): value is string[];
10
+ export declare function isNumberArray(value: unknown): value is number[];
11
+ export declare function isNumberAndEmptyStringArray(value: unknown): value is (number | '')[];
12
+ export declare function isJSONArray(value: string): boolean;
13
+ export declare function isJSONObject(value: string): boolean;
14
+ export declare function toNumberOrEmpty(value: string): number | "";
15
+ export declare function getNotRepeatItems(arr: string[]): string[];
16
+ export declare function debounce(func: Function, wait?: number): (...args: any[]) => void;
17
+ export declare function wait(time?: number): Promise<unknown>;
18
+ /**
19
+ * schema逐个遍历,提供转换回调
20
+ * @author qiyu
21
+ * @param schemaItems
22
+ * @param convertion
23
+ * @example
24
+ import { loop, camelizeKeys } from 'model-driven-front/lib/utils/dataCleaner'
25
+ new_model = loop(new_model, (item: any) => {
26
+ return camelizeKeys(item)
27
+ })
28
+ */
29
+ export declare function loop(schemaItems: any[], convertion: (item: any) => any): any;
30
+ /**
31
+ * @description: key转小驼峰
32
+ * @param {object} arg
33
+ * @return {*}
34
+ */
35
+ export declare function camelizeKeys(arg: object[]): object[];
36
+ export declare function camelizeKeys(arg: object): object;
37
+ /**
38
+ * @description: key转下划线
39
+ * @param {object} arg
40
+ * @return {*}
41
+ */
42
+ export declare function decamelizeKeys(arg: object[]): object[];
43
+ export declare function decamelizeKeys(arg: object): object;
44
+ export type CamelizeToDecamelizeKeys<T> = T extends object ? {
45
+ [K in keyof T as DecamelizeKeysType<K & string>]: CamelizeToDecamelizeKeys<T[K]>;
46
+ } : T;
47
+ type DecamelizeKeysType<S extends string> = S extends `${infer T}${infer U}` ? `${T extends Capitalize<T> ? '_' : ''}${Lowercase<T>}${DecamelizeKeysType<U>}` : S;
48
+ export type DecamelizeToCamelizeKeys<T> = {
49
+ [K in keyof T as CamelizeKeysType<K & string>]: T[K] extends object ? T[K] extends Array<infer U> ? U extends object ? DecamelizeToCamelizeKeys<U>[] : U[] : DecamelizeToCamelizeKeys<T[K]> : T[K];
50
+ };
51
+ type CamelizeKeysType<S extends string> = S extends `${infer First}_${infer Rest}` ? `${First}${Capitalize<CamelizeKeysType<Rest>>}` : S;
52
+ export declare function isBuiltInControls(type: string): boolean;
53
+ export {};
@@ -1,14 +1,14 @@
1
- interface Callback {
2
- (...args: any[]): unknown | Promise<unknown>;
3
- applyingPluginName?: string;
4
- }
5
- declare class Watcher<EventKeys extends string = string> {
6
- private _events;
7
- debug: boolean;
8
- emit(key: EventKeys, ...payload: any[]): Promise<unknown[]>;
9
- on(key: EventKeys, callback: Callback): void;
10
- off(key: EventKeys, callback: Callback): void;
11
- delete(key: EventKeys): void;
12
- clear(): void;
13
- }
14
- export { Watcher, Callback };
1
+ interface Callback {
2
+ (...args: any[]): unknown | Promise<unknown>;
3
+ applyingPluginName?: string;
4
+ }
5
+ declare class Watcher<EventKeys extends string = string> {
6
+ private _events;
7
+ debug: boolean;
8
+ emit(key: EventKeys, ...payload: any[]): Promise<unknown[]>;
9
+ on(key: EventKeys, callback: Callback): void;
10
+ off(key: EventKeys, callback: Callback): void;
11
+ delete(key: EventKeys): void;
12
+ clear(): void;
13
+ }
14
+ export { Watcher, Callback };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@byteluck-fe/model-driven-shared",
3
- "version": "3.0.0-beta.7",
3
+ "version": "5.5.0-1",
4
4
  "description": "> TODO: description",
5
5
  "author": "郝晨光 <2293885211@qq.com>",
6
6
  "homepage": "",
@@ -31,5 +31,5 @@
31
31
  "humps": "^2.0.1",
32
32
  "vue-i18n": "^9.13.1"
33
33
  },
34
- "gitHead": "cd0189dbbaf540d9369eb89b41384516a59d28d0"
34
+ "gitHead": "39c4a91b9c89f399f61799dcacb72bd666631f79"
35
35
  }