mirror of https://github.com/hashicorp/consul
8d4631526c
We need to detect whether an object is an ember-data snapshot or just a plain object, and we where restricted from using `instanceof` due to ember-data's `Snapshot` class being private. We'd chosen to go with `constructor.name` instead, which seemed to work, but when the javascript gets minifed the name of the contructor is also minified and therefore is not what you are expecting. This commit reverts to our original idea of checking for the existence and type of the `.attributes` function, which is the function we require within the conditional, and therefore is more reliable (if the function doesn't exist it will error out during development aswell as production) |
||
---|---|---|
.. | ||
adapters | ||
components | ||
computed | ||
controllers | ||
forms | ||
helpers | ||
initializers | ||
instance-initializers | ||
mixins | ||
models | ||
routes | ||
routing | ||
search/filters | ||
serializers | ||
services | ||
styles | ||
templates | ||
utils | ||
validations | ||
app.js | ||
env.js | ||
index.html | ||
resolver.js | ||
router.js |