MCPcopy Create free account
hub / github.com/Noumena-Network/code / convertFileNameToDate

Function convertFileNameToDate

src/utils/cleanup.ts:49–54  ·  view source on GitHub ↗
(filename: string)

Source from the content-addressed store, hash-verified

47}
48
49export function convertFileNameToDate(filename: string): Date {
50 const isoStr = filename
51 .split('.')[0]!
52 .replace(/T(\d{2})-(\d{2})-(\d{2})-(\d{3})Z/, 'T$1:$2:$3.$4Z')
53 return new Date(isoStr)
54}
55
56async function cleanupOldFilesInDirectory(
57 dirPath: string,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected