fix(lib/utils/objects): use Object.defineProperty instead of delete

This commit is contained in:
PalmDevs 2025-07-09 19:09:05 +07:00
parent 796f1cf392
commit aacb038d09
No known key found for this signature in database
GPG key ID: 6FAE8F8677ACA8BA

View file

@ -139,8 +139,14 @@ function lazyPropDesc<T extends object, K extends keyof T>(
return {
configurable: true,
get(this: T) {
delete this[key]
return (this[key] = loader())
const value = loader()
Object.defineProperty(this, key, {
configurable: true,
value,
})
return value
},
}
}