{"version":3,"file":"DecodeError.cjs","sources":["../../../src/lib/DecodeError.ts"],"sourcesContent":["import * as t from \"io-ts\";\nimport { formatValidationErrors } from \"io-ts-reporters\";\n\ntype DecodeErrorConstructorArgs<TInput = unknown> = {\n\tinput: TInput;\n\terrors: t.Errors;\n};\n\nexport class DecodeError<TInput = unknown> extends Error {\n\tname = \"DecodeError\";\n\tinput: TInput;\n\terrors: string[];\n\n\tconstructor(args: DecodeErrorConstructorArgs<TInput>) {\n\t\tconst formattedErrors = formatValidationErrors(args.errors);\n\n\t\tsuper(formattedErrors.join(\", \"));\n\n\t\tthis.input = args.input;\n\t\tthis.errors = formattedErrors;\n\t}\n}\n"],"names":["formatValidationErrors"],"mappings":";;;;;;AAQM,MAAO,oBAAsC,MAAK;AAAA,EAKvD,YAAY,MAAwC;AACnD,UAAM,kBAAkBA,cAAAA,uBAAuB,KAAK,MAAM;AAE1D,UAAM,gBAAgB,KAAK,IAAI,CAAC;AAPjC,gCAAO;AACP;AACA;AAOC,SAAK,QAAQ,KAAK;AAClB,SAAK,SAAS;AAAA,EACf;AACA;;"}