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

nestjs-i18n

Package Overview
Dependencies
Maintainers
1
Versions
120
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nestjs-i18n - npm Package Compare versions

Comparing version 8.3.0 to 8.3.1

coverage/clover.xml

8

dist/i18n.module.js

@@ -178,3 +178,5 @@ "use strict";

provide: i18n_constants_1.I18N_OPTIONS,
useFactory: options.useFactory,
useFactory: async () => {
return this.sanitizeI18nOptions(await options.useFactory());
},
inject: options.inject || [],

@@ -185,3 +187,3 @@ };

provide: i18n_constants_1.I18N_OPTIONS,
useFactory: async (optionsFactory) => await optionsFactory.createI18nOptions(),
useFactory: async (optionsFactory) => this.sanitizeI18nOptions(await optionsFactory.createI18nOptions()),
inject: [options.useClass || options.useExisting],

@@ -194,3 +196,3 @@ };

useFactory: async (options) => {
return options.parserOptions;
return this.sanitizeI18nOptions(options.parserOptions);
},

@@ -197,0 +199,0 @@ inject: [i18n_constants_1.I18N_OPTIONS],

@@ -13,2 +13,3 @@ import { Logger } from '@nestjs/common';

};
debug?: boolean;
};

@@ -15,0 +16,0 @@ export declare class I18nService {

@@ -85,5 +85,6 @@ "use strict";

async translateObject(key, translations, options, rootTranslations) {
var _a;
const keys = key.split('.');
const [firstKey] = keys;
const { args } = options;
const args = (_a = options === null || options === void 0 ? void 0 : options.args) !== null && _a !== void 0 ? _a : {};
if (keys.length > 1 && !translations.hasOwnProperty(key)) {

@@ -111,5 +112,9 @@ const newKey = keys.slice(1, keys.length).join('.');

else if (translation instanceof Object) {
return Object.keys(translation).reduce(async (obj, nestedKey) => {
const result = await Object.keys(translation).reduce(async (obj, nestedKey) => {
return Object.assign(Object.assign({}, (await obj)), { [nestedKey]: await this.translateObject(nestedKey, translation, options, rootTranslations) });
}, Promise.resolve({}));
if (translation instanceof Array) {
return Object.values(result);
}
return result;
}

@@ -116,0 +121,0 @@ translation = this.i18nOptions.formatter(translation, ...(args instanceof Array ? args || [] : [args]));

{
"name": "nestjs-i18n",
"version": "8.3.0",
"version": "8.3.1",
"description": "",

@@ -5,0 +5,0 @@ "author": "Toon van Strijp",

Sorry, the diff of this file is not supported yet

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