github.com/zoomfoo/nomad@v0.8.5-0.20180907175415-f28fd3a1a056/ui/app/serializers/job-plan.js (about)

     1  import { get } from '@ember/object';
     2  import { assign } from '@ember/polyfills';
     3  import ApplicationSerializer from './application';
     4  
     5  export default ApplicationSerializer.extend({
     6    normalize(typeHash, hash) {
     7      hash.FailedTGAllocs = Object.keys(hash.FailedTGAllocs || {}).map(key => {
     8        return assign({ Name: key }, get(hash, `FailedTGAllocs.${key}`) || {});
     9      });
    10      return this._super(...arguments);
    11    },
    12  });