A class to parse the body of a request and call the appropriate callback.
▶const body = { ... };
const validator = new EntityValidator();
const parser = new RequestParserHandler(body, validator);
const body = { ... }; const validator = new EntityValidator(); const parser = new RequestParserHandler(body, validator);
await parser.parseBody({ note: (note) => { // If the object is a Note, this will be called console.log(note); }, follow: (follow) => { // If the object is a Follow, this will be called console.log(follow); }, ... });