@kamen/create-webapp 1.0.29 → 1.0.30

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 (3) hide show
  1. package/README.md +11 -5
  2. package/index.js +0 -6
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -12,11 +12,17 @@ $ npm init @kamen/webapp
12
12
  import {randomFromRange, randomFromList} from "@kamen/create-webapp";
13
13
 
14
14
  const colors = ['red', 'green', 'blue'];
15
- const data = {
16
- color: randomFromList(colors),
17
- count: randomFromRange(0, 99),
18
- state: Boolean(randomFromRange(0, 1))
19
- };
15
+
16
+ const stateHandler = createRandomFromRange(0, 1);
17
+ const ageHandler = createRandomFromRange(0, 99);
18
+ const colorHandler = createRandomFromList(colors);
19
+
20
+ const data = Array.from({length: 1 << 6}, (_, index) => ({
21
+ index,
22
+ state: Boolean(stateHandler()),
23
+ age: ageHandler(),
24
+ color: colorHandler()
25
+ }));
20
26
 
21
27
  console.dir(data);
22
28
  ```
package/index.js CHANGED
@@ -1,9 +1,3 @@
1
- import packages from './package.json' with {type: 'json'};
2
-
3
- console.dir(packages);
4
-
5
-
6
-
7
1
  const primitiveTypeRe = /^string|number|bigint|boolean|symbol$/;
8
2
  const objectTypeRe = /^object|function$/;
9
3
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kamen/create-webapp",
3
- "version": "1.0.29",
3
+ "version": "1.0.30",
4
4
  "description": "npm init @kamen/webapp",
5
5
  "homepage": "https://www.npmjs.com/package/@kamen/create-webapp",
6
6
  "license": "GPL-2.0-only",