MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / fixFileName

Function fixFileName

packages/migrate/scripts/jnoj.ts:63–73  ·  view source on GitHub ↗
(fileName: string)

Source from the content-addressed store, hash-verified

61}
62
63function fixFileName(fileName: string) {
64 if (fileName.endsWith('.in') || fileName.endsWith('.out')) {
65 const dotAt = fileName.lastIndexOf('.');
66 const name = fileName.slice(0, dotAt);
67 const suffix = fileName.slice(dotAt + 1);
68 if (!/[0-9]/.test(name)) {
69 fileName = `${name}0.${suffix}`;
70 }
71 }
72 return fileName.replace(/[\\/?#~!|*]/g, '_');
73}
74
75async function iterate(
76 count: bigint | number, step: bigint | number, cb: (pageId: bigint) => Promise<void>,

Callers 1

runFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected