data-faker-plus 0.0.8 → 0.1.0
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/README.md +53 -1
- package/dist/index.cjs +1 -0
- package/dist/index.esm.js +1 -1
- package/dist/index.iife.js +1 -0
- package/dist/types/core/DataFieldDecoratorFactory.d.ts +8 -4
- package/dist/types/core/IteratorFactory.d.ts +25 -0
- package/dist/types/core/ModelManager.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +3 -3
- package/dist/index.cjs.js +0 -1
- package/dist/index.umd.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DecoratorInfo } from './DecoratorInfo';
|
|
2
2
|
import { PropertyDecoratorValidator } from '../common/PropertyDecoraotrValidator';
|
|
3
3
|
import 'reflect-metadata';
|
|
4
|
-
import { DecoratedClassOrProto } from '../types/decorator';
|
|
4
|
+
import { DecoratedClassOrProto, PropertyDecorator } from '../types/decorator';
|
|
5
5
|
import { CustomGenerator, DataFieldType, FakerMethodParamsType, FakerMethodPath, RefModel } from '../types/faker';
|
|
6
6
|
/**
|
|
7
7
|
* 数据字段装饰器工厂
|
|
@@ -25,11 +25,15 @@ export declare class DataFieldDecoratorFactory {
|
|
|
25
25
|
protected validateDecorator(target: DecoratedClassOrProto, propertyKey: string | symbol): void;
|
|
26
26
|
/**
|
|
27
27
|
* 设置状态
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
28
|
+
* @param target 被装饰的类或原型
|
|
29
|
+
* @param propertyKey 被装饰的属性名
|
|
30
|
+
* @param config 配置
|
|
31
31
|
*/
|
|
32
32
|
protected setupState(target: DecoratedClassOrProto, propertyKey: string | symbol, config: DataFieldType): void;
|
|
33
|
+
/**
|
|
34
|
+
* 创建装饰器
|
|
35
|
+
* @param config 配置
|
|
36
|
+
*/
|
|
33
37
|
createDecorator(config: DataFieldType): PropertyDecorator;
|
|
34
38
|
}
|
|
35
39
|
/**
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 迭代器工厂
|
|
3
|
+
*/
|
|
4
|
+
export declare class IteratorFactory {
|
|
5
|
+
/**
|
|
6
|
+
* 创建正向迭代器
|
|
7
|
+
*/
|
|
8
|
+
static getIterator<T, M = any>(items: Map<M, T> | Record<string | symbol, T> | T[], consumer?: (item: T, index?: number) => any): Generator<any, void, ((item: T, index?: number) => any) | undefined>;
|
|
9
|
+
/**
|
|
10
|
+
* 循环正向迭代器
|
|
11
|
+
*/
|
|
12
|
+
static getLoopIterator<T, M = any>(items: Map<M, T> | Record<string | symbol, T> | T[], consumer?: (item: T, index?: number) => any): Generator<any, void, ((item: T, index?: number) => any) | undefined>;
|
|
13
|
+
/**
|
|
14
|
+
* 创建反向迭代器
|
|
15
|
+
*/
|
|
16
|
+
static getReverseIterator<T, M = any>(items: Map<M, T> | Record<string | symbol, T> | T[], consumer?: (item: T, index?: number) => any): Generator<any, void, ((item: T, index?: number) => any) | undefined>;
|
|
17
|
+
/**
|
|
18
|
+
* 循环反向迭代器
|
|
19
|
+
*/
|
|
20
|
+
static getLoopReverseIterator<T, M = any>(items: Map<M, T> | Record<string | symbol, T> | T[], consumer?: (item: T, index?: number) => any): Generator<any, void, ((item: T, index?: number) => any) | undefined>;
|
|
21
|
+
/**
|
|
22
|
+
* 处理数据项
|
|
23
|
+
*/
|
|
24
|
+
private static preHandleItems;
|
|
25
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { DataModel } from './core/DataModelDecoratorFactory';
|
|
2
2
|
export { DataField } from './core/DataFieldDecoratorFactory';
|
|
3
|
+
export { IteratorFactory } from './core/IteratorFactory';
|
|
3
4
|
export { fakeData, DataFaker } from './core/DataFaker';
|
|
4
5
|
export { useModel, cloneModel, defineModel } from './core/ModelManager';
|
|
5
6
|
export { COUNT, DEEP } from './constants/DataFakerConstants';
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "data-faker-plus",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0
|
|
4
|
+
"version": "0.1.0",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "dist/index.
|
|
6
|
+
"main": "dist/index.cjs",
|
|
7
7
|
"module": "dist/index.esm.js",
|
|
8
8
|
"types": "dist/types/index.d.ts",
|
|
9
9
|
"files": [
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"type": "git",
|
|
25
25
|
"url": "https://github.com/bloom-lmh/data-faker.git"
|
|
26
26
|
},
|
|
27
|
-
"homepage": "https://df-docs-
|
|
27
|
+
"homepage": "https://df-docs-seven.vercel.app/",
|
|
28
28
|
"bugs": {
|
|
29
29
|
"url": "https://github.com/bloom-lmh/data-faker/issues"
|
|
30
30
|
},
|