Socket
Socket
Sign inDemoInstall

fis3-parser-react-i18n

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fis3-parser-react-i18n - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

34

index.js

@@ -28,14 +28,24 @@ var parse = require('@babel/parser').parse;

var chinesePath = languages.find(function (language) { return language.name === 'zh-CN'; }).path;
var code = fs.readFileSync(p.resolve(process.cwd(), chinesePath, 'zh-CN.ts'), 'utf8');
var ast = parse(code, {
sourceType: 'module',
plugins: ['typescript']
});
traverse(ast, {
ObjectProperty: function (path) {
var key = path.node.key.value || path.node.key.name;
var value = path.node.value.value || path.node.value.name;
baseLocale[key] = value;
}
});
var chineseFunc = function (chinesePath) {
var code = fs.readFileSync(p.resolve(process.cwd(), chinesePath, 'zh-CN.ts'), 'utf8');
var ast = parse(code, {
sourceType: 'module',
plugins: ['typescript']
});
traverse(ast, {
ObjectProperty: function (path) {
var key = path.node.key.value || path.node.key.name;
var value = path.node.value.value || path.node.value.name;
baseLocale[key] = value;
}
});
};
if (typeof chinesePath === 'string') {
chineseFunc(chinesePath);
}
else if (Array.isArray(chinesePath)) {
chinesePath.forEach(function (p) {
chineseFunc(p);
});
}
}

@@ -42,0 +52,0 @@ module.exports = function (content, file, options) {

{
"name": "fis3-parser-react-i18n",
"version": "0.0.5",
"version": "0.0.6",
"description": "fis3处理react国际化插件",

@@ -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