charton API / @chart-on/core / index / migrateDrawings
Function: migrateDrawings()
migrateDrawings(
data,current,steps,hook?):Record<string,unknown>
Defined in: packages/core/src/drawing/manager.ts:2865
Upgrade a saved payload to current, step by step through steps. A version the steps don't cover goes through hook once, which may return the current version or an older one the steps continue from. A payload already at current is returned as it is. Throws when neither applies, or when a step does not return a newer version.
Parameters
data
unknown
current
number
steps
Readonly<Record<number, DrawingMigration>>
hook?
DrawingMigration | null
Returns
Record<string, unknown>