Skip to content

Commit

Permalink
Add some TODO comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mkarajohn committed Dec 22, 2023
1 parent 9f028d8 commit a4635aa
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/idiomorph.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,10 @@ var Idiomorph = (function () {
* @param {MorphContext} ctx
* @returns {boolean}
*/
// TODO: ignoreActive and ignoreActiveValue are marked as optional since they are not
// initialised in the default config object. As a result the && in the function body may
// return undefined instead of boolean. Either expand the type of the return value to
// include undefined or wrap the ctx.ignoreActiveValue into a Boolean()
function ignoreValueOfActiveElement(possibleActiveElement, ctx) {
return ctx.ignoreActiveValue && possibleActiveElement === document.activeElement;
}
Expand Down Expand Up @@ -743,6 +747,8 @@ var Idiomorph = (function () {
function removeNodesBetween(startInclusive, endExclusive, ctx) {
while (startInclusive !== endExclusive) {
let tempNode = startInclusive;
// TODO: Prefer assigning to a new variable here or expand the type of startInclusive
// to be Node | null
startInclusive = startInclusive.nextSibling;
removeNode(tempNode, ctx);
}
Expand Down

0 comments on commit a4635aa

Please sign in to comment.