check-chinese
Advanced tools
Comparing version 1.0.1 to 1.0.2
20
index.js
@@ -23,10 +23,16 @@ #!/usr/bin/env node | ||
const file = fs.readFileSync(filePath, "utf8"); | ||
const hasChinese = file | ||
.toString() | ||
.match( | ||
/[\u3040-\u30ff\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff\uff66-\uff9f]/g | ||
); | ||
if (hasChinese) { | ||
console.log(hasChinese, filePath); | ||
if ( | ||
[".js", ".jsx", ".ts", ".tsx", ".go", ".md"].includes( | ||
path.extname(filePath) | ||
) | ||
) { | ||
const hasChinese = file | ||
.toString() | ||
.match( | ||
/[\u3040-\u30ff\u3400-\u4dbf\u4e00-\u9fff\uf900-\ufaff\uff66-\uff9f]/g | ||
); | ||
if (hasChinese) { | ||
console.log(hasChinese, filePath); | ||
} | ||
} | ||
}); |
{ | ||
"name": "check-chinese", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
1273
34