MCPcopy Index your code
hub / github.com/scriptscat/scriptcat / nameFor

Function nameFor

example/tests/gm_download_test.js:120–122  ·  view source on GitHub ↗
(label, ext = "bin")

Source from the content-addressed store, hash-verified

118 // want them to (the conflictAction "overwrite" test reuses a fixed name).
119 const RUN_TAG = Date.now().toString(36) + "-" + Math.floor(Math.random() * 36 ** 4).toString(36).padStart(4, "0");
120 function nameFor(label, ext = "bin") {
121 return getPrefix() + RUN_TAG + "-" + label.replace(/[^a-zA-Z0-9_-]+/g, "_") + "." + ext;
122 }
123
124 // ---------- A small dataset built once, reused everywhere ----------
125 // 1x1 transparent PNG (67 bytes).

Callers 1

Calls 1

getPrefixFunction · 0.85

Tested by

no test coverage detected