convert-csv-to-json 4.13.0 → 4.14.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.
- package/.github/workflows/ci-cd.yml +1 -1
- package/docs/api/BrowserApi.html +1255 -1028
- package/docs/api/BrowserApiError.html +326 -179
- package/docs/api/ConfigurationError.html +375 -224
- package/docs/api/CsvFormatError.html +334 -187
- package/docs/api/CsvParsingError.html +259 -132
- package/docs/api/CsvToJson.html +1545 -1314
- package/docs/api/CsvToJsonAsync.html +1356 -1148
- package/docs/api/FileOperationError.html +213 -101
- package/docs/api/FileUtils.html +568 -430
- package/docs/api/InputValidationError.html +229 -115
- package/docs/api/JsonUtil.html +222 -110
- package/docs/api/JsonValidationError.html +197 -87
- package/docs/api/StringUtils.html +833 -0
- package/docs/api/global.html +1537 -1354
- package/docs/api/index.html +114 -26
- package/docs/api/index.js.html +137 -31
- package/docs/api/scripts/app.min.js +1 -0
- package/docs/api/scripts/linenumber.js +10 -9
- package/docs/api/scripts/search.js +39 -0
- package/docs/api/src_browserApi.js.html +120 -29
- package/docs/api/src_csvToJson.js.html +119 -28
- package/docs/api/src_csvToJsonAsync.js.html +118 -27
- package/docs/api/src_util_errors.js.html +126 -28
- package/docs/api/src_util_fileUtils.js.html +117 -26
- package/docs/api/src_util_jsonUtils.js.html +117 -26
- package/docs/api/src_util_stringUtils.js.html +121 -27
- package/docs/api/styles/app.min.css +1 -0
- package/docs/api/styles/iframe.css +13 -0
- package/docs/api/styles/reset.css +44 -0
- package/eslint.config.js +115 -0
- package/index.js +21 -5
- package/jsdoc.json +29 -4
- package/package.json +5 -3
- package/src/browserApi.js +4 -3
- package/src/csvToJson.js +3 -2
- package/src/csvToJsonAsync.js +2 -1
- package/src/util/errors.js +10 -2
- package/src/util/fileUtils.js +1 -0
- package/src/util/jsonUtils.js +1 -0
- package/src/util/stringUtils.js +5 -1
- package/.eslintignore +0 -3
- package/.eslintrc.json +0 -48
- package/docs/api/fonts/OpenSans-Bold-webfont.eot +0 -0
- package/docs/api/fonts/OpenSans-Bold-webfont.svg +0 -1830
- package/docs/api/fonts/OpenSans-Bold-webfont.woff +0 -0
- package/docs/api/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
- package/docs/api/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
- package/docs/api/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
- package/docs/api/fonts/OpenSans-Italic-webfont.eot +0 -0
- package/docs/api/fonts/OpenSans-Italic-webfont.svg +0 -1830
- package/docs/api/fonts/OpenSans-Italic-webfont.woff +0 -0
- package/docs/api/fonts/OpenSans-Light-webfont.eot +0 -0
- package/docs/api/fonts/OpenSans-Light-webfont.svg +0 -1831
- package/docs/api/fonts/OpenSans-Light-webfont.woff +0 -0
- package/docs/api/fonts/OpenSans-LightItalic-webfont.eot +0 -0
- package/docs/api/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
- package/docs/api/fonts/OpenSans-LightItalic-webfont.woff +0 -0
- package/docs/api/fonts/OpenSans-Regular-webfont.eot +0 -0
- package/docs/api/fonts/OpenSans-Regular-webfont.svg +0 -1831
- package/docs/api/fonts/OpenSans-Regular-webfont.woff +0 -0
- package/docs/api/scripts/prettify/Apache-License-2.0.txt +0 -202
- package/docs/api/scripts/prettify/lang-css.js +0 -2
- package/docs/api/scripts/prettify/prettify.js +0 -28
- package/docs/api/styles/jsdoc-default.css +0 -358
|
@@ -1,26 +1,109 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
1
3
|
<!DOCTYPE html>
|
|
2
4
|
<html lang="en">
|
|
5
|
+
|
|
3
6
|
<head>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
|
|
8
|
+
<meta charset="utf-8">
|
|
9
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
10
|
+
<title> src/util/errors.js</title>
|
|
11
|
+
|
|
12
|
+
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js"></script>
|
|
13
|
+
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
|
|
14
|
+
<script src="./build/entry.js"></script>
|
|
15
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
|
16
|
+
<!--[if lt IE 9]>
|
|
17
|
+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
18
|
+
<![endif]-->
|
|
19
|
+
<link href="https://fonts.googleapis.com/css?family=Roboto:100,400,700|Inconsolata,700" rel="stylesheet">
|
|
20
|
+
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
|
|
21
|
+
<link type="text/css" rel="stylesheet" href="https://jmblog.github.io/color-themes-for-google-code-prettify/themes/tomorrow-night.min.css">
|
|
22
|
+
<link type="text/css" rel="stylesheet" href="styles/app.min.css">
|
|
23
|
+
<link type="text/css" rel="stylesheet" href="styles/iframe.css">
|
|
24
|
+
<link type="text/css" rel="stylesheet" href="./node_modules/better-docs/css/better-docs.css">
|
|
25
|
+
<script async defer src="https://buttons.github.io/buttons.js"></script>
|
|
26
|
+
|
|
27
|
+
|
|
14
28
|
</head>
|
|
15
29
|
|
|
16
|
-
<body>
|
|
17
30
|
|
|
18
|
-
<div id="main">
|
|
19
|
-
|
|
20
|
-
<h1 class="page-title">Source: src/util/errors.js</h1>
|
|
21
31
|
|
|
32
|
+
<body class="layout small-header">
|
|
33
|
+
<div id="stickyNavbarOverlay"></div>
|
|
22
34
|
|
|
23
35
|
|
|
36
|
+
<div class="top-nav">
|
|
37
|
+
<div class="inner">
|
|
38
|
+
<a id="hamburger" role="button" class="navbar-burger" aria-label="menu" aria-expanded="false">
|
|
39
|
+
<span aria-hidden="true"></span>
|
|
40
|
+
<span aria-hidden="true"></span>
|
|
41
|
+
<span aria-hidden="true"></span>
|
|
42
|
+
</a>
|
|
43
|
+
<div class="logo">
|
|
44
|
+
|
|
45
|
+
<a class="image" href="index.html">
|
|
46
|
+
<img src="https://raw.githubusercontent.com/iuccio/CSVtoJSON/master/CSVtoJSON.png" alt="logo">
|
|
47
|
+
</a>
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
<a href="index.html">
|
|
51
|
+
<h1 class="navbar-item">Convert CSV to JSON</h1>
|
|
52
|
+
</a>
|
|
53
|
+
|
|
54
|
+
</div>
|
|
55
|
+
<div class="menu">
|
|
56
|
+
|
|
57
|
+
<div class="navigation">
|
|
58
|
+
<a
|
|
59
|
+
href="index.html"
|
|
60
|
+
class="link"
|
|
61
|
+
>
|
|
62
|
+
Documentation
|
|
63
|
+
</a>
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
<a
|
|
68
|
+
class="link user-link "
|
|
69
|
+
href="https://github.com/iuccio/CSVtoJSON"
|
|
70
|
+
>
|
|
71
|
+
GitHub
|
|
72
|
+
</a>
|
|
73
|
+
|
|
74
|
+
<a
|
|
75
|
+
class="link user-link "
|
|
76
|
+
href="https://www.npmjs.com/package/convert-csv-to-json"
|
|
77
|
+
>
|
|
78
|
+
NPM
|
|
79
|
+
</a>
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
<div id="main">
|
|
88
|
+
<div
|
|
89
|
+
class="sidebar "
|
|
90
|
+
id="sidebarNav"
|
|
91
|
+
>
|
|
92
|
+
|
|
93
|
+
<nav>
|
|
94
|
+
|
|
95
|
+
<h2><a href="index.html">Documentation</a></h2><div class="category"></div><div class="category"><h2>1-Core API</h2><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#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></div><div class="category"><h2>2-Sync</h2><h3>Classes</h3><ul><li><a href="CsvToJson.html">CsvToJson</a></li></ul></div><div class="category"><h2>3-Async</h2><h3>Classes</h3><ul><li><a href="CsvToJsonAsync.html">CsvToJsonAsync</a></li></ul></div><div class="category"><h2>4-Browser</h2><h3>Classes</h3><ul><li><a href="BrowserApi.html">BrowserApi</a></li></ul></div><div class="category"><h2>Error Classes</h2><h3>Classes</h3><ul><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="FileOperationError.html">FileOperationError</a></li><li><a href="InputValidationError.html">InputValidationError</a></li><li><a href="JsonValidationError.html">JsonValidationError</a></li></ul></div><div class="category"><h2>Utilities</h2><h3>Classes</h3><ul><li><a href="FileUtils.html">FileUtils</a></li><li><a href="JsonUtil.html">JsonUtil</a></li><li><a href="StringUtils.html">StringUtils</a></li></ul></div>
|
|
96
|
+
|
|
97
|
+
</nav>
|
|
98
|
+
</div>
|
|
99
|
+
<div class="core" id="main-content-wrapper">
|
|
100
|
+
<div class="content">
|
|
101
|
+
<header class="page-title">
|
|
102
|
+
<p>Source</p>
|
|
103
|
+
<h1>src/util/errors.js</h1>
|
|
104
|
+
</header>
|
|
105
|
+
|
|
106
|
+
|
|
24
107
|
|
|
25
108
|
|
|
26
109
|
|
|
@@ -31,11 +114,13 @@
|
|
|
31
114
|
/**
|
|
32
115
|
* Custom error classes following clean code principles
|
|
33
116
|
* Provides clear, actionable error messages with context
|
|
117
|
+
* @category Error Classes
|
|
34
118
|
*/
|
|
35
119
|
|
|
36
120
|
/**
|
|
37
121
|
* Base class for all CSV parsing errors
|
|
38
122
|
* Provides consistent error formatting and context
|
|
123
|
+
* @category Error Classes
|
|
39
124
|
*/
|
|
40
125
|
class CsvParsingError extends Error {
|
|
41
126
|
/**
|
|
@@ -71,7 +156,7 @@ class CsvParsingError extends Error {
|
|
|
71
156
|
|
|
72
157
|
/**
|
|
73
158
|
* Format a context value for display in error message
|
|
74
|
-
* @param {
|
|
159
|
+
* @param {unknown} value - Value to format
|
|
75
160
|
* @returns {string} Formatted value string
|
|
76
161
|
* @private
|
|
77
162
|
*/
|
|
@@ -87,6 +172,7 @@ class CsvParsingError extends Error {
|
|
|
87
172
|
/**
|
|
88
173
|
* Input validation errors
|
|
89
174
|
* Thrown when function parameters don't meet expected type or value requirements
|
|
175
|
+
* @category Error Classes
|
|
90
176
|
*/
|
|
91
177
|
class InputValidationError extends CsvParsingError {
|
|
92
178
|
/**
|
|
@@ -114,6 +200,7 @@ class InputValidationError extends CsvParsingError {
|
|
|
114
200
|
/**
|
|
115
201
|
* Configuration-related errors
|
|
116
202
|
* Thrown when configuration options conflict or are invalid
|
|
203
|
+
* @category Error Classes
|
|
117
204
|
*/
|
|
118
205
|
class ConfigurationError extends CsvParsingError {
|
|
119
206
|
/**
|
|
@@ -149,7 +236,7 @@ class ConfigurationError extends CsvParsingError {
|
|
|
149
236
|
/**
|
|
150
237
|
* Create error for invalid header index
|
|
151
238
|
* Occurs when indexHeader() receives non-numeric value
|
|
152
|
-
* @param {
|
|
239
|
+
* @param {unknown} value - Invalid header index value
|
|
153
240
|
* @returns {ConfigurationError} Configured error instance
|
|
154
241
|
* @static
|
|
155
242
|
*/
|
|
@@ -169,6 +256,7 @@ class ConfigurationError extends CsvParsingError {
|
|
|
169
256
|
/**
|
|
170
257
|
* CSV parsing errors with detailed context
|
|
171
258
|
* Thrown when CSV format is invalid or malformed
|
|
259
|
+
* @category Error Classes
|
|
172
260
|
*/
|
|
173
261
|
class CsvFormatError extends CsvParsingError {
|
|
174
262
|
/**
|
|
@@ -228,6 +316,7 @@ class CsvFormatError extends CsvParsingError {
|
|
|
228
316
|
/**
|
|
229
317
|
* File operation errors
|
|
230
318
|
* Thrown when file read or write operations fail
|
|
319
|
+
* @category Error Classes
|
|
231
320
|
*/
|
|
232
321
|
class FileOperationError extends CsvParsingError {
|
|
233
322
|
/**
|
|
@@ -260,6 +349,7 @@ class FileOperationError extends CsvParsingError {
|
|
|
260
349
|
/**
|
|
261
350
|
* JSON validation errors
|
|
262
351
|
* Thrown when parsed CSV data cannot be converted to valid JSON
|
|
352
|
+
* @category Error Classes
|
|
263
353
|
*/
|
|
264
354
|
class JsonValidationError extends CsvParsingError {
|
|
265
355
|
/**
|
|
@@ -290,6 +380,7 @@ class JsonValidationError extends CsvParsingError {
|
|
|
290
380
|
/**
|
|
291
381
|
* Browser-specific errors
|
|
292
382
|
* Thrown when browser API operations fail
|
|
383
|
+
* @category Error Classes
|
|
293
384
|
*/
|
|
294
385
|
class BrowserApiError extends CsvParsingError {
|
|
295
386
|
/**
|
|
@@ -356,19 +447,26 @@ module.exports = {
|
|
|
356
447
|
|
|
357
448
|
|
|
358
449
|
|
|
359
|
-
</div>
|
|
360
|
-
|
|
361
|
-
<
|
|
362
|
-
|
|
363
|
-
</
|
|
364
|
-
|
|
365
|
-
<
|
|
450
|
+
</div>
|
|
451
|
+
|
|
452
|
+
<footer class="footer">
|
|
453
|
+
<div class="content has-text-centered">
|
|
454
|
+
<p>Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a></p>
|
|
455
|
+
<p class="sidebar-created-by">
|
|
456
|
+
<a href="https://github.com/SoftwareBrothers/better-docs" target="_blank">BetterDocs theme</a> provided with <i class="fas fa-heart"></i> by
|
|
457
|
+
<a href="http://softwarebrothers.co" target="_blank">SoftwareBrothers - JavaScript Development Agency</a>
|
|
458
|
+
</p>
|
|
459
|
+
</div>
|
|
460
|
+
</footer>
|
|
461
|
+
|
|
462
|
+
</div>
|
|
463
|
+
<div id="side-nav" class="side-nav">
|
|
464
|
+
</div>
|
|
465
|
+
</div>
|
|
466
|
+
<script src="scripts/app.min.js"></script>
|
|
467
|
+
<script>PR.prettyPrint();</script>
|
|
468
|
+
<script src="scripts/linenumber.js"> </script>
|
|
366
469
|
|
|
367
|
-
<footer>
|
|
368
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.5</a> on Fri Mar 20 2026 16:08:52 GMT+0000 (Coordinated Universal Time)
|
|
369
|
-
</footer>
|
|
370
470
|
|
|
371
|
-
<script> prettyPrint(); </script>
|
|
372
|
-
<script src="scripts/linenumber.js"> </script>
|
|
373
471
|
</body>
|
|
374
472
|
</html>
|
|
@@ -1,26 +1,109 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
1
3
|
<!DOCTYPE html>
|
|
2
4
|
<html lang="en">
|
|
5
|
+
|
|
3
6
|
<head>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
|
|
8
|
+
<meta charset="utf-8">
|
|
9
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
10
|
+
<title> src/util/fileUtils.js</title>
|
|
11
|
+
|
|
12
|
+
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js"></script>
|
|
13
|
+
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
|
|
14
|
+
<script src="./build/entry.js"></script>
|
|
15
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
|
16
|
+
<!--[if lt IE 9]>
|
|
17
|
+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
18
|
+
<![endif]-->
|
|
19
|
+
<link href="https://fonts.googleapis.com/css?family=Roboto:100,400,700|Inconsolata,700" rel="stylesheet">
|
|
20
|
+
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
|
|
21
|
+
<link type="text/css" rel="stylesheet" href="https://jmblog.github.io/color-themes-for-google-code-prettify/themes/tomorrow-night.min.css">
|
|
22
|
+
<link type="text/css" rel="stylesheet" href="styles/app.min.css">
|
|
23
|
+
<link type="text/css" rel="stylesheet" href="styles/iframe.css">
|
|
24
|
+
<link type="text/css" rel="stylesheet" href="./node_modules/better-docs/css/better-docs.css">
|
|
25
|
+
<script async defer src="https://buttons.github.io/buttons.js"></script>
|
|
26
|
+
|
|
27
|
+
|
|
14
28
|
</head>
|
|
15
29
|
|
|
16
|
-
<body>
|
|
17
30
|
|
|
18
|
-
<div id="main">
|
|
19
|
-
|
|
20
|
-
<h1 class="page-title">Source: src/util/fileUtils.js</h1>
|
|
21
31
|
|
|
32
|
+
<body class="layout small-header">
|
|
33
|
+
<div id="stickyNavbarOverlay"></div>
|
|
22
34
|
|
|
23
35
|
|
|
36
|
+
<div class="top-nav">
|
|
37
|
+
<div class="inner">
|
|
38
|
+
<a id="hamburger" role="button" class="navbar-burger" aria-label="menu" aria-expanded="false">
|
|
39
|
+
<span aria-hidden="true"></span>
|
|
40
|
+
<span aria-hidden="true"></span>
|
|
41
|
+
<span aria-hidden="true"></span>
|
|
42
|
+
</a>
|
|
43
|
+
<div class="logo">
|
|
44
|
+
|
|
45
|
+
<a class="image" href="index.html">
|
|
46
|
+
<img src="https://raw.githubusercontent.com/iuccio/CSVtoJSON/master/CSVtoJSON.png" alt="logo">
|
|
47
|
+
</a>
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
<a href="index.html">
|
|
51
|
+
<h1 class="navbar-item">Convert CSV to JSON</h1>
|
|
52
|
+
</a>
|
|
53
|
+
|
|
54
|
+
</div>
|
|
55
|
+
<div class="menu">
|
|
56
|
+
|
|
57
|
+
<div class="navigation">
|
|
58
|
+
<a
|
|
59
|
+
href="index.html"
|
|
60
|
+
class="link"
|
|
61
|
+
>
|
|
62
|
+
Documentation
|
|
63
|
+
</a>
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
<a
|
|
68
|
+
class="link user-link "
|
|
69
|
+
href="https://github.com/iuccio/CSVtoJSON"
|
|
70
|
+
>
|
|
71
|
+
GitHub
|
|
72
|
+
</a>
|
|
73
|
+
|
|
74
|
+
<a
|
|
75
|
+
class="link user-link "
|
|
76
|
+
href="https://www.npmjs.com/package/convert-csv-to-json"
|
|
77
|
+
>
|
|
78
|
+
NPM
|
|
79
|
+
</a>
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
<div id="main">
|
|
88
|
+
<div
|
|
89
|
+
class="sidebar "
|
|
90
|
+
id="sidebarNav"
|
|
91
|
+
>
|
|
92
|
+
|
|
93
|
+
<nav>
|
|
94
|
+
|
|
95
|
+
<h2><a href="index.html">Documentation</a></h2><div class="category"></div><div class="category"><h2>1-Core API</h2><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#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></div><div class="category"><h2>2-Sync</h2><h3>Classes</h3><ul><li><a href="CsvToJson.html">CsvToJson</a></li></ul></div><div class="category"><h2>3-Async</h2><h3>Classes</h3><ul><li><a href="CsvToJsonAsync.html">CsvToJsonAsync</a></li></ul></div><div class="category"><h2>4-Browser</h2><h3>Classes</h3><ul><li><a href="BrowserApi.html">BrowserApi</a></li></ul></div><div class="category"><h2>Error Classes</h2><h3>Classes</h3><ul><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="FileOperationError.html">FileOperationError</a></li><li><a href="InputValidationError.html">InputValidationError</a></li><li><a href="JsonValidationError.html">JsonValidationError</a></li></ul></div><div class="category"><h2>Utilities</h2><h3>Classes</h3><ul><li><a href="FileUtils.html">FileUtils</a></li><li><a href="JsonUtil.html">JsonUtil</a></li><li><a href="StringUtils.html">StringUtils</a></li></ul></div>
|
|
96
|
+
|
|
97
|
+
</nav>
|
|
98
|
+
</div>
|
|
99
|
+
<div class="core" id="main-content-wrapper">
|
|
100
|
+
<div class="content">
|
|
101
|
+
<header class="page-title">
|
|
102
|
+
<p>Source</p>
|
|
103
|
+
<h1>src/util/fileUtils.js</h1>
|
|
104
|
+
</header>
|
|
105
|
+
|
|
106
|
+
|
|
24
107
|
|
|
25
108
|
|
|
26
109
|
|
|
@@ -34,6 +117,7 @@ const { FileOperationError } = require('./errors');
|
|
|
34
117
|
/**
|
|
35
118
|
* File I/O utilities for reading and writing CSV/JSON files
|
|
36
119
|
* Provides both synchronous and asynchronous file operations
|
|
120
|
+
* @category Utilities
|
|
37
121
|
*/
|
|
38
122
|
class FileUtils {
|
|
39
123
|
|
|
@@ -129,19 +213,26 @@ module.exports = new FileUtils();
|
|
|
129
213
|
|
|
130
214
|
|
|
131
215
|
|
|
132
|
-
</div>
|
|
133
|
-
|
|
134
|
-
<
|
|
135
|
-
|
|
136
|
-
</
|
|
137
|
-
|
|
138
|
-
<
|
|
216
|
+
</div>
|
|
217
|
+
|
|
218
|
+
<footer class="footer">
|
|
219
|
+
<div class="content has-text-centered">
|
|
220
|
+
<p>Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a></p>
|
|
221
|
+
<p class="sidebar-created-by">
|
|
222
|
+
<a href="https://github.com/SoftwareBrothers/better-docs" target="_blank">BetterDocs theme</a> provided with <i class="fas fa-heart"></i> by
|
|
223
|
+
<a href="http://softwarebrothers.co" target="_blank">SoftwareBrothers - JavaScript Development Agency</a>
|
|
224
|
+
</p>
|
|
225
|
+
</div>
|
|
226
|
+
</footer>
|
|
227
|
+
|
|
228
|
+
</div>
|
|
229
|
+
<div id="side-nav" class="side-nav">
|
|
230
|
+
</div>
|
|
231
|
+
</div>
|
|
232
|
+
<script src="scripts/app.min.js"></script>
|
|
233
|
+
<script>PR.prettyPrint();</script>
|
|
234
|
+
<script src="scripts/linenumber.js"> </script>
|
|
139
235
|
|
|
140
|
-
<footer>
|
|
141
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.5</a> on Fri Mar 20 2026 16:08:52 GMT+0000 (Coordinated Universal Time)
|
|
142
|
-
</footer>
|
|
143
236
|
|
|
144
|
-
<script> prettyPrint(); </script>
|
|
145
|
-
<script src="scripts/linenumber.js"> </script>
|
|
146
237
|
</body>
|
|
147
238
|
</html>
|
|
@@ -1,26 +1,109 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
1
3
|
<!DOCTYPE html>
|
|
2
4
|
<html lang="en">
|
|
5
|
+
|
|
3
6
|
<head>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
|
|
8
|
+
<meta charset="utf-8">
|
|
9
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
10
|
+
<title> src/util/jsonUtils.js</title>
|
|
11
|
+
|
|
12
|
+
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js"></script>
|
|
13
|
+
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
|
|
14
|
+
<script src="./build/entry.js"></script>
|
|
15
|
+
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
|
|
16
|
+
<!--[if lt IE 9]>
|
|
17
|
+
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
|
18
|
+
<![endif]-->
|
|
19
|
+
<link href="https://fonts.googleapis.com/css?family=Roboto:100,400,700|Inconsolata,700" rel="stylesheet">
|
|
20
|
+
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
|
|
21
|
+
<link type="text/css" rel="stylesheet" href="https://jmblog.github.io/color-themes-for-google-code-prettify/themes/tomorrow-night.min.css">
|
|
22
|
+
<link type="text/css" rel="stylesheet" href="styles/app.min.css">
|
|
23
|
+
<link type="text/css" rel="stylesheet" href="styles/iframe.css">
|
|
24
|
+
<link type="text/css" rel="stylesheet" href="./node_modules/better-docs/css/better-docs.css">
|
|
25
|
+
<script async defer src="https://buttons.github.io/buttons.js"></script>
|
|
26
|
+
|
|
27
|
+
|
|
14
28
|
</head>
|
|
15
29
|
|
|
16
|
-
<body>
|
|
17
30
|
|
|
18
|
-
<div id="main">
|
|
19
|
-
|
|
20
|
-
<h1 class="page-title">Source: src/util/jsonUtils.js</h1>
|
|
21
31
|
|
|
32
|
+
<body class="layout small-header">
|
|
33
|
+
<div id="stickyNavbarOverlay"></div>
|
|
22
34
|
|
|
23
35
|
|
|
36
|
+
<div class="top-nav">
|
|
37
|
+
<div class="inner">
|
|
38
|
+
<a id="hamburger" role="button" class="navbar-burger" aria-label="menu" aria-expanded="false">
|
|
39
|
+
<span aria-hidden="true"></span>
|
|
40
|
+
<span aria-hidden="true"></span>
|
|
41
|
+
<span aria-hidden="true"></span>
|
|
42
|
+
</a>
|
|
43
|
+
<div class="logo">
|
|
44
|
+
|
|
45
|
+
<a class="image" href="index.html">
|
|
46
|
+
<img src="https://raw.githubusercontent.com/iuccio/CSVtoJSON/master/CSVtoJSON.png" alt="logo">
|
|
47
|
+
</a>
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
<a href="index.html">
|
|
51
|
+
<h1 class="navbar-item">Convert CSV to JSON</h1>
|
|
52
|
+
</a>
|
|
53
|
+
|
|
54
|
+
</div>
|
|
55
|
+
<div class="menu">
|
|
56
|
+
|
|
57
|
+
<div class="navigation">
|
|
58
|
+
<a
|
|
59
|
+
href="index.html"
|
|
60
|
+
class="link"
|
|
61
|
+
>
|
|
62
|
+
Documentation
|
|
63
|
+
</a>
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
<a
|
|
68
|
+
class="link user-link "
|
|
69
|
+
href="https://github.com/iuccio/CSVtoJSON"
|
|
70
|
+
>
|
|
71
|
+
GitHub
|
|
72
|
+
</a>
|
|
73
|
+
|
|
74
|
+
<a
|
|
75
|
+
class="link user-link "
|
|
76
|
+
href="https://www.npmjs.com/package/convert-csv-to-json"
|
|
77
|
+
>
|
|
78
|
+
NPM
|
|
79
|
+
</a>
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
</div>
|
|
84
|
+
</div>
|
|
85
|
+
</div>
|
|
86
|
+
</div>
|
|
87
|
+
<div id="main">
|
|
88
|
+
<div
|
|
89
|
+
class="sidebar "
|
|
90
|
+
id="sidebarNav"
|
|
91
|
+
>
|
|
92
|
+
|
|
93
|
+
<nav>
|
|
94
|
+
|
|
95
|
+
<h2><a href="index.html">Documentation</a></h2><div class="category"></div><div class="category"><h2>1-Core API</h2><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#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></div><div class="category"><h2>2-Sync</h2><h3>Classes</h3><ul><li><a href="CsvToJson.html">CsvToJson</a></li></ul></div><div class="category"><h2>3-Async</h2><h3>Classes</h3><ul><li><a href="CsvToJsonAsync.html">CsvToJsonAsync</a></li></ul></div><div class="category"><h2>4-Browser</h2><h3>Classes</h3><ul><li><a href="BrowserApi.html">BrowserApi</a></li></ul></div><div class="category"><h2>Error Classes</h2><h3>Classes</h3><ul><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="FileOperationError.html">FileOperationError</a></li><li><a href="InputValidationError.html">InputValidationError</a></li><li><a href="JsonValidationError.html">JsonValidationError</a></li></ul></div><div class="category"><h2>Utilities</h2><h3>Classes</h3><ul><li><a href="FileUtils.html">FileUtils</a></li><li><a href="JsonUtil.html">JsonUtil</a></li><li><a href="StringUtils.html">StringUtils</a></li></ul></div>
|
|
96
|
+
|
|
97
|
+
</nav>
|
|
98
|
+
</div>
|
|
99
|
+
<div class="core" id="main-content-wrapper">
|
|
100
|
+
<div class="content">
|
|
101
|
+
<header class="page-title">
|
|
102
|
+
<p>Source</p>
|
|
103
|
+
<h1>src/util/jsonUtils.js</h1>
|
|
104
|
+
</header>
|
|
105
|
+
|
|
106
|
+
|
|
24
107
|
|
|
25
108
|
|
|
26
109
|
|
|
@@ -32,6 +115,7 @@ const { JsonValidationError } = require('./errors');
|
|
|
32
115
|
|
|
33
116
|
/**
|
|
34
117
|
* JSON validation utilities
|
|
118
|
+
* @category Utilities
|
|
35
119
|
*/
|
|
36
120
|
class JsonUtil {
|
|
37
121
|
|
|
@@ -57,19 +141,26 @@ module.exports = new JsonUtil();</code></pre>
|
|
|
57
141
|
|
|
58
142
|
|
|
59
143
|
|
|
60
|
-
</div>
|
|
61
|
-
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
</
|
|
65
|
-
|
|
66
|
-
<
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
<footer class="footer">
|
|
147
|
+
<div class="content has-text-centered">
|
|
148
|
+
<p>Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a></p>
|
|
149
|
+
<p class="sidebar-created-by">
|
|
150
|
+
<a href="https://github.com/SoftwareBrothers/better-docs" target="_blank">BetterDocs theme</a> provided with <i class="fas fa-heart"></i> by
|
|
151
|
+
<a href="http://softwarebrothers.co" target="_blank">SoftwareBrothers - JavaScript Development Agency</a>
|
|
152
|
+
</p>
|
|
153
|
+
</div>
|
|
154
|
+
</footer>
|
|
155
|
+
|
|
156
|
+
</div>
|
|
157
|
+
<div id="side-nav" class="side-nav">
|
|
158
|
+
</div>
|
|
159
|
+
</div>
|
|
160
|
+
<script src="scripts/app.min.js"></script>
|
|
161
|
+
<script>PR.prettyPrint();</script>
|
|
162
|
+
<script src="scripts/linenumber.js"> </script>
|
|
67
163
|
|
|
68
|
-
<footer>
|
|
69
|
-
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.5</a> on Fri Mar 20 2026 16:08:52 GMT+0000 (Coordinated Universal Time)
|
|
70
|
-
</footer>
|
|
71
164
|
|
|
72
|
-
<script> prettyPrint(); </script>
|
|
73
|
-
<script src="scripts/linenumber.js"> </script>
|
|
74
165
|
</body>
|
|
75
166
|
</html>
|