Share the CommonMark grammar, close the guard's hole, refuse the lists no marker spells
CI / gate (push) Successful in 4s

This commit is contained in:
2026-08-24 16:18:47 +02:00
parent 0728ea1cfb
commit e92484eb85
14 changed files with 205 additions and 126 deletions
+10
View File
@@ -0,0 +1,10 @@
export type JsonValue = JsonValue[] | boolean | null | number | string | { [key: string]: JsonValue }
export function isJsonValue(value: unknown): value is JsonValue {
if (value === null) return true
if (typeof value === 'boolean' || typeof value === 'string') return true
if (typeof value === 'number') return Number.isFinite(value)
if (Array.isArray(value)) return [...value].every(isJsonValue)
if (typeof value === 'object') return Object.values(value).every(isJsonValue)
return false
}