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

i18next-typescript

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i18next-typescript - npm Package Compare versions

Comparing version 0.0.1-rc4 to 0.0.1-rc5

example/i18next.keys.ts

4

example/i18next-typescript.config.json
{
"inFolder": "example/locales/en",
"outFile": "example/i18next.keys.d.ts",
"outFile": "example/i18next.keys.ts",
"defaultNs": "translation",
"indent": 2,
"typeName": "TranslationKeys",
"quoteChart": "'"
"quoteChar": "'"
}

@@ -33,7 +33,14 @@ #!/usr/bin/env node

});
withOptions(commander.command("generate").alias("g")).action((c) => __awaiter(void 0, void 0, void 0, function* () {
withOptions(commander
.command("generate")
.alias("g")
.description("Generate type definitions for all your translation keys.")).action((c) => __awaiter(void 0, void 0, void 0, function* () {
const options = yield parseOptions(c.opts());
console.log(options);
yield generate_1.generate(options);
}));
withOptions(commander.command("watch").alias("w")).action((c) => __awaiter(void 0, void 0, void 0, function* () {
withOptions(commander
.command("watch")
.alias("w")
.description("Watch your translation files and generate type definitions for all your translations keys when they change.")).action((c) => __awaiter(void 0, void 0, void 0, function* () {
const options = yield parseOptions(c.opts());

@@ -40,0 +47,0 @@ watch_1.watch({ inFolder: options.inFolder }, () => generate_1.generate(options));

@@ -28,3 +28,3 @@ "use strict";

};
const keysToTs = ({ keys, indent, quoteChar, typeName = "TranslationKey", }) => {
const keysToTs = ({ keys, indent, quoteChar, typeName, }) => {
const whitespace = Array(indent)

@@ -39,3 +39,3 @@ .fill(null)

};
exports.generate = ({ inFolder, outFile, defaultNs = "translation", indent = 2, typeName = "TranslationKey", quoteChar = `'`, }) => __awaiter(void 0, void 0, void 0, function* () {
exports.generate = ({ inFolder, outFile, defaultNs = "translation", indent = 2, typeName = "TranslationKeys", quoteChar = `'`, }) => __awaiter(void 0, void 0, void 0, function* () {
const files = yield util_1.readdir(inFolder);

@@ -42,0 +42,0 @@ const jsonFiles = files.filter((f) => f.endsWith(".json"));

{
"name": "i18next-typescript",
"version": "0.0.1-rc4",
"version": "0.0.1-rc5",
"main": "lib/index.js",

@@ -23,3 +23,5 @@ "author": "LFDM <1986gh@gmail.com>",

"dev": "ts-node src/cli.ts",
"prepack": "yarn build"
"prepack": "yarn build",
"example:watch": "yarn dev watch -c example/i18next-typescript.config.json",
"example:generate": "yarn dev generate -c example/i18next-typescript.config.json"
},

@@ -26,0 +28,0 @@ "bin": {

@@ -42,2 +42,3 @@ #!/usr/bin/env node

: {};
return {

@@ -54,8 +55,21 @@ inFolder: opts.in,

withOptions(commander.command("generate").alias("g")).action(async (c) => {
withOptions(
commander
.command("generate")
.alias("g")
.description("Generate type definitions for all your translation keys.")
).action(async (c) => {
const options = await parseOptions(c.opts());
console.log(options);
await generate(options);
});
withOptions(commander.command("watch").alias("w")).action(async (c) => {
withOptions(
commander
.command("watch")
.alias("w")
.description(
"Watch your translation files and generate type definitions for all your translations keys when they change."
)
).action(async (c) => {
const options = await parseOptions(c.opts());

@@ -62,0 +76,0 @@ watch({ inFolder: options.inFolder }, () => generate(options));

@@ -24,3 +24,3 @@ import * as path from "path";

quoteChar,
typeName = "TranslationKey",
typeName,
}: {

@@ -56,3 +56,3 @@ keys: string[];

indent = 2,
typeName = "TranslationKey",
typeName = "TranslationKeys",
quoteChar = `'`,

@@ -59,0 +59,0 @@ }: Options) => {

Sorry, the diff of this file is not supported yet

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