next-translate-plugin 2.5.0 → 2.5.3-canary.1
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/lib/cjs/utils.js +3 -0
- package/lib/esm/utils.js +3 -0
- package/package.json +2 -2
- package/utils.d.ts +1 -1
package/lib/cjs/utils.js
CHANGED
|
@@ -101,6 +101,9 @@ function parseCode(format, code) {
|
|
|
101
101
|
}
|
|
102
102
|
exports.parseCode = parseCode;
|
|
103
103
|
function getSymbol(filePkg, node) {
|
|
104
|
+
if (node.symbol) {
|
|
105
|
+
return node.symbol;
|
|
106
|
+
}
|
|
104
107
|
var location = typescript_1.default.isVariableDeclaration(node) ? node.name : node;
|
|
105
108
|
return filePkg.checker.getSymbolAtLocation(location);
|
|
106
109
|
}
|
package/lib/esm/utils.js
CHANGED
|
@@ -89,6 +89,9 @@ export function parseCode(format, code) {
|
|
|
89
89
|
return getFilePkg(program, filename);
|
|
90
90
|
}
|
|
91
91
|
export function getSymbol(filePkg, node) {
|
|
92
|
+
if (node.symbol) {
|
|
93
|
+
return node.symbol;
|
|
94
|
+
}
|
|
92
95
|
var location = ts.isVariableDeclaration(node) ? node.name : node;
|
|
93
96
|
return filePkg.checker.getSymbolAtLocation(location);
|
|
94
97
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "next-translate-plugin",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.3-canary.1",
|
|
4
4
|
"description": "Tiny and powerful i18n plugin to translate your Next.js pages.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
@@ -104,4 +104,4 @@
|
|
|
104
104
|
"^.+\\.(j|t)sx?$": "babel-jest"
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
}
|
|
107
|
+
}
|
package/utils.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare function getTsCompilerOptions(basePath: string, cutDependencies?:
|
|
|
9
9
|
export declare function getFilePkg(program: ts.Program, filename: string): ParsedFilePkg;
|
|
10
10
|
export declare function parseFile(basePath: string, filename: string): ParsedFilePkg;
|
|
11
11
|
export declare function parseCode(format: string, code: string): ParsedFilePkg;
|
|
12
|
-
export declare function getSymbol(filePkg: ParsedFilePkg, node: ts.Node):
|
|
12
|
+
export declare function getSymbol(filePkg: ParsedFilePkg, node: ts.Node): any;
|
|
13
13
|
export declare function getImportedNames(filePkg: ParsedFilePkg, moduleName: string): Map<string, ts.Identifier> | undefined;
|
|
14
14
|
export declare function resolveParenthesis(filePkg: ParsedFilePkg, parenthesizedExpression: ts.ParenthesizedExpression): ts.Expression;
|
|
15
15
|
export declare function resolveIdentifier(filePkg: ParsedFilePkg, identifier: ts.Identifier): ts.Declaration | ts.Identifier;
|