MCPcopy Create free account
hub / github.com/TruthHun/BookStack / range

Method range

static/katex/katex.mjs:28–36  ·  view source on GitHub ↗

* Merges two `SourceLocation`s from location providers, given they are * provided in order of appearance. * - Returns the first one's location if only the first is provided. * - Returns a merged range of the first and the last if both are provided * and their lexers match. * - Other

(first, second)

Source from the content-addressed store, hash-verified

26
27
28 static range(first, second) {
29 if (!second) {
30 return first && first.loc;
31 } else if (!first || !first.loc || !second.loc || first.loc.lexer !== second.loc.lexer) {
32 return null;
33 } else {
34 return new SourceLocation(first.loc.lexer, first.loc.start, second.loc.end);
35 }
36 }
37
38}
39

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected