'use strict'; var api = require('@flatfile/api'); var r=new api.FlatfileClient,u=(e,n)=>f=>{f.on("file:created",async t=>{let{data:i}=await r.files.get(t.context.fileId);i.mode!=="export"&&(typeof e=="string"&&!i.name.endsWith(e)||e instanceof RegExp&&!e.test(i.name)||a(t).then(l=>n(i,l,t)));});};async function a(e){let n=await r.files.download(e.context.fileId),f=[];for await(let t of n)f.push(t);return Buffer.concat(f)} exports.fileBuffer = u; exports.getFileBuffer = a; //# sourceMappingURL=index.cjs.map //# sourceMappingURL=index.cjs.map