(mixed: unknown, options: Sheet2JSONOpts & ParsingOptions = {})
| 19 | |
| 20 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 21 | export const parse = <T = any[]>(mixed: unknown, options: Sheet2JSONOpts & ParsingOptions = {}) => { |
| 22 | const { dateNF, header = 1, range, blankrows, defval, raw = true, rawNumbers, ...otherOptions } = options; |
| 23 | const workBook = isString(mixed) |
| 24 | ? readFile(mixed, { dateNF, raw, ...otherOptions }) |
| 25 | : read(mixed, { dateNF, raw, ...otherOptions }); |
| 26 | return Object.keys(workBook.Sheets).map((name) => { |
| 27 | const sheet = workBook.Sheets[name]!; |
| 28 | return { |
| 29 | name, |
| 30 | data: utils.sheet_to_json<T>(sheet, { |
| 31 | dateNF, |
| 32 | header, |
| 33 | range: typeof range === "function" ? range(sheet) : range, |
| 34 | blankrows, |
| 35 | defval, |
| 36 | raw, |
| 37 | rawNumbers, |
| 38 | }), |
| 39 | }; |
| 40 | }); |
| 41 | }; |
| 42 | |
| 43 | export const parseMetadata = (mixed: unknown, options: ParsingOptions = {}) => { |
| 44 | const workBook = isString(mixed) ? readFile(mixed, options) : read(mixed, options); |
nothing calls this directly
no test coverage detected
searching dependent graphs…