Skip to content
Sheetwrite

@sheetwrite/core

sanitizeCellStylefunction

Report a problem

On this page

A safe copy of an untrusted cell style, or null when it is invalid. The copy is plain and bounded; the result is null when value is not a plain object of known style fields or any field breaks its rule. The same rule guards hyperlinks, table styles and pasted cells.

Declaration

function sanitizeCellStyle(value: unknown): CellStyle | null

Parameters

value: unknownrequired

A style from outside your code, such as parsed JSON.

Returns

CellStyle | null

A new style with only the known fields, or null when any field is invalid.