github.com/manicqin/nomad@v0.9.5/ui/app/components/fs-directory-entry.js (about)

     1  import Component from '@ember/component';
     2  import { computed } from '@ember/object';
     3  import { isEmpty } from '@ember/utils';
     4  
     5  export default Component.extend({
     6    tagName: '',
     7  
     8    pathToEntry: computed('path', 'entry.Name', function() {
     9      const pathWithNoLeadingSlash = this.get('path').replace(/^\//, '');
    10      const name = encodeURIComponent(this.get('entry.Name'));
    11  
    12      if (isEmpty(pathWithNoLeadingSlash)) {
    13        return name;
    14      } else {
    15        return `${pathWithNoLeadingSlash}/${name}`;
    16      }
    17    }),
    18  });