Reviewing the class-validator ValidatorConstraint implementation and it has a section that looks like this:
name = target.name;
if (!name) // generate name if it was not given
name = name.replace(/\.?([A-Z]+)/g, (x, y) => "_" + y.toLowerCase()).replace(/^_/, "");
Does the !name
part make sense? For example console.log(!"")
logs true, so it could be that name is an empty string and console.log(!undefined)
is also true.
So my hypothesis is that the code block inside the `if (!name) block will never make sense because there will never be a string to perform replacements on inside the block?