diff options
Diffstat (limited to 'lib/utils.js')
| -rw-r--r-- | lib/utils.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/utils.js b/lib/utils.js index 1de8ffeb..af50d7ec 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -1,7 +1,7 @@ -import sequelize from 'sequelize'; +import sequelize from '@sequelize/core'; const { Op } = sequelize; -getUser = async (username, transaction) => { +export const getUser = async (username, transaction) => { let params = { include: [ { @@ -25,7 +25,7 @@ getUser = async (username, transaction) => { return user; }; -getUserById = async (id, transaction) => { +export const getUserById = async (id, transaction) => { let params = { include: [ { @@ -46,3 +46,11 @@ getUserById = async (id, transaction) => { return user; }; + +export const prod = process.env.NODE_ENV === "production"; +export const fail = msg => { + throw new Error(msg); +}; + +export const SATS = 100000000; +export const toSats = n => Math.round(n * SATS); |
