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

@opensea/i18n-extract

Package Overview
Dependencies
Maintainers
10
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opensea/i18n-extract - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

dist/file.d.ts

18

dist/cli.js

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

var extract_1 = require("./extract");
var path_1 = __importDefault(require("path"));
var file_1 = require("./file");
var extract = function () { return __awaiter(void 0, void 0, void 0, function () {

@@ -58,7 +60,7 @@ var options, directory, out, spinner, files, translations;

.requiredOption("-D, --directory <directory>", "Source directory to recursively extract i18n keys.")
.requiredOption("-O, --out <out>", "Path to the locale file with extracted translations keys.");
.requiredOption("-O, --out <out>", "Directory where to extract translations keys into.");
options = commander_1.program.parse().opts();
directory = options.directory, out = options.out;
spinner = (0, ora_1.default)("Processing files for translations...").start();
return [4 /*yield*/, (0, glob_1.glob)("".concat(directory, "/**/*"))];
return [4 /*yield*/, (0, glob_1.glob)("".concat(directory, "/**/*.{ts,tsx}"))];
case 1:

@@ -69,5 +71,15 @@ files = _a.sent();

translations = _a.sent();
return [4 /*yield*/, promises_1.default.writeFile(out, JSON.stringify(translations, null, 2))];
return [4 /*yield*/, (0, file_1.fileExists)(out)];
case 3:
if (!!(_a.sent())) return [3 /*break*/, 5];
return [4 /*yield*/, promises_1.default.mkdir(out, { recursive: true })];
case 4:
_a.sent();
_a.label = 5;
case 5: return [4 /*yield*/, Promise.all(Object.keys(translations).map(function (namespace) {
var outfile = path_1.default.join(out, "".concat(namespace, ".json"));
return promises_1.default.writeFile(outfile, JSON.stringify(translations[namespace], null, 2));
}))];
case 6:
_a.sent();
spinner.succeed("All translations created!");

@@ -74,0 +86,0 @@ return [2 /*return*/];

2

package.json
{
"name": "@opensea/i18n-extract",
"version": "0.0.3",
"version": "0.0.4",
"description": "Package for i18n key extractions",

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

Sorry, the diff of this file is not supported yet

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