esrap 2.2.2 → 2.2.4
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/package.json +3 -3
- package/src/languages/ts/index.js +15 -0
- package/src/languages/ts/public.d.ts +1 -1
- package/src/languages/tsx/index.js +0 -2
- package/src/languages/tsx/public.d.ts +1 -1
- package/src/languages/types.d.ts +1 -2
- package/src/public.d.ts +1 -1
- package/src/types.d.ts +1 -15
- package/types/index.d.ts +0 -1
- package/types/index.d.ts.map +2 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "esrap",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.4",
|
|
4
4
|
"description": "Parse in reverse",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@changesets/cli": "^2.27.11",
|
|
31
31
|
"@sveltejs/acorn-typescript": "^1.0.5",
|
|
32
|
-
"@typescript-eslint/types": "^8.2.0",
|
|
33
32
|
"@vitest/ui": "^2.1.1",
|
|
34
33
|
"acorn": "^8.15.0",
|
|
35
34
|
"dts-buddy": "^0.6.2",
|
|
@@ -41,7 +40,8 @@
|
|
|
41
40
|
},
|
|
42
41
|
"license": "MIT",
|
|
43
42
|
"dependencies": {
|
|
44
|
-
"@jridgewell/sourcemap-codec": "^1.4.15"
|
|
43
|
+
"@jridgewell/sourcemap-codec": "^1.4.15",
|
|
44
|
+
"@typescript-eslint/types": "^8.2.0"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
@@ -566,6 +566,13 @@ export default (options = {}) => {
|
|
|
566
566
|
if (node.superClass) {
|
|
567
567
|
context.write('extends ');
|
|
568
568
|
context.visit(node.superClass);
|
|
569
|
+
|
|
570
|
+
// @ts-expect-error `acorn-typescript` and `@typescript-eslint/types` have slightly different type definitions
|
|
571
|
+
var type_arguments = node.superTypeParameters ?? node.superTypeArguments;
|
|
572
|
+
if (type_arguments) {
|
|
573
|
+
context.visit(type_arguments);
|
|
574
|
+
}
|
|
575
|
+
|
|
569
576
|
context.write(' ');
|
|
570
577
|
}
|
|
571
578
|
|
|
@@ -638,6 +645,14 @@ export default (options = {}) => {
|
|
|
638
645
|
context.write('abstract ');
|
|
639
646
|
}
|
|
640
647
|
|
|
648
|
+
if (node.accessibility) {
|
|
649
|
+
context.write(node.accessibility + ' ');
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
if (node.override) {
|
|
653
|
+
context.write('override ');
|
|
654
|
+
}
|
|
655
|
+
|
|
641
656
|
if (node.static) {
|
|
642
657
|
context.write('static ');
|
|
643
658
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './index';
|
|
2
|
-
export { BaseComment, Comment } from '../types';
|
|
2
|
+
export type { BaseComment, Comment } from '../types';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './index';
|
|
2
|
-
export { BaseComment, Comment } from '../types';
|
|
2
|
+
export type { BaseComment, Comment } from '../types';
|
package/src/languages/types.d.ts
CHANGED
package/src/public.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { PrintOptions, Visitors } from './types';
|
|
1
|
+
export type { PrintOptions, Visitors } from './types';
|
|
2
2
|
export * from './index';
|
package/src/types.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Context } from 'esrap';
|
|
1
|
+
import type { Context } from 'esrap';
|
|
3
2
|
|
|
4
3
|
export type BaseNode = {
|
|
5
4
|
type: string;
|
|
@@ -23,19 +22,6 @@ export type Visitors<T extends BaseNode = BaseNode> = T['type'] extends '_'
|
|
|
23
22
|
|
|
24
23
|
export { Context };
|
|
25
24
|
|
|
26
|
-
export type TypeAnnotationNodes =
|
|
27
|
-
| TSESTree.TypeNode
|
|
28
|
-
| TSESTree.TypeElement
|
|
29
|
-
| TSESTree.TSTypeAnnotation
|
|
30
|
-
| TSESTree.TSPropertySignature
|
|
31
|
-
| TSESTree.TSTypeParameter
|
|
32
|
-
| TSESTree.TSTypeParameterDeclaration
|
|
33
|
-
| TSESTree.TSTypeParameterInstantiation
|
|
34
|
-
| TSESTree.TSEnumMember
|
|
35
|
-
| TSESTree.TSInterfaceHeritage
|
|
36
|
-
| TSESTree.TSClassImplements
|
|
37
|
-
| TSExpressionWithTypeArguments;
|
|
38
|
-
|
|
39
25
|
type TSExpressionWithTypeArguments = {
|
|
40
26
|
type: 'TSExpressionWithTypeArguments';
|
|
41
27
|
expression: any;
|
package/types/index.d.ts
CHANGED
|
@@ -128,7 +128,6 @@ declare module 'esrap/languages/tsx' {
|
|
|
128
128
|
import type { TSESTree } from '@typescript-eslint/types';
|
|
129
129
|
import type { Context } from 'esrap';
|
|
130
130
|
export default function _default(options?: TSOptions): Visitors<TSESTree.Node>;
|
|
131
|
-
export type Node = TSESTree.Node;
|
|
132
131
|
type TSOptions = {
|
|
133
132
|
quotes?: 'double' | 'single';
|
|
134
133
|
comments?: Comment[];
|
package/types/index.d.ts.map
CHANGED
|
@@ -24,17 +24,15 @@
|
|
|
24
24
|
"../src/index.js",
|
|
25
25
|
"../src/context.js",
|
|
26
26
|
"../src/languages/ts/index.js",
|
|
27
|
-
"../src/languages/types.d.ts"
|
|
28
|
-
"../src/languages/tsx/index.js"
|
|
27
|
+
"../src/languages/types.d.ts"
|
|
29
28
|
],
|
|
30
29
|
"sourcesContent": [
|
|
31
30
|
null,
|
|
32
31
|
null,
|
|
33
32
|
null,
|
|
34
33
|
null,
|
|
35
|
-
null,
|
|
36
34
|
null
|
|
37
35
|
],
|
|
38
|
-
"mappings": ";
|
|
36
|
+
"mappings": ";MAEYA,QAAQA;;;;;;;;MAQfC,MAAMA;;MAENC,mBAAmBA;;;;MAIZC,OAAOA;;aAEPC,QAAQA;;;;WAWHC,QAAQA;;;;;;MAWbC,OAAOA;;kBAEFC,YAAYA;;;;;;;;;iBCWbC,KAAKA;;;;cC7CRC,OAAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCAPC,sBAAsBA;;aAHZC,IAAIA;MCHfC,SAASA;;;;;;;WAOXC,QAAQA;;;;;;;kBAODC,WAAWA;;;;;;;kBAOXC,OAAOA;;;;;;MJrBZf,QAAQA;;;;;;;;MAQfC,MAAMA;;MAENC,mBAAmBA;;;;MAIZC,OAAOA;;MAEPC,QAAQA;;;;;;;;;;;MIhBRQ,SAASA;;;;;;;WAOXC,QAAQA;;;;;;;kBAODC,WAAWA;;;;;;;kBAOXC,OAAOA;;;;;;MJrBZf,QAAQA;;;;;;;;MAQfC,MAAMA;;MAENC,mBAAmBA;;;;MAIZC,OAAOA;;MAEPC,QAAQA",
|
|
39
37
|
"ignoreList": []
|
|
40
38
|
}
|