MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / safeLine

Function safeLine

graph-ui/src/provider/cypher.ts:128–133  ·  view source on GitHub ↗

Reject a line number that could not have come from an editor.

(oneBasedLine: number)

Source from the content-addressed store, hash-verified

126
127/** Reject a line number that could not have come from an editor. */
128function safeLine(oneBasedLine: number): number {
129 if (!Number.isFinite(oneBasedLine)) {
130 return 0;
131 }
132 return Math.max(0, Math.floor(oneBasedLine));
133}
134
135function safeLimit(limit: number): number {
136 if (!Number.isFinite(limit) || limit <= 0) {

Callers 1

enclosingByLabelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected