Spaces:
ainz
/
Configuration error

hi / src /lib /tools.js
ainz's picture
x
688d352
raw
history blame contribute delete
332 Bytes
const crypto = require('crypto')
const uuid = () => {
return crypto.randomUUID()
}
const isJson = (str) => {
try {
JSON.parse(str)
return true
} catch (error) {
return false
}
}
const sleep = async (ms) => {
return new Promise(resolve => setTimeout(resolve, ms))
}
module.exports = { uuid, isJson, sleep }