ecency-mobile/src/utils/communityValidation.js

10 lines
197 B
JavaScript
Raw Normal View History

2021-01-18 00:51:59 +03:00
import { isNumber } from 'lodash';
2020-12-11 23:56:00 +03:00
export const isCommunity = (text) => {
2021-01-18 22:30:13 +03:00
if (/hive-[1-3]\d{4,6}$/.test(text) && isNumber(Number(text.split('-')[1]))) {
2020-12-11 23:56:00 +03:00
return true;
}
return false;
};