A bare slug/name that resolves to a direct child of the themes dir.
(slug: unknown)
| 32 | |
| 33 | /** A bare slug/name that resolves to a direct child of the themes dir. */ |
| 34 | function 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 |
no outgoing calls
no test coverage detected