UNPKG

@zenbase/llml

Version:

Lightweight Language Markup Language - Convert nested data structures to human-readable, XML-like markup

15 lines (13 loc) 530 B
import { isAny } from "./base/any"; import type { Formatters } from "./types"; export const json = ( replacer?: | (number | string)[] // biome-ignore lint/suspicious/noExplicitAny: this is literally the type signature of JSON.stringify | ((this: any, key: string, value: any) => any) | null, space?: string | number, ): Formatters => [ // biome-ignore lint/suspicious/noExplicitAny: this is literally the type signature of JSON.stringify [isAny, (value: unknown) => JSON.stringify(value, replacer as any, space)], ];