Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.then(buffer => setData(Table.from([new Uint8Array(buffer)])))
}, [url])
export function base64StringToArrowTable(text: string): Table {
const b64 = atob(text);
const arr = Uint8Array.from(b64, c => {
return c.charCodeAt(0);
});
return Table.from(arr);
}
function arrowTable(data) {
if (data instanceof Table) {
return data;
}
if (data instanceof ArrayBuffer) {
data = new Uint8Array(data);
}
return Table.from(Array.isArray(data) ? data : [data]);
}