NBTObject should accept undefined values, which means NBT.stringify would omit them just as JSON.stringify does.
For the motivation, see this minimal example. This is a niche case, but there isn't really a clean workaround for it without removing type safety.
Additionally, I don't see any practical reason to disallow undefined. I can think of a few other (equally niche) cases where doing so would be problematic as well.
NBTObject
should acceptundefined
values, which meansNBT.stringify
would omit them just asJSON.stringify
does.For the motivation, see this minimal example. This is a niche case, but there isn't really a clean workaround for it without removing type safety.
Additionally, I don't see any practical reason to disallow
undefined
. I can think of a few other (equally niche) cases where doing so would be problematic as well.