Type Alias SerializationResult

SerializationResult:
    | {
        error?: undefined;
        errorLevel?: undefined;
        errorPath?: string;
        serialized: JsonValue;
    }
    | {
        error: string;
        errorLevel: ValidationErrorLevel;
        errorPath: string;
        serialized?: JsonValue;
    }

If error is undefined, the result is a success. Otherwise, there was a problem.