validate.js 256 Bytes
Newer Older
Pan's avatar
Pan committed
1 2 3 4
/**
 * Created by jiachenpan on 16/11/18.
 */

Pan's avatar
Pan committed
5 6 7
export function isvalidUsername(str) {
  const valid_map = ['admin', 'editor']
  return valid_map.indexOf(str.trim()) >= 0
Pan's avatar
Pan committed
8 9
}

Pan's avatar
Pan committed
10 11
export function isExternal(path) {
  return /^(https?:|mailto:|tel:)/.test(path)
Pan's avatar
Pan committed
12
}