UNPKG

strip-url-auth

Version:
8 lines (6 loc) 189 B
export default function stripUrlAuth(string) { if (typeof string !== 'string') { throw new TypeError('Expected a string'); } return string.replace(/^((?:\w+:)?\/\/)[^@/]+@/, '$1'); }