stacker.news/lib/url.js

7 lines
135 B
JavaScript

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