rt-sim-training-client/src/utils/validate.js

21 lines
342 B
JavaScript
Raw Normal View History

2019-07-02 16:29:52 +08:00
/**
* Created by PanJiaChen on 16/11/18.
*/
/**
* @param {string} path
* @returns {Boolean}
*/
export function isExternal(path) {
return /^(https?:|mailto:|tel:)/.test(path)
}
/**
* @param {string} str
* @returns {Boolean}
*/
export function validUsername(str) {
const valid_map = ['']
return valid_map.indexOf(str.trim()) < 0
}