MCPcopy Create free account
hub / github.com/anus-dev/ANUS / getTimestampFromFunctionId

Function getTimestampFromFunctionId

packages/core/src/utils/editCorrector.ts:63–72  ·  view source on GitHub ↗

* Extracts the timestamp from the .id value, which is in format * - - * @param fcnId the ID value of a functionCall or functionResponse object * @returns -1 if the timestamp could not be extracted, else the timestamp (as a number)

(fcnId: string)

Source from the content-addressed store, hash-verified

61 * @returns -1 if the timestamp could not be extracted, else the timestamp (as a number)
62 */
63function getTimestampFromFunctionId(fcnId: string): number {
64 const idParts = fcnId.split('-');
65 if (idParts.length > 2) {
66 const timestamp = parseInt(idParts[1], 10);
67 if (!isNaN(timestamp)) {
68 return timestamp;
69 }
70 }
71 return -1;
72}
73
74/**
75 * Will look through the ANUSent history and determine when the most recent

Callers 1

findLastEditTimestampFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected