Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/automerge/index.ts>Text#toSpans

A JSON-like data structure (a CRDT) that can be modified concurrently by different users, and merged again automatically.
Go to Latest
method Text.prototype.toSpans
Re-export
import { Text } from "https://deno.land/x/automerge@2.2.0/index.ts";

Returns the content of the Text object as a sequence of strings, interleaved with non-character elements.

For example, the value ['a', 'b', {x: 3}, 'c', 'd'] has spans: => ['ab', {x: 3}, 'cd']

Returns

Array<Value | object>