linkmore-intl-generator
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -82,5 +82,11 @@ "use strict"; | ||
const toHump = (name) => { | ||
return name.replace(/[^a-zA-Z0-9 ]/g, '').replace(/( +)(\w)/g, (all) => { | ||
const _name = name.replace(/[^a-zA-Z0-9 ]/g, '').replace(/( +)(\w)/g, (all) => { | ||
return all.trim().toUpperCase(); | ||
}); | ||
// 中文开头, 将中文移动到末尾 | ||
if (/^\d+/.test(_name)) { | ||
const num = /^\d+/.exec(_name); | ||
return _name.replace(`${num}`, '') + num; | ||
} | ||
return _name; | ||
}; | ||
@@ -96,3 +102,3 @@ const result = {}; | ||
result[id] = { | ||
id: toHump(englishList[index]), | ||
id, | ||
defaultMessage: text, | ||
@@ -289,2 +295,3 @@ description: this.options.description, | ||
// const filepath = path.resolve(process.cwd(), './Table/**/*.ts(x)?'); | ||
// const filepath = path.resolve(process.cwd(), './1.tsx'); | ||
// const configPath = path.resolve(process.cwd(), './common.ts'); | ||
@@ -291,0 +298,0 @@ // const util = new GenerateIntl({ |
{ | ||
"name": "linkmore-intl-generator", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -110,5 +110,11 @@ import fs from 'fs'; | ||
const toHump = (name: string) => { | ||
return name.replace(/[^a-zA-Z0-9 ]/g, '').replace(/( +)(\w)/g, (all) => { | ||
const _name = name.replace(/[^a-zA-Z0-9 ]/g, '').replace(/( +)(\w)/g, (all) => { | ||
return all.trim().toUpperCase(); | ||
}); | ||
// 中文开头, 将中文移动到末尾 | ||
if (/^\d+/.test(_name)) { | ||
const num = /^\d+/.exec(_name) | ||
return _name.replace(`${num}`, '') + num | ||
} | ||
return _name | ||
}; | ||
@@ -126,3 +132,3 @@ | ||
result[id] = { | ||
id: toHump(englishList[index]), | ||
id, | ||
defaultMessage: text, | ||
@@ -338,2 +344,3 @@ description: this.options.description, | ||
// const filepath = path.resolve(process.cwd(), './Table/**/*.ts(x)?'); | ||
// const filepath = path.resolve(process.cwd(), './1.tsx'); | ||
@@ -340,0 +347,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
47434
1038