@mocanvas/editor · type

UnknownPropsPolicy

type UnknownPropsPolicy = "reject" | "keep"

How strict the props half of a record validator is about props the map does not declare.

"reject" is the default and the right answer for a record an app is *making*: an undeclared prop there is a typo or a prop whose migration was forgotten, and saying so early is the point.

"keep" is the right answer for a record the store is *holding*, and is what the schema's shape and binding types use. A .tldr written by a newer generation of the format legitimately carries props this build has never heard of — binding.props.snap is in the fixture in this repo — and dropping or rejecting them would lose the user's data on the next save. The declared props are still checked; the rest ride along. See normalizeLoadedRecords, which states the same policy for the load path.

mocanvas is built by Symbio. Free for non-commercial, non-profit and development use; commercial use needs an agreement. Not affiliated with or endorsed by tldraw.