Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
createRepeatInstruction(expression, def) {
return new runtime_1.HydrateTemplateController(def, 'repeat', [new runtime_1.IteratorBindingInstruction(jit_1.parseExpression(expression, 539 /* ForCommand */), 'items')]);
},
createReplaceableInstruction(def) {
createTextDefinition(expression: string, name: string = `${expression}-text`): ITemplateDefinition {
return {
build: { required: false },
name,
template: AuNode.createText().makeTarget(),
// @ts-ignore
instructions: [[new AuTextInstruction(parseExpression(expression))]]
};
},
createTemplateControllerDefinition(instruction: HydrateTemplateController, name: string = instruction.res): ITemplateDefinition {
it(char, function () {
const identifier = `$${char}`;
assert.deepStrictEqual(parseExpression(identifier), new AccessScopeExpression(identifier, 0));
});
}
} = setup();
const flags = LF.none;
const ViewModel = createViewModel(
h(
'div',
null,
h('au-m', { class: 'au' }),
'',
h('au-m', { class: 'au' }),
),
[],
[
[
new TextBindingInstruction(parseExpression(`\${id&oneTime}`, BindingType.Interpolation)),
],
[
new HydrateTemplateController(
createDescription(
'if',
h('view-model', { class: 'au' }),
[],
[
[new HydrateElementInstruction('view-model', [])],
],
noHooks,
),
'if',
[new ToViewBindingInstruction(parseExpression('id===1&oneTime'), 'value')],
),
],
return new HydrateElementInstruction(name, bindings.map(([from, to]) => new ToViewBindingInstruction(parseExpression(from), to)), parts);
},
createIfInstruction(expression, def) {
return new runtime_1.HydrateTemplateController(def, 'if', [new runtime_1.ToViewBindingInstruction(jit_1.parseExpression(expression), 'value')]);
},
createElseInstruction(def) {
bindings.map(([from, to]) => new LetBindingInstruction(parseExpression(from), to)),
toViewModel
createWithInstruction(expression: string, def: PartialCustomElementDefinition): HydrateTemplateController {
return new HydrateTemplateController(
def,
'with',
[new ToViewBindingInstruction(parseExpression(expression), 'value')]
);
},
createElementInstruction(name: string, bindings: [string, string][], parts?: Record): HydrateElementInstruction {
bindings.map(([from, to]) => new ToViewBindingInstruction(parseExpression(from), to)),
parts
bindings.map(([from, to]) => new LetBindingInstruction(parseExpression(from), to)),
toBindingContext