linkmore-intl-generator
Advanced tools
Comparing version 0.0.12 to 0.0.13
@@ -153,2 +153,3 @@ "use strict"; | ||
}); | ||
console.log('----', file); | ||
file.getDescendantsOfKind(ts_morph_1.SyntaxKind.StringLiteral).forEach((literal) => { | ||
@@ -272,2 +273,16 @@ const text = literal.getText(false); | ||
/** | ||
* class property | ||
*/ | ||
file | ||
.getDescendantsOfKind(ts_morph_1.SyntaxKind.ClassDeclaration) | ||
.forEach((Variable) => { | ||
Variable.getDescendantsOfKind(ts_morph_1.SyntaxKind.StringLiteral).forEach((literal) => { | ||
const text = this.stripQuotation(literal.getText(false).trim()); | ||
if (this.haveChineseReg.test(text)) { | ||
const targetText = replacer(text); | ||
literal.replaceWithText(`${targetText}/* ts-morph: ${text} */`); | ||
} | ||
}); | ||
}); | ||
/** | ||
* 其他的统一处理 | ||
@@ -321,3 +336,3 @@ */ | ||
// const filepath = path.resolve(process.cwd(), './Table/**/*.ts(x)?'); | ||
// const filepath = path.resolve(process.cwd(), './1.tsx'); | ||
// const filepath = path.resolve(process.cwd(), './store.ts'); | ||
// const configPath = path.resolve(process.cwd(), './common.ts'); | ||
@@ -324,0 +339,0 @@ // const util = new GenerateIntl({ |
@@ -139,5 +139,5 @@ "use strict"; | ||
exports.default = GenerateIntl; | ||
const filepath = path_1.default.resolve(process.cwd(), './Table/**/*.ts(x)?'); | ||
console.log('=====', filepath); | ||
// const filepath = path.resolve(process.cwd(), './1.tsx'); | ||
// const filepath = path.resolve(process.cwd(), './Table/**/*.ts(x)?'); | ||
// console.log('=====', filepath) | ||
const filepath = path_1.default.resolve(process.cwd(), './store.ts'); | ||
const configPath = path_1.default.resolve(process.cwd(), './common.ts'); | ||
@@ -144,0 +144,0 @@ const util = new GenerateIntl({ |
{ | ||
"name": "linkmore-intl-generator", | ||
"version": "0.0.12", | ||
"version": "0.0.13", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
@@ -190,2 +190,4 @@ import fs from 'fs'; | ||
}); | ||
console.log('----', file); | ||
file.getDescendantsOfKind(SyntaxKind.StringLiteral).forEach((literal) => { | ||
@@ -320,2 +322,19 @@ const text = literal.getText(false); | ||
/** | ||
* class property | ||
*/ | ||
file | ||
.getDescendantsOfKind(SyntaxKind.ClassDeclaration) | ||
.forEach((Variable) => { | ||
Variable.getDescendantsOfKind(SyntaxKind.StringLiteral).forEach( | ||
(literal) => { | ||
const text = this.stripQuotation(literal.getText(false).trim()); | ||
if (this.haveChineseReg.test(text)) { | ||
const targetText = replacer(text); | ||
literal.replaceWithText(`${targetText}/* ts-morph: ${text} */`); | ||
} | ||
} | ||
); | ||
}); | ||
/** | ||
* 其他的统一处理 | ||
@@ -373,3 +392,3 @@ */ | ||
// const filepath = path.resolve(process.cwd(), './Table/**/*.ts(x)?'); | ||
// const filepath = path.resolve(process.cwd(), './1.tsx'); | ||
// const filepath = path.resolve(process.cwd(), './store.ts'); | ||
@@ -376,0 +395,0 @@ // const configPath = path.resolve(process.cwd(), './common.ts'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57717
1273