Skip to content

Instantly share code, notes, and snippets.

@AbdulKabia
Last active April 15, 2018 17:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AbdulKabia/a12146a6b5741a73282680e908b7a6d2 to your computer and use it in GitHub Desktop.
Save AbdulKabia/a12146a6b5741a73282680e908b7a6d2 to your computer and use it in GitHub Desktop.
// Original
if (case2Reg.test(str) || !case3Reg.test(str) || (scheme === undefined && /\s/g.test(str))) {
return true
}
// Fix
const case5Reg = /(?:^\/)|(?:^[a-zA-Z]:\\)/
if (case2Reg.test(str) || !case3Reg.test(str) || (scheme === undefined && /\s/g.test(str) && !case5Reg.test(str))) {
return true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment