Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function createFullOverrideContext(repeat, data, index, length, key) {
let bindingContext = {};
let overrideContext = createOverrideContext(bindingContext, repeat.scope.overrideContext);
// is key/value pair (Map)
if (typeof key !== 'undefined') {
bindingContext[repeat.key] = key;
bindingContext[repeat.value] = data;
} else {
bindingContext[repeat.local] = data;
}
updateOverrideContext(overrideContext, index, length);
return overrideContext;
}
automate(overrideContext?: Object, owningView?: View): void {
this.view.bindingContext = this.viewModel;
this.view.overrideContext = overrideContext || createOverrideContext(this.viewModel);
this.view._isUserControlled = true;
if (this.behavior.handlesCreated) {
this.viewModel.created(owningView || null, this.view);
}
this.bind(this.view);
}
automate(overrideContext?: Object, owningView?: View): void {
this.view.bindingContext = this.viewModel;
this.view.overrideContext = overrideContext || createOverrideContext(this.viewModel);
this.view._isUserControlled = true;
if (this.behavior.handlesCreated) {
this.viewModel.created(owningView || null, this.view);
}
this.bind(this.view);
}
function createFullOverrideContext(repeat, data, index, length, key) {
let bindingContext = {};
let overrideContext = createOverrideContext(bindingContext, repeat.scope.overrideContext);
if (typeof key !== 'undefined') {
bindingContext[repeat.key] = key;
bindingContext[repeat.value] = data;
}
else {
bindingContext[repeat.local] = data;
}
updateOverrideContext(overrideContext, index, length);
return overrideContext;
}
function updateOverrideContext(overrideContext, index, length) {
function createFullOverrideContext(repeat, data, index, length, key) {
var bindingContext = {};
var overrideContext = aureliaBinding.createOverrideContext(bindingContext, repeat.scope.overrideContext);
if (typeof key !== 'undefined') {
bindingContext[repeat.key] = key;
bindingContext[repeat.value] = data;
}
else {
bindingContext[repeat.local] = data;
}
updateOverrideContext(overrideContext, index, length);
return overrideContext;
}
function updateOverrideContext(overrideContext, index, length) {