MCPcopy Create free account
hub / github.com/bywwcnll/StreamPanel / parseTimestamp

Function parseTimestamp

devtools/modules/importManager.js:140–153  ·  view source on GitHub ↗
(value, fallback)

Source from the content-addressed store, hash-verified

138}
139
140function parseTimestamp(value, fallback) {
141 if (typeof value === 'number' && Number.isFinite(value)) {
142 return value;
143 }
144
145 if (typeof value === 'string') {
146 const parsed = Date.parse(value);
147 if (Number.isFinite(parsed)) {
148 return parsed;
149 }
150 }
151
152 return fallback;
153}
154
155function generateImportedId(index) {
156 return `imported-${Date.now()}-${index}-${Math.random().toString(36).slice(2, 9)}`;

Callers 2

normalizeConnectionFunction · 0.70
normalizeMessageFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected