convert-csv-to-json 4.2.0 → 4.4.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
package/.eslintignore ADDED
@@ -0,0 +1,3 @@
1
+ node_modules
2
+ coverage
3
+ docs/api
package/.eslintrc.json ADDED
@@ -0,0 +1,48 @@
1
+ {
2
+ "root": true,
3
+ "env": {
4
+ "node": true,
5
+ "browser": true,
6
+ "es2024": true,
7
+ "jest": true
8
+ },
9
+ "extends": [
10
+ "eslint:recommended",
11
+ "plugin:jsdoc/recommended"
12
+ ],
13
+ "plugins": ["jsdoc"],
14
+ "overrides": [
15
+ {
16
+ "files": ["test/**/*.js", "test/**/*.spec.js"],
17
+ "rules": {
18
+ "jsdoc/require-jsdoc": "off",
19
+ "no-unused-vars": "off"
20
+ }
21
+ }
22
+ ],
23
+ "rules": {
24
+ "no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
25
+ "jsdoc/check-alignment": "error",
26
+ "jsdoc/check-param-names": "error",
27
+ "jsdoc/check-tag-names": "error",
28
+ "jsdoc/check-types": "warn",
29
+ "jsdoc/no-undefined-types": "warn",
30
+ "jsdoc/require-description": "warn",
31
+ "jsdoc/require-param": "error",
32
+ "jsdoc/require-returns": "error",
33
+ "jsdoc/require-jsdoc": [
34
+ "warn",
35
+ {
36
+ "require": {
37
+ "FunctionDeclaration": true,
38
+ "MethodDefinition": true,
39
+ "ClassDeclaration": false,
40
+ "ArrowFunctionExpression": false,
41
+ "FunctionExpression": false
42
+ }
43
+ }
44
+ ],
45
+ "no-mixed-spaces-and-tabs": "off",
46
+ "no-prototype-builtins": "off"
47
+ }
48
+ }
@@ -19,11 +19,12 @@ jobs:
19
19
  uses: actions/setup-node@v6
20
20
  with:
21
21
  node-version: ${{ matrix.node-version }}
22
- - name: npm install, build, and test
22
+ - name: npm install, lint, build, test, and docs
23
23
  run: |
24
- npm install
25
24
  npm ci
25
+ npm run lint
26
26
  npm test
27
+ npm run docs:api
27
28
  env:
28
29
  CI: true
29
30
 
@@ -47,5 +48,30 @@ jobs:
47
48
  registry-url: 'https://registry.npmjs.org'
48
49
  - name: npm-semver-publish
49
50
  run: |
51
+ npm ci
50
52
  npm run release
53
+
54
+ pages:
55
+ needs: release
56
+ if: github.ref == 'refs/heads/master'
57
+ name: deploy docs to GitHub Pages
58
+ runs-on: ubuntu-latest
59
+ steps:
60
+ - uses: actions/checkout@v6
61
+ - name: Use Node.js 24.x
62
+ uses: actions/setup-node@v6
63
+ with:
64
+ node-version: 24.x
65
+ - name: Install dependencies
66
+ run: npm ci
67
+ - name: Generate API docs
68
+ run: npm run docs:api
69
+ - name: Configure GitHub Pages
70
+ uses: actions/configure-pages@v4
71
+ - name: Upload pages artifact
72
+ uses: actions/upload-pages-artifact@v13
73
+ with:
74
+ path: docs/api
75
+ - name: Deploy to GitHub Pages
76
+ uses: actions/deploy-pages@v2
51
77