dobo-extra 2.3.1 → 2.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,38 +0,0 @@
1
- // Borrowed from: https://github.com/fanlia/ndjson-csv-xlsx/blob/main/index.js
2
-
3
- import ndj from 'ndjson'
4
- import fastCsv from 'fast-csv'
5
- import xlsxparse from 'xlsx-parse-stream'
6
- import XLSXWriteStream from '@atomictech/xlsx-write-stream'
7
- import StreamArray from 'stream-json/streamers/StreamArray.js'
8
- import Stringer from 'stream-json/Stringer.js'
9
- import Disassembler from 'stream-json/Disassembler.js'
10
- import chain from 'stream-chain'
11
-
12
- const XLSXStreamer = XLSXWriteStream.default
13
-
14
- export const ndjson = {
15
- parse: (...args) => ndj.parse(...args),
16
- stringify: (...args) => ndj.stringify(...args)
17
- }
18
-
19
- export const csv = {
20
- parse: (...args) => fastCsv.parse(...args),
21
- stringify: (...args) => fastCsv.format(...args)
22
- }
23
-
24
- export const xlsx = {
25
- parse: (...args) => xlsxparse(...args),
26
- stringify: (...args) => new XLSXStreamer(...args)
27
- }
28
-
29
- export const json = {
30
- parse: (...args) => chain([
31
- StreamArray.withParser(...args),
32
- data => data.value
33
- ]),
34
- stringify: (options, ...args) => chain([
35
- new Disassembler(),
36
- new Stringer({ ...options, makeArray: true })
37
- ])
38
- }