mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
18 lines
303 B
JavaScript
18 lines
303 B
JavaScript
const { isValidAddress } = require('../../../../util')
|
|
|
|
function getToErrorObject (to) {
|
|
let toError = null
|
|
|
|
if (!to) {
|
|
toError = 'required'
|
|
} else if (!isValidAddress(to)) {
|
|
toError = 'invalidAddressRecipient'
|
|
}
|
|
|
|
return { to: toError }
|
|
}
|
|
|
|
module.exports = {
|
|
getToErrorObject,
|
|
}
|