Skip to content

API > @blocksuite/blocks > insertPositionToIndex

Function: insertPositionToIndex ​

insertPositionToIndex<T>(position, arr): number

Type parameters ​

Parameter
T extends {id: string;}

Parameters ​

ParameterType
positionInsertToPosition
arrT[]

Returns ​

number

Defined In ​

packages/blocks/src/database-block/utils/insert.ts:3

insertPositionToIndex<T>( position, arr, key): number

Type parameters ​

Parameter
T

Parameters ​

ParameterType
positionInsertToPosition
arrT[]
keyfunction

Returns ​

number

Defined In ​

packages/blocks/src/database-block/utils/insert.ts:8