stacker.news/lib/url.js
2021-05-21 14:34:40 -05:00

7 lines
142 B
JavaScript

export function ensureProtocol (value) {
if (!/^([a-z0-9]+:\/\/|mailto:)/.test(value)) {
value = 'http://' + value
}
return value
}