createShapePropsMigrationSequence

See source code

Creates a migration sequence for shape properties.

This is a pass-through function that maintains the same structure as the input. It's used for consistency and to provide a clear API for defining shape property migrations.

function createShapePropsMigrationSequence(
  migrations: TLPropsMigrations
): TLPropsMigrations

Example

const myShapeMigrations = createShapePropsMigrationSequence({
  sequence: [
    {
      id: 'com.myapp.shape.custom/1.0.0',
      up: (props) => ({ ...props, newProperty: 'default' }),
      down: ({ newProperty, ...props }) => props,
    },
  ],
})

Parameters

NameDescription

migrations

The migration sequence to create

Returns

The same migration sequence (pass-through)

Prev
createShapePropsMigrationIds
Next
createShapeValidator