UNPKG

907 BJavaScriptView Raw
1var File = /** @class */ (function () {
2 function File(url) {
3 this.url = url;
4 this.url = url;
5 }
6 Object.defineProperty(File.prototype, "name", {
7 get: function () {
8 return this.url ? this.url.substring(this.url.lastIndexOf('/') + 1, this.url.lastIndexOf('.')) : null;
9 },
10 enumerable: true,
11 configurable: true
12 });
13 Object.defineProperty(File.prototype, "icon", {
14 get: function () {
15 var ext = this.url ? this.url.substring(this.url.lastIndexOf('.') + 1) : null;
16 switch (ext) {
17 case 'pdf':
18 return 'icon-pdf';
19 case 'ppt':
20 return 'icon-ppt';
21 default:
22 return 'icon-docs';
23 }
24 },
25 enumerable: true,
26 configurable: true
27 });
28 return File;
29}());
30export { File };