Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function setup(aliases: string[] = ['t']) {
const patterns: AttributePatternDefinition[] = [];
for (const pattern of aliases) {
patterns.push({ pattern, symbols: '' });
TranslationAttributePattern.registerAlias(pattern);
}
const container = DI.createContainer(AttributePattern.define(patterns, TranslationAttributePattern));
return container.get(IAttributePattern);
}
function setup(aliases: string[] = ['t']) {
const patterns: AttributePatternDefinition[] = [];
for (const pattern of aliases) {
patterns.push({ pattern: `${pattern}.bind`, symbols: '.' });
TranslationBindAttributePattern.registerAlias(pattern);
}
const container = DI.createContainer(AttributePattern.define(patterns, TranslationBindAttributePattern));
return container.get(IAttributePattern);
}
for (const alias of aliases) {
const bindAlias = `${alias}.bind`;
patterns.push({ pattern: alias, symbols: '' });
TranslationAttributePattern.registerAlias(alias);
bindPatterns.push({ pattern: bindAlias, symbols: '.' });
TranslationBindAttributePattern.registerAlias(alias);
if (alias !== 't') {
commandAliases.push(alias);
bindCommandAliases.push(bindAlias);
}
}
const renderers = [
AttributePattern.define(patterns, TranslationAttributePattern),
BindingCommand.define({ name: 't', aliases: commandAliases }, TranslationBindingCommand),
TranslationBindingRenderer,
AttributePattern.define(bindPatterns, TranslationBindAttributePattern),
BindingCommand.define({ name: 't.bind', aliases: bindCommandAliases }, TranslationBindBindingCommand),
TranslationBindBindingRenderer,
TranslationParametersAttributePattern,
TranslationParametersBindingCommand,
TranslationParametersBindingRenderer
];
return {
register(container) {
return container.register(Registration.callback(I18nInitOptions, () => options.initOptions), StartTask.with(I18N).beforeBind().call(i18n => i18n.task), Registration.singleton(I18nWrapper, I18nextWrapper), Registration.singleton(I18N, I18nService), ...renderers, ...translation);
}
};
}
const dateFormat = [
const bindPatterns = [];
const commandAliases = [];
const bindCommandAliases = [];
for (const alias of aliases) {
const bindAlias = `${alias}.bind`;
patterns.push({ pattern: alias, symbols: '' });
TranslationAttributePattern.registerAlias(alias);
bindPatterns.push({ pattern: bindAlias, symbols: '.' });
TranslationBindAttributePattern.registerAlias(alias);
if (alias !== 't') {
commandAliases.push(alias);
bindCommandAliases.push(bindAlias);
}
}
const renderers = [
AttributePattern.define(patterns, TranslationAttributePattern),
BindingCommand.define({ name: 't', aliases: commandAliases }, TranslationBindingCommand),
TranslationBindingRenderer,
AttributePattern.define(bindPatterns, TranslationBindAttributePattern),
BindingCommand.define({ name: 't.bind', aliases: bindCommandAliases }, TranslationBindBindingCommand),
TranslationBindBindingRenderer,
TranslationParametersAttributePattern,
TranslationParametersBindingCommand,
TranslationParametersBindingRenderer
];
return {
register(container) {
return container.register(Registration.callback(I18nInitOptions, () => options.initOptions), StartTask.with(I18N).beforeBind().call(i18n => i18n.task), Registration.singleton(I18nWrapper, I18nextWrapper), Registration.singleton(I18N, I18nService), ...renderers, ...translation);
}
};
}
const dateFormat = [