From 4a65f855d7b89bc8e152ccdce16d3ff9ff3fbb47 Mon Sep 17 00:00:00 2001 From: Joris Date: Wed, 5 Apr 2023 09:30:46 +0200 Subject: [PATCH] fix(typebox): errors iteration (#537) --- mangle.json | 5 +++++ typebox/src/typebox.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 mangle.json diff --git a/mangle.json b/mangle.json new file mode 100644 index 00000000..ce0e9d3e --- /dev/null +++ b/mangle.json @@ -0,0 +1,5 @@ +{ + "mangle": { + "regex": "^_" + } +} diff --git a/typebox/src/typebox.ts b/typebox/src/typebox.ts index d3ad5255..3424ab37 100644 --- a/typebox/src/typebox.ts +++ b/typebox/src/typebox.ts @@ -40,7 +40,7 @@ const parseErrorSchema = ( export const typeboxResolver: Resolver = (schema) => async (values, _, options) => { - const errors = [...Value.Errors(schema, values)]; + const errors = Array.from(Value.Errors(schema, values)); options.shouldUseNativeValidation && validateFieldsNatively({}, options);