| ; | |
| Object.defineProperty(exports, "__esModule", { value: true }); | |
| exports.parseDataUrl = parseDataUrl; | |
| function parseDataUrl(value) { | |
| const match = /^data:([^;,]+)?(;base64)?,([\s\S]*)$/.exec(value); | |
| if (!match) { | |
| return null; | |
| } | |
| const mime = match[1] || 'application/octet-stream'; | |
| const isBase64 = !!match[2]; | |
| const data = match[3]; | |
| const buffer = isBase64 | |
| ? Buffer.from(data, 'base64') | |
| : Buffer.from(decodeURIComponent(data), 'utf-8'); | |
| return { buffer, mime }; | |
| } | |
| //# sourceMappingURL=data.url.js.map |