diff --git a/dist/RequestValidator.js b/dist/RequestValidator.js index b979640..6a1bfe2 100644 --- a/dist/RequestValidator.js +++ b/dist/RequestValidator.js @@ -102,8 +102,17 @@ function checkSchema(a) { }, getSearchableFieldsOfTypeString(b) { var c = b.filter(function (b) { - var c = a.path(b) instanceof mongoose.Schema.Types.String; - return c || void 0, c; + var c = a.path(b); + if (c instanceof mongoose.Schema.Types.String) return !0; + var d = c instanceof mongoose.Schema.Types.Array, + e = c.caster && c.caster instanceof mongoose.Schema.Types.String; + return ( + !!(d && e) || + (console.warn( + `schema.path(${b}) is not of type String or String[] - searchableField ${b} has been removed` + ), + !1) + ); }); return c; },