mirror of
https://github.com/strapi/strapi.git
synced 2025-07-27 02:44:13 +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
|
if (res.length >= max) break
|
||||||
const p = pages[i]
|
const p = pages[i]
|
||||||
// filter out results that do not match current version context
|
// 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
|
// filter out results that do not match current locale
|
||||||
if (this.getPageLocalePath(p) !== localePath) continue
|
if (this.getPageLocalePath(p) !== localePath) continue
|
||||||
if (matches(p)) {
|
if (matches(p)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user