MCPcopy Index your code
hub / github.com/deepnote/deepnote / sanitizeFilenameComponent

Function sanitizeFilenameComponent

packages/convert/src/snapshot/split.ts:34–36  ·  view source on GitHub ↗

Neutralizes path traversal from untrusted ids interpolated into snapshot filenames.

(value: string)

Source from the content-addressed store, hash-verified

32
33/** Neutralizes path traversal from untrusted ids interpolated into snapshot filenames. */
34function sanitizeFilenameComponent(value: string): string {
35 return value.replace(/[^a-zA-Z0-9_-]/g, '_')
36}
37
38/**
39 * Normalizes snapshot timestamps for filenames: keeps digits, `T`, and `-`, maps other separators to `-`,

Callers 1

generateSnapshotFilenameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected