github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/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 }