+1
-1
| { | ||
| "name": "esrap", | ||
| "version": "2.2.5", | ||
| "version": "2.2.6", | ||
| "description": "Parse in reverse", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -1851,11 +1851,19 @@ /** @import { TSESTree } from '@typescript-eslint/types' */ | ||
| if (node.typeParameter) { | ||
| context.visit(node.typeParameter); | ||
| const legacy_type_parameter = node.typeParameter; | ||
| const key = node.key ?? legacy_type_parameter?.name; | ||
| const constraint = node.constraint ?? legacy_type_parameter?.constraint; | ||
| if (key && typeof key === 'object') { | ||
| context.visit(key); | ||
| } else { | ||
| context.visit(node.key); | ||
| context.write(key, node); | ||
| } | ||
| if (constraint) { | ||
| context.write(' in '); | ||
| context.visit(node.constraint); | ||
| context.visit(constraint); | ||
| } | ||
| context.write(']'); | ||
| if (node.typeAnnotation) { | ||
@@ -1865,2 +1873,3 @@ context.write(': '); | ||
| } | ||
| context.write('}'); | ||
@@ -2024,5 +2033,11 @@ }, | ||
| if (node.declare) context.write('declare '); | ||
| else context.write('namespace '); | ||
| context.visit(node.id); | ||
| if (node.global) { | ||
| context.write('global', node.id); | ||
| } else { | ||
| // @ts-expect-error `acorn-typescript` and `@typescript-eslint/types` have slightly different type definitions | ||
| const kind = node.kind ?? (node.id.type === 'Literal' ? 'module' : 'namespace'); | ||
| context.write(kind + ' '); | ||
| context.visit(node.id); | ||
| } | ||
@@ -2029,0 +2044,0 @@ if (!node.body) return; |
80799
0.6%2456
0.45%