@awesomeness-js/utils 1.2.0 → 1.2.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 +0 -3
- package/package.json +1 -1
- package/src/random/object.js +16 -3
package/README.md
CHANGED
|
@@ -37,9 +37,6 @@ Webpack is a great bundler, but it’s not suited for building a structured expo
|
|
|
37
37
|
✔ **Namespace support**—Uses folder structure to organize functions logically.
|
|
38
38
|
✔ **Minimal setup** — one line to generate your exports
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
> Uses `chokidar` under the hood for reliable cross-platform file watching.
|
|
42
|
-
|
|
43
40
|
---
|
|
44
41
|
|
|
45
42
|
## ⚙️ How It Works
|
package/package.json
CHANGED
package/src/random/object.js
CHANGED
|
@@ -30,11 +30,24 @@ function randomObject({
|
|
|
30
30
|
|
|
31
31
|
if(typeof randomTypes[value.type] !== 'function') {
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
if(typeof value.random === 'function') {
|
|
34
|
+
result[key] = value.random();
|
|
35
|
+
} else if(
|
|
36
|
+
value.default !== undefined
|
|
37
|
+
&& value.default !== null
|
|
38
|
+
) {
|
|
39
|
+
result[key] = value.default;
|
|
40
|
+
} else {
|
|
41
|
+
|
|
42
|
+
result[key] = null;
|
|
43
|
+
|
|
44
|
+
}
|
|
34
45
|
|
|
35
|
-
}
|
|
46
|
+
} else {
|
|
47
|
+
|
|
48
|
+
result[key] = randomTypes[value.type](value);
|
|
36
49
|
|
|
37
|
-
|
|
50
|
+
}
|
|
38
51
|
|
|
39
52
|
});
|
|
40
53
|
|