w-data-csv 1.0.19 → 1.0.21

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.
package/docs/global.html CHANGED
@@ -140,7 +140,7 @@
140
140
 
141
141
  <dt class="tag-source">Source:</dt>
142
142
  <dd class="tag-source"><ul class="dummy"><li>
143
- <a href="WDataCsv.mjs.html">WDataCsv.mjs</a>, <a href="WDataCsv.mjs.html#line279">line 279</a>
143
+ <a href="WDataCsv.mjs.html">WDataCsv.mjs</a>, <a href="WDataCsv.mjs.html#line363">line 363</a>
144
144
  </li></ul></dd>
145
145
 
146
146
 
@@ -206,7 +206,7 @@
206
206
 
207
207
 
208
208
 
209
- <h4 class="name" id="parseCsv"><span class="type-signature type-signature-async">(async) </span>parseCsv<span class="signature">(c)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
209
+ <h4 class="name" id="parseCsv"><span class="type-signature type-signature-async">(async) </span>parseCsv<span class="signature">(inp, opt<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
210
210
 
211
211
 
212
212
 
@@ -222,7 +222,7 @@
222
222
 
223
223
  <dt class="tag-source">Source:</dt>
224
224
  <dd class="tag-source"><ul class="dummy"><li>
225
- <a href="WDataCsv.mjs.html">WDataCsv.mjs</a>, <a href="WDataCsv.mjs.html#line39">line 39</a>
225
+ <a href="WDataCsv.mjs.html">WDataCsv.mjs</a>, <a href="WDataCsv.mjs.html#line128">line 128</a>
226
226
  </li></ul></dd>
227
227
 
228
228
 
@@ -269,7 +269,7 @@
269
269
 
270
270
  <h5 class="h5-examples">Example</h5>
271
271
 
272
- <pre class="prettyprint"><code>import wdc from './src/WDataCsv.mjs'
273
272
  .then((ltdt) => {
274
273
  console.log(ltdt)
275
274
  // => [ { NAME: 'Daffy Duck', AGE: '24' }, { NAME: 'Bugs 邦妮', AGE: '22' } ]
276
275
  })
277
276
  .catch((err) => {
278
277
  console.log(err)
279
278
  })</code></pre>
279
+ <pre class="prettyprint"><code>import wdc from './src/WDataCsv.mjs'
280
280
  .then((ltdt) => {
281
281
  console.log(ltdt)
282
282
  // => [ { NAME: 'Daffy Duck', AGE: '24' }, { NAME: 'Bugs 邦妮', AGE: '22' } ]
283
283
  })
284
284
  .catch((err) => {
285
285
  console.log(err)
286
286
  })
287
287
  .then((mat) => {
288
288
  console.log(mat)
289
289
  // => [ [ 'NAME', 'AGE' ], [ 'Daffy Duck', '24' ], [ 'Bugs 邦妮', '22' ] ]
290
290
  })
291
291
  .catch((err) => {
292
292
  console.log(err)
293
293
  })</code></pre>
294
294
 
295
295
 
296
296
 
@@ -287,8 +287,12 @@
287
287
  <th>Type</th>
288
288
 
289
289
 
290
+ <th>Attributes</th>
291
+
290
292
 
291
293
 
294
+ <th>Default</th>
295
+
292
296
 
293
297
  <th class="last">Description</th>
294
298
  </tr>
@@ -299,7 +303,7 @@
299
303
 
300
304
  <tr>
301
305
 
302
- <td class="name"><code>c</code></td>
306
+ <td class="name"><code>inp</code></td>
303
307
 
304
308
 
305
309
  <td class="type">
@@ -313,156 +317,290 @@
313
317
  </td>
314
318
 
315
319
 
320
+ <td class="attributes">
321
+
322
+
323
+
324
+
325
+
326
+ </td>
327
+
316
328
 
317
329
 
330
+ <td class="default">
331
+
332
+ </td>
333
+
318
334
 
319
335
  <td class="description last"><p>輸入CSV字串</p></td>
320
336
  </tr>
321
337
 
322
338
 
323
- </tbody>
324
- </table>
325
339
 
340
+ <tr>
341
+
342
+ <td class="name"><code>opt</code></td>
343
+
326
344
 
345
+ <td class="type">
346
+
347
+
348
+ <span class="param-type">Object</span>
327
349
 
328
350
 
329
351
 
352
+
353
+ </td>
330
354
 
355
+
356
+ <td class="attributes">
357
+
358
+ &lt;optional><br>
359
+
331
360
 
361
+
332
362
 
363
+
364
+ </td>
365
+
333
366
 
367
+
368
+ <td class="default">
369
+
370
+ <code>{}</code>
371
+
372
+ </td>
373
+
334
374
 
375
+ <td class="description last"><p>輸入設定物件,預設{}</p>
376
+ <h6>Properties</h6>
377
+
335
378
 
379
+ <table class="params">
380
+ <thead>
381
+ <tr>
382
+
383
+ <th>Name</th>
384
+
336
385
 
386
+ <th>Type</th>
337
387
 
388
+
389
+ <th>Attributes</th>
390
+
338
391
 
392
+
393
+ <th>Default</th>
394
+
339
395
 
396
+ <th class="last">Description</th>
397
+ </tr>
398
+ </thead>
340
399
 
341
- <h5 class="h5-returns">Returns:</h5>
400
+ <tbody>
401
+
342
402
 
343
-
344
- <div class="param-desc">
345
- <p>回傳Promise,resolve回傳ltdt(各數據列為物件陣列),reject回傳錯誤訊息</p>
346
- </div>
403
+ <tr>
404
+
405
+ <td class="name"><code>mode</code></td>
406
+
347
407
 
408
+ <td class="type">
409
+
410
+
411
+ <span class="param-type">String</span>
348
412
 
349
413
 
350
- <dl class="param-type">
351
- <dt>
352
- Type
353
- </dt>
354
- <dd>
355
-
356
- <span class="param-type">Promise</span>
357
414
 
415
+
416
+ </td>
358
417
 
418
+
419
+ <td class="attributes">
420
+
421
+ &lt;optional><br>
422
+
359
423
 
360
- </dd>
361
- </dl>
424
+
362
425
 
363
-
426
+
427
+ </td>
428
+
429
+
430
+
431
+ <td class="default">
432
+
433
+ <code>'ltdt'</code>
434
+
435
+ </td>
436
+
364
437
 
438
+ <td class="description last"><p>輸入回傳數據格式字串,可選ltdt(各數據列為物件)或mat(各數據列為陣列),預設ltdt</p></td>
439
+ </tr>
365
440
 
441
+
366
442
 
367
-
443
+ <tr>
444
+
445
+ <td class="name"><code>headers</code></td>
368
446
 
369
447
 
370
-
448
+ <td class="type">
449
+
450
+
451
+ <span class="param-type">Boolean</span>
452
+ |
371
453
 
372
- <h4 class="name" id="readCsv"><span class="type-signature type-signature-async">(async) </span>readCsv<span class="signature">(fp)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
454
+ <span class="param-type">Array</span>
373
455
 
374
-
375
456
 
376
457
 
458
+
459
+ </td>
377
460
 
461
+
462
+ <td class="attributes">
463
+
464
+ &lt;optional><br>
465
+
378
466
 
379
- <dl class="details">
380
-
381
- <dt class="tag-description">Description:</dt>
382
- <dd class="tag-description"><ul class="dummy"><li><p>讀取CSV檔,自動清除BOM</p></li></ul></dd>
383
-
467
+
384
468
 
385
-
386
- <dt class="tag-source">Source:</dt>
387
- <dd class="tag-source"><ul class="dummy"><li>
388
- <a href="WDataCsv.mjs.html">WDataCsv.mjs</a>, <a href="WDataCsv.mjs.html#line88">line 88</a>
389
- </li></ul></dd>
390
-
469
+
470
+ </td>
471
+
391
472
 
392
-
473
+
474
+ <td class="default">
475
+
476
+ </td>
477
+
393
478
 
394
-
479
+ <td class="description last"><p>輸入標頭設定,給false代表無標頭列,給陣列代表無標頭列且以此陣列為欄名,不給則取第1列為標頭。因csv-parser於給true時會使各列成為_0,_1等溢出鍵之壞數據,故給true時視為不給。另mode為mat時本設定固定為false</p></td>
480
+ </tr>
395
481
 
396
482
 
397
483
 
398
-
484
+ <tr>
485
+
486
+ <td class="name"><code>skipLines</code></td>
487
+
399
488
 
400
-
489
+ <td class="type">
490
+
491
+
492
+ <span class="param-type">Number</span>
401
493
 
402
-
403
494
 
404
-
405
495
 
406
-
496
+
497
+ </td>
407
498
 
408
-
499
+
500
+ <td class="attributes">
501
+
502
+ &lt;optional><br>
503
+
409
504
 
410
-
505
+
411
506
 
412
-
507
+
508
+ </td>
509
+
413
510
 
414
-
511
+
512
+ <td class="default">
513
+
514
+ </td>
515
+
415
516
 
416
-
517
+ <td class="description last"><p>輸入解析前跳過列數整數。因csv-parser之註解列不計入行號,故與skipComments併用時計數基準會位移,兩者不建議同時使用</p></td>
518
+ </tr>
417
519
 
418
520
 
419
521
 
420
-
421
- </dl>
522
+ <tr>
523
+
524
+ <td class="name"><code>skipComments</code></td>
525
+
422
526
 
527
+ <td class="type">
528
+
529
+
530
+ <span class="param-type">Boolean</span>
531
+ |
423
532
 
533
+ <span class="param-type">String</span>
424
534
 
425
535
 
426
536
 
537
+
538
+ </td>
427
539
 
540
+
541
+ <td class="attributes">
542
+
543
+ &lt;optional><br>
544
+
428
545
 
546
+
429
547
 
548
+
549
+ </td>
550
+
430
551
 
552
+
553
+ <td class="default">
554
+
555
+ </td>
556
+
431
557
 
558
+ <td class="description last"><p>輸入忽略註解列設定,給true代表跳過#開頭之列,給字串代表以該字元為註解符</p></td>
559
+ </tr>
432
560
 
433
- <h5 class="h5-examples">Example</h5>
434
561
 
435
- <pre class="prettyprint"><code>import wdc from './src/WDataCsv.mjs'
436
562
  .then((ltdt) => {
437
563
  console.log(ltdt)
438
564
  // => [ { NAME: 'Daffy Duck', AGE: '24' }, { NAME: 'Bugs 邦妮', AGE: '22' } ]
439
565
  })
440
566
  .catch((err) => {
441
567
  console.log(err)
442
568
  })</code></pre>
443
569
 
570
+ <tr>
571
+
572
+ <td class="name"><code>separator</code></td>
573
+
444
574
 
575
+ <td class="type">
576
+
577
+
578
+ <span class="param-type">String</span>
445
579
 
446
580
 
447
- <h5 class="h5-parameters">Parameters:</h5>
448
-
449
581
 
450
- <table class="params">
451
- <thead>
452
- <tr>
453
-
454
- <th>Name</th>
455
-
582
+
583
+ </td>
456
584
 
457
- <th>Type</th>
585
+
586
+ <td class="attributes">
587
+
588
+ &lt;optional><br>
589
+
458
590
 
459
-
591
+
460
592
 
461
-
593
+
594
+ </td>
595
+
462
596
 
463
- <th class="last">Description</th>
464
- </tr>
465
- </thead>
597
+
598
+ <td class="default">
599
+
600
+ </td>
601
+
602
+
603
+ <td class="description last"><p>輸入欄位分隔字元,因csv-parser僅取首個byte,故須為單字元</p></td>
604
+ </tr>
466
605
 
467
- <tbody>
468
606
 
469
607
 
470
608
  <tr>
471
609
 
472
- <td class="name"><code>fp</code></td>
610
+ <td class="name"><code>quote</code></td>
473
611
 
474
612
 
475
613
  <td class="type">
@@ -476,10 +614,972 @@
476
614
  </td>
477
615
 
478
616
 
617
+ <td class="attributes">
618
+
619
+ &lt;optional><br>
620
+
479
621
 
480
-
622
+
481
623
 
482
- <td class="description last"><p>輸入檔案位置字串</p></td>
624
+
625
+ </td>
626
+
627
+
628
+
629
+ <td class="default">
630
+
631
+ </td>
632
+
633
+
634
+ <td class="description last"><p>輸入引號字元,因csv-parser僅取首個byte,故須為單字元</p></td>
635
+ </tr>
636
+
637
+
638
+
639
+ <tr>
640
+
641
+ <td class="name"><code>escape</code></td>
642
+
643
+
644
+ <td class="type">
645
+
646
+
647
+ <span class="param-type">String</span>
648
+
649
+
650
+
651
+
652
+ </td>
653
+
654
+
655
+ <td class="attributes">
656
+
657
+ &lt;optional><br>
658
+
659
+
660
+
661
+
662
+
663
+ </td>
664
+
665
+
666
+
667
+ <td class="default">
668
+
669
+ </td>
670
+
671
+
672
+ <td class="description last"><p>輸入逃逸字元,因csv-parser僅取首個byte,故須為單字元</p></td>
673
+ </tr>
674
+
675
+
676
+
677
+ <tr>
678
+
679
+ <td class="name"><code>newline</code></td>
680
+
681
+
682
+ <td class="type">
683
+
684
+
685
+ <span class="param-type">String</span>
686
+
687
+
688
+
689
+
690
+ </td>
691
+
692
+
693
+ <td class="attributes">
694
+
695
+ &lt;optional><br>
696
+
697
+
698
+
699
+
700
+
701
+ </td>
702
+
703
+
704
+
705
+ <td class="default">
706
+
707
+ </td>
708
+
709
+
710
+ <td class="description last"><p>輸入行尾字元,因csv-parser僅取首個byte,故須為單字元</p></td>
711
+ </tr>
712
+
713
+
714
+
715
+ <tr>
716
+
717
+ <td class="name"><code>strict</code></td>
718
+
719
+
720
+ <td class="type">
721
+
722
+
723
+ <span class="param-type">Boolean</span>
724
+
725
+
726
+
727
+
728
+ </td>
729
+
730
+
731
+ <td class="attributes">
732
+
733
+ &lt;optional><br>
734
+
735
+
736
+
737
+
738
+
739
+ </td>
740
+
741
+
742
+
743
+ <td class="default">
744
+
745
+ </td>
746
+
747
+
748
+ <td class="description last"><p>輸入各列欄數是否須與標頭數相符布林值。因csv-parser於headers為false時會強制關閉本設定,故mode為mat時本設定無效</p></td>
749
+ </tr>
750
+
751
+
752
+
753
+ <tr>
754
+
755
+ <td class="name"><code>mapHeaders</code></td>
756
+
757
+
758
+ <td class="type">
759
+
760
+
761
+ <span class="param-type">function</span>
762
+
763
+
764
+
765
+
766
+ </td>
767
+
768
+
769
+ <td class="attributes">
770
+
771
+ &lt;optional><br>
772
+
773
+
774
+
775
+
776
+
777
+ </td>
778
+
779
+
780
+
781
+ <td class="default">
782
+
783
+ </td>
784
+
785
+
786
+ <td class="description last"><p>輸入標頭轉換函式。因csv-parser僅於解析標頭列時呼叫,故mode為mat時不會被呼叫。另回傳null時該欄將被整欄丟棄</p></td>
787
+ </tr>
788
+
789
+
790
+
791
+ <tr>
792
+
793
+ <td class="name"><code>mapValues</code></td>
794
+
795
+
796
+ <td class="type">
797
+
798
+
799
+ <span class="param-type">function</span>
800
+
801
+
802
+
803
+
804
+ </td>
805
+
806
+
807
+ <td class="attributes">
808
+
809
+ &lt;optional><br>
810
+
811
+
812
+
813
+
814
+
815
+ </td>
816
+
817
+
818
+
819
+ <td class="default">
820
+
821
+ </td>
822
+
823
+
824
+ <td class="description last"><p>輸入欄值轉換函式。mode為mat時其header參數恆為undefined</p></td>
825
+ </tr>
826
+
827
+
828
+
829
+ <tr>
830
+
831
+ <td class="name"><code>maxRowBytes</code></td>
832
+
833
+
834
+ <td class="type">
835
+
836
+
837
+ <span class="param-type">Number</span>
838
+
839
+
840
+
841
+
842
+ </td>
843
+
844
+
845
+ <td class="attributes">
846
+
847
+ &lt;optional><br>
848
+
849
+
850
+
851
+
852
+
853
+ </td>
854
+
855
+
856
+
857
+ <td class="default">
858
+
859
+ </td>
860
+
861
+
862
+ <td class="description last"><p>輸入單列位元組數上限整數</p></td>
863
+ </tr>
864
+
865
+
866
+ </tbody>
867
+ </table>
868
+
869
+ </td>
870
+ </tr>
871
+
872
+
873
+ </tbody>
874
+ </table>
875
+
876
+
877
+
878
+
879
+
880
+
881
+
882
+
883
+
884
+
885
+
886
+
887
+
888
+
889
+
890
+
891
+ <h5 class="h5-returns">Returns:</h5>
892
+
893
+
894
+ <div class="param-desc">
895
+ <p>回傳Promise,resolve回傳ltdt(各數據列為物件陣列)或mat(二維陣列),reject回傳錯誤訊息</p>
896
+ </div>
897
+
898
+
899
+
900
+ <dl class="param-type">
901
+ <dt>
902
+ Type
903
+ </dt>
904
+ <dd>
905
+
906
+ <span class="param-type">Promise</span>
907
+
908
+
909
+
910
+ </dd>
911
+ </dl>
912
+
913
+
914
+
915
+
916
+
917
+
918
+
919
+
920
+
921
+
922
+ <h4 class="name" id="readCsv"><span class="type-signature type-signature-async">(async) </span>readCsv<span class="signature">(fp, opt<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
923
+
924
+
925
+
926
+
927
+
928
+
929
+ <dl class="details">
930
+
931
+ <dt class="tag-description">Description:</dt>
932
+ <dd class="tag-description"><ul class="dummy"><li><p>讀取CSV檔,自動清除BOM</p></li></ul></dd>
933
+
934
+
935
+
936
+ <dt class="tag-source">Source:</dt>
937
+ <dd class="tag-source"><ul class="dummy"><li>
938
+ <a href="WDataCsv.mjs.html">WDataCsv.mjs</a>, <a href="WDataCsv.mjs.html#line186">line 186</a>
939
+ </li></ul></dd>
940
+
941
+
942
+
943
+
944
+
945
+
946
+
947
+
948
+
949
+
950
+
951
+
952
+
953
+
954
+
955
+
956
+
957
+
958
+
959
+
960
+
961
+
962
+
963
+
964
+
965
+
966
+
967
+
968
+
969
+
970
+
971
+ </dl>
972
+
973
+
974
+
975
+
976
+
977
+
978
+
979
+
980
+
981
+
982
+
983
+ <h5 class="h5-examples">Example</h5>
984
+
985
+ <pre class="prettyprint"><code>import wdc from './src/WDataCsv.mjs'
483
986
  .then((ltdt) => {
484
987
  console.log(ltdt)
485
988
  // => [ { NAME: 'Daffy Duck', AGE: '24' }, { NAME: 'Bugs 邦妮', AGE: '22' } ]
486
989
  })
487
990
  .catch((err) => {
488
991
  console.log(err)
489
992
  })
490
993
  .then((mat) => {
491
994
  console.log(mat)
492
995
  // => [ [ 'NAME', 'AGE' ], [ 'Daffy Duck', '24' ], [ 'Bugs 邦妮', '22' ] ]
493
996
  })
494
997
  .catch((err) => {
495
998
  console.log(err)
496
999
  })</code></pre>
1000
+
1001
+
1002
+
1003
+
1004
+ <h5 class="h5-parameters">Parameters:</h5>
1005
+
1006
+
1007
+ <table class="params">
1008
+ <thead>
1009
+ <tr>
1010
+
1011
+ <th>Name</th>
1012
+
1013
+
1014
+ <th>Type</th>
1015
+
1016
+
1017
+ <th>Attributes</th>
1018
+
1019
+
1020
+
1021
+ <th>Default</th>
1022
+
1023
+
1024
+ <th class="last">Description</th>
1025
+ </tr>
1026
+ </thead>
1027
+
1028
+ <tbody>
1029
+
1030
+
1031
+ <tr>
1032
+
1033
+ <td class="name"><code>fp</code></td>
1034
+
1035
+
1036
+ <td class="type">
1037
+
1038
+
1039
+ <span class="param-type">String</span>
1040
+
1041
+
1042
+
1043
+
1044
+ </td>
1045
+
1046
+
1047
+ <td class="attributes">
1048
+
1049
+
1050
+
1051
+
1052
+
1053
+ </td>
1054
+
1055
+
1056
+
1057
+ <td class="default">
1058
+
1059
+ </td>
1060
+
1061
+
1062
+ <td class="description last"><p>輸入檔案位置字串</p></td>
1063
+ </tr>
1064
+
1065
+
1066
+
1067
+ <tr>
1068
+
1069
+ <td class="name"><code>opt</code></td>
1070
+
1071
+
1072
+ <td class="type">
1073
+
1074
+
1075
+ <span class="param-type">Object</span>
1076
+
1077
+
1078
+
1079
+
1080
+ </td>
1081
+
1082
+
1083
+ <td class="attributes">
1084
+
1085
+ &lt;optional><br>
1086
+
1087
+
1088
+
1089
+
1090
+
1091
+ </td>
1092
+
1093
+
1094
+
1095
+ <td class="default">
1096
+
1097
+ <code>{}</code>
1098
+
1099
+ </td>
1100
+
1101
+
1102
+ <td class="description last"><p>輸入設定物件,預設{}</p>
1103
+ <h6>Properties</h6>
1104
+
1105
+
1106
+ <table class="params">
1107
+ <thead>
1108
+ <tr>
1109
+
1110
+ <th>Name</th>
1111
+
1112
+
1113
+ <th>Type</th>
1114
+
1115
+
1116
+ <th>Attributes</th>
1117
+
1118
+
1119
+
1120
+ <th>Default</th>
1121
+
1122
+
1123
+ <th class="last">Description</th>
1124
+ </tr>
1125
+ </thead>
1126
+
1127
+ <tbody>
1128
+
1129
+
1130
+ <tr>
1131
+
1132
+ <td class="name"><code>mode</code></td>
1133
+
1134
+
1135
+ <td class="type">
1136
+
1137
+
1138
+ <span class="param-type">String</span>
1139
+
1140
+
1141
+
1142
+
1143
+ </td>
1144
+
1145
+
1146
+ <td class="attributes">
1147
+
1148
+ &lt;optional><br>
1149
+
1150
+
1151
+
1152
+
1153
+
1154
+ </td>
1155
+
1156
+
1157
+
1158
+ <td class="default">
1159
+
1160
+ <code>'ltdt'</code>
1161
+
1162
+ </td>
1163
+
1164
+
1165
+ <td class="description last"><p>輸入回傳數據格式字串,可選ltdt(各數據列為物件)或mat(各數據列為陣列),預設ltdt</p></td>
1166
+ </tr>
1167
+
1168
+
1169
+
1170
+ <tr>
1171
+
1172
+ <td class="name"><code>headers</code></td>
1173
+
1174
+
1175
+ <td class="type">
1176
+
1177
+
1178
+ <span class="param-type">Boolean</span>
1179
+ |
1180
+
1181
+ <span class="param-type">Array</span>
1182
+
1183
+
1184
+
1185
+
1186
+ </td>
1187
+
1188
+
1189
+ <td class="attributes">
1190
+
1191
+ &lt;optional><br>
1192
+
1193
+
1194
+
1195
+
1196
+
1197
+ </td>
1198
+
1199
+
1200
+
1201
+ <td class="default">
1202
+
1203
+ </td>
1204
+
1205
+
1206
+ <td class="description last"><p>輸入標頭設定,給false代表無標頭列,給陣列代表無標頭列且以此陣列為欄名,不給則取第1列為標頭。因csv-parser於給true時會使各列成為_0,_1等溢出鍵之壞數據,故給true時視為不給。另mode為mat時本設定固定為false</p></td>
1207
+ </tr>
1208
+
1209
+
1210
+
1211
+ <tr>
1212
+
1213
+ <td class="name"><code>skipLines</code></td>
1214
+
1215
+
1216
+ <td class="type">
1217
+
1218
+
1219
+ <span class="param-type">Number</span>
1220
+
1221
+
1222
+
1223
+
1224
+ </td>
1225
+
1226
+
1227
+ <td class="attributes">
1228
+
1229
+ &lt;optional><br>
1230
+
1231
+
1232
+
1233
+
1234
+
1235
+ </td>
1236
+
1237
+
1238
+
1239
+ <td class="default">
1240
+
1241
+ </td>
1242
+
1243
+
1244
+ <td class="description last"><p>輸入解析前跳過列數整數。因csv-parser之註解列不計入行號,故與skipComments併用時計數基準會位移,兩者不建議同時使用</p></td>
1245
+ </tr>
1246
+
1247
+
1248
+
1249
+ <tr>
1250
+
1251
+ <td class="name"><code>skipComments</code></td>
1252
+
1253
+
1254
+ <td class="type">
1255
+
1256
+
1257
+ <span class="param-type">Boolean</span>
1258
+ |
1259
+
1260
+ <span class="param-type">String</span>
1261
+
1262
+
1263
+
1264
+
1265
+ </td>
1266
+
1267
+
1268
+ <td class="attributes">
1269
+
1270
+ &lt;optional><br>
1271
+
1272
+
1273
+
1274
+
1275
+
1276
+ </td>
1277
+
1278
+
1279
+
1280
+ <td class="default">
1281
+
1282
+ </td>
1283
+
1284
+
1285
+ <td class="description last"><p>輸入忽略註解列設定,給true代表跳過#開頭之列,給字串代表以該字元為註解符</p></td>
1286
+ </tr>
1287
+
1288
+
1289
+
1290
+ <tr>
1291
+
1292
+ <td class="name"><code>separator</code></td>
1293
+
1294
+
1295
+ <td class="type">
1296
+
1297
+
1298
+ <span class="param-type">String</span>
1299
+
1300
+
1301
+
1302
+
1303
+ </td>
1304
+
1305
+
1306
+ <td class="attributes">
1307
+
1308
+ &lt;optional><br>
1309
+
1310
+
1311
+
1312
+
1313
+
1314
+ </td>
1315
+
1316
+
1317
+
1318
+ <td class="default">
1319
+
1320
+ </td>
1321
+
1322
+
1323
+ <td class="description last"><p>輸入欄位分隔字元,因csv-parser僅取首個byte,故須為單字元</p></td>
1324
+ </tr>
1325
+
1326
+
1327
+
1328
+ <tr>
1329
+
1330
+ <td class="name"><code>quote</code></td>
1331
+
1332
+
1333
+ <td class="type">
1334
+
1335
+
1336
+ <span class="param-type">String</span>
1337
+
1338
+
1339
+
1340
+
1341
+ </td>
1342
+
1343
+
1344
+ <td class="attributes">
1345
+
1346
+ &lt;optional><br>
1347
+
1348
+
1349
+
1350
+
1351
+
1352
+ </td>
1353
+
1354
+
1355
+
1356
+ <td class="default">
1357
+
1358
+ </td>
1359
+
1360
+
1361
+ <td class="description last"><p>輸入引號字元,因csv-parser僅取首個byte,故須為單字元</p></td>
1362
+ </tr>
1363
+
1364
+
1365
+
1366
+ <tr>
1367
+
1368
+ <td class="name"><code>escape</code></td>
1369
+
1370
+
1371
+ <td class="type">
1372
+
1373
+
1374
+ <span class="param-type">String</span>
1375
+
1376
+
1377
+
1378
+
1379
+ </td>
1380
+
1381
+
1382
+ <td class="attributes">
1383
+
1384
+ &lt;optional><br>
1385
+
1386
+
1387
+
1388
+
1389
+
1390
+ </td>
1391
+
1392
+
1393
+
1394
+ <td class="default">
1395
+
1396
+ </td>
1397
+
1398
+
1399
+ <td class="description last"><p>輸入逃逸字元,因csv-parser僅取首個byte,故須為單字元</p></td>
1400
+ </tr>
1401
+
1402
+
1403
+
1404
+ <tr>
1405
+
1406
+ <td class="name"><code>newline</code></td>
1407
+
1408
+
1409
+ <td class="type">
1410
+
1411
+
1412
+ <span class="param-type">String</span>
1413
+
1414
+
1415
+
1416
+
1417
+ </td>
1418
+
1419
+
1420
+ <td class="attributes">
1421
+
1422
+ &lt;optional><br>
1423
+
1424
+
1425
+
1426
+
1427
+
1428
+ </td>
1429
+
1430
+
1431
+
1432
+ <td class="default">
1433
+
1434
+ </td>
1435
+
1436
+
1437
+ <td class="description last"><p>輸入行尾字元,因csv-parser僅取首個byte,故須為單字元</p></td>
1438
+ </tr>
1439
+
1440
+
1441
+
1442
+ <tr>
1443
+
1444
+ <td class="name"><code>strict</code></td>
1445
+
1446
+
1447
+ <td class="type">
1448
+
1449
+
1450
+ <span class="param-type">Boolean</span>
1451
+
1452
+
1453
+
1454
+
1455
+ </td>
1456
+
1457
+
1458
+ <td class="attributes">
1459
+
1460
+ &lt;optional><br>
1461
+
1462
+
1463
+
1464
+
1465
+
1466
+ </td>
1467
+
1468
+
1469
+
1470
+ <td class="default">
1471
+
1472
+ </td>
1473
+
1474
+
1475
+ <td class="description last"><p>輸入各列欄數是否須與標頭數相符布林值。因csv-parser於headers為false時會強制關閉本設定,故mode為mat時本設定無效</p></td>
1476
+ </tr>
1477
+
1478
+
1479
+
1480
+ <tr>
1481
+
1482
+ <td class="name"><code>mapHeaders</code></td>
1483
+
1484
+
1485
+ <td class="type">
1486
+
1487
+
1488
+ <span class="param-type">function</span>
1489
+
1490
+
1491
+
1492
+
1493
+ </td>
1494
+
1495
+
1496
+ <td class="attributes">
1497
+
1498
+ &lt;optional><br>
1499
+
1500
+
1501
+
1502
+
1503
+
1504
+ </td>
1505
+
1506
+
1507
+
1508
+ <td class="default">
1509
+
1510
+ </td>
1511
+
1512
+
1513
+ <td class="description last"><p>輸入標頭轉換函式。因csv-parser僅於解析標頭列時呼叫,故mode為mat時不會被呼叫。另回傳null時該欄將被整欄丟棄</p></td>
1514
+ </tr>
1515
+
1516
+
1517
+
1518
+ <tr>
1519
+
1520
+ <td class="name"><code>mapValues</code></td>
1521
+
1522
+
1523
+ <td class="type">
1524
+
1525
+
1526
+ <span class="param-type">function</span>
1527
+
1528
+
1529
+
1530
+
1531
+ </td>
1532
+
1533
+
1534
+ <td class="attributes">
1535
+
1536
+ &lt;optional><br>
1537
+
1538
+
1539
+
1540
+
1541
+
1542
+ </td>
1543
+
1544
+
1545
+
1546
+ <td class="default">
1547
+
1548
+ </td>
1549
+
1550
+
1551
+ <td class="description last"><p>輸入欄值轉換函式。mode為mat時其header參數恆為undefined</p></td>
1552
+ </tr>
1553
+
1554
+
1555
+
1556
+ <tr>
1557
+
1558
+ <td class="name"><code>maxRowBytes</code></td>
1559
+
1560
+
1561
+ <td class="type">
1562
+
1563
+
1564
+ <span class="param-type">Number</span>
1565
+
1566
+
1567
+
1568
+
1569
+ </td>
1570
+
1571
+
1572
+ <td class="attributes">
1573
+
1574
+ &lt;optional><br>
1575
+
1576
+
1577
+
1578
+
1579
+
1580
+ </td>
1581
+
1582
+
1583
+
1584
+ <td class="default">
1585
+
1586
+ </td>
1587
+
1588
+
1589
+ <td class="description last"><p>輸入單列位元組數上限整數</p></td>
1590
+ </tr>
1591
+
1592
+
1593
+ </tbody>
1594
+ </table>
1595
+
1596
+ </td>
497
1597
  </tr>
498
1598
 
499
1599
 
@@ -505,7 +1605,7 @@
505
1605
 
506
1606
 
507
1607
  <div class="param-desc">
508
- <p>回傳Promise,resolve回傳ltdt(各數據列為物件陣列),reject回傳錯誤訊息</p>
1608
+ <p>回傳Promise,resolve回傳ltdt(各數據列為物件陣列)或mat(二維陣列),reject回傳錯誤訊息</p>
509
1609
  </div>
510
1610
 
511
1611
 
@@ -548,7 +1648,7 @@
548
1648
 
549
1649
  <dt class="tag-source">Source:</dt>
550
1650
  <dd class="tag-source"><ul class="dummy"><li>
551
- <a href="WDataCsv.mjs.html">WDataCsv.mjs</a>, <a href="WDataCsv.mjs.html#line146">line 146</a>
1651
+ <a href="WDataCsv.mjs.html">WDataCsv.mjs</a>, <a href="WDataCsv.mjs.html#line230">line 230</a>
552
1652
  </li></ul></dd>
553
1653
 
554
1654
 
@@ -992,7 +2092,7 @@
992
2092
  <br class="clear">
993
2093
 
994
2094
  <footer>
995
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Fri Aug 07 2026 23:52:25 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
2095
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Sat Aug 15 2026 17:02:41 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
996
2096
  </footer>
997
2097
 
998
2098
  <script>prettyPrint();</script>