MCPcopy Create free account
hub / github.com/ehmicky/log-process-errors / getPreviousEvent

Function getPreviousEvent

src/repeat.js:36–41  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

34// This introduces higher risk of false positives (see comment below).
35// We do not hash as it would be too CPU-intensive if the value is big.
36const getPreviousEvent = (value) => {
37 const previousEvent = isErrorInstance(value)
38 ? serializeError(value)
39 : stableSerialize(value)
40 return previousEvent.slice(0, FINGERPRINT_MAX_LENGTH)
41}
42
43// We do not serialize `error.message` as it may contain dynamic values like
44// timestamps. This means errors are only `error.name` + `error.stack`, which

Callers 1

isRepeatedFunction · 0.85

Calls 2

serializeErrorFunction · 0.85
stableSerializeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…