diff options
| author | Adam Soltys <[email protected]> | 2023-02-22 19:38:55 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-02-23 00:31:21 -0800 |
| commit | 50b270db6fda60b5b3e39a9dbada5c27a14cbad1 (patch) | |
| tree | 6cc2ce81bd703aab912f3594d8c1c2086fcc731d /src/lib | |
| parent | c1c019beae03bbebde70557e1d0a9e064a48927c (diff) | |
| download | coinos-ui-50b270db6fda60b5b3e39a9dbada5c27a14cbad1.tar.gz coinos-ui-50b270db6fda60b5b3e39a9dbada5c27a14cbad1.zip | |
fee slider wip
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/utils.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/utils.js b/src/lib/utils.js index 86f722b9..1d064c9a 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -148,6 +148,11 @@ export const login = async (user, cookies) => { export const auth = (cookies) => ({ authorization: `Bearer ${cookies.get('token')}` }); export const fiat = (amount, rate) => (amount * rate) / sats; +export const fd = async (req) => { + let obj = Object.fromEntries(await req.formData()); + for (let k in obj) (obj[k] === 'undefined' && (obj[k] = undefined)) ||( obj[k] === 'false' && (obj[k] = false)); + return obj; +}; export const f = (s, currency) => new Intl.NumberFormat('en-US', { |
