MCPcopy
hub / github.com/formatjs/formatjs / bumpUntil

Method bumpUntil

packages/icu-messageformat-parser/parser.ts:1201–1211  ·  view source on GitHub ↗

* Bump the parser until the pattern character is found and return `true`. * Otherwise bump to the end of the file and return `false`.

(pattern: string)

Source from the content-addressed store, hash-verified

1199 * Otherwise bump to the end of the file and return `false`.
1200 */
1201 private bumpUntil(pattern: string): boolean {
1202 const currentOffset = this.offset()
1203 const index = this.message.indexOf(pattern, currentOffset)
1204 if (index >= 0) {
1205 this.bumpTo(index)
1206 return true
1207 } else {
1208 this.bumpTo(this.message.length)
1209 return false
1210 }
1211 }
1212
1213 /**
1214 * Bump the parser to the target offset.

Callers 1

Calls 2

offsetMethod · 0.95
bumpToMethod · 0.95

Tested by

no test coverage detected