BTW, why `!withoutHashUrl.length` rather than `withoutHashUrl === ''`?  Is this because you want to match null too?