diff options
| author | Adam Soltys <[email protected]> | 2023-05-10 14:05:26 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-05-10 14:05:26 -0700 |
| commit | 7974e1565a0dc3a1809d84fefc1feb90b0d83383 (patch) | |
| tree | 2593b330cac19745671d3fc142985b2df959d46a /src/lib/utils.js | |
| parent | 092fe68e09434ed290bcb0e1b8076d3852901e5f (diff) | |
| download | coinos-ui-7974e1565a0dc3a1809d84fefc1feb90b0d83383.tar.gz coinos-ui-7974e1565a0dc3a1809d84fefc1feb90b0d83383.zip | |
update docs
Diffstat (limited to 'src/lib/utils.js')
| -rw-r--r-- | src/lib/utils.js | 6 |
1 files changed, 6 insertions, 0 deletions
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; |
