Enable lense growing with empty values

This commit is contained in:
Talia 2024-01-08 14:27:14 +01:00
parent be79784b2d
commit f6b82e22ef

View file

@ -25,7 +25,10 @@ const lense = (methods, extra) => {
if (child) { if (child) {
methods.set(child, value) methods.set(child, value)
return true 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) const element = methods.new(value)
target.appendChild(element) target.appendChild(element)
if (methods.get(element) !== value) if (methods.get(element) !== value)