Enable lense growing with empty values

This commit is contained in:
Talia 2024-01-08 14:27:14 +01:00
parent be79784b2d
commit f6b82e22ef
1 changed files with 4 additions and 1 deletions

View File

@ -25,7 +25,10 @@ const lense = (methods, extra) => {
if (child) {
methods.set(child, value)
return true
} else if(prop == target.children.length) {
} else {
for (let i = target.children.length; i < Number(prop); i++) {
target.appendChild(methods.new(undefined))
}
const element = methods.new(value)
target.appendChild(element)
if (methods.get(element) !== value)