Open LucidityDesign opened 2 years ago
So I tried to debug this phenomenon:
After axios is transforming the response response.data.constructor === Object
is true
.
Due to the resolving of promises I lose track of the variable, but as soon as they appear in this module (e.g. here) response.data.constructor === Object
is false
.
anyobject.constructor === Object
is a popular method to check if a variable is an object (e.g. see here: https://stackoverflow.com/a/16608074/1301058)For the server-side response data from
$axios.get
this doesn't work becauseresponse.data.constructor === Object
returnsfalse
.Steps to reproduce:
git clone git@github.com:LucidityDesign/axios-module.git
yarn install
yarn dev
response type false
Expected behaviour: