fix(lib/utils/object): lazy properties shouldn't delete itself when loader errors

This commit is contained in:
PalmDevs 2026-07-29 21:38:50 +07:00
parent c7b5ae8ee6
commit 49c1b1e68d
No known key found for this signature in database
GPG key ID: 6FAE8F8677ACA8BA

View file

@ -137,8 +137,9 @@ function lazyPropDesc<T extends object, K extends keyof T>(
return {
configurable: true,
get(this: T) {
const val = loader()
delete this[key]
return (this[key] = loader())
return (this[key] = val)
},
}
}