Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
eachCartesianJoin(
[
[
TargetedInstructionType.callBinding,
TargetedInstructionType.hydrateAttribute,
TargetedInstructionType.hydrateElement,
TargetedInstructionType.hydrateLetElement,
TargetedInstructionType.hydrateTemplateController,
TargetedInstructionType.interpolation,
TargetedInstructionType.iteratorBinding,
TargetedInstructionType.letBinding,
TargetedInstructionType.propertyBinding,
TargetedInstructionType.refBinding,
TargetedInstructionType.setProperty,
HTMLTargetedInstructionType.listenerBinding,
HTMLTargetedInstructionType.setAttribute,
HTMLTargetedInstructionType.stylePropertyBinding,
HTMLTargetedInstructionType.textBinding
]
],
t => {
it(`understands targeted instruction type=${t}`, function () {
const ctx = TestContext.createHTMLTestContext();
//@ts-ignore
const actual = sut(ctx.dom, tag, { prop: { type: t }});
const instruction = actual['instructions'][0][0] as TargetedInstruction;
const node = actual['node'] as Element;
assert.strictEqual(actual['instructions'].length, 1, `actual['instructions'].length`);
assert.strictEqual(actual['instructions'][0].length, 1, `actual['instructions'][0].length`);export function targetedInstructionTypeName(type: string): string {
switch (type) {
case HTMLTargetedInstructionType.textBinding:
return 'textBinding';
case TargetedInstructionType.interpolation:
return 'interpolation';
case TargetedInstructionType.propertyBinding:
return 'propertyBinding';
case TargetedInstructionType.iteratorBinding:
return 'iteratorBinding';
case HTMLTargetedInstructionType.listenerBinding:
return 'listenerBinding';
case TargetedInstructionType.callBinding:
return 'callBinding';
case TargetedInstructionType.refBinding:
return 'refBinding';
case HTMLTargetedInstructionType.stylePropertyBinding:
return 'stylePropertyBinding';
case TargetedInstructionType.setProperty:
return 'setProperty';
case HTMLTargetedInstructionType.setAttribute:
return 'setAttribute';
case TargetedInstructionType.hydrateElement:
return 'hydrateElement';
case TargetedInstructionType.hydrateAttribute:
return 'hydrateAttribute';
case TargetedInstructionType.hydrateTemplateController: (ctx, $1, [attr, to, value]) => [`${attr}.delegate`, value, { type: HTT.listenerBinding, from: new AccessScopeExpression(value), to, strategy: DelegationStrategy.bubbling, preventDefault: false }],
(ctx, $1, [attr, to, value]) => [`${attr}.capture`, value, { type: HTT.listenerBinding, from: new AccessScopeExpression(value), to, strategy: DelegationStrategy.capturing, preventDefault: false }], (ctx, $1, [attr, to, value]) => [`${attr}.delegate`, value, { type: HTT.listenerBinding, from: new AccessScopeExpression(value), to, strategy: DelegationStrategy.bubbling, preventDefault: false }],
(ctx, $1, [attr, to, value]) => [`${attr}.capture`, value, { type: HTT.listenerBinding, from: new AccessScopeExpression(value), to, strategy: DelegationStrategy.capturing, preventDefault: false }],export function stringifyInstructions(instruction: HTMLTargetedInstruction, depth: number): string {
const indent = ' '.repeat(depth);
let output = indent;
switch (instruction.type) {
case HTMLTargetedInstructionType.textBinding:
output += 'textBinding\n';
break;
case TargetedInstructionType.callBinding:
output += 'callBinding\n';
break;
case TargetedInstructionType.iteratorBinding:
output += 'iteratorBinding\n';
break;
case HTMLTargetedInstructionType.listenerBinding:
output += 'listenerBinding\n';
break;
case TargetedInstructionType.propertyBinding:
output += 'propertyBinding\n';
break;
case TargetedInstructionType.refBinding:
output += 'refBinding\n';
break;
case HTMLTargetedInstructionType.stylePropertyBinding:
output += 'stylePropertyBinding\n';
break;
case TargetedInstructionType.setProperty:
output += 'setProperty\n';
break;
case HTMLTargetedInstructionType.setAttribute:
output += 'setAttribute\n';export function stringifyInstructions(instruction: HTMLTargetedInstruction, depth: number): string {
const indent = ' '.repeat(depth);
let output = indent;
switch (instruction.type) {
case HTMLTargetedInstructionType.textBinding:
output += 'textBinding\n';
break;
case TargetedInstructionType.callBinding:
output += 'callBinding\n';
break;
case TargetedInstructionType.iteratorBinding:
output += 'iteratorBinding\n';
break;
case HTMLTargetedInstructionType.listenerBinding:
output += 'listenerBinding\n';
break;
case TargetedInstructionType.propertyBinding:
output += 'propertyBinding\n';
break;
case TargetedInstructionType.refBinding:
output += 'refBinding\n';
break;
case HTMLTargetedInstructionType.stylePropertyBinding:
output += 'stylePropertyBinding\n';
break;
case TargetedInstructionType.setProperty:
output += 'setProperty\n';
break;
case HTMLTargetedInstructionType.setAttribute:
output += 'setAttribute\n';