stacker.news/lib/url.js

7 lines
142 B
JavaScript
Raw Normal View History

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