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

i18n-validate

Package Overview
Dependencies
Maintainers
1
Versions
134
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i18n-validate - npm Package Compare versions

Comparing version 1.4.3-next.f9c39c5.0 to 1.4.3-next.fb11ed3.0

dist/chunk-OSNOD3G2.js

36

CHANGELOG.md

@@ -9,12 +9,12 @@ # Changelog

- Empty string check ([09ac1d2](https://github.com/imranbarbhuiya/i18n-validate/commit/09ac1d23ebe08eecfe4c1562c16d7ac4e0bdba30))
- Dynamic import ([58b2196](https://github.com/imranbarbhuiya/i18n-validate/commit/58b21966f8ef1c0365f2d05516435c6bceb773a2))
- Jsconfig url ([708b1b0](https://github.com/imranbarbhuiya/i18n-validate/commit/708b1b082b99889d1293ac07d2db8d66aa2800aa))
- Add file count ([2b2002c](https://github.com/imranbarbhuiya/i18n-validate/commit/2b2002cdca4ea31edc76bb2d018c378a161b7ee5))
- Add time taken log ([91a1533](https://github.com/imranbarbhuiya/i18n-validate/commit/91a153309bbfef7450b46cced9091a68ccb6e9f8))
- Empty string check ([09ac1d2](https://github.com/imranbarbhuiya/i18n-validate/commit/09ac1d23ebe08eecfe4c1562c16d7ac4e0bdba30))
- Dynamic import ([58b2196](https://github.com/imranbarbhuiya/i18n-validate/commit/58b21966f8ef1c0365f2d05516435c6bceb773a2))
- Jsconfig url ([708b1b0](https://github.com/imranbarbhuiya/i18n-validate/commit/708b1b082b99889d1293ac07d2db8d66aa2800aa))
- Add file count ([2b2002c](https://github.com/imranbarbhuiya/i18n-validate/commit/2b2002cdca4ea31edc76bb2d018c378a161b7ee5))
- Add time taken log ([91a1533](https://github.com/imranbarbhuiya/i18n-validate/commit/91a153309bbfef7450b46cced9091a68ccb6e9f8))
### 🚀 Features
- Support dynamic key using ts type ([3673637](https://github.com/imranbarbhuiya/i18n-validate/commit/36736374577a15030a80929870de98fb43d520a7))
- Support ternary and string concatenation in key ([943682f](https://github.com/imranbarbhuiya/i18n-validate/commit/943682f7aefac0da152ae2ae240c1c314c6d1f16))
- Support dynamic key using ts type ([3673637](https://github.com/imranbarbhuiya/i18n-validate/commit/36736374577a15030a80929870de98fb43d520a7))
- Support ternary and string concatenation in key ([943682f](https://github.com/imranbarbhuiya/i18n-validate/commit/943682f7aefac0da152ae2ae240c1c314c6d1f16))

@@ -25,10 +25,10 @@ ## [i18n-validate@1.4.1](https://github.com/imranbarbhuiya/i18n-validate/compare/v1.2.1...i18n-validate@1.4.1) - (2023-07-19)

- Jsconfig url ([708b1b0](https://github.com/imranbarbhuiya/i18n-validate/commit/708b1b082b99889d1293ac07d2db8d66aa2800aa))
- Add file count ([2b2002c](https://github.com/imranbarbhuiya/i18n-validate/commit/2b2002cdca4ea31edc76bb2d018c378a161b7ee5))
- Add time taken log ([91a1533](https://github.com/imranbarbhuiya/i18n-validate/commit/91a153309bbfef7450b46cced9091a68ccb6e9f8))
- Jsconfig url ([708b1b0](https://github.com/imranbarbhuiya/i18n-validate/commit/708b1b082b99889d1293ac07d2db8d66aa2800aa))
- Add file count ([2b2002c](https://github.com/imranbarbhuiya/i18n-validate/commit/2b2002cdca4ea31edc76bb2d018c378a161b7ee5))
- Add time taken log ([91a1533](https://github.com/imranbarbhuiya/i18n-validate/commit/91a153309bbfef7450b46cced9091a68ccb6e9f8))
### 🚀 Features
- Support dynamic key using ts type ([3673637](https://github.com/imranbarbhuiya/i18n-validate/commit/36736374577a15030a80929870de98fb43d520a7))
- Support ternary and string concatenation in key ([943682f](https://github.com/imranbarbhuiya/i18n-validate/commit/943682f7aefac0da152ae2ae240c1c314c6d1f16))
- Support dynamic key using ts type ([3673637](https://github.com/imranbarbhuiya/i18n-validate/commit/36736374577a15030a80929870de98fb43d520a7))
- Support ternary and string concatenation in key ([943682f](https://github.com/imranbarbhuiya/i18n-validate/commit/943682f7aefac0da152ae2ae240c1c314c6d1f16))

@@ -39,9 +39,9 @@ ## [i18n-validate@1.4.0](https://github.com/imranbarbhuiya/i18n-validate/compare/v1.2.1...i18n-validate@1.4.0) - (2023-07-18)

- Add file count ([2b2002c](https://github.com/imranbarbhuiya/i18n-validate/commit/2b2002cdca4ea31edc76bb2d018c378a161b7ee5))
- Add time taken log ([91a1533](https://github.com/imranbarbhuiya/i18n-validate/commit/91a153309bbfef7450b46cced9091a68ccb6e9f8))
- Add file count ([2b2002c](https://github.com/imranbarbhuiya/i18n-validate/commit/2b2002cdca4ea31edc76bb2d018c378a161b7ee5))
- Add time taken log ([91a1533](https://github.com/imranbarbhuiya/i18n-validate/commit/91a153309bbfef7450b46cced9091a68ccb6e9f8))
### 🚀 Features
- Support dynamic key using ts type ([3673637](https://github.com/imranbarbhuiya/i18n-validate/commit/36736374577a15030a80929870de98fb43d520a7))
- Support ternary and string concatenation in key ([943682f](https://github.com/imranbarbhuiya/i18n-validate/commit/943682f7aefac0da152ae2ae240c1c314c6d1f16))
- Support dynamic key using ts type ([3673637](https://github.com/imranbarbhuiya/i18n-validate/commit/36736374577a15030a80929870de98fb43d520a7))
- Support ternary and string concatenation in key ([943682f](https://github.com/imranbarbhuiya/i18n-validate/commit/943682f7aefac0da152ae2ae240c1c314c6d1f16))

@@ -52,7 +52,7 @@ ## [i18n-validate@1.3.0](https://github.com/imranbarbhuiya/i18n-validate/compare/v1.2.1...i18n-validate@1.3.0) - (2023-07-18)

- Add time taken log ([91a1533](https://github.com/imranbarbhuiya/i18n-validate/commit/91a153309bbfef7450b46cced9091a68ccb6e9f8))
- Add time taken log ([91a1533](https://github.com/imranbarbhuiya/i18n-validate/commit/91a153309bbfef7450b46cced9091a68ccb6e9f8))
### 🚀 Features
- Support ternary and string concatenation in key ([943682f](https://github.com/imranbarbhuiya/i18n-validate/commit/943682f7aefac0da152ae2ae240c1c314c6d1f16))
- Support ternary and string concatenation in key ([943682f](https://github.com/imranbarbhuiya/i18n-validate/commit/943682f7aefac0da152ae2ae240c1c314c6d1f16))

@@ -59,0 +59,0 @@ ## [1.2.1](https://github.com/imranbarbhuiya/i18n-validate/compare/v1.2.0...v1.2.1) - (2023-07-16)

#!/usr/bin/env node
import { parseOptionsFile, log, parseFile, ValidationError, validateKey } from './chunk-STXOAPH2.js';
import { parseOptionsFile, log, parseFile, ValidationError, validateKey } from './chunk-OSNOD3G2.js';
import process from 'node:process';
import { Command } from 'commander';
import { Glob } from 'glob';
import { stream } from 'fast-glob';
var start = performance.now();
var command = new Command().version("1.4.3-next.f9c39c5.0").usage("[options] <file ...>").option("-c, --config <config>", "Path to the config file", "./i18n-validate.json").option("--log-level <logLevel>", "Log level").option("--exclude <exclude...>", "Exclude files from parsing").option("--exit-on-error", "Exit immediately if an error is found");
var command = new Command().version("1.4.3-next.fb11ed3.0").usage("[options] <file ...>").option("-c, --config <config>", "Path to the config file", "./i18n-validate.json").option("--log-level <logLevel>", "Log level").option("--exclude <exclude...>", "Exclude files from parsing").option("--exit-on-error", "Exit immediately if an error is found");
command.on("--help", () => {

@@ -21,9 +21,7 @@ console.log("");

options.inputs = program.args.length > 0 ? program.args : options.inputs;
if (!Array.isArray(options.inputs))
options.inputs = [options.inputs];
if (!Array.isArray(options.inputs)) options.inputs = [options.inputs];
if (!Array.isArray(options.exclude)) options.exclude = [options.exclude];
options.inputs = options.inputs.map((_input) => {
let input = _input.trim().replaceAll("\\", "/");
if (/^'.*'$|^".*"$/.test(input)) {
input = input.slice(1, -1);
}
if (/^'.*'$|^".*"$/.test(input)) input = input.slice(1, -1);
return input;

@@ -37,3 +35,3 @@ }).filter(Boolean);

}
var glob = new Glob(options.inputs, {
var glob = stream(options.inputs, {
ignore: options.exclude

@@ -47,3 +45,3 @@ });

log(`Parsing ${file}`, "debug", options);
const translationNodes = parseFile(file, options);
const translationNodes = parseFile(file.toString(), options);
for (const node of translationNodes) {

@@ -64,4 +62,3 @@ if (!node.isStaticKey) {

const valid = await validateKey(node, options);
if (!valid)
errorCount++;
if (!valid) errorCount++;
} else {

@@ -76,5 +73,3 @@ log(

}
if (errorCount > 0 && options.exitOnError) {
break;
}
if (errorCount > 0 && options.exitOnError) break;
}

@@ -81,0 +76,0 @@ var timeTaken = `${(performance.now() - start).toFixed(2)}ms`;

@@ -121,2 +121,2 @@ type LogLevel = 'debug' | 'error' | 'info' | 'warn';

export { LogLevel, Options, TranslationNode, ValidationError, parseFile, parseOptionsFile, validateKey };
export { type LogLevel, type Options, type TranslationNode, ValidationError, parseFile, parseOptionsFile, validateKey };

@@ -1,3 +0,3 @@

export { ValidationError, parseFile, parseOptionsFile, validateKey } from './chunk-STXOAPH2.js';
export { ValidationError, parseFile, parseOptionsFile, validateKey } from './chunk-OSNOD3G2.js';
//# sourceMappingURL=out.js.map
//# sourceMappingURL=index.js.map
{
"name": "i18n-validate",
"version": "1.4.3-next.f9c39c5.0",
"version": "1.4.3-next.fb11ed3.0",
"description": "A cli tool to find invalid i18n keys, missing variables and many more",

@@ -32,19 +32,19 @@ "main": "./dist/index.js",

"dependencies": {
"commander": "^11.0.0",
"glob": "^10.3.3",
"typescript": "^5.1.6"
"commander": "^12.1.0",
"fast-glob": "^3.3.2",
"typescript": "^5.4.5"
},
"devDependencies": {
"@favware/cliff-jumper": "^2.1.1",
"@favware/cliff-jumper": "^3.0.3",
"@favware/npm-deprecate": "^1.0.7",
"@types/node": "^20.4.2",
"@vitest/coverage-v8": "^0.33.0",
"esbuild-plugin-version-injector": "^1.2.0",
"eslint": "^8.45.0",
"eslint-config-mahir": "^0.0.29",
"husky": "^8.0.3",
"lint-staged": "^13.2.3",
"prettier": "^3.0.0",
"tsup": "^7.1.0",
"vitest": "^0.33.0"
"@types/node": "^20.14.2",
"@vitest/coverage-v8": "^1.6.0",
"esbuild-plugin-version-injector": "^1.2.1",
"eslint": "^8.57.0",
"eslint-config-mahir": "^0.0.43",
"husky": "^9.0.11",
"lint-staged": "^15.2.5",
"prettier": "^3.3.1",
"tsup": "^8.1.0",
"vitest": "^1.6.0"
},

@@ -51,0 +51,0 @@ "files": [

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