(resource)
| 65 | * @returns {string} resource name for display |
| 66 | */ |
| 67 | const getResourceName = (resource) => { |
| 68 | if (!resource) return ""; |
| 69 | const dataUrl = /^data:[^,]+,/.exec(resource); |
| 70 | if (!dataUrl) return resource; |
| 71 | |
| 72 | const len = dataUrl[0].length + DATA_URI_CONTENT_LENGTH; |
| 73 | if (resource.length < len) return resource; |
| 74 | return `${resource.slice( |
| 75 | 0, |
| 76 | Math.min(resource.length - /* '..'.length */ 2, len) |
| 77 | )}..`; |
| 78 | }; |
| 79 | |
| 80 | /** |
| 81 | * Returns prefix and module name. |
no test coverage detected