mirror of
https://github.com/strapi/strapi.git
synced 2025-07-24 17:40:18 +00:00
use more descriptive startsWith than indexOf
Co-Authored-By: MartinMuzatko <martin@happy-css.com>
This commit is contained in:
parent
02edab8053
commit
7e87e7da97
@ -64,7 +64,9 @@ export default {
|
||||
if (res.length >= max) break
|
||||
const p = pages[i]
|
||||
// filter out results that do not match current version context
|
||||
if (!~p.path.slice(1).indexOf(searchContext)) continue
|
||||
if ( ! p.path.startsWith(searchContext, 1)) {
|
||||
continue;
|
||||
}
|
||||
// filter out results that do not match current locale
|
||||
if (this.getPageLocalePath(p) !== localePath) continue
|
||||
if (matches(p)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user