github.com/manicqin/nomad@v0.9.5/ui/app/utils/properties/short-uuid.js (about)

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