Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var attrs = object.map(component.getAttrs(names), function(key, value) {
if (component.getAttrConfig(key).isHtml && core.isString(value)) {
return SoyRenderer.sanitizeHtml(value);
} else {
return value;
}
});
return object.mixin(data, attrs);
setterItemsFn_(items) {
for (let i = 0; i < items.length; i++) {
if (core.isString(items[i])) {
items[i] = {
href: items[i],
};
}
this.generateItemMissingData_(items[i]);
}
return items;
}
findElementInContent_(id, content) {
content = core.isString(content) ? dom.buildFragment(content) : content;
var firstChild = content.childNodes[0];
if (firstChild && firstChild.id === id) {
return firstChild;
}
}
resolveComponentConstructor() {
var componentConstructor = this.component;
if (core.isString(componentConstructor)) {
componentConstructor = ComponentRegistry.getConstructor(componentConstructor);
}
return componentConstructor;
}
createComponent(componentNameOrCtor, opt_data) {
var component = ComponentCollector.components[(opt_data || {}).id];
if (!component) {
var ConstructorFn = componentNameOrCtor;
if (core.isString(ConstructorFn)) {
ConstructorFn = ComponentRegistry.getConstructor(componentNameOrCtor);
}
component = new ConstructorFn(opt_data);
}
return component;
}
callFunction_(fn, args) {
if (core.isString(fn)) {
return this[fn].apply(this, args);
} else if (core.isFunction(fn)) {
return fn.apply(this, args);
}
}