convert-csv-to-json 4.2.0 → 4.3.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.
Files changed (60) hide show
  1. package/.eslintignore +3 -0
  2. package/.eslintrc.json +48 -0
  3. package/.github/workflows/ci-cd.yml +28 -2
  4. package/docs/api/BrowserApi.html +2435 -0
  5. package/docs/api/BrowserApiError.html +522 -0
  6. package/docs/api/ConfigurationError.html +594 -0
  7. package/docs/api/CsvFormatError.html +530 -0
  8. package/docs/api/CsvParsingError.html +384 -0
  9. package/docs/api/CsvToJson.html +3136 -0
  10. package/docs/api/CsvToJsonAsync.html +2672 -0
  11. package/docs/api/FileOperationError.html +270 -0
  12. package/docs/api/FileUtils.html +1012 -0
  13. package/docs/api/InputValidationError.html +293 -0
  14. package/docs/api/JsonUtil.html +340 -0
  15. package/docs/api/JsonValidationError.html +247 -0
  16. package/docs/api/fonts/OpenSans-Bold-webfont.eot +0 -0
  17. package/docs/api/fonts/OpenSans-Bold-webfont.svg +1830 -0
  18. package/docs/api/fonts/OpenSans-Bold-webfont.woff +0 -0
  19. package/docs/api/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  20. package/docs/api/fonts/OpenSans-BoldItalic-webfont.svg +1830 -0
  21. package/docs/api/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  22. package/docs/api/fonts/OpenSans-Italic-webfont.eot +0 -0
  23. package/docs/api/fonts/OpenSans-Italic-webfont.svg +1830 -0
  24. package/docs/api/fonts/OpenSans-Italic-webfont.woff +0 -0
  25. package/docs/api/fonts/OpenSans-Light-webfont.eot +0 -0
  26. package/docs/api/fonts/OpenSans-Light-webfont.svg +1831 -0
  27. package/docs/api/fonts/OpenSans-Light-webfont.woff +0 -0
  28. package/docs/api/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  29. package/docs/api/fonts/OpenSans-LightItalic-webfont.svg +1835 -0
  30. package/docs/api/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  31. package/docs/api/fonts/OpenSans-Regular-webfont.eot +0 -0
  32. package/docs/api/fonts/OpenSans-Regular-webfont.svg +1831 -0
  33. package/docs/api/fonts/OpenSans-Regular-webfont.woff +0 -0
  34. package/docs/api/global.html +3315 -0
  35. package/docs/api/index.html +326 -0
  36. package/docs/api/index.js.html +341 -0
  37. package/docs/api/scripts/linenumber.js +25 -0
  38. package/docs/api/scripts/prettify/Apache-License-2.0.txt +202 -0
  39. package/docs/api/scripts/prettify/lang-css.js +2 -0
  40. package/docs/api/scripts/prettify/prettify.js +28 -0
  41. package/docs/api/src_browserApi.js.html +271 -0
  42. package/docs/api/src_csvToJson.js.html +605 -0
  43. package/docs/api/src_csvToJsonAsync.js.html +244 -0
  44. package/docs/api/src_util_errors.js.html +374 -0
  45. package/docs/api/src_util_fileUtils.js.html +147 -0
  46. package/docs/api/src_util_jsonUtils.js.html +75 -0
  47. package/docs/api/src_util_stringUtils.js.html +212 -0
  48. package/docs/api/styles/jsdoc-default.css +358 -0
  49. package/docs/api/styles/prettify-jsdoc.css +111 -0
  50. package/docs/api/styles/prettify-tomorrow.css +132 -0
  51. package/index.js +109 -32
  52. package/jsdoc.json +17 -0
  53. package/package.json +10 -3
  54. package/src/browserApi.js +96 -4
  55. package/src/csvToJson.js +163 -2
  56. package/src/csvToJsonAsync.js +74 -14
  57. package/src/util/errors.js +96 -0
  58. package/src/util/fileUtils.js +34 -0
  59. package/src/util/jsonUtils.js +8 -0
  60. package/src/util/stringUtils.js +51 -0
