Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return actions;
}
let newActions = [];
let actualSlice = [];
let expectedSlice = [];
const counter = { equal: 0, insert: 0, delete: 0 };
for ( const action of actions ) {
if ( action === 'insert' ) {
expectedSlice.push( expectedDom[ counter.equal + counter.insert ] );
} else if ( action === 'delete' ) {
actualSlice.push( actualDom[ counter.equal + counter.delete ] );
} else { // equal
newActions = newActions.concat( diff( actualSlice, expectedSlice, areSimilar ).map( x => x === 'equal' ? 'replace' : x ) );
newActions.push( 'equal' );
// Reset stored elements on 'equal'.
actualSlice = [];
expectedSlice = [];
}
counter[ action ]++;
}
return newActions.concat( diff( actualSlice, expectedSlice, areSimilar ).map( x => x === 'equal' ? 'replace' : x ) );
}
return actions;
}
let newActions = [];
let actualSlice = [];
let expectedSlice = [];
const counter = { equal: 0, insert: 0, delete: 0 };
for ( const action of actions ) {
if ( action === 'insert' ) {
expectedSlice.push( expectedDom[ counter.equal + counter.insert ] );
} else if ( action === 'delete' ) {
actualSlice.push( actualDom[ counter.equal + counter.delete ] );
} else { // equal
newActions = newActions.concat( diff( actualSlice, expectedSlice, areSimilar ).map( x => x === 'equal' ? 'replace' : x ) );
newActions.push( 'equal' );
// Reset stored elements on 'equal'.
actualSlice = [];
expectedSlice = [];
}
counter[ action ]++;
}
return newActions.concat( diff( actualSlice, expectedSlice, areSimilar ).map( x => x === 'equal' ? 'replace' : x ) );
}
_diffNodeLists( actualDomChildren, expectedDomChildren ) {
actualDomChildren = filterOutFakeSelectionContainer( actualDomChildren, this._fakeSelectionContainer );
return diff( actualDomChildren, expectedDomChildren, sameNodes.bind( null, this.domConverter ) );
}
_diffNodeLists( actualDomChildren, expectedDomChildren ) {
actualDomChildren = filterOutFakeSelectionContainer( actualDomChildren, this._fakeSelectionContainer );
return diff( actualDomChildren, expectedDomChildren, sameNodes.bind( null, this.domConverter.blockFiller ) );
}