MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / nonNegative

Function nonNegative

packages/core/src/query/contact-scoring.ts:65–67  ·  view source on GitHub ↗
(value: number | null | undefined)

Source from the content-addressed store, hash-verified

63}
64
65function nonNegative(value: number | null | undefined): number {
66 return Number.isFinite(value) && value !== null && value !== undefined ? Math.max(0, value) : 0
67}
68
69function parseMonthIndex(month: string): number | null {
70 const match = /^(\d{4})-(\d{2})$/.exec(month)

Callers 3

rankPercentilesFunction · 0.85
computeFriendScoresFunction · 0.85
computeNonFriendScoresFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected