steve-lebleu/typeplate

whitelist issue

chikka opened this issue · 6 comments

When we have boolean type of value in entity whitelist ,it is returning as blank object like this {} due to sanitize method.

It is possible, this middleware is a little bit tricky. Which version of the package are you using ? Can you give me your exact object representation ?

its just simple have any column with boolean value and when return it in response,it is converted in to {} object. I have fixed this using below changes in isSanitizable method for sanitizer.service.ts file. added boolean typeof check.

if (Util.types.isDate(value) || typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') { return false; }

Nice @chikka ! I will check the bug asap and fix it in a further release.

Hi, related to sinitize service, i had an issue with null object.
object.util.ts isObject return true for val = null;

I've added && val !== null to check, and don't know whether is right.

Yes this is because in JS typeof null = object, so i will implements asap a more refined condition according to these remarks.

These issues are resolved in v1.4.6, thanks for your returns !