MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / isSafeSlug

Function isSafeSlug

apps/desktop/src/main/custom-themes.ts:34–36  ·  view source on GitHub ↗

A bare slug/name that resolves to a direct child of the themes dir.

(slug: unknown)

Source from the content-addressed store, hash-verified

32
33/** A bare slug/name that resolves to a direct child of the themes dir. */
34function isSafeSlug(slug: unknown): slug is string {
35 return typeof slug === 'string' && !!slug && !/[/\\]/.test(slug) && !slug.includes('..')
36}
37
38// --- Seeded example -------------------------------------------------------
39// Soft Paper, a port of Nick Milo's Obsidian theme. Generated from palettes so

Callers 4

migrateTomlThemesFunction · 0.85
resolveThemeAssetPathFunction · 0.85
customThemeRevealTargetFunction · 0.85
deleteCustomThemeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected