Fix string test for endsWith('*') not supported on all browsers.