@@ -0,0 +1,2435 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>JSDoc: Class: BrowserApi</title>
6
+
7
+ <script src="scripts/prettify/prettify.js"> </script>
8
+ <script src="scripts/prettify/lang-css.js"> </script>
9
+ <!--[if lt IE 9]>
10
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
11
+ <![endif]-->
12
+ <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
13
+ <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
14
+ </head>
15
+
16
+ <body>
17
+
18
+ <div id="main">
19
+
20
+ <h1 class="page-title">Class: BrowserApi</h1>
21
+
22
+
23
+
24
+
25
+
26
+
27
+ <section>
28
+
29
+ <header>
30
+
31
+ <h2><span class="attribs"><span class="type-signature"></span></span>BrowserApi<span class="signature">()</span><span class="type-signature"></span></h2>
32
+
33
+ <div class="class-description"><p>Browser-friendly CSV to JSON API
34
+ Provides methods for parsing CSV strings and File/Blob objects in browser environments
35
+ Proxies configuration to sync csvToJson instance</p></div>
36
+
37
+
38
+ </header>
39
+
40
+ <article>
41
+ <div class="container-overview">
42
+
43
+
44
+
45
+
46
+ <h2>Constructor</h2>
47
+
48
+
49
+
50
+ <h4 class="name" id="BrowserApi"><span class="type-signature"></span>new BrowserApi<span class="signature">()</span><span class="type-signature"></span></h4>
51
+
52
+
53
+
54
+
55
+
56
+
57
+ <div class="description">
58
+ <p>Constructor initializes proxy to sync csvToJson instance</p>
59
+ </div>
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+ <dl class="details">
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+
100
+ <dt class="tag-source">Source:</dt>
101
+ <dd class="tag-source"><ul class="dummy"><li>
102
+ <a href="src_browserApi.js.html">src/browserApi.js</a>, <a href="src_browserApi.js.html#line13">line 13</a>
103
+ </li></ul></dd>
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+ </dl>
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+
129
+
130
+
131
+
132
+
133
+ </div>
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+
147
+
148
+
149
+
150
+ <h3 class="subsection-title">Methods</h3>
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+ <h4 class="name" id="csvStringToJson"><span class="type-signature"></span>csvStringToJson<span class="signature">(csvString)</span><span class="type-signature"> &rarr; {Array.&lt;object>}</span></h4>
159
+
160
+
161
+
162
+
163
+
164
+
165
+ <div class="description">
166
+ <p>Parse a CSV string and return as JSON array of objects</p>
167
+ </div>
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
+ <h5>Parameters:</h5>
178
+
179
+
180
+ <table class="params">
181
+ <thead>
182
+ <tr>
183
+
184
+ <th>Name</th>
185
+
186
+
187
+ <th>Type</th>
188
+
189
+
190
+
191
+
192
+
193
+ <th class="last">Description</th>
194
+ </tr>
195
+ </thead>
196
+
197
+ <tbody>
198
+
199
+
200
+ <tr>
201
+
202
+ <td class="name"><code>csvString</code></td>
203
+
204
+
205
+ <td class="type">
206
+
207
+
208
+ <span class="param-type">string</span>
209
+
210
+
211
+
212
+ </td>
213
+
214
+
215
+
216
+
217
+
218
+ <td class="description last"><p>CSV content as string</p></td>
219
+ </tr>
220
+
221
+
222
+ </tbody>
223
+ </table>
224
+
225
+
226
+
227
+
228
+
229
+
230
+ <dl class="details">
231
+
232
+
233
+
234
+
235
+
236
+
237
+
238
+
239
+
240
+
241
+
242
+
243
+
244
+
245
+
246
+
247
+
248
+
249
+
250
+
251
+
252
+
253
+
254
+
255
+
256
+
257
+ <dt class="tag-source">Source:</dt>
258
+ <dd class="tag-source"><ul class="dummy"><li>
259
+ <a href="src_browserApi.js.html">src/browserApi.js</a>, <a href="src_browserApi.js.html#line104">line 104</a>
260
+ </li></ul></dd>
261
+
262
+
263
+
264
+
265
+
266
+
267
+
268
+ </dl>
269
+
270
+
271
+
272
+
273
+
274
+
275
+
276
+
277
+
278
+
279
+
280
+
281
+
282
+ <h5>Throws:</h5>
283
+ <ul>
284
+ <li>
285
+
286
+ <dl>
287
+ <dt>
288
+ <div class="param-desc">
289
+ <p>If csvString is invalid</p>
290
+ </div>
291
+ </dt>
292
+ <dd></dd>
293
+ <dt>
294
+ <dl>
295
+ <dt>
296
+ Type
297
+ </dt>
298
+ <dd>
299
+
300
+ <span class="param-type"><a href="InputValidationError.html">InputValidationError</a></span>
301
+
302
+
303
+ </dd>
304
+ </dl>
305
+ </dt>
306
+ <dd></dd>
307
+ </dl>
308
+
309
+ </li>
310
+
311
+ <li>
312
+
313
+ <dl>
314
+ <dt>
315
+ <div class="param-desc">
316
+ <p>If CSV is malformed</p>
317
+ </div>
318
+ </dt>
319
+ <dd></dd>
320
+ <dt>
321
+ <dl>
322
+ <dt>
323
+ Type
324
+ </dt>
325
+ <dd>
326
+
327
+ <span class="param-type"><a href="CsvFormatError.html">CsvFormatError</a></span>
328
+
329
+
330
+ </dd>
331
+ </dl>
332
+ </dt>
333
+ <dd></dd>
334
+ </dl>
335
+
336
+ </li>
337
+ </ul>
338
+
339
+
340
+ <h5>Returns:</h5>
341
+
342
+
343
+ <div class="param-desc">
344
+ <p>Array of objects representing CSV rows</p>
345
+ </div>
346
+
347
+
348
+
349
+ <dl>
350
+ <dt>
351
+ Type
352
+ </dt>
353
+ <dd>
354
+
355
+ <span class="param-type">Array.&lt;object></span>
356
+
357
+
358
+ </dd>
359
+ </dl>
360
+
361
+
362
+
363
+
364
+
365
+
366
+ <h5>Example</h5>
367
+
368
+ <pre class="prettyprint"><code>const csvToJson = require('convert-csv-to-json');
369
+ const rows = csvToJson.browser.csvStringToJson('name,age\nAlice,30');
370
+ console.log(rows); // [{ name: 'Alice', age: '30' }]</code></pre>
371
+
372
+
373
+
374
+
375
+
376
+
377
+
378
+
379
+
380
+ <h4 class="name" id="csvStringToJsonAsync"><span class="type-signature"></span>csvStringToJsonAsync<span class="signature">(csvString)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;object>>}</span></h4>
381
+
382
+
383
+
384
+
385
+
386
+
387
+ <div class="description">
388
+ <p>Parse a CSV string asynchronously (returns resolved Promise)</p>
389
+ </div>
390
+
391
+
392
+
393
+
394
+
395
+
396
+
397
+
398
+
399
+ <h5>Parameters:</h5>
400
+
401
+
402
+ <table class="params">
403
+ <thead>
404
+ <tr>
405
+
406
+ <th>Name</th>
407
+
408
+
409
+ <th>Type</th>
410
+
411
+
412
+
413
+
414
+
415
+ <th class="last">Description</th>
416
+ </tr>
417
+ </thead>
418
+
419
+ <tbody>
420
+
421
+
422
+ <tr>
423
+
424
+ <td class="name"><code>csvString</code></td>
425
+
426
+
427
+ <td class="type">
428
+
429
+
430
+ <span class="param-type">string</span>
431
+
432
+
433
+
434
+ </td>
435
+
436
+
437
+
438
+
439
+
440
+ <td class="description last"><p>CSV content as string</p></td>
441
+ </tr>
442
+
443
+
444
+ </tbody>
445
+ </table>
446
+
447
+
448
+
449
+
450
+
451
+
452
+ <dl class="details">
453
+
454
+
455
+
456
+
457
+
458
+
459
+
460
+
461
+
462
+
463
+
464
+
465
+
466
+
467
+
468
+
469
+
470
+
471
+
472
+
473
+
474
+
475
+
476
+
477
+
478
+
479
+ <dt class="tag-source">Source:</dt>
480
+ <dd class="tag-source"><ul class="dummy"><li>
481
+ <a href="src_browserApi.js.html">src/browserApi.js</a>, <a href="src_browserApi.js.html#line150">line 150</a>
482
+ </li></ul></dd>
483
+
484
+
485
+
486
+
487
+
488
+
489
+
490
+ </dl>
491
+
492
+
493
+
494
+
495
+
496
+
497
+
498
+
499
+
500
+
501
+
502
+
503
+
504
+ <h5>Throws:</h5>
505
+ <ul>
506
+ <li>
507
+
508
+ <dl>
509
+ <dt>
510
+ <div class="param-desc">
511
+ <p>If csvString is invalid</p>
512
+ </div>
513
+ </dt>
514
+ <dd></dd>
515
+ <dt>
516
+ <dl>
517
+ <dt>
518
+ Type
519
+ </dt>
520
+ <dd>
521
+
522
+ <span class="param-type"><a href="InputValidationError.html">InputValidationError</a></span>
523
+
524
+
525
+ </dd>
526
+ </dl>
527
+ </dt>
528
+ <dd></dd>
529
+ </dl>
530
+
531
+ </li>
532
+
533
+ <li>
534
+
535
+ <dl>
536
+ <dt>
537
+ <div class="param-desc">
538
+ <p>If CSV is malformed</p>
539
+ </div>
540
+ </dt>
541
+ <dd></dd>
542
+ <dt>
543
+ <dl>
544
+ <dt>
545
+ Type
546
+ </dt>
547
+ <dd>
548
+
549
+ <span class="param-type"><a href="CsvFormatError.html">CsvFormatError</a></span>
550
+
551
+
552
+ </dd>
553
+ </dl>
554
+ </dt>
555
+ <dd></dd>
556
+ </dl>
557
+
558
+ </li>
559
+ </ul>
560
+
561
+
562
+ <h5>Returns:</h5>
563
+
564
+
565
+ <div class="param-desc">
566
+ <p>Promise resolving to array of objects</p>
567
+ </div>
568
+
569
+
570
+
571
+ <dl>
572
+ <dt>
573
+ Type
574
+ </dt>
575
+ <dd>
576
+
577
+ <span class="param-type">Promise.&lt;Array.&lt;object>></span>
578
+
579
+
580
+ </dd>
581
+ </dl>
582
+
583
+
584
+
585
+
586
+
587
+
588
+ <h5>Example</h5>
589
+
590
+ <pre class="prettyprint"><code>const csvToJson = require('convert-csv-to-json');
591
+ const rows = await csvToJson.browser.csvStringToJsonAsync('name,age\nAlice,30');
592
+ console.log(rows);</code></pre>
593
+
594
+
595
+
596
+
597
+
598
+
599
+
600
+
601
+
602
+ <h4 class="name" id="csvStringToJsonStringified"><span class="type-signature"></span>csvStringToJsonStringified<span class="signature">(csvString)</span><span class="type-signature"> &rarr; {string}</span></h4>
603
+
604
+
605
+
606
+
607
+
608
+
609
+ <div class="description">
610
+ <p>Parse a CSV string and return as stringified JSON</p>
611
+ </div>
612
+
613
+
614
+
615
+
616
+
617
+
618
+
619
+
620
+
621
+ <h5>Parameters:</h5>
622
+
623
+
624
+ <table class="params">
625
+ <thead>
626
+ <tr>
627
+
628
+ <th>Name</th>
629
+
630
+
631
+ <th>Type</th>
632
+
633
+
634
+
635
+
636
+
637
+ <th class="last">Description</th>
638
+ </tr>
639
+ </thead>
640
+
641
+ <tbody>
642
+
643
+
644
+ <tr>
645
+
646
+ <td class="name"><code>csvString</code></td>
647
+
648
+
649
+ <td class="type">
650
+
651
+
652
+ <span class="param-type">string</span>
653
+
654
+
655
+
656
+ </td>
657
+
658
+
659
+
660
+
661
+
662
+ <td class="description last"><p>CSV content as string</p></td>
663
+ </tr>
664
+
665
+
666
+ </tbody>
667
+ </table>
668
+
669
+
670
+
671
+
672
+
673
+
674
+ <dl class="details">
675
+
676
+
677
+
678
+
679
+
680
+
681
+
682
+
683
+
684
+
685
+
686
+
687
+
688
+
689
+
690
+
691
+
692
+
693
+
694
+
695
+
696
+
697
+
698
+
699
+
700
+
701
+ <dt class="tag-source">Source:</dt>
702
+ <dd class="tag-source"><ul class="dummy"><li>
703
+ <a href="src_browserApi.js.html">src/browserApi.js</a>, <a href="src_browserApi.js.html#line127">line 127</a>
704
+ </li></ul></dd>
705
+
706
+
707
+
708
+
709
+
710
+
711
+
712
+ </dl>
713
+
714
+
715
+
716
+
717
+
718
+
719
+
720
+
721
+
722
+
723
+
724
+
725
+
726
+ <h5>Throws:</h5>
727
+ <ul>
728
+ <li>
729
+
730
+ <dl>
731
+ <dt>
732
+ <div class="param-desc">
733
+ <p>If csvString is invalid</p>
734
+ </div>
735
+ </dt>
736
+ <dd></dd>
737
+ <dt>
738
+ <dl>
739
+ <dt>
740
+ Type
741
+ </dt>
742
+ <dd>
743
+
744
+ <span class="param-type"><a href="InputValidationError.html">InputValidationError</a></span>
745
+
746
+
747
+ </dd>
748
+ </dl>
749
+ </dt>
750
+ <dd></dd>
751
+ </dl>
752
+
753
+ </li>
754
+
755
+ <li>
756
+
757
+ <dl>
758
+ <dt>
759
+ <div class="param-desc">
760
+ <p>If CSV is malformed</p>
761
+ </div>
762
+ </dt>
763
+ <dd></dd>
764
+ <dt>
765
+ <dl>
766
+ <dt>
767
+ Type
768
+ </dt>
769
+ <dd>
770
+
771
+ <span class="param-type"><a href="CsvFormatError.html">CsvFormatError</a></span>
772
+
773
+
774
+ </dd>
775
+ </dl>
776
+ </dt>
777
+ <dd></dd>
778
+ </dl>
779
+
780
+ </li>
781
+ </ul>
782
+
783
+
784
+ <h5>Returns:</h5>
785
+
786
+
787
+ <div class="param-desc">
788
+ <p>JSON stringified array of objects</p>
789
+ </div>
790
+
791
+
792
+
793
+ <dl>
794
+ <dt>
795
+ Type
796
+ </dt>
797
+ <dd>
798
+
799
+ <span class="param-type">string</span>
800
+
801
+
802
+ </dd>
803
+ </dl>
804
+
805
+
806
+
807
+
808
+
809
+
810
+ <h5>Example</h5>
811
+
812
+ <pre class="prettyprint"><code>const csvToJson = require('convert-csv-to-json');
813
+ const jsonString = csvToJson.browser.csvStringToJsonStringified('name,age\nAlice,30');
814
+ console.log(jsonString);</code></pre>
815
+
816
+
817
+
818
+
819
+
820
+
821
+
822
+
823
+
824
+ <h4 class="name" id="csvStringToJsonStringifiedAsync"><span class="type-signature"></span>csvStringToJsonStringifiedAsync<span class="signature">(csvString)</span><span class="type-signature"> &rarr; {Promise.&lt;string>}</span></h4>
825
+
826
+
827
+
828
+
829
+
830
+
831
+ <div class="description">
832
+ <p>Parse a CSV string asynchronously and return as stringified JSON</p>
833
+ </div>
834
+
835
+
836
+
837
+
838
+
839
+
840
+
841
+
842
+
843
+ <h5>Parameters:</h5>
844
+
845
+
846
+ <table class="params">
847
+ <thead>
848
+ <tr>
849
+
850
+ <th>Name</th>
851
+
852
+
853
+ <th>Type</th>
854
+
855
+
856
+
857
+
858
+
859
+ <th class="last">Description</th>
860
+ </tr>
861
+ </thead>
862
+
863
+ <tbody>
864
+
865
+
866
+ <tr>
867
+
868
+ <td class="name"><code>csvString</code></td>
869
+
870
+
871
+ <td class="type">
872
+
873
+
874
+ <span class="param-type">string</span>
875
+
876
+
877
+
878
+ </td>
879
+
880
+
881
+
882
+
883
+
884
+ <td class="description last"><p>CSV content as string</p></td>
885
+ </tr>
886
+
887
+
888
+ </tbody>
889
+ </table>
890
+
891
+
892
+
893
+
894
+
895
+
896
+ <dl class="details">
897
+
898
+
899
+
900
+
901
+
902
+
903
+
904
+
905
+
906
+
907
+
908
+
909
+
910
+
911
+
912
+
913
+
914
+
915
+
916
+
917
+
918
+
919
+
920
+
921
+
922
+
923
+ <dt class="tag-source">Source:</dt>
924
+ <dd class="tag-source"><ul class="dummy"><li>
925
+ <a href="src_browserApi.js.html">src/browserApi.js</a>, <a href="src_browserApi.js.html#line165">line 165</a>
926
+ </li></ul></dd>
927
+
928
+
929
+
930
+
931
+
932
+
933
+
934
+ </dl>
935
+
936
+
937
+
938
+
939
+
940
+
941
+
942
+
943
+
944
+
945
+
946
+
947
+
948
+ <h5>Throws:</h5>
949
+ <ul>
950
+ <li>
951
+
952
+ <dl>
953
+ <dt>
954
+ <div class="param-desc">
955
+ <p>If csvString is invalid</p>
956
+ </div>
957
+ </dt>
958
+ <dd></dd>
959
+ <dt>
960
+ <dl>
961
+ <dt>
962
+ Type
963
+ </dt>
964
+ <dd>
965
+
966
+ <span class="param-type"><a href="InputValidationError.html">InputValidationError</a></span>
967
+
968
+
969
+ </dd>
970
+ </dl>
971
+ </dt>
972
+ <dd></dd>
973
+ </dl>
974
+
975
+ </li>
976
+
977
+ <li>
978
+
979
+ <dl>
980
+ <dt>
981
+ <div class="param-desc">
982
+ <p>If CSV is malformed</p>
983
+ </div>
984
+ </dt>
985
+ <dd></dd>
986
+ <dt>
987
+ <dl>
988
+ <dt>
989
+ Type
990
+ </dt>
991
+ <dd>
992
+
993
+ <span class="param-type"><a href="CsvFormatError.html">CsvFormatError</a></span>
994
+
995
+
996
+ </dd>
997
+ </dl>
998
+ </dt>
999
+ <dd></dd>
1000
+ </dl>
1001
+
1002
+ </li>
1003
+ </ul>
1004
+
1005
+
1006
+ <h5>Returns:</h5>
1007
+
1008
+
1009
+ <div class="param-desc">
1010
+ <p>Promise resolving to JSON stringified array</p>
1011
+ </div>
1012
+
1013
+
1014
+
1015
+ <dl>
1016
+ <dt>
1017
+ Type
1018
+ </dt>
1019
+ <dd>
1020
+
1021
+ <span class="param-type">Promise.&lt;string></span>
1022
+
1023
+
1024
+ </dd>
1025
+ </dl>
1026
+
1027
+
1028
+
1029
+
1030
+
1031
+
1032
+ <h5>Example</h5>
1033
+
1034
+ <pre class="prettyprint"><code>const csvToJson = require('convert-csv-to-json');
1035
+ const json = await csvToJson.browser.csvStringToJsonStringifiedAsync('name,age\nAlice,30');
1036
+ console.log(json);</code></pre>
1037
+
1038
+
1039
+
1040
+
1041
+
1042
+
1043
+
1044
+
1045
+
1046
+ <h4 class="name" id="fieldDelimiter"><span class="type-signature"></span>fieldDelimiter<span class="signature">(delimiter)</span><span class="type-signature"> &rarr; {this}</span></h4>
1047
+
1048
+
1049
+
1050
+
1051
+
1052
+
1053
+ <div class="description">
1054
+ <p>Set the field delimiter character</p>
1055
+ </div>
1056
+
1057
+
1058
+
1059
+
1060
+
1061
+
1062
+
1063
+
1064
+
1065
+ <h5>Parameters:</h5>
1066
+
1067
+
1068
+ <table class="params">
1069
+ <thead>
1070
+ <tr>
1071
+
1072
+ <th>Name</th>
1073
+
1074
+
1075
+ <th>Type</th>
1076
+
1077
+
1078
+
1079
+
1080
+
1081
+ <th class="last">Description</th>
1082
+ </tr>
1083
+ </thead>
1084
+
1085
+ <tbody>
1086
+
1087
+
1088
+ <tr>
1089
+
1090
+ <td class="name"><code>delimiter</code></td>
1091
+
1092
+
1093
+ <td class="type">
1094
+
1095
+
1096
+ <span class="param-type">string</span>
1097
+
1098
+
1099
+
1100
+ </td>
1101
+
1102
+
1103
+
1104
+
1105
+
1106
+ <td class="description last"><p>Character(s) to use as field separator</p></td>
1107
+ </tr>
1108
+
1109
+
1110
+ </tbody>
1111
+ </table>
1112
+
1113
+
1114
+
1115
+
1116
+
1117
+
1118
+ <dl class="details">
1119
+
1120
+
1121
+
1122
+
1123
+
1124
+
1125
+
1126
+
1127
+
1128
+
1129
+
1130
+
1131
+
1132
+
1133
+
1134
+
1135
+
1136
+
1137
+
1138
+
1139
+
1140
+
1141
+
1142
+
1143
+
1144
+
1145
+ <dt class="tag-source">Source:</dt>
1146
+ <dd class="tag-source"><ul class="dummy"><li>
1147
+ <a href="src_browserApi.js.html">src/browserApi.js</a>, <a href="src_browserApi.js.html#line47">line 47</a>
1148
+ </li></ul></dd>
1149
+
1150
+
1151
+
1152
+
1153
+
1154
+
1155
+
1156
+ </dl>
1157
+
1158
+
1159
+
1160
+
1161
+
1162
+
1163
+
1164
+
1165
+
1166
+
1167
+
1168
+
1169
+
1170
+
1171
+
1172
+ <h5>Returns:</h5>
1173
+
1174
+
1175
+ <div class="param-desc">
1176
+ <p>For method chaining</p>
1177
+ </div>
1178
+
1179
+
1180
+
1181
+ <dl>
1182
+ <dt>
1183
+ Type
1184
+ </dt>
1185
+ <dd>
1186
+
1187
+ <span class="param-type">this</span>
1188
+
1189
+
1190
+ </dd>
1191
+ </dl>
1192
+
1193
+
1194
+
1195
+
1196
+
1197
+
1198
+
1199
+
1200
+
1201
+
1202
+
1203
+
1204
+
1205
+ <h4 class="name" id="formatValueByType"><span class="type-signature"></span>formatValueByType<span class="signature">(active)</span><span class="type-signature"> &rarr; {this}</span></h4>
1206
+
1207
+
1208
+
1209
+
1210
+
1211
+
1212
+ <div class="description">
1213
+ <p>Enable or disable automatic type formatting for values</p>
1214
+ </div>
1215
+
1216
+
1217
+
1218
+
1219
+
1220
+
1221
+
1222
+
1223
+
1224
+ <h5>Parameters:</h5>
1225
+
1226
+
1227
+ <table class="params">
1228
+ <thead>
1229
+ <tr>
1230
+
1231
+ <th>Name</th>
1232
+
1233
+
1234
+ <th>Type</th>
1235
+
1236
+
1237
+
1238
+
1239
+ <th>Default</th>
1240
+
1241
+
1242
+ <th class="last">Description</th>
1243
+ </tr>
1244
+ </thead>
1245
+
1246
+ <tbody>
1247
+
1248
+
1249
+ <tr>
1250
+
1251
+ <td class="name"><code>active</code></td>
1252
+
1253
+
1254
+ <td class="type">
1255
+
1256
+
1257
+ <span class="param-type">boolean</span>
1258
+
1259
+
1260
+
1261
+ </td>
1262
+
1263
+
1264
+
1265
+
1266
+ <td class="default">
1267
+
1268
+ true
1269
+
1270
+ </td>
1271
+
1272
+
1273
+ <td class="description last"><p>Whether to format values by type (default: true)</p></td>
1274
+ </tr>
1275
+
1276
+
1277
+ </tbody>
1278
+ </table>
1279
+
1280
+
1281
+
1282
+
1283
+
1284
+
1285
+ <dl class="details">
1286
+
1287
+
1288
+
1289
+
1290
+
1291
+
1292
+
1293
+
1294
+
1295
+
1296
+
1297
+
1298
+
1299
+
1300
+
1301
+
1302
+
1303
+
1304
+
1305
+
1306
+
1307
+
1308
+
1309
+
1310
+
1311
+
1312
+ <dt class="tag-source">Source:</dt>
1313
+ <dd class="tag-source"><ul class="dummy"><li>
1314
+ <a href="src_browserApi.js.html">src/browserApi.js</a>, <a href="src_browserApi.js.html#line27">line 27</a>
1315
+ </li></ul></dd>
1316
+
1317
+
1318
+
1319
+
1320
+
1321
+
1322
+
1323
+ </dl>
1324
+
1325
+
1326
+
1327
+
1328
+
1329
+
1330
+
1331
+
1332
+
1333
+
1334
+
1335
+
1336
+
1337
+
1338
+
1339
+ <h5>Returns:</h5>
1340
+
1341
+
1342
+ <div class="param-desc">
1343
+ <p>For method chaining</p>
1344
+ </div>
1345
+
1346
+
1347
+
1348
+ <dl>
1349
+ <dt>
1350
+ Type
1351
+ </dt>
1352
+ <dd>
1353
+
1354
+ <span class="param-type">this</span>
1355
+
1356
+
1357
+ </dd>
1358
+ </dl>
1359
+
1360
+
1361
+
1362
+
1363
+
1364
+
1365
+
1366
+
1367
+
1368
+
1369
+
1370
+
1371
+
1372
+ <h4 class="name" id="indexHeader"><span class="type-signature"></span>indexHeader<span class="signature">(index)</span><span class="type-signature"> &rarr; {this}</span></h4>
1373
+
1374
+
1375
+
1376
+
1377
+
1378
+
1379
+ <div class="description">
1380
+ <p>Set the row index where CSV headers are located</p>
1381
+ </div>
1382
+
1383
+
1384
+
1385
+
1386
+
1387
+
1388
+
1389
+
1390
+
1391
+ <h5>Parameters:</h5>
1392
+
1393
+
1394
+ <table class="params">
1395
+ <thead>
1396
+ <tr>
1397
+
1398
+ <th>Name</th>
1399
+
1400
+
1401
+ <th>Type</th>
1402
+
1403
+
1404
+
1405
+
1406
+
1407
+ <th class="last">Description</th>
1408
+ </tr>
1409
+ </thead>
1410
+
1411
+ <tbody>
1412
+
1413
+
1414
+ <tr>
1415
+
1416
+ <td class="name"><code>index</code></td>
1417
+
1418
+
1419
+ <td class="type">
1420
+
1421
+
1422
+ <span class="param-type">number</span>
1423
+
1424
+
1425
+
1426
+ </td>
1427
+
1428
+
1429
+
1430
+
1431
+
1432
+ <td class="description last"><p>Zero-based row index containing headers</p></td>
1433
+ </tr>
1434
+
1435
+
1436
+ </tbody>
1437
+ </table>
1438
+
1439
+
1440
+
1441
+
1442
+
1443
+
1444
+ <dl class="details">
1445
+
1446
+
1447
+
1448
+
1449
+
1450
+
1451
+
1452
+
1453
+
1454
+
1455
+
1456
+
1457
+
1458
+
1459
+
1460
+
1461
+
1462
+
1463
+
1464
+
1465
+
1466
+
1467
+
1468
+
1469
+
1470
+
1471
+ <dt class="tag-source">Source:</dt>
1472
+ <dd class="tag-source"><ul class="dummy"><li>
1473
+ <a href="src_browserApi.js.html">src/browserApi.js</a>, <a href="src_browserApi.js.html#line67">line 67</a>
1474
+ </li></ul></dd>
1475
+
1476
+
1477
+
1478
+
1479
+
1480
+
1481
+
1482
+ </dl>
1483
+
1484
+
1485
+
1486
+
1487
+
1488
+
1489
+
1490
+
1491
+
1492
+
1493
+
1494
+
1495
+
1496
+
1497
+
1498
+ <h5>Returns:</h5>
1499
+
1500
+
1501
+ <div class="param-desc">
1502
+ <p>For method chaining</p>
1503
+ </div>
1504
+
1505
+
1506
+
1507
+ <dl>
1508
+ <dt>
1509
+ Type
1510
+ </dt>
1511
+ <dd>
1512
+
1513
+ <span class="param-type">this</span>
1514
+
1515
+
1516
+ </dd>
1517
+ </dl>
1518
+
1519
+
1520
+
1521
+
1522
+
1523
+
1524
+
1525
+
1526
+
1527
+
1528
+
1529
+
1530
+
1531
+ <h4 class="name" id="mapRows"><span class="type-signature"></span>mapRows<span class="signature">(mapperFn)</span><span class="type-signature"> &rarr; {this}</span></h4>
1532
+
1533
+
1534
+
1535
+
1536
+
1537
+
1538
+ <div class="description">
1539
+ <p>Set a mapper function to transform each row after conversion</p>
1540
+ </div>
1541
+
1542
+
1543
+
1544
+
1545
+
1546
+
1547
+
1548
+
1549
+
1550
+ <h5>Parameters:</h5>
1551
+
1552
+
1553
+ <table class="params">
1554
+ <thead>
1555
+ <tr>
1556
+
1557
+ <th>Name</th>
1558
+
1559
+
1560
+ <th>Type</th>
1561
+
1562
+
1563
+
1564
+
1565
+
1566
+ <th class="last">Description</th>
1567
+ </tr>
1568
+ </thead>
1569
+
1570
+ <tbody>
1571
+
1572
+
1573
+ <tr>
1574
+
1575
+ <td class="name"><code>mapperFn</code></td>
1576
+
1577
+
1578
+ <td class="type">
1579
+
1580
+
1581
+ <span class="param-type">function</span>
1582
+
1583
+
1584
+
1585
+ </td>
1586
+
1587
+
1588
+
1589
+
1590
+
1591
+ <td class="description last"><p>Function receiving (row, index) that returns transformed row or null to filter</p></td>
1592
+ </tr>
1593
+
1594
+
1595
+ </tbody>
1596
+ </table>
1597
+
1598
+
1599
+
1600
+
1601
+
1602
+
1603
+ <dl class="details">
1604
+
1605
+
1606
+
1607
+
1608
+
1609
+
1610
+
1611
+
1612
+
1613
+
1614
+
1615
+
1616
+
1617
+
1618
+
1619
+
1620
+
1621
+
1622
+
1623
+
1624
+
1625
+
1626
+
1627
+
1628
+
1629
+
1630
+ <dt class="tag-source">Source:</dt>
1631
+ <dd class="tag-source"><ul class="dummy"><li>
1632
+ <a href="src_browserApi.js.html">src/browserApi.js</a>, <a href="src_browserApi.js.html#line88">line 88</a>
1633
+ </li></ul></dd>
1634
+
1635
+
1636
+
1637
+
1638
+
1639
+
1640
+
1641
+ </dl>
1642
+
1643
+
1644
+
1645
+
1646
+
1647
+
1648
+
1649
+
1650
+
1651
+
1652
+
1653
+
1654
+
1655
+
1656
+
1657
+ <h5>Returns:</h5>
1658
+
1659
+
1660
+ <div class="param-desc">
1661
+ <p>For method chaining</p>
1662
+ </div>
1663
+
1664
+
1665
+
1666
+ <dl>
1667
+ <dt>
1668
+ Type
1669
+ </dt>
1670
+ <dd>
1671
+
1672
+ <span class="param-type">this</span>
1673
+
1674
+
1675
+ </dd>
1676
+ </dl>
1677
+
1678
+
1679
+
1680
+
1681
+
1682
+
1683
+
1684
+
1685
+
1686
+
1687
+
1688
+
1689
+
1690
+ <h4 class="name" id="parseFile"><span class="type-signature"></span>parseFile<span class="signature">(file, options)</span><span class="type-signature"> &rarr; {Promise.&lt;Array.&lt;any>>}</span></h4>
1691
+
1692
+
1693
+
1694
+
1695
+
1696
+
1697
+ <div class="description">
1698
+ <p>Parse a browser File or Blob object to JSON array.</p>
1699
+ </div>
1700
+
1701
+
1702
+
1703
+
1704
+
1705
+
1706
+
1707
+
1708
+
1709
+ <h5>Parameters:</h5>
1710
+
1711
+
1712
+ <table class="params">
1713
+ <thead>
1714
+ <tr>
1715
+
1716
+ <th>Name</th>
1717
+
1718
+
1719
+ <th>Type</th>
1720
+
1721
+
1722
+
1723
+
1724
+
1725
+ <th class="last">Description</th>
1726
+ </tr>
1727
+ </thead>
1728
+
1729
+ <tbody>
1730
+
1731
+
1732
+ <tr>
1733
+
1734
+ <td class="name"><code>file</code></td>
1735
+
1736
+
1737
+ <td class="type">
1738
+
1739
+
1740
+ <span class="param-type">File</span>
1741
+ |
1742
+
1743
+ <span class="param-type">Blob</span>
1744
+
1745
+
1746
+
1747
+ </td>
1748
+
1749
+
1750
+
1751
+
1752
+
1753
+ <td class="description last"><p>File or Blob to read as text</p></td>
1754
+ </tr>
1755
+
1756
+
1757
+
1758
+ <tr>
1759
+
1760
+ <td class="name"><code>options</code></td>
1761
+
1762
+
1763
+ <td class="type">
1764
+
1765
+
1766
+ <span class="param-type">object</span>
1767
+
1768
+
1769
+
1770
+ </td>
1771
+
1772
+
1773
+
1774
+
1775
+
1776
+ <td class="description last"><p>options: { encoding?: string }</p></td>
1777
+ </tr>
1778
+
1779
+
1780
+ </tbody>
1781
+ </table>
1782
+
1783
+
1784
+
1785
+
1786
+
1787
+
1788
+ <dl class="details">
1789
+
1790
+
1791
+
1792
+
1793
+
1794
+
1795
+
1796
+
1797
+
1798
+
1799
+
1800
+
1801
+
1802
+
1803
+
1804
+
1805
+
1806
+
1807
+
1808
+
1809
+
1810
+
1811
+
1812
+
1813
+
1814
+
1815
+ <dt class="tag-source">Source:</dt>
1816
+ <dd class="tag-source"><ul class="dummy"><li>
1817
+ <a href="src_browserApi.js.html">src/browserApi.js</a>, <a href="src_browserApi.js.html#line180">line 180</a>
1818
+ </li></ul></dd>
1819
+
1820
+
1821
+
1822
+
1823
+
1824
+
1825
+
1826
+ </dl>
1827
+
1828
+
1829
+
1830
+
1831
+
1832
+
1833
+
1834
+
1835
+
1836
+
1837
+
1838
+
1839
+
1840
+
1841
+
1842
+ <h5>Returns:</h5>
1843
+
1844
+
1845
+ <div class="param-desc">
1846
+ <p>Promise resolving to parsed JSON rows</p>
1847
+ </div>
1848
+
1849
+
1850
+
1851
+ <dl>
1852
+ <dt>
1853
+ Type
1854
+ </dt>
1855
+ <dd>
1856
+
1857
+ <span class="param-type">Promise.&lt;Array.&lt;any>></span>
1858
+
1859
+
1860
+ </dd>
1861
+ </dl>
1862
+
1863
+
1864
+
1865
+
1866
+
1867
+
1868
+ <h5>Example</h5>
1869
+
1870
+ <pre class="prettyprint"><code>const csvToJson = require('convert-csv-to-json');
1871
+ const fileInput = document.querySelector('#csvfile').files[0];
1872
+ const rows = await csvToJson.browser.parseFile(fileInput);
1873
+ console.log(rows);</code></pre>
1874
+
1875
+
1876
+
1877
+
1878
+
1879
+
1880
+
1881
+
1882
+
1883
+ <h4 class="name" id="parseSubArray"><span class="type-signature"></span>parseSubArray<span class="signature">(delimiter, separator)</span><span class="type-signature"> &rarr; {this}</span></h4>
1884
+
1885
+
1886
+
1887
+
1888
+
1889
+
1890
+ <div class="description">
1891
+ <p>Configure sub-array parsing for special field values</p>
1892
+ </div>
1893
+
1894
+
1895
+
1896
+
1897
+
1898
+
1899
+
1900
+
1901
+
1902
+ <h5>Parameters:</h5>
1903
+
1904
+
1905
+ <table class="params">
1906
+ <thead>
1907
+ <tr>
1908
+
1909
+ <th>Name</th>
1910
+
1911
+
1912
+ <th>Type</th>
1913
+
1914
+
1915
+
1916
+
1917
+ <th>Default</th>
1918
+
1919
+
1920
+ <th class="last">Description</th>
1921
+ </tr>
1922
+ </thead>
1923
+
1924
+ <tbody>
1925
+
1926
+
1927
+ <tr>
1928
+
1929
+ <td class="name"><code>delimiter</code></td>
1930
+
1931
+
1932
+ <td class="type">
1933
+
1934
+
1935
+ <span class="param-type">string</span>
1936
+
1937
+
1938
+
1939
+ </td>
1940
+
1941
+
1942
+
1943
+
1944
+ <td class="default">
1945
+
1946
+ *
1947
+
1948
+ </td>
1949
+
1950
+
1951
+ <td class="description last"><p>Bracket character (default: '*')</p></td>
1952
+ </tr>
1953
+
1954
+
1955
+
1956
+ <tr>
1957
+
1958
+ <td class="name"><code>separator</code></td>
1959
+
1960
+
1961
+ <td class="type">
1962
+
1963
+
1964
+ <span class="param-type">string</span>
1965
+
1966
+
1967
+
1968
+ </td>
1969
+
1970
+
1971
+
1972
+
1973
+ <td class="default">
1974
+
1975
+ ,
1976
+
1977
+ </td>
1978
+
1979
+
1980
+ <td class="description last"><p>Item separator within brackets (default: ',')</p></td>
1981
+ </tr>
1982
+
1983
+
1984
+ </tbody>
1985
+ </table>
1986
+
1987
+
1988
+
1989
+
1990
+
1991
+
1992
+ <dl class="details">
1993
+
1994
+
1995
+
1996
+
1997
+
1998
+
1999
+
2000
+
2001
+
2002
+
2003
+
2004
+
2005
+
2006
+
2007
+
2008
+
2009
+
2010
+
2011
+
2012
+
2013
+
2014
+
2015
+
2016
+
2017
+
2018
+
2019
+ <dt class="tag-source">Source:</dt>
2020
+ <dd class="tag-source"><ul class="dummy"><li>
2021
+ <a href="src_browserApi.js.html">src/browserApi.js</a>, <a href="src_browserApi.js.html#line78">line 78</a>
2022
+ </li></ul></dd>
2023
+
2024
+
2025
+
2026
+
2027
+
2028
+
2029
+
2030
+ </dl>
2031
+
2032
+
2033
+
2034
+
2035
+
2036
+
2037
+
2038
+
2039
+
2040
+
2041
+
2042
+
2043
+
2044
+
2045
+
2046
+ <h5>Returns:</h5>
2047
+
2048
+
2049
+ <div class="param-desc">
2050
+ <p>For method chaining</p>
2051
+ </div>
2052
+
2053
+
2054
+
2055
+ <dl>
2056
+ <dt>
2057
+ Type
2058
+ </dt>
2059
+ <dd>
2060
+
2061
+ <span class="param-type">this</span>
2062
+
2063
+
2064
+ </dd>
2065
+ </dl>
2066
+
2067
+
2068
+
2069
+
2070
+
2071
+
2072
+
2073
+
2074
+
2075
+
2076
+
2077
+
2078
+
2079
+ <h4 class="name" id="supportQuotedField"><span class="type-signature"></span>supportQuotedField<span class="signature">(active)</span><span class="type-signature"> &rarr; {this}</span></h4>
2080
+
2081
+
2082
+
2083
+
2084
+
2085
+
2086
+ <div class="description">
2087
+ <p>Enable or disable support for RFC 4180 quoted fields</p>
2088
+ </div>
2089
+
2090
+
2091
+
2092
+
2093
+
2094
+
2095
+
2096
+
2097
+
2098
+ <h5>Parameters:</h5>
2099
+
2100
+
2101
+ <table class="params">
2102
+ <thead>
2103
+ <tr>
2104
+
2105
+ <th>Name</th>
2106
+
2107
+
2108
+ <th>Type</th>
2109
+
2110
+
2111
+
2112
+
2113
+ <th>Default</th>
2114
+
2115
+
2116
+ <th class="last">Description</th>
2117
+ </tr>
2118
+ </thead>
2119
+
2120
+ <tbody>
2121
+
2122
+
2123
+ <tr>
2124
+
2125
+ <td class="name"><code>active</code></td>
2126
+
2127
+
2128
+ <td class="type">
2129
+
2130
+
2131
+ <span class="param-type">boolean</span>
2132
+
2133
+
2134
+
2135
+ </td>
2136
+
2137
+
2138
+
2139
+
2140
+ <td class="default">
2141
+
2142
+ false
2143
+
2144
+ </td>
2145
+
2146
+
2147
+ <td class="description last"><p>Whether to support quoted fields (default: false)</p></td>
2148
+ </tr>
2149
+
2150
+
2151
+ </tbody>
2152
+ </table>
2153
+
2154
+
2155
+
2156
+
2157
+
2158
+
2159
+ <dl class="details">
2160
+
2161
+
2162
+
2163
+
2164
+
2165
+
2166
+
2167
+
2168
+
2169
+
2170
+
2171
+
2172
+
2173
+
2174
+
2175
+
2176
+
2177
+
2178
+
2179
+
2180
+
2181
+
2182
+
2183
+
2184
+
2185
+
2186
+ <dt class="tag-source">Source:</dt>
2187
+ <dd class="tag-source"><ul class="dummy"><li>
2188
+ <a href="src_browserApi.js.html">src/browserApi.js</a>, <a href="src_browserApi.js.html#line37">line 37</a>
2189
+ </li></ul></dd>
2190
+
2191
+
2192
+
2193
+
2194
+
2195
+
2196
+
2197
+ </dl>
2198
+
2199
+
2200
+
2201
+
2202
+
2203
+
2204
+
2205
+
2206
+
2207
+
2208
+
2209
+
2210
+
2211
+
2212
+
2213
+ <h5>Returns:</h5>
2214
+
2215
+
2216
+ <div class="param-desc">
2217
+ <p>For method chaining</p>
2218
+ </div>
2219
+
2220
+
2221
+
2222
+ <dl>
2223
+ <dt>
2224
+ Type
2225
+ </dt>
2226
+ <dd>
2227
+
2228
+ <span class="param-type">this</span>
2229
+
2230
+
2231
+ </dd>
2232
+ </dl>
2233
+
2234
+
2235
+
2236
+
2237
+
2238
+
2239
+
2240
+
2241
+
2242
+
2243
+
2244
+
2245
+
2246
+ <h4 class="name" id="trimHeaderFieldWhiteSpace"><span class="type-signature"></span>trimHeaderFieldWhiteSpace<span class="signature">(active)</span><span class="type-signature"> &rarr; {this}</span></h4>
2247
+
2248
+
2249
+
2250
+
2251
+
2252
+
2253
+ <div class="description">
2254
+ <p>Configure whitespace handling in header field names</p>
2255
+ </div>
2256
+
2257
+
2258
+
2259
+
2260
+
2261
+
2262
+
2263
+
2264
+
2265
+ <h5>Parameters:</h5>
2266
+
2267
+
2268
+ <table class="params">
2269
+ <thead>
2270
+ <tr>
2271
+
2272
+ <th>Name</th>
2273
+
2274
+
2275
+ <th>Type</th>
2276
+
2277
+
2278
+
2279
+
2280
+ <th>Default</th>
2281
+
2282
+
2283
+ <th class="last">Description</th>
2284
+ </tr>
2285
+ </thead>
2286
+
2287
+ <tbody>
2288
+
2289
+
2290
+ <tr>
2291
+
2292
+ <td class="name"><code>active</code></td>
2293
+
2294
+
2295
+ <td class="type">
2296
+
2297
+
2298
+ <span class="param-type">boolean</span>
2299
+
2300
+
2301
+
2302
+ </td>
2303
+
2304
+
2305
+
2306
+
2307
+ <td class="default">
2308
+
2309
+ false
2310
+
2311
+ </td>
2312
+
2313
+
2314
+ <td class="description last"><p>If true, removes all whitespace; if false, only trims edges (default: false)</p></td>
2315
+ </tr>
2316
+
2317
+
2318
+ </tbody>
2319
+ </table>
2320
+
2321
+
2322
+
2323
+
2324
+
2325
+
2326
+ <dl class="details">
2327
+
2328
+
2329
+
2330
+
2331
+
2332
+
2333
+
2334
+
2335
+
2336
+
2337
+
2338
+
2339
+
2340
+
2341
+
2342
+
2343
+
2344
+
2345
+
2346
+
2347
+
2348
+
2349
+
2350
+
2351
+
2352
+
2353
+ <dt class="tag-source">Source:</dt>
2354
+ <dd class="tag-source"><ul class="dummy"><li>
2355
+ <a href="src_browserApi.js.html">src/browserApi.js</a>, <a href="src_browserApi.js.html#line57">line 57</a>
2356
+ </li></ul></dd>
2357
+
2358
+
2359
+
2360
+
2361
+
2362
+
2363
+
2364
+ </dl>
2365
+
2366
+
2367
+
2368
+
2369
+
2370
+
2371
+
2372
+
2373
+
2374
+
2375
+
2376
+
2377
+
2378
+
2379
+
2380
+ <h5>Returns:</h5>
2381
+
2382
+
2383
+ <div class="param-desc">
2384
+ <p>For method chaining</p>
2385
+ </div>
2386
+
2387
+
2388
+
2389
+ <dl>
2390
+ <dt>
2391
+ Type
2392
+ </dt>
2393
+ <dd>
2394
+
2395
+ <span class="param-type">this</span>
2396
+
2397
+
2398
+ </dd>
2399
+ </dl>
2400
+
2401
+
2402
+
2403
+
2404
+
2405
+
2406
+
2407
+
2408
+
2409
+
2410
+
2411
+
2412
+
2413
+ </article>
2414
+
2415
+ </section>
2416
+
2417
+
2418
+
2419
+
2420
+ </div>
2421
+
2422
+ <nav>
2423
+ <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BrowserApi.html">BrowserApi</a></li><li><a href="BrowserApiError.html">BrowserApiError</a></li><li><a href="ConfigurationError.html">ConfigurationError</a></li><li><a href="CsvFormatError.html">CsvFormatError</a></li><li><a href="CsvParsingError.html">CsvParsingError</a></li><li><a href="CsvToJson.html">CsvToJson</a></li><li><a href="CsvToJsonAsync.html">CsvToJsonAsync</a></li><li><a href="FileOperationError.html">FileOperationError</a></li><li><a href="FileUtils.html">FileUtils</a></li><li><a href="InputValidationError.html">InputValidationError</a></li><li><a href="JsonUtil.html">JsonUtil</a></li><li><a href="JsonValidationError.html">JsonValidationError</a></li></ul><h3>Global</h3><ul><li><a href="global.html#asciiEncoding">asciiEncoding</a></li><li><a href="global.html#base64Encoding">base64Encoding</a></li><li><a href="global.html#browser">browser</a></li><li><a href="global.html#csvStringToJson">csvStringToJson</a></li><li><a href="global.html#csvStringToJsonStringified">csvStringToJsonStringified</a></li><li><a href="global.html#csvToJsonAsync">csvToJsonAsync</a></li><li><a href="global.html#customEncoding">customEncoding</a></li><li><a href="global.html#fieldDelimiter">fieldDelimiter</a></li><li><a href="global.html#formatValueByType">formatValueByType</a></li><li><a href="global.html#generateJsonFileFromCsv">generateJsonFileFromCsv</a></li><li><a href="global.html#getJsonFromCsv">getJsonFromCsv</a></li><li><a href="global.html#hexEncoding">hexEncoding</a></li><li><a href="global.html#indexHeader">indexHeader</a></li><li><a href="global.html#latin1Encoding">latin1Encoding</a></li><li><a href="global.html#mapRows">mapRows</a></li><li><a href="global.html#parseSubArray">parseSubArray</a></li><li><a href="global.html#supportQuotedField">supportQuotedField</a></li><li><a href="global.html#trimHeaderFieldWhiteSpace">trimHeaderFieldWhiteSpace</a></li><li><a href="global.html#ucs2Encoding">ucs2Encoding</a></li><li><a href="global.html#utf16leEncoding">utf16leEncoding</a></li><li><a href="global.html#utf8Encoding">utf8Encoding</a></li></ul>
2424
+ </nav>
2425
+
2426
+ <br class="clear">
2427
+
2428
+ <footer>
2429
+ Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.5</a> on Fri Mar 20 2026 14:48:29 GMT+0000 (Coordinated Universal Time)
2430
+ </footer>
2431
+
2432
+ <script> prettyPrint(); </script>
2433
+ <script src="scripts/linenumber.js"> </script>
2434
+ </body>
2435
+ </html>