Erfan Safari

Results 111 comments of Erfan Safari

> validator option to disable expect values, like errorExpectedValue: false Like it, It's a good way > If it's a problem... In general, it's not. but people may carelessly use...

It's expected, empty string is not a valid `alpha` pattern

`optional` flag only cares about `null` and `undefined` values, it doesn't skip empty strings

You can add a preValidation middleware to delete these keys from object. it's more safe for the validator to be strict

https://www.typescriptlang.org/tsconfig#esModuleInterop Do you have tried to set esModuleInterop: true in tsconfig?

https://github.com/icebob/fastest-validator/issues/71

@FFKL you can use a clean up function that removes any null key from request body/params. Please let's keep the validator simple Also you can test `{ optional: true, nullable:...

```js const schema = { token: 'string|optional', key: 'string|optional', $$custom(obj, errors) { if (!obj.token && !obj.key) errors.push({ ... }) return obj } } ``` or Typescript's way: ```js const schema...

@icebob he/she means something like this ```js schema = { "*": "string" } ```

@icebob I think we can introduce a new rule called `Map` for these kind of usages. ```js const schema = { dictionary: { type: "map", key: "string", // or number,...