diff --git a/packages/move/src/utils.ts b/packages/move/src/utils.ts index 525b8065..0d3be0fe 100644 --- a/packages/move/src/utils.ts +++ b/packages/move/src/utils.ts @@ -43,19 +43,74 @@ export function accountAddressString(account: string): string { return `0x${address.padStart(MOVE_ADDRESS_LENGTH * 2, '0')}` } +// https://github.com/microsoft/TypeScript/issues/2536 const KEYWORDS = new Set([ + 'break', + 'case', + 'catch', + 'class', + 'const', + 'continue', + 'debugger', 'default', + 'delete', + 'do', + 'else', + 'enum', + 'export', + 'extends', + 'false', + 'finally', + 'for', + 'function', + 'if', + 'import', + 'in', + 'instanceof', + 'new', + 'null', + 'return', + 'super', + 'switch', + 'this', + 'throw', + 'true', + 'try', + 'typeof', + 'var', + 'void', + 'while', + 'with', + 'as', + 'implements', + 'interface', + 'let', 'package', - 'namespace', - 'volatile', - 'object', - 'string', + 'private', + 'protected', + 'public', + 'static', + 'yield', + 'any', + 'boolean', + 'constructor', + 'declare', + // 'get', + 'module', + // 'require', 'number', + // 'set', + 'string', + 'symbol', + 'type', + 'from', + // 'of', + 'async', + 'await', 'bigint', - 'any', - 'new', - 'delete', - 'symbol' + 'object', + 'volatile', + 'namespace' ]) export function normalizeToJSName(name: string) {