From 7e87e7da97eb8ed712fd1dc8e0832ea4cae1911f Mon Sep 17 00:00:00 2001 From: Alberto Maturano <5768813+maturanomx@users.noreply.github.com> Date: Fri, 26 Oct 2018 14:19:04 +0200 Subject: [PATCH] use more descriptive startsWith than indexOf Co-Authored-By: MartinMuzatko --- docs/.vuepress/theme/SearchBox.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/.vuepress/theme/SearchBox.vue b/docs/.vuepress/theme/SearchBox.vue index d3644ae09f..8d078a39c8 100644 --- a/docs/.vuepress/theme/SearchBox.vue +++ b/docs/.vuepress/theme/SearchBox.vue @@ -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)) {