New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

update-translation-keys

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

update-translation-keys - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

README.md

23

index.js

@@ -23,4 +23,4 @@ #!/usr/bin/env node

You can also pass a flag 'yaml' if the files are in this format:
update-translation-keys --yaml translations/en.yml translations/fr.json
You can also pass a flag 'yaml=true' if the files are in this format:
update-translation-keys --yaml=true translations/en.yml translations/fr.json
`);

@@ -30,9 +30,20 @@ return;

const [_, ...otherFilesPaths] = filePaths;
const [baseFile, ...otherFiles] = filePaths
.map(path => fs.readFileSync(path, 'utf8'))
.map(parseObject);
.map(path => {
const [_, locale] = /(\w+)\.\w+$/.exec(path);
const file = fs.readFileSync(path, 'utf8');
const parsedFile = parseObject(file);
return {
locale,
data: parsedFile[locale],
};
});
const updatedFiles = otherFiles
.map(otherFile => deepMerge(baseFile, otherFile));
.map(({ locale, data }) => ({
[locale]: deepMerge(baseFile.data, object),
}));
filePaths.slice(1)
otherFilesPaths
.forEach((path, i) => {

@@ -39,0 +50,0 @@ const fileToWrite = stringifyObject(updatedFiles[i]);

{
"name": "update-translation-keys",
"version": "1.0.0",
"version": "1.0.1",
"main": "index.js",

@@ -5,0 +5,0 @@ "license": "MIT",

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