mirror of
https://github.com/trezor/trezor-wallet
synced 2024-11-30 04:08:28 +00:00
rename regexps
This commit is contained in:
parent
7da8d4124d
commit
88a0053235
@ -10,10 +10,10 @@ export const hasDecimals = (value: string, decimals: number) => {
|
||||
return isAbs(value);
|
||||
}
|
||||
|
||||
const ETH_18_RE = new RegExp(
|
||||
const ETH_DECIMALS_RE = new RegExp(
|
||||
`^(0|0\\.([0-9]{0,${decimals}})?|[1-9][0-9]*\\.?([0-9]{0,${decimals}})?)$`
|
||||
);
|
||||
return ETH_18_RE.test(value);
|
||||
return ETH_DECIMALS_RE.test(value);
|
||||
};
|
||||
|
||||
export const isAbs = (value: string) => {
|
||||
@ -22,6 +22,6 @@ export const isAbs = (value: string) => {
|
||||
};
|
||||
|
||||
export const isNumber = (value: string) => {
|
||||
const ETH_18_RE = new RegExp(`^(0|0\\.([0-9]+)?|[1-9][0-9]*\\.?([0-9]+)?)$`);
|
||||
return ETH_18_RE.test(value);
|
||||
const NUMBER_RE = new RegExp(`^(0|0\\.([0-9]+)?|[1-9][0-9]*\\.?([0-9]+)?)$`);
|
||||
return NUMBER_RE.test(value);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user