feathers
feathers copied to clipboard
Schema resolver stack with same function
I apologize this is not a fully formed issue. I noticed this recently while perusing the code for schemas and wanted to capture it before I forgot. But I haven't had a chance to validate this is a bug.
I believe the following line that validates if this function is in the stack already may cause errors if the user is reusing the same function. Correct? https://github.com/feathersjs/feathers/blob/68cf03f092da38ccbec5e9fd42b95d00f5a0a9f2/packages/schema/src/resolver.ts#L73
For example
function lowercase(value) {
return value.toLowerCase();
}
const properties = {
value1: lowercase,
value2: lowercase
};
I will try to get back to this and validate/test it soon