@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.
Files changed (2) hide show
  1. package/README.md +13 -10
  2. 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 [fromCharacter, toCharacter] = ['a', 'z'];
38
- const lowerCharacterCode = fromCharacter.toLowerCase().charCodeAt();
39
- const upperCharacterCode = fromCharacter.toUpperCase().charCodeAt();
40
- const length = toCharacter.toLowerCase().charCodeAt() - lowerCharacterCode + 1;
41
- return Array
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kamen/create-webapp",
3
- "version": "1.0.55",
3
+ "version": "1.0.56",
4
4
  "description": "npm init @kamen/webapp",
5
5
  "keywords": [
6
6
  "init",