nestjs-i18n
Advanced tools
Comparing version 9.0.2 to 9.0.3
@@ -14,2 +14,13 @@ "use strict"; | ||
}; | ||
var __rest = (this && this.__rest) || function (s, e) { | ||
var t = {}; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) | ||
t[p] = s[p]; | ||
if (s != null && typeof Object.getOwnPropertySymbols === "function") | ||
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { | ||
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) | ||
t[p[i]] = s[p[i]]; | ||
} | ||
return t; | ||
}; | ||
var I18nModule_1; | ||
@@ -280,14 +291,14 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
.reduce((providers, r) => { | ||
if (r['use'] && r['options']) { | ||
const resolver = r; | ||
const optionsToken = (0, i18n_resolver_options_decorator_1.getI18nResolverOptionsToken)(resolver.use); | ||
if (r['use']) { | ||
const _a = r, { use: resolver, options } = _a, rest = __rest(_a, ["use", "options"]); | ||
const optionsToken = (0, i18n_resolver_options_decorator_1.getI18nResolverOptionsToken)(resolver); | ||
providers.push({ | ||
provide: resolver.use, | ||
useClass: resolver.use, | ||
provide: resolver, | ||
useClass: resolver, | ||
inject: [optionsToken], | ||
}); | ||
providers.push({ | ||
provide: optionsToken, | ||
useFactory: () => resolver.options, | ||
}); | ||
if (options) { | ||
rest.useValue = options; | ||
} | ||
providers.push(Object.assign({ provide: optionsToken }, rest)); | ||
} | ||
@@ -294,0 +305,0 @@ else { |
@@ -56,3 +56,3 @@ "use strict"; | ||
if ((0, util_1.shouldResolve)(r)) { | ||
if (r['use'] && r['options']) { | ||
if (r['use']) { | ||
const resolver = r; | ||
@@ -59,0 +59,0 @@ return this.moduleRef.get(resolver.use); |
import { Type } from '@nestjs/common'; | ||
import { ModuleMetadata } from '@nestjs/common/interfaces'; | ||
import { ClassProvider, ExistingProvider, FactoryProvider, ModuleMetadata, ValueProvider } from '@nestjs/common/interfaces'; | ||
import { I18nResolver } from './i18n-language-resolver.interface'; | ||
import { I18nLoader } from '../loaders/i18n.loader'; | ||
export interface OptionsProvider { | ||
options: any; | ||
} | ||
export declare type OptionProvider<T = any> = Omit<ClassProvider<T>, 'provide'> | Omit<ValueProvider<T>, 'provide'> | Omit<FactoryProvider<T>, 'provide'> | Omit<ExistingProvider<T>, 'provide'> | OptionsProvider; | ||
export declare type ResolverWithOptions = { | ||
use: Type<I18nResolver>; | ||
options: any; | ||
}; | ||
} & OptionProvider; | ||
export declare type I18nOptionsWithoutResolvers = Omit<I18nOptions, 'resolvers' | 'loader'>; | ||
@@ -10,0 +13,0 @@ export declare type I18nOptionResolver = ResolverWithOptions | Type<I18nResolver> | I18nResolver; |
@@ -50,3 +50,3 @@ "use strict"; | ||
if ((0, util_1.shouldResolve)(r)) { | ||
if (r['use'] && r['options']) { | ||
if (r['use']) { | ||
const resolver = r; | ||
@@ -53,0 +53,0 @@ return this.moduleRef.get(resolver.use); |
@@ -7,3 +7,3 @@ "use strict"; | ||
function shouldResolve(e) { | ||
return typeof e === 'function' || (e['use'] && e['options']); | ||
return typeof e === 'function' || e['use']; | ||
} | ||
@@ -10,0 +10,0 @@ exports.shouldResolve = shouldResolve; |
@@ -59,3 +59,3 @@ // @ts-check | ||
}, | ||
copyright: `Sponsered by <a href="https://www.debugged.nl" target="_blank">Debugged</a>`, | ||
copyright: `Sponsored by <a href="https://www.debugged.nl" target="_blank">Debugged</a>`, | ||
links: [ | ||
@@ -62,0 +62,0 @@ { |
{ | ||
"name": "nestjs-i18n", | ||
"version": "9.0.2", | ||
"version": "9.0.3", | ||
"homepage": "https://nestjs-i18n.com", | ||
@@ -5,0 +5,0 @@ "description": "The i18n module for Nest.", |
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
613894
5386