Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
test(module, filename, magnet) {
return (
!isMultiple(module) &&
isObject(module.route) &&
isFunction(module.default)
);
},
buildTemplateData_(component, params) {
const data = object.mixin({}, this.getConfig(component));
component.getStateKeys().forEach(key => {
let value = component[key];
if (this.isHtmlParam_(component, key)) {
value = soyRenderer.toIncDom(value);
}
data[key] = value;
});
for (let i = 0; i < params.length; i++) {
if (!data[params[i]] && isFunction(component[params[i]])) {
data[params[i]] = component[params[i]].bind(component);
}
}
if (isFunction(component.prepareStateForRender)) {
return component.prepareStateForRender(data) || data;
} else {
return data;
}
}
async function maybeSetupPluginsWebpack_(magnet) {
try {
for (const plugin of magnet.getPlugins()) {
if (isFunction(plugin.webpackConfig)) {
magnet.webpackConfig = await plugin.webpackConfig(
magnet.webpackConfig,
magnet
);
}
}
} catch (error) {
log.error(false, error);
}
}
validateListener_(listener) {
if (!isFunction(listener)) {
throw new TypeError('Listener must be a function');
}
}
}
const data = object.mixin({}, this.getConfig(component));
component.getStateKeys().forEach(key => {
let value = component[key];
if (this.isHtmlParam_(component, key)) {
value = soyRenderer.toIncDom(value);
}
data[key] = value;
});
for (let i = 0; i < params.length; i++) {
if (!data[params[i]] && isFunction(component[params[i]])) {
data[params[i]] = component[params[i]].bind(component);
}
}
if (isFunction(component.prepareStateForRender)) {
return component.prepareStateForRender(data) || data;
} else {
return data;
}
}
const data = object.mixin({}, this.getConfig(component));
component.getStateKeys().forEach(key => {
let value = component[key];
if (this.isHtmlParam_(component, key)) {
value = soyRenderer_.toIncDom(value);
}
data[key] = value;
});
for (let i = 0; i < params.length; i++) {
if (!data[params[i]] && isFunction(component[params[i]])) {
data[params[i]] = component[params[i]].bind(component);
}
}
if (isFunction(component.prepareStateForRender)) {
return component.prepareStateForRender(data) || data;
} else {
return data;
}
}