'use strict';

async function asyncFileRead(file) {
  return new Promise((resolve, reject) => {
    const reader = new FileReader();
    reader.addEventListener('load', () => {
      resolve(reader.result);
    });
    reader.addEventListener('error', () => {
      reject(reader.error ?? new Error('Cannot read file'));
    });
    reader.readAsDataURL(file);
  });
}

exports.asyncFileRead = asyncFileRead;
//# sourceMappingURL=asyncFileRead.js.map
