Skip to content

Commit

Permalink
feat(text-canvas): add FMT_NONE dummy formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Mar 23, 2021
1 parent 4e171db commit 0b1f3bd
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions packages/text-canvas/src/string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0b1f3bd

Please sign in to comment.