From 7974e1565a0dc3a1809d84fefc1feb90b0d83383 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 10 May 2023 14:05:26 -0700 Subject: update docs --- src/lib/utils.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/lib/utils.js') diff --git a/src/lib/utils.js b/src/lib/utils.js index 69606d36..70ea5d3b 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -74,6 +74,12 @@ export let copy = (text) => { success('Copied!'); }; +export let copyNoNewlines = (text) => { + let stripped = text.replace(/\n/g, ' ').replace(/\s+/g, ' '); + navigator.clipboard.writeText(stripped); + success('Copied!'); +}; + export function reverseFormat(val, locale) { let parts = new Intl.NumberFormat(locale).formatToParts(1111.1); let group = parts.find((part) => part.type === 'group').value; -- cgit v1.2.3