MCPcopy Create free account
hub / github.com/nwutils/nw-sample-apps / maybeAdd

Function maybeAdd

mini-code-edit/cm/lib/util/javascript-hint.js:94–96  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

92 function getCompletions(token, context, keywords) {
93 var found = [], start = token.string;
94 function maybeAdd(str) {
95 if (str.indexOf(start) == 0 && !arrayContains(found, str)) found.push(str);
96 }
97 function gatherCompletions(obj) {
98 if (typeof obj == "string") forEach(stringProps, maybeAdd);
99 else if (obj instanceof Array) forEach(arrayProps, maybeAdd);

Callers 2

gatherCompletionsFunction · 0.85
getCompletionsFunction · 0.85

Calls 1

arrayContainsFunction · 0.85

Tested by

no test coverage detected