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

official-intl

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

official-intl - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

11

bin/update.js

@@ -16,6 +16,6 @@ #!/usr/bin/env node

rootDir += 'src/';
const updateStr = (str, obj, node) => {
const updateStr = (str, obj, tmp) => {
const strTrim = str.trim();
if (obj[strTrim]) {
node.value = node.value.replace(strTrim, obj[strTrim]);
tmp.content = tmp.content.replaceAll(strTrim, obj[strTrim]);
return true;

@@ -45,2 +45,3 @@ }

let content = fs.readFileSync(`${dir}${f}`).toString();
const tmp = { content };
const ast = babelParser.parse(content, {

@@ -59,3 +60,3 @@ sourceType: "module",

if (!/^[\x00-\xff]*$/.test(str)) {
const result = updateStr(v.node.value, obj, v.node);
const result = updateStr(v.node.value, obj, tmp);
hasChange = hasChange || result

@@ -67,3 +68,3 @@ }

if (!/^[\x00-\xff]*$/.test(str)) {
const result = updateStr(v.node.value, obj, v.node);
const result = updateStr(v.node.value, obj, tmp);
hasChange = hasChange || result

@@ -74,3 +75,3 @@ }

if (hasChange) {
fs.writeFileSync(`${dir}${f}`, generate(ast, {}, content ).code);
fs.writeFileSync(`${dir}${f}`, tmp.content);
}

@@ -77,0 +78,0 @@ });

{
"name": "official-intl",
"version": "1.0.6",
"version": "1.0.7",
"description": "数数科技官网国际化文案提取和更新工具",

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

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