@kamen/create-webapp 1.0.28 → 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 +21 -1
  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
@@ -296,4 +296,24 @@ export class URLBuilder {
296
296
  toString() {
297
297
  return this.url.toString();
298
298
  }
299
- }
299
+ }
300
+
301
+ export const introspection = {
302
+ isPrimitive,
303
+ isObject
304
+ };
305
+
306
+ export const numbering = {
307
+ modulo,
308
+ range,
309
+ clamp
310
+ };
311
+
312
+ export const randomness = {
313
+ randomFromRange,
314
+ createRandomFromRange,
315
+ randomFromList,
316
+ createRandomFromList,
317
+ randomColorFromSaturationLightnessAlpha,
318
+ createRandomColorFromSaturationLightnessAlpha
319
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kamen/create-webapp",
3
- "version": "1.0.28",
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",