import "missing-native-js-functions" ; export function FieldErrors ( fields ) { return new FieldError ( 50035 , "Invalid Form Body" , fields . map ( ( { message , code } ) => ( { _errors : [ { message , code : code || "BASE_TYPE_INVALID" , } , ] , } ) ) ) ; } export class FieldError extends Error { constructor ( public code , public message , public errors ? ) { super ( message ) ; } }