Plite formats some thrown error details with document values and nodes. Text fields are redacted by default. Apps that need stricter diagnostics can install a scrubber for additional fields.
import { setDebugValueScrubber } from "@platejs/plite";
setDebugValueScrubber((key, value) => {
if (key === "text" || key === "src") return "[redacted]";
return value;
});import { setDebugValueScrubber } from "@platejs/plite";
setDebugValueScrubber((key, value) => {
if (key === "text" || key === "src") return "[redacted]";
return value;
});Pass null or undefined to restore the default scrubber.
setDebugValueScrubber(null);setDebugValueScrubber(null);setDebugValueScrubber: (scrubber: DebugValueScrubber | null | undefined) => voidOverride the debug value scrubber used by Plite diagnostic formatting.
SourceSet the function used before Plite formats debug values.
type DebugValueScrubber = (key: string, value: unknown) => unknown;Hook for replacing values before Plite debug output is stringified.
SourceThe custom scrubber runs before Plite's default text redaction. Return the original value to let the default scrubber handle it.