MCPcopy
hub / github.com/vogler/free-games-claimer / filenamify

Function filenamify

src/util.js:22–22  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20// same as datetimeUTC() but for local timezone, e.g., UTC + 2h for the above in DE
21export const datetime = (d = new Date()) => datetimeUTC(new Date(d.getTime() - d.getTimezoneOffset() * 60000));
22export const filenamify = s => s.replaceAll(':', '.').replace(/[^a-z0-9 _\-.]/gi, '_'); // alternative: https://www.npmjs.com/package/filenamify - On Unix-like systems, / is reserved. On Windows, <>:"/\|?* along with trailing periods are reserved.
23
24export const handleSIGINT = (context = null) => process.on('SIGINT', async () => { // e.g. when killed by Ctrl-C
25 console.error('\nInterrupted by SIGINT. Exit!'); // Exception shows where the script was:\n'); // killed before catch in docker...

Callers 5

prime-gaming.jsFile · 0.90
aliexpress.jsFile · 0.90
epic-games.jsFile · 0.90
gog.jsFile · 0.90
unrealengine.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected