@mfdj/tsc-as-build-tool 1.0.0 → 1.1.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,5 @@
1
1
  export declare class CaseChanger {
2
2
  static ToLower(input: string): string;
3
+ static toLowercase(input: string): string;
3
4
  }
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
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"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,qBAAa,WAAW;IAEtB,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,MAAM;IAI5B,MAAM,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM;CAGjC"}
package/dist/index.js CHANGED
@@ -1,26 +1,10 @@
1
+ import { toLowercase } from "./utils/toLowercase.js";
1
2
  export class CaseChanger {
2
- /*
3
- Crude version that handles basic latin alphabet.
4
- */
3
+ // @deprecated in favor of toLowercase
5
4
  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;
18
- }
19
- else {
20
- // console.log(`already lowercase: ${i} ${char} ${charCode}`);
21
- output += input[i];
22
- }
23
- }
24
- return output;
5
+ return toLowercase(input);
6
+ }
7
+ static toLowercase(input) {
8
+ return toLowercase(input);
25
9
  }
26
10
  }
@@ -0,0 +1,2 @@
1
+ export declare function toLowercase(input: string): string;
2
+ //# sourceMappingURL=toLowercase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toLowercase.d.ts","sourceRoot":"","sources":["../../src/utils/toLowercase.ts"],"names":[],"mappings":"AAGA,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,UAyBxC"}
@@ -0,0 +1,24 @@
1
+ /*
2
+ Crude version that handles basic latin alphabet.
3
+ */
4
+ export function toLowercase(input) {
5
+ let output = "";
6
+ for (let i = 0; i < input.length; i++) {
7
+ let charCode = input.charCodeAt(i);
8
+ let char = input.charAt(i);
9
+ if (charCode >= 65 && charCode <= 90) {
10
+ let newChar = String.fromCharCode(charCode + 32);
11
+ // console.log(
12
+ // `uppercase: ${i} ${char} ${charCode} newCharCode ${
13
+ // charCode + 32
14
+ // } newChar: ${newChar}`
15
+ // );
16
+ output += newChar;
17
+ }
18
+ else {
19
+ // console.log(`already lowercase: ${i} ${char} ${charCode}`);
20
+ output += input[i];
21
+ }
22
+ }
23
+ return output;
24
+ }
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": "1.0.0",
11
+ "version": "1.1.0",
12
12
  "type": "module"
13
13
  }
package/src/index.ts CHANGED
@@ -1,31 +1,12 @@
1
+ import { toLowercase } from "./utils/toLowercase.js";
2
+
1
3
  export class CaseChanger {
2
- /*
3
- Crude version that handles basic latin alphabet.
4
- */
4
+ // @deprecated in favor of toLowercase
5
5
  static ToLower(input: string) {
6
- let output = "";
7
-
8
- for (let i = 0; i < input.length; i++) {
9
- let charCode = input.charCodeAt(i);
10
- let char = input.charAt(i);
11
-
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;
22
- } else {
23
- // console.log(`already lowercase: ${i} ${char} ${charCode}`);
24
-
25
- output += input[i];
26
- }
27
- }
6
+ return toLowercase(input);
7
+ }
28
8
 
29
- return output;
9
+ static toLowercase(input: string) {
10
+ return toLowercase(input);
30
11
  }
31
12
  }
@@ -0,0 +1,29 @@
1
+ /*
2
+ Crude version that handles basic latin alphabet.
3
+ */
4
+ export function toLowercase(input: string) {
5
+ let output = "";
6
+
7
+ for (let i = 0; i < input.length; i++) {
8
+ let charCode = input.charCodeAt(i);
9
+ let char = input.charAt(i);
10
+
11
+ if (charCode >= 65 && charCode <= 90) {
12
+ let newChar = String.fromCharCode(charCode + 32);
13
+
14
+ // console.log(
15
+ // `uppercase: ${i} ${char} ${charCode} newCharCode ${
16
+ // charCode + 32
17
+ // } newChar: ${newChar}`
18
+ // );
19
+
20
+ output += newChar;
21
+ } else {
22
+ // console.log(`already lowercase: ${i} ${char} ${charCode}`);
23
+
24
+ output += input[i];
25
+ }
26
+ }
27
+
28
+ return output;
29
+ }