@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.
- package/CHANGELOG.md +7 -0
- package/LICENSE +0 -0
- package/README.md +0 -0
- package/build/main/array-includes.d.ts +0 -0
- package/build/main/array-includes.js +0 -0
- package/build/main/index.d.ts +0 -0
- package/build/main/index.js +0 -0
- package/build/main/index.spec.d.ts +0 -0
- package/build/main/index.spec.js +0 -0
- package/build/main/lib/Generator.d.ts +0 -0
- package/build/main/lib/Generator.js +0 -0
- package/build/main/lib/Mocker.d.ts +0 -0
- package/build/main/lib/Mocker.js +0 -0
- package/build/main/lib/Schema.d.ts +0 -0
- package/build/main/lib/Schema.js +0 -0
- package/build/main/lib/types.d.ts +0 -0
- package/build/main/lib/types.js +0 -0
- package/build/main/lib/utils.d.ts +0 -0
- package/build/main/lib/utils.js +13 -1
- package/build/main/tests/Generator.db.spec.d.ts +0 -0
- package/build/main/tests/Generator.db.spec.js +0 -0
- package/build/main/tests/Generator.eval.spec.d.ts +0 -0
- package/build/main/tests/Generator.eval.spec.js +0 -0
- package/build/main/tests/Generator.function.spec.d.ts +0 -0
- package/build/main/tests/Generator.function.spec.js +0 -0
- package/build/main/tests/Generator.generator.spec.d.ts +0 -0
- package/build/main/tests/Generator.generator.spec.js +0 -0
- package/build/main/tests/Generator.hasMany.spec.d.ts +0 -0
- package/build/main/tests/Generator.hasMany.spec.js +0 -0
- package/build/main/tests/Generator.hasOne.spec.d.ts +0 -0
- package/build/main/tests/Generator.hasOne.spec.js +0 -0
- package/build/main/tests/Generator.incrementalId.spec.d.ts +0 -0
- package/build/main/tests/Generator.incrementalId.spec.js +0 -0
- package/build/main/tests/Generator.self.spec.d.ts +0 -0
- package/build/main/tests/Generator.self.spec.js +0 -0
- package/build/main/tests/Generator.static.spec.d.ts +0 -0
- package/build/main/tests/Generator.static.spec.js +0 -0
- package/build/main/tests/Generator.values.spec.d.ts +0 -0
- package/build/main/tests/Generator.values.spec.js +0 -0
- package/build/main/tests/Mocker.build.spec.d.ts +0 -0
- package/build/main/tests/Mocker.build.spec.js +0 -0
- package/build/main/tests/Mocker.reset.spec.d.ts +0 -0
- package/build/main/tests/Mocker.reset.spec.js +0 -0
- package/build/main/tests/Mocker.restart.spec.d.ts +0 -0
- package/build/main/tests/Mocker.restart.spec.js +0 -0
- package/build/main/tests/Mocker.schema.spec.d.ts +0 -0
- package/build/main/tests/Mocker.schema.spec.js +0 -0
- package/build/main/tests/Mocker.seed.spec.d.ts +0 -0
- package/build/main/tests/Mocker.seed.spec.js +0 -0
- package/build/main/tests/Schema.Array.spec.d.ts +0 -0
- package/build/main/tests/Schema.Array.spec.js +0 -0
- package/build/main/tests/Schema.BuildSingle.spec.d.ts +0 -0
- package/build/main/tests/Schema.BuildSingle.spec.js +0 -0
- package/build/main/tests/mocker.spec.d.ts +0 -0
- package/build/main/tests/mocker.spec.js +0 -0
- package/build/module/array-includes.js +0 -0
- package/build/module/index.js +0 -0
- package/build/module/lib/Generator.js +0 -0
- package/build/module/lib/Mocker.js +0 -0
- package/build/module/lib/Schema.js +0 -0
- package/build/module/lib/types.js +0 -0
- package/build/module/lib/utils.js +13 -1
- 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
|
package/build/main/index.d.ts
CHANGED
File without changes
|
package/build/main/index.js
CHANGED
File without changes
|
File without changes
|
package/build/main/index.spec.js
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
package/build/main/lib/Mocker.js
CHANGED
File without changes
|
File without changes
|
package/build/main/lib/Schema.js
CHANGED
File without changes
|
File without changes
|
package/build/main/lib/types.js
CHANGED
File without changes
|
File without changes
|
package/build/main/lib/utils.js
CHANGED
@@ -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
|
-
? [
|
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
|
package/build/module/index.js
CHANGED
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
|
-
? [
|
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.
|
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",
|