1 | ;
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | function datauri(uri) {
|
4 | if (!/^data\:/i.test(uri)) {
|
5 | throw new TypeError('must begin with `data:`');
|
6 | }
|
7 | const [, body] = uri.split(',');
|
8 | return {
|
9 | body: Buffer.from(body, 'base64'),
|
10 | };
|
11 | }
|
12 | exports.datauri = datauri;
|