Skip to content

TypeScript API / laikacms/json-api / recoverableErrorsToWarnings

Function: recoverableErrorsToWarnings() ​

ts
function recoverableErrorsToWarnings(errs): readonly object[] | undefined;

Map a list of recoverable LaikaErrors to JSON:API error objects suitable for meta.warnings. Returns undefined for an empty input so the caller can omit the field entirely instead of writing warnings: [].

Parameters ​

ParameterType
errsreadonly unknown[]

Returns ​

readonly object[] | undefined

Released under the MIT License.