MCPcopy
hub / github.com/1weiho/open-slide / spliceRange

Function spliceRange

packages/core/src/editing/edit-ops.ts:28–30  ·  view source on GitHub ↗
(node: t.Node, text: string)

Source from the content-addressed store, hash-verified

26}
27
28export function spliceRange(node: t.Node, text: string): Splice {
29 return { from: node.start ?? 0, to: node.end ?? 0, text };
30}
31
32// Emit a JSX attribute value: `"foo"` when the value is round-trip-safe
33// inside double quotes; otherwise wrap in `{...}` so escapes work.

Callers 7

applyRevertAssetFunction · 0.90
textLeafSpliceFunction · 0.85
planReplacePlaceholderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected