From 915a5939d0ff80e60a1bc7c566cdf652c2f17465 Mon Sep 17 00:00:00 2001 From: Gautier <6089653+GautierT@users.noreply.github.com> Date: Fri, 9 Jul 2021 11:41:11 +0200 Subject: [PATCH] Update index.js To fix : https://github.com/eddyystop/joi-errors-for-forms/issues/6 When the path is an array we should join with dot to avoid having `field,subfield`. --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 0d3f90a..64421ba 100755 --- a/index.js +++ b/index.js @@ -36,7 +36,7 @@ function joiErrorsForForms(format, options) { var newErrs = {}; for (var i = 0, leni = joiErrs.details.length; i < leni; i++) { var detail = joiErrs.details[i]; - var path = detail.path; + var path = detail.path.join('.'); switch (format) { case 'mongoose':