github.com/blixtra/nomad@v0.7.2-0.20171221000451-da9a1d7bb050/ui/app/utils/properties/short-uuid.js (about)

     1  import Ember from 'ember';
     2  
     3  const { computed } = Ember;
     4  
     5  // An Ember.Computed property for taking the first segment
     6  // of a uuid.
     7  //
     8  // ex. id: 123456-7890-abcd-efghijk
     9  //     short: shortUUIDProperty('id') // 123456
    10  export default function shortUUIDProperty(uuidKey) {
    11    return computed(uuidKey, function() {
    12      return this.get(uuidKey).split('-')[0];
    13    });
    14  }