deal with no-prototype-builtins

This commit is contained in:
Henry Jameson 2022-07-31 12:36:02 +03:00
commit fc18673030
6 changed files with 12 additions and 6 deletions

View file

@ -26,6 +26,7 @@ export class RegistrationError extends Error {
// the error is probably a JSON object with a single key, "errors", whose value is another JSON object containing the real errors
if (typeof error === 'string') {
error = JSON.parse(error)
// eslint-disable-next-line
if (error.hasOwnProperty('error')) {
error = JSON.parse(error.error)
}