@esportsplus/typescript 0.12.0 → 0.12.2
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/build/transformer/constants.d.ts +3 -1
- package/build/transformer/constants.js +3 -1
- package/build/transformer/index.d.ts +2 -1
- package/build/transformer/index.js +1 -0
- package/build/transformer/types.d.ts +6 -6
- package/package.json +1 -1
- package/src/transformer/constants.ts +10 -1
- package/src/transformer/index.ts +2 -7
- package/src/transformer/types.ts +7 -6
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
declare const BRACES_CONTENT_REGEX: RegExp;
|
|
2
2
|
declare const REGEX_ESCAPE_PATTERN: RegExp;
|
|
3
|
+
declare const TRAILING_SEMICOLON: RegExp;
|
|
4
|
+
declare const TRANSFORM_PATTERN: RegExp;
|
|
3
5
|
declare const UUID_DASH_REGEX: RegExp;
|
|
4
|
-
export { BRACES_CONTENT_REGEX, REGEX_ESCAPE_PATTERN, UUID_DASH_REGEX };
|
|
6
|
+
export { BRACES_CONTENT_REGEX, REGEX_ESCAPE_PATTERN, TRAILING_SEMICOLON, TRANSFORM_PATTERN, UUID_DASH_REGEX, };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
const BRACES_CONTENT_REGEX = /\{([^}]*)\}/;
|
|
2
2
|
const REGEX_ESCAPE_PATTERN = /[.*+?^${}()|[\]\\]/g;
|
|
3
|
+
const TRAILING_SEMICOLON = /;$/;
|
|
4
|
+
const TRANSFORM_PATTERN = /\.[tj]sx?$/;
|
|
3
5
|
const UUID_DASH_REGEX = /-/g;
|
|
4
|
-
export { BRACES_CONTENT_REGEX, REGEX_ESCAPE_PATTERN, UUID_DASH_REGEX };
|
|
6
|
+
export { BRACES_CONTENT_REGEX, REGEX_ESCAPE_PATTERN, TRAILING_SEMICOLON, TRANSFORM_PATTERN, UUID_DASH_REGEX, };
|
|
@@ -11,4 +11,5 @@ declare const updateImports: (code: string, modification: ImportModification) =>
|
|
|
11
11
|
declare const visitAst: <T>(sourceFile: ts.SourceFile, callback: VisitorCallback<T>, state: T, predicate?: VisitorPredicate) => T;
|
|
12
12
|
declare const visitAstWithDepth: <T>(sourceFile: ts.SourceFile, callback: (node: ts.Node, depth: number, state: T) => void, state: T, depthTrigger: (node: ts.Node) => boolean) => T;
|
|
13
13
|
export { addImport, applyReplacements, applyReplacementsReverse, collectNodes, mightNeedTransform, program, uid, updateImports, visitAst, visitAstWithDepth };
|
|
14
|
-
export type
|
|
14
|
+
export type * from './types.js';
|
|
15
|
+
export * from './constants.js';
|
|
@@ -156,3 +156,4 @@ const visitAstWithDepth = (sourceFile, callback, state, depthTrigger) => {
|
|
|
156
156
|
return state;
|
|
157
157
|
};
|
|
158
158
|
export { addImport, applyReplacements, applyReplacementsReverse, collectNodes, mightNeedTransform, program, uid, updateImports, visitAst, visitAstWithDepth };
|
|
159
|
+
export * from './constants.js';
|
|
@@ -3,21 +3,21 @@ type ImportModification = {
|
|
|
3
3
|
module: string;
|
|
4
4
|
specifiers: Set<string>;
|
|
5
5
|
};
|
|
6
|
-
type NodeMatch<T> = {
|
|
6
|
+
type NodeMatch<T> = Range & {
|
|
7
7
|
data: T;
|
|
8
|
-
end: number;
|
|
9
8
|
node: ts.Node;
|
|
10
|
-
start: number;
|
|
11
9
|
};
|
|
12
10
|
type QuickCheckPattern = {
|
|
13
11
|
patterns?: string[];
|
|
14
12
|
regex?: RegExp;
|
|
15
13
|
};
|
|
16
|
-
type
|
|
14
|
+
type Range = {
|
|
17
15
|
end: number;
|
|
18
|
-
newText: string;
|
|
19
16
|
start: number;
|
|
20
17
|
};
|
|
18
|
+
type Replacement = Range & {
|
|
19
|
+
newText: string;
|
|
20
|
+
};
|
|
21
21
|
type VisitorCallback<T> = (node: ts.Node, state: T) => void;
|
|
22
22
|
type VisitorPredicate = (node: ts.Node) => boolean;
|
|
23
|
-
export type { ImportModification, NodeMatch, QuickCheckPattern, Replacement, VisitorCallback, VisitorPredicate };
|
|
23
|
+
export type { ImportModification, NodeMatch, QuickCheckPattern, Range, Replacement, VisitorCallback, VisitorPredicate };
|
package/package.json
CHANGED
|
@@ -2,7 +2,16 @@ const BRACES_CONTENT_REGEX = /\{([^}]*)\}/;
|
|
|
2
2
|
|
|
3
3
|
const REGEX_ESCAPE_PATTERN = /[.*+?^${}()|[\]\\]/g;
|
|
4
4
|
|
|
5
|
+
const TRAILING_SEMICOLON = /;$/;
|
|
6
|
+
|
|
7
|
+
const TRANSFORM_PATTERN = /\.[tj]sx?$/;
|
|
8
|
+
|
|
5
9
|
const UUID_DASH_REGEX = /-/g;
|
|
6
10
|
|
|
7
11
|
|
|
8
|
-
export {
|
|
12
|
+
export {
|
|
13
|
+
BRACES_CONTENT_REGEX,
|
|
14
|
+
REGEX_ESCAPE_PATTERN,
|
|
15
|
+
TRAILING_SEMICOLON, TRANSFORM_PATTERN,
|
|
16
|
+
UUID_DASH_REGEX,
|
|
17
|
+
};
|
package/src/transformer/index.ts
CHANGED
|
@@ -249,10 +249,5 @@ export {
|
|
|
249
249
|
uid, updateImports,
|
|
250
250
|
visitAst, visitAstWithDepth
|
|
251
251
|
};
|
|
252
|
-
export type
|
|
253
|
-
|
|
254
|
-
NodeMatch,
|
|
255
|
-
QuickCheckPattern,
|
|
256
|
-
Replacement,
|
|
257
|
-
VisitorCallback, VisitorPredicate
|
|
258
|
-
};
|
|
252
|
+
export type * from './types';
|
|
253
|
+
export * from './constants';
|
package/src/transformer/types.ts
CHANGED
|
@@ -6,11 +6,9 @@ type ImportModification = {
|
|
|
6
6
|
specifiers: Set<string>;
|
|
7
7
|
};
|
|
8
8
|
|
|
9
|
-
type NodeMatch<T> = {
|
|
9
|
+
type NodeMatch<T> = Range & {
|
|
10
10
|
data: T;
|
|
11
|
-
end: number;
|
|
12
11
|
node: ts.Node;
|
|
13
|
-
start: number;
|
|
14
12
|
};
|
|
15
13
|
|
|
16
14
|
type QuickCheckPattern = {
|
|
@@ -18,12 +16,15 @@ type QuickCheckPattern = {
|
|
|
18
16
|
regex?: RegExp;
|
|
19
17
|
};
|
|
20
18
|
|
|
21
|
-
type
|
|
19
|
+
type Range = {
|
|
22
20
|
end: number;
|
|
23
|
-
newText: string;
|
|
24
21
|
start: number;
|
|
25
22
|
};
|
|
26
23
|
|
|
24
|
+
type Replacement = Range & {
|
|
25
|
+
newText: string;
|
|
26
|
+
};
|
|
27
|
+
|
|
27
28
|
type VisitorCallback<T> = (node: ts.Node, state: T) => void;
|
|
28
29
|
|
|
29
30
|
type VisitorPredicate = (node: ts.Node) => boolean;
|
|
@@ -33,6 +34,6 @@ export type {
|
|
|
33
34
|
ImportModification,
|
|
34
35
|
NodeMatch,
|
|
35
36
|
QuickCheckPattern,
|
|
36
|
-
Replacement,
|
|
37
|
+
Range, Replacement,
|
|
37
38
|
VisitorCallback, VisitorPredicate
|
|
38
39
|
};
|