@coderzz/mocker-data-generator 3.0.5

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.
Files changed (63) hide show
  1. package/CHANGELOG.md +561 -0
  2. package/LICENSE +21 -0
  3. package/README.md +550 -0
  4. package/build/main/array-includes.d.ts +0 -0
  5. package/build/main/array-includes.js +45 -0
  6. package/build/main/index.d.ts +7 -0
  7. package/build/main/index.js +12 -0
  8. package/build/main/index.spec.d.ts +1 -0
  9. package/build/main/index.spec.js +16 -0
  10. package/build/main/lib/Generator.d.ts +61 -0
  11. package/build/main/lib/Generator.js +134 -0
  12. package/build/main/lib/Mocker.d.ts +22 -0
  13. package/build/main/lib/Mocker.js +76 -0
  14. package/build/main/lib/Schema.d.ts +9 -0
  15. package/build/main/lib/Schema.js +210 -0
  16. package/build/main/lib/types.d.ts +8 -0
  17. package/build/main/lib/types.js +2 -0
  18. package/build/main/lib/utils.d.ts +10 -0
  19. package/build/main/lib/utils.js +222 -0
  20. package/build/main/tests/Generator.db.spec.d.ts +1 -0
  21. package/build/main/tests/Generator.db.spec.js +33 -0
  22. package/build/main/tests/Generator.eval.spec.d.ts +1 -0
  23. package/build/main/tests/Generator.eval.spec.js +21 -0
  24. package/build/main/tests/Generator.function.spec.d.ts +1 -0
  25. package/build/main/tests/Generator.function.spec.js +48 -0
  26. package/build/main/tests/Generator.generator.spec.d.ts +1 -0
  27. package/build/main/tests/Generator.generator.spec.js +187 -0
  28. package/build/main/tests/Generator.hasMany.spec.d.ts +1 -0
  29. package/build/main/tests/Generator.hasMany.spec.js +115 -0
  30. package/build/main/tests/Generator.hasOne.spec.d.ts +1 -0
  31. package/build/main/tests/Generator.hasOne.spec.js +146 -0
  32. package/build/main/tests/Generator.incrementalId.spec.d.ts +1 -0
  33. package/build/main/tests/Generator.incrementalId.spec.js +26 -0
  34. package/build/main/tests/Generator.self.spec.d.ts +1 -0
  35. package/build/main/tests/Generator.self.spec.js +24 -0
  36. package/build/main/tests/Generator.static.spec.d.ts +1 -0
  37. package/build/main/tests/Generator.static.spec.js +15 -0
  38. package/build/main/tests/Generator.values.spec.d.ts +1 -0
  39. package/build/main/tests/Generator.values.spec.js +16 -0
  40. package/build/main/tests/Mocker.build.spec.d.ts +1 -0
  41. package/build/main/tests/Mocker.build.spec.js +196 -0
  42. package/build/main/tests/Mocker.reset.spec.d.ts +1 -0
  43. package/build/main/tests/Mocker.reset.spec.js +17 -0
  44. package/build/main/tests/Mocker.restart.spec.d.ts +1 -0
  45. package/build/main/tests/Mocker.restart.spec.js +24 -0
  46. package/build/main/tests/Mocker.schema.spec.d.ts +1 -0
  47. package/build/main/tests/Mocker.schema.spec.js +18 -0
  48. package/build/main/tests/Mocker.seed.spec.d.ts +1 -0
  49. package/build/main/tests/Mocker.seed.spec.js +42 -0
  50. package/build/main/tests/Schema.Array.spec.d.ts +1 -0
  51. package/build/main/tests/Schema.Array.spec.js +332 -0
  52. package/build/main/tests/Schema.BuildSingle.spec.d.ts +1 -0
  53. package/build/main/tests/Schema.BuildSingle.spec.js +13 -0
  54. package/build/main/tests/mocker.spec.d.ts +1 -0
  55. package/build/main/tests/mocker.spec.js +405 -0
  56. package/build/module/array-includes.js +45 -0
  57. package/build/module/index.js +7 -0
  58. package/build/module/lib/Generator.js +131 -0
  59. package/build/module/lib/Mocker.js +73 -0
  60. package/build/module/lib/Schema.js +207 -0
  61. package/build/module/lib/types.js +1 -0
  62. package/build/module/lib/utils.js +209 -0
  63. package/package.json +130 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,561 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
