@travetto/schema-faker 3.0.2 → 3.1.0-rc.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 +6 -7
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<!-- This file was generated by @travetto/doc and should not be modified directly -->
|
|
2
|
-
<!-- Please modify https://github.com/travetto/travetto/tree/main/module/schema-faker/DOC.
|
|
2
|
+
<!-- Please modify https://github.com/travetto/travetto/tree/main/module/schema-faker/DOC.tsx and execute "npx trv doc" to rebuild -->
|
|
3
3
|
# Schema Faker
|
|
4
|
+
|
|
4
5
|
## Data generation for schema-registered objects.
|
|
5
6
|
|
|
6
7
|
**Install: @travetto/schema-faker**
|
|
@@ -12,23 +13,21 @@ npm install @travetto/schema-faker
|
|
|
12
13
|
yarn add @travetto/schema-faker
|
|
13
14
|
```
|
|
14
15
|
|
|
15
|
-
In the course of application development, there is often a need to generate fake data on demand. Given all the information that we have about the schemas provided, translating that into data generation is fairly straightforward. The generation utility is built upon [faker](https://github.com/faker-js/faker), mapping data types, and various field names into specific [faker](https://github.com/faker-js/faker) generation routines.
|
|
16
|
+
In the course of application development, there is often a need to generate fake data on demand. Given all the information that we have about the schemas provided, translating that into data generation is fairly straightforward. The generation utility is built upon [faker](https://github.com/faker-js/faker), mapping data types, and various field names into specific [faker](https://github.com/faker-js/faker) generation routines.
|
|
16
17
|
|
|
17
18
|
By default all types are mapped as-is:
|
|
18
|
-
|
|
19
|
-
|
|
20
19
|
* `string`
|
|
21
20
|
* `number`
|
|
22
21
|
* `Date`
|
|
23
22
|
* `boolean`
|
|
24
23
|
* Enumerations as `string` or `number` types.
|
|
25
|
-
* Provided regular expressions:
|
|
24
|
+
* Provided regular expressions:
|
|
25
|
+
|
|
26
26
|
* email
|
|
27
27
|
* url
|
|
28
28
|
* telephone
|
|
29
29
|
* postalCode
|
|
30
|
-
* Sub-schemas as registered via [@Schema](https://github.com/travetto/travetto/tree/main/module/schema/src/decorator/schema.ts#L14) decorators
|
|
31
|
-
|
|
30
|
+
* Sub-schemas as registered via [@Schema](https://github.com/travetto/travetto/tree/main/module/schema/src/decorator/schema.ts#L14) decorators
|
|
32
31
|
In addition to the general types, the code relies upon name matching to provide additional refinement:
|
|
33
32
|
|
|
34
33
|
**Code: Supported Mappings**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@travetto/schema-faker",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.1.0-rc.0",
|
|
4
4
|
"description": "Data generation for schema-registered objects.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"faker",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@faker-js/faker": "^7.6.0",
|
|
29
|
-
"@travetto/schema": "^3.0.
|
|
29
|
+
"@travetto/schema": "^3.1.0-rc.0"
|
|
30
30
|
},
|
|
31
31
|
"travetto": {
|
|
32
32
|
"displayName": "Schema Faker"
|