Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
install(
_element: Simple.Element,
component: Component,
rootRef: RootReference,
operations: ElementOperations
) {
let componentMapStyleValue = (isVisible: boolean) => {
return this.mapStyleValue(isVisible, component);
};
operations.setAttribute(
'style',
map(referenceForKey(rootRef, 'isVisible') as any, componentMapStyleValue),
false,
null
);
// // the upstream type for addDynamicAttribute's `value` argument
// // appears to be incorrect. It is currently a Reference, I
// // think it should be a Reference.
// operations.addDynamicAttribute(element, 'style', ref as any as Reference, false);
},
const increment = (args) => {
return reference_1.map(args.positional.at(0), (i) => i + 1);
};
const TEMPLATE_ONLY_COMPONENT = { state: null, manager: new runtime_1.SimpleComponentManager() };
function helper(vm: PublicVM, args: IArguments) {
let { env } = vm;
let nameRef = args.positional.at(0);
return map(nameRef, name => {
if (typeof name === 'string' && name) {
if (!env.hasPartial(name, templateMeta)) {
throw new Error(`Could not find a partial named "${name}"`);
}
return env.lookupPartial(name, templateMeta);
} else if (name) {
throw new Error(`Could not find a partial named "${String(name)}"`);
} else {
return null;
}
});
}
const increment: Helper = (args: VMArguments) => {
return map(args.positional.at(0), (i: number) => i + 1);
};