+
5
+ ### 3.0.4 (2025-02-15)
6
+
7
+
8
+ ### Features
9
+
10
+ * add buildSync method to Mocker class ([772b20d](https://github.com/anyideaz/mocker-data-generator/commit/772b20da6f9ccaba98f20a1361babe5f55810d78))
11
+ * Added a way to obtain actual array while the generation, [@zamnuts](https://github.com/zamnuts) suggestion ([2588a34](https://github.com/anyideaz/mocker-data-generator/commit/2588a347749c0140bfe4dc328ade1f2282781097))
12
+ * Added length on the array function generator, thanks [@zamnuts](https://github.com/zamnuts) ([1f17519](https://github.com/anyideaz/mocker-data-generator/commit/1f17519ced60cf51cd06bb9385ac5c091b8725ad))
13
+ * added min max for value generation randomly with tests. thanks [@jhkim-novavin](https://github.com/jhkim-novavin) ([5eaa6f4](https://github.com/anyideaz/mocker-data-generator/commit/5eaa6f4692c9814e479edbadc0284076c900a11f))
14
+ * added PR [#16](https://github.com/anyideaz/mocker-data-generator/issues/16) Add parameter to hasMany generator, thanks [@justinbarry](https://github.com/justinbarry) ([71d947f](https://github.com/anyideaz/mocker-data-generator/commit/71d947f83486cf344e4a4c2bc754f7480629a037))
15
+ * **build:** new build using Typescript, breaking change in imports, adapted import to be used with es6 ([6114eaf](https://github.com/anyideaz/mocker-data-generator/commit/6114eaff5a560514b489100d14822ef79153bc39))
16
+ * **chore:** easy publish as minor shortcut ([fd1a87b](https://github.com/anyideaz/mocker-data-generator/commit/fd1a87bfe444817b75af88c91398929fab91b83c))
17
+ * **chore:** update chance and tslib, and some devDependencies ([59d0aea](https://github.com/anyideaz/mocker-data-generator/commit/59d0aea51fba7ef2e6b1ea153da4aa8007f07170))
18
+ * **fakerjs:** Added multilanguaje support ([0b94471](https://github.com/anyideaz/mocker-data-generator/commit/0b944711f6543394974eb9c6a240c18162fab1a8))
19
+ * **fakerjs:** Added tests for multilang support ([5078d24](https://github.com/anyideaz/mocker-data-generator/commit/5078d2488fdea636b8a9cd329020eaec8a309eab))
20
+ * **fakerjs:** Updates on the readme ([b79e88f](https://github.com/anyideaz/mocker-data-generator/commit/b79e88f43bb9558b15fe8718643f5f671294c5e0))
21
+ * **Mocker.seed:** add posibility to prepopulate the db. Thanks [@suspiciousfellow](https://github.com/suspiciousfellow) and [@marshallswain](https://github.com/marshallswain) for the idea and the code ([dfb2ad6](https://github.com/anyideaz/mocker-data-generator/commit/dfb2ad64fe002e4b55dfe71d1d65574d5054d6cc))
22
+ * **Mocker.seed:** add tests ([7faafab](https://github.com/anyideaz/mocker-data-generator/commit/7faafab779af49434c47ac63631aea9cebbc9be7))
23
+ * **Mocker.seed:** seed and schema and work together ([68970fc](https://github.com/anyideaz/mocker-data-generator/commit/68970fc3fe7a2072c99d58ed3b1ececd3b6909dd))
24
+ * update faker-js ([d9be8f6](https://github.com/anyideaz/mocker-data-generator/commit/d9be8f65505b5dba6389b7986ce26c270036ef1c))
25
+
26
+
27
+ ### Bug Fixes
28
+
29
+ * **appveyor:** update matrix config to install defined node version ([703aa41](https://github.com/anyideaz/mocker-data-generator/commit/703aa41411b3813f3d1af6e79b6d2643a36dec56))
30
+ * Better error throwing and test covered ([20ca0a0](https://github.com/anyideaz/mocker-data-generator/commit/20ca0a07ebec52d425dcf91a6dc88415629a887f))
31
+ * **browserify:** fix browserify builds changing casual to browserify-casual ([de93262](https://github.com/anyideaz/mocker-data-generator/commit/de932625d885c3a39ed77c0d1e0a88ddccc96d4b))
32
+ * **builder:** fix tslint space identation ([b3f9f7c](https://github.com/anyideaz/mocker-data-generator/commit/b3f9f7c54d495ea56df98058ace52fbe62666ef2))
33
+ * Changelog ([8cc7b58](https://github.com/anyideaz/mocker-data-generator/commit/8cc7b58be9108f2da09b8c1a036be7f6a212f6a5))
34
+ * Changelog ([d598862](https://github.com/anyideaz/mocker-data-generator/commit/d59886218ca289c72f39446978fbbeaf5d368804))
35
+ * **docs-website:** added seed example ([d1fa143](https://github.com/anyideaz/mocker-data-generator/commit/d1fa143f20467cf69c87e5cc4a74657429550384))
36
+ * **fakerjs:** Better locale detector and better testing ([f05872d](https://github.com/anyideaz/mocker-data-generator/commit/f05872d4b5c7985604a044b95b58f5c578986f7a))
37
+ * **generation:** added fix when min = 0 in hasMany, now can produce empty array of data, by default is 1, so you have to specify minimum to 0 in order to have the chance to produce empty arrays ([7f97646](https://github.com/anyideaz/mocker-data-generator/commit/7f976460f6ef3e718667a52a90294ae9791d570e))
38
+ * **gh-pages:** add unpkg ([ca93d07](https://github.com/anyideaz/mocker-data-generator/commit/ca93d07684526af58a7641598c736ea531ca8966))
39
+ * **hasOne:** Issues with eval ([f1ab9e8](https://github.com/anyideaz/mocker-data-generator/commit/f1ab9e86d2c4c93b932f2b2fbde1a54eccfc6e73))
40
+ * **linter:** trying to use supported tslint rule ([5edac70](https://github.com/anyideaz/mocker-data-generator/commit/5edac701b0b3d5d7cc070e14b2bc08c6e9317098))
41
+ * **package:** update randexp to version 0.5.0 ([cfddafd](https://github.com/anyideaz/mocker-data-generator/commit/cfddafdc9527e43a78c6d9d1cf04ae0065390b9c))
42
+ * **test:** separate gh-pages generation modules from the mocker modules for development, some test fails ([2cc421e](https://github.com/anyideaz/mocker-data-generator/commit/2cc421eb04404fcecd8c882090dfc10450eb23c3))
43
+ * **updates:** Update libs to last releases ([a6ce60b](https://github.com/anyideaz/mocker-data-generator/commit/a6ce60bd14625ad1dd886299477cdb25e31dcfec))
44
+
45
+ ### 3.0.4 (2025-02-15)
46
+
47
+
48
+ ### Features
49
+
50
+ * add buildSync method to Mocker class ([772b20d](https://github.com/anyideaz/mocker-data-generator/commit/772b20da6f9ccaba98f20a1361babe5f55810d78))
51
+ * Added a way to obtain actual array while the generation, [@zamnuts](https://github.com/zamnuts) suggestion ([2588a34](https://github.com/anyideaz/mocker-data-generator/commit/2588a347749c0140bfe4dc328ade1f2282781097))
52
+ * Added length on the array function generator, thanks [@zamnuts](https://github.com/zamnuts) ([1f17519](https://github.com/anyideaz/mocker-data-generator/commit/1f17519ced60cf51cd06bb9385ac5c091b8725ad))
53
+ * added min max for value generation randomly with tests. thanks [@jhkim-novavin](https://github.com/jhkim-novavin) ([5eaa6f4](https://github.com/anyideaz/mocker-data-generator/commit/5eaa6f4692c9814e479edbadc0284076c900a11f))
54
+ * added PR [#16](https://github.com/anyideaz/mocker-data-generator/issues/16) Add parameter to hasMany generator, thanks [@justinbarry](https://github.com/justinbarry) ([71d947f](https://github.com/anyideaz/mocker-data-generator/commit/71d947f83486cf344e4a4c2bc754f7480629a037))
55
+ * **build:** new build using Typescript, breaking change in imports, adapted import to be used with es6 ([6114eaf](https://github.com/anyideaz/mocker-data-generator/commit/6114eaff5a560514b489100d14822ef79153bc39))
56
+ * **chore:** easy publish as minor shortcut ([fd1a87b](https://github.com/anyideaz/mocker-data-generator/commit/fd1a87bfe444817b75af88c91398929fab91b83c))
57
+ * **chore:** update chance and tslib, and some devDependencies ([59d0aea](https://github.com/anyideaz/mocker-data-generator/commit/59d0aea51fba7ef2e6b1ea153da4aa8007f07170))
58
+ * **fakerjs:** Added multilanguaje support ([0b94471](https://github.com/anyideaz/mocker-data-generator/commit/0b944711f6543394974eb9c6a240c18162fab1a8))
59
+ * **fakerjs:** Added tests for multilang support ([5078d24](https://github.com/anyideaz/mocker-data-generator/commit/5078d2488fdea636b8a9cd329020eaec8a309eab))
60
+ * **fakerjs:** Updates on the readme ([b79e88f](https://github.com/anyideaz/mocker-data-generator/commit/b79e88f43bb9558b15fe8718643f5f671294c5e0))
61
+ * **Mocker.seed:** add posibility to prepopulate the db. Thanks [@suspiciousfellow](https://github.com/suspiciousfellow) and [@marshallswain](https://github.com/marshallswain) for the idea and the code ([dfb2ad6](https://github.com/anyideaz/mocker-data-generator/commit/dfb2ad64fe002e4b55dfe71d1d65574d5054d6cc))
62
+ * **Mocker.seed:** add tests ([7faafab](https://github.com/anyideaz/mocker-data-generator/commit/7faafab779af49434c47ac63631aea9cebbc9be7))
63
+ * **Mocker.seed:** seed and schema and work together ([68970fc](https://github.com/anyideaz/mocker-data-generator/commit/68970fc3fe7a2072c99d58ed3b1ececd3b6909dd))
64
+ * update faker-js ([d9be8f6](https://github.com/anyideaz/mocker-data-generator/commit/d9be8f65505b5dba6389b7986ce26c270036ef1c))
65
+
66
+
67
+ ### Bug Fixes
68
+
69
+ * **appveyor:** update matrix config to install defined node version ([703aa41](https://github.com/anyideaz/mocker-data-generator/commit/703aa41411b3813f3d1af6e79b6d2643a36dec56))
70
+ * Better error throwing and test covered ([20ca0a0](https://github.com/anyideaz/mocker-data-generator/commit/20ca0a07ebec52d425dcf91a6dc88415629a887f))
71
+ * **browserify:** fix browserify builds changing casual to browserify-casual ([de93262](https://github.com/anyideaz/mocker-data-generator/commit/de932625d885c3a39ed77c0d1e0a88ddccc96d4b))
72
+ * **builder:** fix tslint space identation ([b3f9f7c](https://github.com/anyideaz/mocker-data-generator/commit/b3f9f7c54d495ea56df98058ace52fbe62666ef2))
73
+ * Changelog ([8cc7b58](https://github.com/anyideaz/mocker-data-generator/commit/8cc7b58be9108f2da09b8c1a036be7f6a212f6a5))
74
+ * Changelog ([d598862](https://github.com/anyideaz/mocker-data-generator/commit/d59886218ca289c72f39446978fbbeaf5d368804))
75
+ * **docs-website:** added seed example ([d1fa143](https://github.com/anyideaz/mocker-data-generator/commit/d1fa143f20467cf69c87e5cc4a74657429550384))
76
+ * **fakerjs:** Better locale detector and better testing ([f05872d](https://github.com/anyideaz/mocker-data-generator/commit/f05872d4b5c7985604a044b95b58f5c578986f7a))
77
+ * **generation:** added fix when min = 0 in hasMany, now can produce empty array of data, by default is 1, so you have to specify minimum to 0 in order to have the chance to produce empty arrays ([7f97646](https://github.com/anyideaz/mocker-data-generator/commit/7f976460f6ef3e718667a52a90294ae9791d570e))
78
+ * **gh-pages:** add unpkg ([ca93d07](https://github.com/anyideaz/mocker-data-generator/commit/ca93d07684526af58a7641598c736ea531ca8966))
79
+ * **hasOne:** Issues with eval ([f1ab9e8](https://github.com/anyideaz/mocker-data-generator/commit/f1ab9e86d2c4c93b932f2b2fbde1a54eccfc6e73))
80
+ * **linter:** trying to use supported tslint rule ([5edac70](https://github.com/anyideaz/mocker-data-generator/commit/5edac701b0b3d5d7cc070e14b2bc08c6e9317098))
81
+ * **package:** update randexp to version 0.5.0 ([cfddafd](https://github.com/anyideaz/mocker-data-generator/commit/cfddafdc9527e43a78c6d9d1cf04ae0065390b9c))
82
+ * **test:** separate gh-pages generation modules from the mocker modules for development, some test fails ([2cc421e](https://github.com/anyideaz/mocker-data-generator/commit/2cc421eb04404fcecd8c882090dfc10450eb23c3))
83
+ * **updates:** Update libs to last releases ([a6ce60b](https://github.com/anyideaz/mocker-data-generator/commit/a6ce60bd14625ad1dd886299477cdb25e31dcfec))
84
+
85
+ ### 3.0.4 (2025-02-15)
86
+
87
+
88
+ ### Features
89
+
90
+ * add buildSync method to Mocker class ([772b20d](https://github.com/anyideaz/mocker-data-generator/commit/772b20da6f9ccaba98f20a1361babe5f55810d78))
91
+ * Added a way to obtain actual array while the generation, [@zamnuts](https://github.com/zamnuts) suggestion ([2588a34](https://github.com/anyideaz/mocker-data-generator/commit/2588a347749c0140bfe4dc328ade1f2282781097))
92
+ * Added length on the array function generator, thanks [@zamnuts](https://github.com/zamnuts) ([1f17519](https://github.com/anyideaz/mocker-data-generator/commit/1f17519ced60cf51cd06bb9385ac5c091b8725ad))
93
+ * added min max for value generation randomly with tests. thanks [@jhkim-novavin](https://github.com/jhkim-novavin) ([5eaa6f4](https://github.com/anyideaz/mocker-data-generator/commit/5eaa6f4692c9814e479edbadc0284076c900a11f))
94
+ * added PR [#16](https://github.com/anyideaz/mocker-data-generator/issues/16) Add parameter to hasMany generator, thanks [@justinbarry](https://github.com/justinbarry) ([71d947f](https://github.com/anyideaz/mocker-data-generator/commit/71d947f83486cf344e4a4c2bc754f7480629a037))
95
+ * **build:** new build using Typescript, breaking change in imports, adapted import to be used with es6 ([6114eaf](https://github.com/anyideaz/mocker-data-generator/commit/6114eaff5a560514b489100d14822ef79153bc39))
96
+ * **chore:** easy publish as minor shortcut ([fd1a87b](https://github.com/anyideaz/mocker-data-generator/commit/fd1a87bfe444817b75af88c91398929fab91b83c))
97
+ * **chore:** update chance and tslib, and some devDependencies ([59d0aea](https://github.com/anyideaz/mocker-data-generator/commit/59d0aea51fba7ef2e6b1ea153da4aa8007f07170))
98
+ * **fakerjs:** Added multilanguaje support ([0b94471](https://github.com/anyideaz/mocker-data-generator/commit/0b944711f6543394974eb9c6a240c18162fab1a8))
99
+ * **fakerjs:** Added tests for multilang support ([5078d24](https://github.com/anyideaz/mocker-data-generator/commit/5078d2488fdea636b8a9cd329020eaec8a309eab))
100
+ * **fakerjs:** Updates on the readme ([b79e88f](https://github.com/anyideaz/mocker-data-generator/commit/b79e88f43bb9558b15fe8718643f5f671294c5e0))
101
+ * **Mocker.seed:** add posibility to prepopulate the db. Thanks [@suspiciousfellow](https://github.com/suspiciousfellow) and [@marshallswain](https://github.com/marshallswain) for the idea and the code ([dfb2ad6](https://github.com/anyideaz/mocker-data-generator/commit/dfb2ad64fe002e4b55dfe71d1d65574d5054d6cc))
102
+ * **Mocker.seed:** add tests ([7faafab](https://github.com/anyideaz/mocker-data-generator/commit/7faafab779af49434c47ac63631aea9cebbc9be7))
103
+ * **Mocker.seed:** seed and schema and work together ([68970fc](https://github.com/anyideaz/mocker-data-generator/commit/68970fc3fe7a2072c99d58ed3b1ececd3b6909dd))
104
+ * update faker-js ([d9be8f6](https://github.com/anyideaz/mocker-data-generator/commit/d9be8f65505b5dba6389b7986ce26c270036ef1c))
105
+
106
+
107
+ ### Bug Fixes
108
+
109
+ * **appveyor:** update matrix config to install defined node version ([703aa41](https://github.com/anyideaz/mocker-data-generator/commit/703aa41411b3813f3d1af6e79b6d2643a36dec56))
110
+ * Better error throwing and test covered ([20ca0a0](https://github.com/anyideaz/mocker-data-generator/commit/20ca0a07ebec52d425dcf91a6dc88415629a887f))
111
+ * **browserify:** fix browserify builds changing casual to browserify-casual ([de93262](https://github.com/anyideaz/mocker-data-generator/commit/de932625d885c3a39ed77c0d1e0a88ddccc96d4b))
112
+ * **builder:** fix tslint space identation ([b3f9f7c](https://github.com/anyideaz/mocker-data-generator/commit/b3f9f7c54d495ea56df98058ace52fbe62666ef2))
113
+ * Changelog ([8cc7b58](https://github.com/anyideaz/mocker-data-generator/commit/8cc7b58be9108f2da09b8c1a036be7f6a212f6a5))
114
+ * Changelog ([d598862](https://github.com/anyideaz/mocker-data-generator/commit/d59886218ca289c72f39446978fbbeaf5d368804))
115
+ * **docs-website:** added seed example ([d1fa143](https://github.com/anyideaz/mocker-data-generator/commit/d1fa143f20467cf69c87e5cc4a74657429550384))
116
+ * **fakerjs:** Better locale detector and better testing ([f05872d](https://github.com/anyideaz/mocker-data-generator/commit/f05872d4b5c7985604a044b95b58f5c578986f7a))
117
+ * **generation:** added fix when min = 0 in hasMany, now can produce empty array of data, by default is 1, so you have to specify minimum to 0 in order to have the chance to produce empty arrays ([7f97646](https://github.com/anyideaz/mocker-data-generator/commit/7f976460f6ef3e718667a52a90294ae9791d570e))
118
+ * **gh-pages:** add unpkg ([ca93d07](https://github.com/anyideaz/mocker-data-generator/commit/ca93d07684526af58a7641598c736ea531ca8966))
119
+ * **hasOne:** Issues with eval ([f1ab9e8](https://github.com/anyideaz/mocker-data-generator/commit/f1ab9e86d2c4c93b932f2b2fbde1a54eccfc6e73))
120
+ * **linter:** trying to use supported tslint rule ([5edac70](https://github.com/anyideaz/mocker-data-generator/commit/5edac701b0b3d5d7cc070e14b2bc08c6e9317098))
121
+ * **package:** update randexp to version 0.5.0 ([cfddafd](https://github.com/anyideaz/mocker-data-generator/commit/cfddafdc9527e43a78c6d9d1cf04ae0065390b9c))
122
+ * **test:** separate gh-pages generation modules from the mocker modules for development, some test fails ([2cc421e](https://github.com/anyideaz/mocker-data-generator/commit/2cc421eb04404fcecd8c882090dfc10450eb23c3))
123
+ * **updates:** Update libs to last releases ([a6ce60b](https://github.com/anyideaz/mocker-data-generator/commit/a6ce60bd14625ad1dd886299477cdb25e31dcfec))
124
+
125
+ ### [3.0.3](https://github.com/danibram/mocker-data-generator/compare/v3.0.2...v3.0.3) (2023-04-22)
126
+
127
+ ### [3.0.2](https://github.com/danibram/mocker-data-generator/compare/v3.0.1...v3.0.2) (2023-04-22)
128
+
129
+ ### [3.0.1](https://github.com/danibram/mocker-data-generator/compare/v3.0.0...v3.0.1) (2022-12-30)
130
+
131
+ ## [3.0.0](https://github.com/danibram/mocker-data-generator/compare/v2.12.0...v3.0.0) (2022-12-30)
132
+
133
+ ### Breaking changes!
134
+
135
+ - **generators:** Now mocker remove thirdparty generators from it. Now you should provide to the library, check the readme
136
+ - **string-parser:** Now to unify logic, and reduce complexity. The fast eval function not call the function. So if in the past with faker you use: `lorem.paragraph` now its important to use `lorem.paragraph()` because eval function is not doing more magic than the necesary
137
+
138
+ Thank you all for you patient, this release was planned maybe a year ago, but I didnt have time to work on it.
139
+
140
+ ## [2.12.0](https://github.com/danibram/mocker-data-generator/compare/v2.10.0...v2.12.0) (2021-02-03)
141
+ ### Features
142
+
143
+ - **chore:** updated deps
144
+
145
+ ## [2.10.0](https://github.com/danibram/mocker-data-generator/compare/v2.9.0...v2.10.0) (2020-10-13)
146
+
147
+ ### Features
148
+
149
+ - Merged Array Example: [#102](https://github.com/danibram/mocker-data-generator/pull/102)
150
+ - Merged Generic Type for Generator: [#114](https://github.com/danibram/mocker-data-generator/pull/114)
151
+
152
+ ## [2.9.0](https://github.com/danibram/mocker-data-generator/compare/v2.8.0...v2.9.0) (2020-09-04)
153
+
154
+ ### Features
155
+
156
+ - add buildSync method to Mocker class ([772b20d](https://github.com/danibram/mocker-data-generator/commit/772b20da6f9ccaba98f20a1361babe5f55810d78))
157
+ - all deps updated!!
158
+
159
+ ### Bug Fixes
160
+
161
+ - **appveyor:** update matrix config to install defined node version ([703aa41](https://github.com/danibram/mocker-data-generator/commit/703aa41411b3813f3d1af6e79b6d2643a36dec56))
162
+ - **docs-website:** added seed example ([d1fa143](https://github.com/danibram/mocker-data-generator/commit/d1fa143f20467cf69c87e5cc4a74657429550384))
163
+
164
+ ## [2.8.0](https://github.com/danibram/mocker-data-generator/compare/v2.7.0...v2.8.0) (2020-05-13)
165
+
166
+ ### Features
167
+
168
+ - **chore:** easy publish as minor shortcut ([fd1a87b](https://github.com/danibram/mocker-data-generator/commit/fd1a87bfe444817b75af88c91398929fab91b83c))
169
+ - **chore:** update chance and tslib, and some devDependencies ([59d0aea](https://github.com/danibram/mocker-data-generator/commit/59d0aea51fba7ef2e6b1ea153da4aa8007f07170))
170
+ - **Mocker.seed:** add posibility to prepopulate the db. Thanks [@suspiciousfellow](https://github.com/suspiciousfellow) and [@marshallswain](https://github.com/marshallswain) for the idea and the code ([dfb2ad6](https://github.com/danibram/mocker-data-generator/commit/dfb2ad64fe002e4b55dfe71d1d65574d5054d6cc))
171
+ - **Mocker.seed:** add tests ([7faafab](https://github.com/danibram/mocker-data-generator/commit/7faafab779af49434c47ac63631aea9cebbc9be7))
172
+ - **Mocker.seed:** seed and schema and work together ([68970fc](https://github.com/danibram/mocker-data-generator/commit/68970fc3fe7a2072c99d58ed3b1ececd3b6909dd))
173
+
174
+ ## [2.7.0](https://github.com/danibram/mocker-data-generator/compare/v2.6.5...v2.7.0) (2020-04-16)
175
+
176
+ ### All deps updated!
177
+
178
+ <a name="2.6.6"></a>
179
+
180
+ ## [2.6.6](https://github.com/danibram/mocker-data-generator/compare/v2.6.5...v2.6.6) (2018-09-18)
181
+
182
+ ### Feature
183
+
184
+ Unique field in hasMany generator
185
+
186
+ ### Bug Fixes
187
+
188
+ - **errors:** hasMany added unique error
189
+
190
+ ### All deps updated!
191
+
192
+ <a name="2.6.5"></a>
193
+
194
+ ## [2.6.5](https://github.com/danibram/mocker-data-generator/compare/v2.6.4...v2.6.5) (2018-09-06)
195
+
196
+ ### All deps updated!
197
+
198
+ <a name="2.6.4"></a>
199
+
200
+ ## [2.6.4](https://github.com/danibram/mocker-data-generator/compare/v2.6.3...v2.6.4) (2018-05-08)
201
+
202
+ ### Bug Fixes
203
+
204
+ - **hasOne:** Issues with eval ([f1ab9e8](https://github.com/danibram/mocker-data-generator/commit/f1ab9e8))
205
+
206
+ <a name="2.6.3"></a>
207
+
208
+ ## [2.6.3](https://github.com/danibram/mocker-data-generator/compare/v2.6.2...v2.6.3) (2018-05-08)
209
+
210
+ <a name="2.6.2"></a>
211
+
212
+ ## [2.6.2](https://github.com/danibram/mocker-data-generator/compare/v2.6.1...v2.6.2) (2018-05-08)
213
+
214
+ ### Bug!
215
+
216
+ - Fixing bug related to _eval_!
217
+
218
+ <a name="2.6.1"></a>
219
+
220
+ ## [2.6.1](https://github.com/danibram/mocker-data-generator/compare/v2.5.2...v2.6.1) (2018-03-20)
221
+
222
+ ### Improvements!
223
+
224
+ - Now I rework internal part of the generators to offer the posibility of avoid **eval** step, i used eval to offer the maximum flexibility, but now its optional, of course that without eval, is less flexible, but if it fits for your mock data right now you will gain **10x speed**, Awesome!
225
+ Also it offers the posibility of use eval like in the older versions of mocker.
226
+
227
+ Welcome to the ludicrous speed! 🎉
228
+
229
+ <a name="2.5.2"></a>
230
+
231
+ ## [2.5.2](https://github.com/danibram/mocker-data-generator/compare/v2.5.1...v2.5.2) (2018-01-17)
232
+
233
+ ### Bug Fixes
234
+
235
+ - **generation:** added fix when min = 0 in hasMany, now can produce empty array of data, by default is 1, so you have to specify minimum to 0 in order to have the chance to produce empty arrays ([7f97646](https://github.com/danibram/mocker-data-generator/commit/7f97646))
236
+
237
+ ### All deps updated!
238
+
239
+ <a name="2.5.0"></a>
240
+
241
+ # [2.5.0](https://github.com/danibram/mocker-data-generator/compare/v2.4.9...v2.5.0) (2017-11-01)
242
+
243
+ ### Breaking Changes!
244
+
245
+ - Now the build method throws the error, in the case of the callback in a traditional style function **function(err, data)** in the case of promise style in the reject.
246
+
247
+ ### Bug Fixes
248
+
249
+ - **test:** separate gh-pages generation modules from the mocker modules for development, some test fails ([2cc421e](https://github.com/danibram/mocker-data-generator/commit/2cc421e))
250
+ - Better error throwing and test covered ([20ca0a0](https://github.com/danibram/mocker-data-generator/commit/20ca0a0))
251
+
252
+ ### Bug Fixes
253
+
254
+ - **test:** separate gh-pages generation modules from the mocker modules for development, some test fails ([2cc421e](https://github.com/danibram/mocker-data-generator/commit/2cc421e))
255
+ - Better error throwing and test covered ([20ca0a0](https://github.com/danibram/mocker-data-generator/commit/20ca0a0))
256
+
257
+ <a name="2.4.9"></a>
258
+
259
+ ## [2.4.9](https://github.com/danibram/mocker-data-generator/compare/v2.4.7...v2.4.9) (2017-10-20)
260
+
261
+ ### Features
262
+
263
+ - Added browser build
264
+ - Fixes in build to sync with gh-pages
265
+
266
+ <a name="2.4.5"></a>
267
+
268
+ ## [2.4.5](https://github.com/danibram/mocker-data-generator/compare/v2.4.4...v2.4.5) (2017-10-20)
269
+
270
+ <a name="2.4.4"></a>
271
+
272
+ ## [2.4.4](https://github.com/danibram/mocker-data-generator/compare/v2.4.3...v2.4.4) (2017-10-17)
273
+
274
+ ### Bug Fixes
275
+
276
+ - **fakerjs:** Better locale detector and better testing ([f05872d](https://github.com/danibram/mocker-data-generator/commit/f05872d))
277
+
278
+ <a name="2.4.3"></a>
279
+
280
+ ## [2.4.3](https://github.com/danibram/mocker-data-generator/compare/v2.4.2...v2.4.3) (2017-10-16)
281
+
282
+ <a name="2.4.2"></a>
283
+
284
+ ## [2.4.2](https://github.com/danibram/mocker-data-generator/compare/v2.4.1...v2.4.2) (2017-10-16)
285
+
286
+ <a name="2.4.1"></a>
287
+
288
+ ## [2.4.1](https://github.com/danibram/mocker-data-generator/compare/v2.4.0...v2.4.1) (2017-10-16)
289
+
290
+ <a name="2.4.0"></a>
291
+
292
+ # [2.4.0](https://github.com/danibram/mocker-data-generator/compare/v2.2.1...v2.4.0) (2017-10-16)
293
+
294
+ ### Bug Fixes
295
+
296
+ - **builder:** fix tslint space identation ([b3f9f7c](https://github.com/danibram/mocker-data-generator/commit/b3f9f7c))
297
+
298
+ ### Features
299
+
300
+ - **fakerjs:** Added multilanguaje support ([0b94471](https://github.com/danibram/mocker-data-generator/commit/0b94471))
301
+ - **fakerjs:** Added tests for multilang support ([5078d24](https://github.com/danibram/mocker-data-generator/commit/5078d24))
302
+ - **fakerjs:** Updates on the readme ([b79e88f](https://github.com/danibram/mocker-data-generator/commit/b79e88f))
303
+
304
+ <a name="2.3.0"></a>
305
+
306
+ # [2.3.0](https://github.com/danibram/mocker-data-generator/compare/v2.2.1...v2.3.0) (2017-10-16)
307
+
308
+ ### Bug Fixes
309
+
310
+ - **builder:** fix tslint space identation ([b3f9f7c](https://github.com/danibram/mocker-data-generator/commit/b3f9f7c))
311
+
312
+ ### Features
313
+
314
+ - **fakerjs:** Added multilanguaje support ([0b94471](https://github.com/danibram/mocker-data-generator/commit/0b94471))
315
+ - **fakerjs:** Added tests for multilang support ([5078d24](https://github.com/danibram/mocker-data-generator/commit/5078d24))
316
+ - **fakerjs:** Updates on the readme ([b79e88f](https://github.com/danibram/mocker-data-generator/commit/b79e88f))
317
+
318
+ <a name="2.2.1"></a>
319
+
320
+ ## [2.2.1](https://github.com/danibram/mocker-data-generator/compare/v2.2.0...v2.2.1) (2017-10-13)
321
+
322
+ ### Bug Fixes
323
+
324
+ - **linter:** trying to use supported tslint rule ([5edac70](https://github.com/danibram/mocker-data-generator/commit/5edac70))
325
+ - **updates:** Update libs to last releases ([a6ce60b](https://github.com/danibram/mocker-data-generator/commit/a6ce60b))
326
+
327
+ <a name="2.2.0"></a>
328
+
329
+ # [2.2.0](https://github.com/danibram/mocker-data-generator/compare/v2.1.0...v2.2.0) (2017-06-14)
330
+
331
+ ### Features
332
+
333
+ - added min max for value generation randomly with tests. thanks [@jhkim-novavin](https://github.com/jhkim-novavin) ([5eaa6f4](https://github.com/danibram/mocker-data-generator/commit/5eaa6f4))
334
+
335
+ <a name="2.1.0"></a>
336
+
337
+ # [2.1.0](https://github.com/danibram/mocker-data-generator/compare/v2.0.2...v2.1.0) (2017-05-27)
338
+
339
+ ### Features
340
+
341
+ - Added a way to obtain actual array while the generation, [@zamnuts](https://github.com/zamnuts) suggestion ([2588a34](https://github.com/danibram/mocker-data-generator/commit/2588a34))
342
+ - Added length on the array function generator, thanks [@zamnuts](https://github.com/zamnuts) ([1f17519](https://github.com/danibram/mocker-data-generator/commit/1f17519))
343
+ - added PR #16 Add parameter to hasMany generator, thanks [@justinbarry](https://github.com/justinbarry) ([71d947f](https://github.com/danibram/mocker-data-generator/commit/71d947f))
344
+
345
+ <a name="2.0.2"></a>
346
+
347
+ ## [2.0.2](https://github.com/danibram/mocker-data-generator/compare/v2.0.1...v2.0.2) (2017-05-24)
348
+
349
+ ### Bug Fixes
350
+
351
+ - **browserify:** fix browserify builds changing casual to browserify-casual ([de93262](https://github.com/danibram/mocker-data-generator/commit/de93262))
352
+
353
+ <a name="2.0.1"></a>
354
+
355
+ ## [2.0.1](https://github.com/danibram/mocker-data-generator/compare/v2.0.0...v2.0.1) (2017-05-24)
356
+
357
+ ### Changes
358
+
359
+ - **fix:** tslib fix for ES5 builds
360
+ - **updates:** updates on dependencies
361
+
362
+ <a name="2.0.0"></a>
363
+
364
+ # [2.0.0](https://github.com/danibram/mocker-data-generator/compare/v1.2.7...v2.0.0) (2017-03-18)
365
+
366
+ ### Features
367
+
368
+ - **build:** new build using Typescript, breaking change in imports, adapted import to be used with es6 ([6114eaf](https://github.com/danibram/mocker-data-generator/commit/6114eaf))
369
+
370
+ ### OLD Release History
371
+
372
+ #### (1.2.7)
373
+
374
+ - Fix little issue with array generators, now parse well the index inside, add a test for that
375
+ - Fix string issue with fakerJs
376
+ - Fixed babel polyfill issues
377
+ - updates on dev packages
378
+
379
+ #### (1.2.2)
380
+
381
+ - Better error management
382
+ - Added eval methods
383
+ - Update docs with the online mocker-api: https://mocker-api.herokuapp.com/
384
+
385
+ #### (1.2.1)
386
+
387
+ - Start to parse better the errors
388
+
389
+ #### (1.2.0)
390
+
391
+ - New internal reorganization
392
+ - Added hasOne (related is deprecated) and hasMany
393
+ - **_Breaking Change_**: related config is deprecated, instead of related use hasOne.
394
+
395
+ #### (1.1.1)
396
+
397
+ - Added RandExpJs generator
398
+ - Improve test system (I know im improving it! =P)
399
+ - **_Breaking Change_**: the older versions aren´t compatible with this module, the way to generate the data are changed:
400
+ #### (1.1.0)
401
+ - Added casualJs
402
+ - Added self option
403
+ - Added db option
404
+ - Added related option
405
+
406
+ #### (1.0.6)
407
+
408
+ - Updated chance.js to 1.0
409
+
410
+ #### (1.0.5)
411
+
412
+ - Added the concat option, and the strictConcat on Array generator.
413
+
414
+ #### (1.0.4)
415
+
416
+ - Added on uniqueField two ways to generate the data
417
+ - Starting to add errors
418
+
419
+ #### (1.0.3)
420
+
421
+ - Fix Arrays
422
+ - **_Breaking Change_**: the older versions aren´t compatible with this module, the way to generate the data are changed:
423
+
424
+ ```javascript
425
+ var cat = {
426
+ name: {
427
+ values: ['txuri', 'pitxi', 'kitty']
428
+ }
429
+ }
430
+ var m = mocker()
431
+ .schema('cat', cat, 10)
432
+ .schema('cat2', cat, { uniqueField: 'name' })
433
+ .build(function (data) {
434
+ console.log(util.inspect(data, { depth: 10 }))
435
+ })
436
+ ```
437
+
438
+ #### (0.7.0)
439
+
440
+ - **_Breaking Change_**: Added the posibility to enable the pluralize on the output entity. Now if you want to pluralize the output follow the example in the doc, **_by defatult is not anymore pluralized_**.
441
+
442
+ Old call configuration:
443
+
444
+ ```javascript
445
+ var m = mocker(config)
446
+ m.generate('user', 2)
447
+ .then(m.generate('group', 2))
448
+ .then(m.generate('conditionalField', 2))
449
+ .then(function (data) {
450
+ console.log(util.inspect(data, { depth: 10 }))
451
+ //This returns an object
452
+ // {
453
+ // user:[array of users],
454
+ // group: [array of groups],
455
+ // conditionalField: [array of conditionalFields]
456
+ // }
457
+ })
458
+ ```
459
+
460
+ New array configuration:
461
+
462
+ ```javascript
463
+ var m = mocker(config)
464
+ m.generate('user', 2)
465
+ .generate('group', 2)
466
+ .generate('conditionalField', 2)
467
+ .build(function (data) {
468
+ console.log(util.inspect(data, { depth: 10 }))
469
+ //This returns an object
470
+ // {
471
+ // user:[array of users],
472
+ // group: [array of groups],
473
+ // conditionalField: [array of conditionalFields]
474
+ // }
475
+ })
476
+ ```
477
+
478
+ #### (0.6.0)
479
+
480
+ - **_Breaking Change_**: Added the posibility to enable the pluralize on the output entity. Now if you want to pluralize the output follow the example in the doc, **_by defatult is not anymore pluralized_**.
481
+
482
+ #### (0.5.0)
483
+
484
+ - **_Breaking Change_**: Break Point with array config. Now is more clear.
485
+
486
+ Old array configuration:
487
+
488
+ ```javascript
489
+ [{
490
+ //Any generator
491
+ //Faker
492
+ faker: 'random.arrayElement(db.users)[userId]'
493
+ //Chance
494
+ chance: 'integer'
495
+ //Function
496
+ function: function (){ return /**/ }
497
+
498
+ }, //Array config
499
+ {length: 10, fixedLength: false}]
500
+ ```
501
+
502
+ New array configuration:
503
+
504
+ ```javascript
505
+ [{
506
+ //Any generator
507
+ //Faker
508
+ faker: 'random.arrayElement(db.users)[userId]'
509
+ //Chance
510
+ chance: 'integer'
511
+ //Function
512
+ function: function (){ return /**/ }
513
+
514
+ //Array config
515
+ length: 10,
516
+ fixedLength: false
517
+ }]
518
+ ```
519
+
520
+ #### (0.4.7)
521
+
522
+ - Add virtual fields
523
+
524
+ #### (0.4.5)
525
+
526
+ - Add incrementalId config
527
+ - Some tweaks on dev config to start to use generators on typescript
528
+ - Performance tweaks for large data generation
529
+
530
+ #### (0.4.1)
531
+
532
+ - Show in console the errors. (I will improve this)
533
+ - Add support to chanceJs, exactly like FakerJs (see "Model definition" **_Chance_**)
534
+
535
+ #### (0.3.0)
536
+
537
+ - Fix errors on iteration over nested structures (new improved interator)
538
+ - Added support to call more naturally to FackerJs fields (see "Model definition" **_Faker_**)
539
+
540
+ #### (0.2.2)
541
+
542
+ - Added a pluralization function
543
+ - Fixed a little issue with the roots schemas (now you can do really crazy things, see test/mocker.example.js)
544
+ - Fix errors introduced in 0.2.0
545
+
546
+ #### (0.1.6)
547
+
548
+ - Fix an error: (Clean initial data field)
549
+ - Fix some memory errors adding inmutableJS for the model
550
+ - Add new tests
551
+
552
+ #### (0.1.1)
553
+
554
+ - Real Refractor of the code
555
+ - Add support multi-level schemas
556
+ - Add tests
557
+ - Add travis support
558
+
559
+ #### (0.0.4)
560
+
561
+ - First release i will update soon with tests and more examples, stay tuned!
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 Daniel Biedma
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.