MCPcopy Create free account
hub / github.com/sourcebot-dev/sourcebot / matchesStringAt

Function matchesStringAt

packages/queryLanguage/src/tokens.ts:51–58  ·  view source on GitHub ↗

* Checks if the input at the given offset matches the given string.

(input: InputStream, offset: number, str: string)

Source from the content-addressed store, hash-verified

49 * Checks if the input at the given offset matches the given string.
50 */
51function matchesStringAt(input: InputStream, offset: number, str: string): boolean {
52 for (let i = 0; i < str.length; i++) {
53 if (input.peek(offset + i) !== str.charCodeAt(i)) {
54 return false;
55 }
56 }
57 return true;
58}
59
60/**
61 * Checks if current position starts with "or" that will be recognized as the OR operator.

Callers 2

matchesStringFunction · 0.85
startsWithPrefixAtFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected