type Props = {
class?: string;
language?: string;
autoDetect?: boolean;
ignoreIllegals?: boolean;
children: any;
};
import { Prettify } from "./Prettify";
export type DeepReadonly<T> = Prettify<_DeepReadonly<T>>;
type _DeepReadonly<T> = T extends Record<string | number | symbol, unknown>
? Readonly<{
[P in keyof T]: _DeepReadonly<T[P]>;
}>
: T;
export function escapeHtml(value: string): string {
return value
.replace(/&/g, "&")
.replace(/</g, "<")
.replace(/>/g, ">")
.replace(/"/g, """)
.replace(/'/g, "'");
}
type Props = {
class?: string;
language?: string;
autoDetect?: boolean;
ignoreIllegals?: boolean;
children: any;
};
import { Prettify } from "./Prettify";
/**
* Like `Readonly`, but also makes all nested properties readonly.
*/
export type DeepReadonly<T> = Prettify<_DeepReadonly<T>>;
type _DeepReadonly<T> = T extends Record<string | number | symbol, unknown>
? Readonly<{
[P in keyof T]: _DeepReadonly<T[P]>;
}>
: T;
export function escapeHtml(value: string): string {
return value
.replace(/&/g, "&")
.replace(/</g, "<")
.replace(/>/g, ">")
.replace(/"/g, """)
.replace(/'/g, "'");
}