@mfdj/tsc-as-build-tool 0.4.1 → 1.0.0

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/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export declare class StringToLowercase {
2
- static ToLower(stringName: string): string;
1
+ export declare class CaseChanger {
2
+ static ToLower(input: string): string;
3
3
  }
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qBAAa,iBAAiB;IAE5B,MAAM,CAAC,OAAO,CAAC,UAAU,EAAC,MAAM;CAejC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,qBAAa,WAAW;IAItB,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM;CA0B7B"}
package/dist/index.js CHANGED
@@ -1,15 +1,26 @@
1
- export class StringToLowercase {
2
- static ToLower(stringName) {
3
- let lower = "";
4
- for (let i = 0; i < stringName.length; i++) {
5
- let value = stringName.charCodeAt(i);
6
- if (value >= 65 && value <= 90) {
7
- lower += String.fromCharCode(value + 32);
1
+ export class CaseChanger {
2
+ /*
3
+ Crude version that handles basic latin alphabet.
4
+ */
5
+ static ToLower(input) {
6
+ let output = "";
7
+ for (let i = 0; i < input.length; i++) {
8
+ let charCode = input.charCodeAt(i);
9
+ let char = input.charAt(i);
10
+ if (charCode >= 65 && charCode <= 90) {
11
+ let newChar = String.fromCharCode(charCode + 32);
12
+ // console.log(
13
+ // `uppercase: ${i} ${char} ${charCode} newCharCode ${
14
+ // charCode + 32
15
+ // } newChar: ${newChar}`
16
+ // );
17
+ output += newChar;
8
18
  }
9
19
  else {
10
- lower += stringName[i];
20
+ // console.log(`already lowercase: ${i} ${char} ${charCode}`);
21
+ output += input[i];
11
22
  }
12
23
  }
13
- return lower;
24
+ return output;
14
25
  }
15
26
  }
package/package.json CHANGED
@@ -8,6 +8,6 @@
8
8
  "build": "rm -rf dist/*; tsc",
9
9
  "prepare": "npm run build"
10
10
  },
11
- "version": "0.4.1",
11
+ "version": "1.0.0",
12
12
  "type": "module"
13
13
  }
package/src/index.ts CHANGED
@@ -1,18 +1,31 @@
1
- export class StringToLowercase
2
- {
3
- static ToLower(stringName:string) {
4
- let lower = "";
1
+ export class CaseChanger {
2
+ /*
3
+ Crude version that handles basic latin alphabet.
4
+ */
5
+ static ToLower(input: string) {
6
+ let output = "";
5
7
 
6
- for (let i = 0; i < stringName.length; i++) {
7
- let value = stringName.charCodeAt(i);
8
+ for (let i = 0; i < input.length; i++) {
9
+ let charCode = input.charCodeAt(i);
10
+ let char = input.charAt(i);
8
11
 
9
- if (value >= 65 && value <= 90) {
10
- lower += String.fromCharCode(value + 32);
12
+ if (charCode >= 65 && charCode <= 90) {
13
+ let newChar = String.fromCharCode(charCode + 32);
14
+
15
+ // console.log(
16
+ // `uppercase: ${i} ${char} ${charCode} newCharCode ${
17
+ // charCode + 32
18
+ // } newChar: ${newChar}`
19
+ // );
20
+
21
+ output += newChar;
11
22
  } else {
12
- lower += stringName[i];
23
+ // console.log(`already lowercase: ${i} ${char} ${charCode}`);
24
+
25
+ output += input[i];
13
26
  }
14
27
  }
15
28
 
16
- return lower;
29
+ return output;
17
30
  }
18
31
  }