@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.
- package/README.md +11 -5
- package/index.js +21 -1
- 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
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
+
};
|