@kamen/create-webapp 1.0.55 → 1.0.56
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 +13 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -33,17 +33,20 @@ const {
|
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
```js
|
|
36
|
+
function createCharacterRange(minCharacter = 'a', maxCharacter = 'z') {
|
|
37
|
+
const characterCodeRange = [String(minCharacter).charCodeAt(), String(maxCharacter).charCodeAt()];
|
|
38
|
+
const minCharacterCode = Math.min(...characterCodeRange);
|
|
39
|
+
const maxCharacterCode = Math.max(...characterCodeRange);
|
|
40
|
+
const length = maxCharacterCode - minCharacterCode + 1;
|
|
41
|
+
return Array.from({length}, (_, index) => String.fromCharCode(minCharacterCode + index));
|
|
42
|
+
}
|
|
43
|
+
|
|
36
44
|
function createCharacters() {
|
|
37
|
-
const [
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
.from({length}, (_, index) => [
|
|
43
|
-
String.fromCharCode(lowerCharacterCode + index),
|
|
44
|
-
String.fromCharCode(upperCharacterCode + index)
|
|
45
|
-
])
|
|
46
|
-
.flat();
|
|
45
|
+
const [minCharacter, maxCharacter] = ['a', 'z'];
|
|
46
|
+
return [
|
|
47
|
+
createCharacterRange(minCharacter.toLowerCase(), maxCharacter.toLowerCase()),
|
|
48
|
+
createCharacterRange(minCharacter.toUpperCase(), maxCharacter.toUpperCase())
|
|
49
|
+
].flat();
|
|
47
50
|
}
|
|
48
51
|
|
|
49
52
|
const ageHandler = createRandomFromRange(0, 99);
|