MCPcopy Create free account
hub / github.com/editablejs/editable / getInsertLength

Function getInsertLength

packages/yjs-transform/src/delta.ts:39–41  ·  view source on GitHub ↗
({ insert }: DeltaInsert)

Source from the content-addressed store, hash-verified

37}
38
39export function getInsertLength({ insert }: DeltaInsert): number {
40 return typeof insert === 'string' ? insert.length : 1
41}
42
43export function getInsertDeltaLength(delta: InsertDelta): number {
44 return delta.reduce((curr, element) => curr + getInsertLength(element), 0)

Callers 2

getInsertDeltaLengthFunction · 0.85
sliceInsertDeltaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…