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/stringUtils.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/stringUtils.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/stringUtils.js</h1>
|
|
104
|
+
</header>
|
|
105
|
+
|
|
106
|
+
|
|
24
107
|
|
|
25
108
|
|
|
26
109
|
|
|
@@ -28,6 +111,10 @@
|
|
|
28
111
|
<article>
|
|
29
112
|
<pre class="prettyprint source linenums"><code>'use strict';
|
|
30
113
|
|
|
114
|
+
/**
|
|
115
|
+
* String processing utilities for CSV parsing
|
|
116
|
+
* @category Utilities
|
|
117
|
+
*/
|
|
31
118
|
class StringUtils {
|
|
32
119
|
// Regular expressions as constants for better maintainability
|
|
33
120
|
static PATTERNS = {
|
|
@@ -94,7 +181,7 @@ class StringUtils {
|
|
|
94
181
|
// Private helper methods for type checking and conversion
|
|
95
182
|
/**
|
|
96
183
|
* Check if a value is empty (undefined or empty string)
|
|
97
|
-
* @param {
|
|
184
|
+
* @param {unknown} value - Value to check
|
|
98
185
|
* @returns {boolean} True if value is undefined or empty string
|
|
99
186
|
* @private
|
|
100
187
|
*/
|
|
@@ -194,19 +281,26 @@ module.exports = new StringUtils();
|
|
|
194
281
|
|
|
195
282
|
|
|
196
283
|
|
|
197
|
-
</div>
|
|
198
|
-
|
|
199
|
-
<
|
|
200
|
-
|
|
201
|
-
</
|
|
202
|
-
|
|
203
|
-
<
|
|
284
|
+
</div>
|
|
285
|
+
|
|
286
|
+
<footer class="footer">
|
|
287
|
+
<div class="content has-text-centered">
|
|
288
|
+
<p>Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a></p>
|
|
289
|
+
<p class="sidebar-created-by">
|
|
290
|
+
<a href="https://github.com/SoftwareBrothers/better-docs" target="_blank">BetterDocs theme</a> provided with <i class="fas fa-heart"></i> by
|
|
291
|
+
<a href="http://softwarebrothers.co" target="_blank">SoftwareBrothers - JavaScript Development Agency</a>
|
|
292
|
+
</p>
|
|
293
|
+
</div>
|
|
294
|
+
</footer>
|
|
295
|
+
|
|
296
|
+
</div>
|
|
297
|
+
<div id="side-nav" class="side-nav">
|
|
298
|
+
</div>
|
|
299
|
+
</div>
|
|
300
|
+
<script src="scripts/app.min.js"></script>
|
|
301
|
+
<script>PR.prettyPrint();</script>
|
|
302
|
+
<script src="scripts/linenumber.js"> </script>
|
|
204
303
|
|
|
205
|
-
<footer>
|
|
206
|
-
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)
|
|
207
|
-
</footer>
|
|
208
304
|
|
|
209
|
-
<script> prettyPrint(); </script>
|
|
210
|
-
<script src="scripts/linenumber.js"> </script>
|
|
211
305
|
</body>
|
|
212
306
|
</html>
|