Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

linkmore-intl-generator

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

linkmore-intl-generator - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

20

dist/index.js

@@ -35,2 +35,6 @@ "use strict";

}
// 去除引号
stripQuotation(s) {
return s.replace(/^('|")/, '').replace(/'|"$/, '');
}
translationLanguage(sourceLanguage = 'zh', targetLanguage = 'en', dataSource = []) {

@@ -79,5 +83,5 @@ return __awaiter(this, void 0, void 0, function* () {

const toHump = (name) => {
return name
.replace(/[^a-zA-Z0-9 ]/g, '')
.replace(/( *)(\w)/g, (all) => all.trim().toUpperCase());
return name.replace(/[^a-zA-Z0-9 ]/g, '').replace(/( +)(\w)/g, (all) => {
return all.trim().toUpperCase();
});
};

@@ -130,3 +134,3 @@ const result = {};

if (this.haveChineseReg.test(text)) {
result.push(text.trim());
result.push(this.stripQuotation(text.trim()));
}

@@ -137,3 +141,3 @@ });

if (this.haveChineseReg.test(text)) {
result.push(text.trim());
result.push(this.stripQuotation(text.trim()));
}

@@ -216,3 +220,3 @@ });

file.getDescendantsOfKind(ts_morph_1.SyntaxKind.JsxText).forEach((jsx) => {
const text = jsx.getText(false).trim();
const text = this.stripQuotation(jsx.getText(false).trim());
if (this.haveChineseReg.test(text)) {

@@ -227,3 +231,3 @@ const targetText = replacer(text);

.forEach((literal) => {
const text = literal.getText(false).trim();
const text = this.stripQuotation(literal.getText(false).trim());
if (this.haveChineseReg.test(text)) {

@@ -239,3 +243,3 @@ const targetText = replacer(text);

Variable.getDescendantsOfKind(ts_morph_1.SyntaxKind.StringLiteral).forEach((literal) => {
const text = literal.getText(false).trim();
const text = this.stripQuotation(literal.getText(false).trim());
if (this.haveChineseReg.test(text)) {

@@ -242,0 +246,0 @@ const targetText = replacer(text);

2

package.json
{
"name": "linkmore-intl-generator",
"version": "0.0.1",
"version": "0.0.2",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -55,2 +55,7 @@ import fs from 'fs';

// 去除引号
private stripQuotation(s: string) {
return s.replace(/^('|")/, '').replace(/'|"$/, '');
}
private async translationLanguage(

@@ -106,5 +111,5 @@ sourceLanguage = 'zh',

const toHump = (name: string) => {
return name
.replace(/[^a-zA-Z0-9 ]/g, '')
.replace(/( *)(\w)/g, (all) => all.trim().toUpperCase());
return name.replace(/[^a-zA-Z0-9 ]/g, '').replace(/( +)(\w)/g, (all) => {
return all.trim().toUpperCase();
});
};

@@ -166,3 +171,3 @@

if (this.haveChineseReg.test(text)) {
result.push(text.trim());
result.push(this.stripQuotation(text.trim()));
}

@@ -173,3 +178,3 @@ });

if (this.haveChineseReg.test(text)) {
result.push(text.trim());
result.push(this.stripQuotation(text.trim()));
}

@@ -255,3 +260,3 @@ });

file.getDescendantsOfKind(SyntaxKind.JsxText).forEach((jsx) => {
const text = jsx.getText(false).trim();
const text = this.stripQuotation(jsx.getText(false).trim());
if (this.haveChineseReg.test(text)) {

@@ -267,3 +272,3 @@ const targetText = replacer(text);

.forEach((literal) => {
const text = literal.getText(false).trim();
const text = this.stripQuotation(literal.getText(false).trim());
if (this.haveChineseReg.test(text)) {

@@ -281,3 +286,3 @@ const targetText = replacer(text);

(literal) => {
const text = literal.getText(false).trim();
const text = this.stripQuotation(literal.getText(false).trim());
if (this.haveChineseReg.test(text)) {

@@ -284,0 +289,0 @@ const targetText = replacer(text);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc