Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function valueConverter(nameOrTarget) {
if (nameOrTarget === undefined || typeof nameOrTarget === 'string') {
return function(target) {
metadata.define(metadata.resource, new ValueConverterResource(nameOrTarget), target);
};
}
metadata.define(metadata.resource, new ValueConverterResource(), nameOrTarget);
}
let deco = function(t) {
metadata.define(metadata.resource, new ElementConfigResource(), t);
};
let deco = function (t) {
metadata.define(metadata.resource, new ViewEngineHooksResource(), t);
};
var deco = function (target) {
metadata.define(metadata.invoker, FactoryInvoker.instance, target);
};
return potentialTarget ? deco(potentialTarget) : deco;
export function bindingBehavior(nameOrTarget){
if(nameOrTarget === undefined || typeof nameOrTarget === 'string'){
return function(target){
metadata.define(metadata.resource, new BindingBehaviorResource(nameOrTarget), target);
}
}
metadata.define(metadata.resource, new BindingBehaviorResource(), nameOrTarget);
}
let deco = function(target) {
metadata.define(metadata.invoker, FactoryInvoker.instance, target);
};
return function (target) {
metadata.define(metadata.invoker, value, target);
};
}
const deco = (target: DependencyCtor) => {
metadata.define(metadata.invoker, FactoryInvoker.instance, target);
};
} else if (exportedValue instanceof ViewStrategy) {
viewStrategy = exportedValue;
} else if (exportedValue instanceof TemplateRegistryEntry) {
viewStrategy = new TemplateRegistryViewStrategy(moduleId, exportedValue);
} else {
if (conventional = HtmlBehaviorResource.convention(key)) {
if (conventional.elementName !== null && !mainResource) {
mainResource = new ResourceDescription(key, exportedValue, conventional);
} else {
resources.push(new ResourceDescription(key, exportedValue, conventional));
}
metadata.define(metadata.resource, conventional, exportedValue);
} else if (conventional = ValueConverterResource.convention(key)) {
resources.push(new ResourceDescription(key, exportedValue, conventional));
metadata.define(metadata.resource, conventional, exportedValue);
} else if (!fallbackValue) {
fallbackValue = exportedValue;
fallbackKey = key;
}
}
}
if (!mainResource && fallbackValue) {
mainResource = new ResourceDescription(fallbackKey, fallbackValue);
}
resourceModule.moduleInstance = moduleInstance;
resourceModule.mainResource = mainResource;
resourceModule.resources = resources;
resourceModule.viewStrategy = viewStrategy;