refactor to use upper and lower case terms
MODIFY
packages/@romejs/codec-source-map/base64.ts
packages/@romejs/codec-source-map/base64.ts
@@ -129,11 +129,11 @@ export function encodeVLQ(value: number): string {
* failure.
*/
export function decode(charCode: number): number {
- const bigA = 65; // 'A'
- const bigZ = 90; // 'Z'
+ const uppercaseA = 65; // 'A'
+ const uppercaseZ = 90; // 'Z'
- const littleA = 97; // 'a'
- const littleZ = 122; // 'z'
+ const lowercaseA = 97; // 'a'
+ const lowercaseZ = 122; // 'z'
const zero = 48; // '0'
const nine = 57; // '9'
@@ -141,17 +141,17 @@ export function decode(charCode: number): number {
const plus = 43; // '+'
const slash = 47; // '/'
- const littleOffset = 26;
+ const lowercaseOffset = 26;
const numberOffset = 52;
// 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
- if (bigA <= charCode && charCode <= bigZ) {
- return charCode - bigA;
+ if (uppercaseA <= charCode && charCode <= uppercaseZ) {
+ return charCode - uppercaseA;
}
// 26 - 51: abcdefghijklmnopqrstuvwxyz
- if (littleA <= charCode && charCode <= littleZ) {
- return charCode - littleA + littleOffset;
+ if (lowercaseA <= charCode && charCode <= lowercaseZ) {
+ return charCode - lowercaseA + lowercaseOffset;
}
// 52 - 61: 0123456789

refactor to use upper and lower case terms