(url)
| 364 | }); |
| 365 | |
| 366 | function resolveObjectURL(url) { |
| 367 | url = `${url}`; |
| 368 | try { |
| 369 | const parsed = new URL(url); |
| 370 | |
| 371 | const split = StringPrototypeSplit(parsed.pathname, ':', 3); |
| 372 | |
| 373 | if (split.length !== 2) |
| 374 | return; |
| 375 | |
| 376 | const { |
| 377 | 0: base, |
| 378 | 1: id, |
| 379 | } = split; |
| 380 | |
| 381 | if (base !== 'nodedata') |
| 382 | return; |
| 383 | |
| 384 | const ret = getDataObject(id); |
| 385 | |
| 386 | if (ret === undefined) |
| 387 | return; |
| 388 | |
| 389 | const { |
| 390 | 0: handle, |
| 391 | 1: length, |
| 392 | 2: type, |
| 393 | } = ret; |
| 394 | |
| 395 | if (handle !== undefined) |
| 396 | return createBlob(handle, length, type); |
| 397 | } catch { |
| 398 | // If there's an error, it's ignored and nothing is returned |
| 399 | } |
| 400 | } |
| 401 | |
| 402 | // TODO(@jasnell): Now that the File class exists, we might consider having |
| 403 | // this return a `File` instead of a `Blob`. |
no test coverage detected
searching dependent graphs…