From 0b1f3bd88405aa89fdf344513bb43f7ac8a95e84 Mon Sep 17 00:00:00 2001 From: Karsten Schmidt Date: Tue, 23 Mar 2021 13:49:55 +0000 Subject: [PATCH] feat(text-canvas): add FMT_NONE dummy formatter --- packages/text-canvas/src/string.ts | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/text-canvas/src/string.ts b/packages/text-canvas/src/string.ts index 1814f1c2c2..1b0e51b5c9 100644 --- a/packages/text-canvas/src/string.ts +++ b/packages/text-canvas/src/string.ts @@ -21,9 +21,20 @@ import { import type { Canvas } from "./canvas"; /** - * Returns string representation of canvas, optionally using given - * string formatter. If none is given, returns plain string - * representation, ignoring any character format data. + * Convenience {@link StringFormat} which ignores any formatting and results in + * plain text. + */ +export const FMT_NONE: StringFormat = { + prefix: "", + suffix: "", + start: () => "", + end: "", +}; + +/** + * Returns string representation of canvas, optionally using given string + * formatter. If none is given, returns plain string representation, ignoring + * any character format data. * * @param canvas * @param format