@travetto/schema-faker 6.0.0-rc.0 → 6.0.0-rc.2

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 CHANGED
@@ -27,7 +27,7 @@ By default all types are mapped as-is:
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
30
+ * Sub-schemas as registered via [@Schema](https://github.com/travetto/travetto/tree/main/module/schema/src/decorator/schema.ts#L13) decorators
31
31
  In addition to the general types, the code relies upon name matching to provide additional refinement:
32
32
 
33
33
  **Code: Supported Mappings**
@@ -59,7 +59,7 @@ static #namesToType = {
59
59
  [/(desc|description)$/, faker.lorem.sentences.bind(null, 10)]
60
60
  ]),
61
61
  date: new Map([
62
- [/dob|birth/, faker.date.past.bind(null, 60)],
62
+ [/dob|birth/, (): Date => faker.date.past({ years: 60 })],
63
63
  [/creat(e|ion)/, this.#between.bind(null, -200, -100)],
64
64
  [/(update|modif(y|ied))/, this.#between.bind(null, -100, -50)]
65
65
  ]),
package/__index__.ts CHANGED
@@ -1 +1 @@
1
- export * from './src/faker';
1
+ export * from './src/faker.ts';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@travetto/schema-faker",
3
- "version": "6.0.0-rc.0",
3
+ "version": "6.0.0-rc.2",
4
4
  "description": "Data generation for schema-registered objects.",
5
5
  "keywords": [
6
6
  "faker",
@@ -25,8 +25,8 @@
25
25
  "directory": "module/schema-faker"
26
26
  },
27
27
  "dependencies": {
28
- "@faker-js/faker": "^9.4.0",
29
- "@travetto/schema": "^6.0.0-rc.0"
28
+ "@faker-js/faker": "^9.7.0",
29
+ "@travetto/schema": "^6.0.0-rc.2"
30
30
  },
31
31
  "travetto": {
32
32
  "displayName": "Schema Faker"
package/src/faker.ts CHANGED
@@ -45,7 +45,7 @@ export class SchemaFaker {
45
45
  [/(desc|description)$/, faker.lorem.sentences.bind(null, 10)]
46
46
  ]),
47
47
  date: new Map([
48
- [/dob|birth/, faker.date.past.bind(null, 60)],
48
+ [/dob|birth/, (): Date => faker.date.past({ years: 60 })],
49
49
  [/creat(e|ion)/, this.#between.bind(null, -200, -100)],
50
50
  [/(update|modif(y|ied))/, this.#between.bind(null, -100, -50)]
51
51
  ]),