Skip to content

Type Editor


Type Editor / @type-editor/tables / copypaste/fit-slice / fitSlice

Function: fitSlice()

ts
function fitSlice(nodeType, slice): Node_2;

Defined in: tables/src/copypaste/fit-slice.ts:16

Fits a slice into a node of the given type.

Creates an empty node of the specified type and replaces its content with the slice content. This is useful for normalizing partial cell selections into complete cells.

Parameters

ParameterTypeDescription
nodeTypeNodeTypeThe node type to create and fill.
sliceSliceThe slice containing the content to fit.

Returns

Node_2

A new node containing the fitted slice content.