Builtin Library
README.md
heal
Rewrites a preset's preset.yaml into the form presets are written in, on a
local edit of this world's own content: a target written as an identity
string that resolves becomes the guid envelope, and a component-only
document whose component accepts every property it holds becomes the typed
form, its target the component and its legacy name moved to the
.metadata title. Every value is kept as decoded. A remote-origin edit and
library-installed content are left as they are. A component-only document
that cannot heal stays as it is, and the reason is warned once.
Exports
Heal.ifNeeded(ref, origin: string?) -> boolean— true when the document was rewritten.Heal.writeTyped(ref, doc, declarer, values)— writevaluesin the typed form targetingdeclarer, moving a component-only document'snameto the.metadatatitle.preset.setValueswrites through it too.Heal.forget(ref)— drop what the module remembers about a removed preset.
Usage
local Heal = require("@builtin::modules.preset.heal")
Heal.ifNeeded(presetRef, change.origin)