@coderzz/mocker-data-generator 3.0.7 → 3.0.8

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 +7 -0
  2. package/LICENSE +0 -0
  3. package/README.md +0 -0
  4. package/build/main/array-includes.d.ts +0 -0
  5. package/build/main/array-includes.js +0 -0
  6. package/build/main/index.d.ts +0 -0
  7. package/build/main/index.js +0 -0
  8. package/build/main/index.spec.d.ts +0 -0
  9. package/build/main/index.spec.js +0 -0
  10. package/build/main/lib/Generator.d.ts +0 -0
  11. package/build/main/lib/Generator.js +0 -0
  12. package/build/main/lib/Mocker.d.ts +0 -0
  13. package/build/main/lib/Mocker.js +0 -0
  14. package/build/main/lib/Schema.d.ts +0 -0
  15. package/build/main/lib/Schema.js +0 -0
  16. package/build/main/lib/types.d.ts +0 -0
  17. package/build/main/lib/types.js +0 -0
  18. package/build/main/lib/utils.d.ts +0 -0
  19. package/build/main/lib/utils.js +13 -1
  20. package/build/main/tests/Generator.db.spec.d.ts +0 -0
  21. package/build/main/tests/Generator.db.spec.js +0 -0
  22. package/build/main/tests/Generator.eval.spec.d.ts +0 -0
  23. package/build/main/tests/Generator.eval.spec.js +0 -0
  24. package/build/main/tests/Generator.function.spec.d.ts +0 -0
  25. package/build/main/tests/Generator.function.spec.js +0 -0
  26. package/build/main/tests/Generator.generator.spec.d.ts +0 -0
  27. package/build/main/tests/Generator.generator.spec.js +0 -0
  28. package/build/main/tests/Generator.hasMany.spec.d.ts +0 -0
  29. package/build/main/tests/Generator.hasMany.spec.js +0 -0
  30. package/build/main/tests/Generator.hasOne.spec.d.ts +0 -0
  31. package/build/main/tests/Generator.hasOne.spec.js +0 -0
  32. package/build/main/tests/Generator.incrementalId.spec.d.ts +0 -0
  33. package/build/main/tests/Generator.incrementalId.spec.js +0 -0
  34. package/build/main/tests/Generator.self.spec.d.ts +0 -0
  35. package/build/main/tests/Generator.self.spec.js +0 -0
  36. package/build/main/tests/Generator.static.spec.d.ts +0 -0
  37. package/build/main/tests/Generator.static.spec.js +0 -0
  38. package/build/main/tests/Generator.values.spec.d.ts +0 -0
  39. package/build/main/tests/Generator.values.spec.js +0 -0
  40. package/build/main/tests/Mocker.build.spec.d.ts +0 -0
  41. package/build/main/tests/Mocker.build.spec.js +0 -0
  42. package/build/main/tests/Mocker.reset.spec.d.ts +0 -0
  43. package/build/main/tests/Mocker.reset.spec.js +0 -0
  44. package/build/main/tests/Mocker.restart.spec.d.ts +0 -0
  45. package/build/main/tests/Mocker.restart.spec.js +0 -0
  46. package/build/main/tests/Mocker.schema.spec.d.ts +0 -0
  47. package/build/main/tests/Mocker.schema.spec.js +0 -0
  48. package/build/main/tests/Mocker.seed.spec.d.ts +0 -0
  49. package/build/main/tests/Mocker.seed.spec.js +0 -0
  50. package/build/main/tests/Schema.Array.spec.d.ts +0 -0
  51. package/build/main/tests/Schema.Array.spec.js +0 -0
  52. package/build/main/tests/Schema.BuildSingle.spec.d.ts +0 -0
  53. package/build/main/tests/Schema.BuildSingle.spec.js +0 -0
  54. package/build/main/tests/mocker.spec.d.ts +0 -0
  55. package/build/main/tests/mocker.spec.js +0 -0
  56. package/build/module/array-includes.js +0 -0
  57. package/build/module/index.js +0 -0
  58. package/build/module/lib/Generator.js +0 -0
  59. package/build/module/lib/Mocker.js +0 -0
  60. package/build/module/lib/Schema.js +0 -0
  61. package/build/module/lib/types.js +0 -0
  62. package/build/module/lib/utils.js +13 -1
  63. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
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
4
 
5
+ ### [3.0.8](https://github.com/anyideaz/mocker-data-generator/compare/v3.0.7...v3.0.8) (2025-02-18)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * parse property ([9085995](https://github.com/anyideaz/mocker-data-generator/commit/9085995a9a9356c418f201ff706eae3285c65719))
11
+
5
12
  ### [3.0.7](https://github.com/anyideaz/mocker-data-generator/compare/v3.0.6...v3.0.7) (2025-02-18)
6
13
 
7
14
  ### 3.0.6 (2025-02-18)
package/LICENSE CHANGED
File without changes
package/README.md CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -188,7 +188,7 @@ var stringToPathOrCall = function (name, fn, cfg) {
188
188
  var _b = args.split(')'), args2 = _b[0], mods = _b[1];
189
189
  args = args2
190
190
  ? args2[0] === '{'
191
- ? [eval(args2)]
191
+ ? [parseObjectString(args2)]
192
192
  : args2
193
193
  .split(',')
194
194
  .map(function (e) { return (/^\d+$/.test(e) ? Number.parseInt(e) : e); })
@@ -220,3 +220,15 @@ var loopInside = function (object, path) {
220
220
  }, object);
221
221
  };
222
222
  exports.loopInside = loopInside;
223
+ function parseObjectString(str) {
224
+ // Remove curly braces
225
+ var content = str.slice(1, -1);
226
+ // Split by comma and map each key-value pair
227
+ var pairs = content.split(',').map(function (pair) {
228
+ var _a = pair.split(':').map(function (s) { return s.trim(); }), key = _a[0], value = _a[1];
229
+ // Try to convert value to number if possible
230
+ var val = isNaN(value) ? value : Number(value);
231
+ return [key, val];
232
+ });
233
+ return Object.fromEntries(pairs);
234
+ }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -177,7 +177,7 @@ export var stringToPathOrCall = function (name, fn, cfg) {
177
177
  var _b = args.split(')'), args2 = _b[0], mods = _b[1];
178
178
  args = args2
179
179
  ? args2[0] === '{'
180
- ? [eval(args2)]
180
+ ? [parseObjectString(args2)]
181
181
  : args2
182
182
  .split(',')
183
183
  .map(function (e) { return (/^\d+$/.test(e) ? Number.parseInt(e) : e); })
@@ -207,3 +207,15 @@ export var loopInside = function (object, path) {
207
207
  return acc[val];
208
208
  }, object);
209
209
  };
210
+ function parseObjectString(str) {
211
+ // Remove curly braces
212
+ var content = str.slice(1, -1);
213
+ // Split by comma and map each key-value pair
214
+ var pairs = content.split(',').map(function (pair) {
215
+ var _a = pair.split(':').map(function (s) { return s.trim(); }), key = _a[0], value = _a[1];
216
+ // Try to convert value to number if possible
217
+ var val = isNaN(value) ? value : Number(value);
218
+ return [key, val];
219
+ });
220
+ return Object.fromEntries(pairs);
221
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coderzz/mocker-data-generator",
3
- "version": "3.0.7",
3
+ "version": "3.0.8",
4
4
  "description": "A simplified way to generate mock data, builds using a simple schema and with the FakerJs",
5
5
  "main": "build/main/index.js",
6
6
  "typings": "build/main/index.d.ts",