Skip to content

api/aoa Functions

Functions from src/api/aoa.ts

Functions exported from src/api/aoa.ts

addArrayToSheet

function addArrayToSheet(worksheet: WorkSheet | null, data: any[][], opts?: AOA2SheetOpts): WorkSheet

Parameters

NameTypeDescription
worksheet`WorkSheetnull`
dataany[][]The array-of-arrays containing raw cell values
opts (optional)AOA2SheetOptsOptional settings (origin, dense, dateNF, cellDates, UTC, date1904, nullError, sheetStubs)

Returns

WorkSheet

The updated or newly created worksheet


arrayToSheet

function arrayToSheet(data: any[][], opts?: AOA2SheetOpts): WorkSheet

Parameters

NameTypeDescription
dataany[][]The array-of-arrays containing raw cell values
opts (optional)AOA2SheetOptsOptional settings (same as addArrayToSheet)

Returns

WorkSheet

A new worksheet populated with the given data


sheetToArray

function sheetToArray<T>(sheet: WorkSheet, opts?: Omit<Sheet2JSONOpts, "header">): T[][]

Parameters

NameTypeDescription
sheetWorkSheetThe worksheet to convert
opts (optional)Omit<Sheet2JSONOpts, "header">Optional conversion settings, except header which is fixed to array output

Returns

T[][]

A two-dimensional array of worksheet values