readEntryText

tcmts.store.readEntryText · #tbopjkyk · term · runs anywhere

entryText read back: the command's label, and the message, if there is one.

export function readEntryText(text: string): { command: string; message?: string } {
  const i = text.indexOf("\n");
  return i < 0 ? { command: text } : { command: text.slice(0, i), message: text.slice(i + 1) };
}

used by