mirror of https://github.com/hashicorp/consul
Browse Source
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)pull/7565/head
John Cowen
5 years ago
committed by
GitHub
1 changed files with 6 additions and 1 deletions
Loading…
Reference in new issue