MCPcopy
hub / github.com/philc/vimium / matches

Function matches

background_scripts/completion/ranking.js:6–18  ·  view source on GitHub ↗
(queryTerms, ...things)

Source from the content-addressed store, hash-verified

4// This is used to prune out irrelevant suggestions before we try to rank them, and for
5// calculating word relevancy. Every term must match at least one thing.
6export function matches(queryTerms, ...things) {
7 for (const term of queryTerms) {
8 const regexp = RegexpCache.get(term);
9 let matchedTerm = false;
10 for (const thing of things) {
11 if (!matchedTerm) {
12 matchedTerm = thing.match(regexp);
13 }
14 }
15 if (!matchedTerm) return false;
16 }
17 return true;
18}
19
20// Weights used for scoring matches.
21const matchWeights = {

Callers

nothing calls this directly

Calls 2

getMethod · 0.80
matchMethod · 0.80

Tested by

no test coverage detected