Skip to content

Commit b8f2888

Browse files
author
Roman Snapko
committed
Refactor character code usage in flow-helper to use consistent variable naming and fromCodePoint
1 parent d2915f0 commit b8f2888

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

packages/shared/src/lib/flows/flow-helper.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const actionSchemaValidator = TypeCompiler.Compile(SingleActionSchema);
4747
const triggerSchemaValidation = TypeCompiler.Compile(TriggerWithOptionalId);
4848

4949
const ALPHABET_LENGTH = 26;
50-
const A_CHAR_CODE = 'a'.charCodeAt(0);
50+
const A_CODE_POINT = 97;
5151

5252
export function buildBlockActionKey(
5353
blockName: string,
@@ -1104,7 +1104,8 @@ function indexToAlphabetical(index: number): string {
11041104
let result = '';
11051105
while (n > 0) {
11061106
n--;
1107-
result = String.fromCharCode(A_CHAR_CODE + (n % ALPHABET_LENGTH)) + result;
1107+
result =
1108+
String.fromCodePoint(A_CODE_POINT + (n % ALPHABET_LENGTH)) + result;
11081109
n = Math.floor(n / ALPHABET_LENGTH);
11091110
}
11101111
return result;

0 commit comments

Comments
 (0)