convert-csv-to-json 3.28.0 → 4.1.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/CHANGELOG.md +41 -1
- package/README.md +173 -833
- package/docs/ASYNC.md +485 -0
- package/docs/BROWSER.md +425 -0
- package/docs/ERROR_HANDLING.md +367 -0
- package/docs/MAPROWS.md +196 -0
- package/docs/SYNC.md +239 -0
- package/index.d.ts +10 -8
- package/index.js +13 -10
- package/migration/RFC4180_MIGRATION_GUIDE.md +737 -0
- package/package.json +1 -1
- package/release-notes/RELEASE_NOTES_v4.0.0.md +320 -0
- package/src/browserApi.js +29 -6
- package/src/csvToJson.js +233 -82
- package/src/csvToJsonAsync.js +15 -1
- package/src/util/errors.js +227 -0
- package/src/util/fileUtils.js +18 -7
- package/src/util/jsonUtils.js +3 -1
- /package/{MIGRATION.md → migration/MIGRATION_TO_ASYNC.md} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -12,4 +12,44 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
12
12
|
- Improved test coverage for string-based CSV parsing
|
|
13
13
|
|
|
14
14
|
### Changed
|
|
15
|
-
- No breaking changes - all existing APIs remain unchanged
|
|
15
|
+
- No breaking changes - all existing APIs remain unchanged
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## [4.0.0] - RFC 4180 Compliance Update
|
|
20
|
+
|
|
21
|
+
### Overview
|
|
22
|
+
This release makes csvToJson **fully compliant with RFC 4180**, the standard format specification for CSV files. This is a significant update that improves standards compliance, reliability, and compatibility with CSV data from various sources.
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
- **RFC 4180 Compliant CSV Parsing** - Full support for RFC 4180 standard with proper handling of quoted fields with embedded delimiters, newlines, and correct quote escaping
|
|
26
|
+
- **Comprehensive Test Coverage** - 12 new RFC 4180 compliance tests and 12 new comma-delimiter tests (109 total tests, up from 94)
|
|
27
|
+
- **Enhanced Documentation** - Comprehensive JSDoc comments and extracted complex logic into focused helper methods
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
- **Default Field Delimiter** - Changed from semicolon (`;`) to comma (`,`) for RFC 4180 compliance ⚠️ **BREAKING CHANGE**
|
|
31
|
+
- **Line Ending Support** - Enhanced support for CRLF (`\r\n`), LF (`\n`), and CR (`\r`) line endings with automatic detection
|
|
32
|
+
- **Code Quality** - Refactored for better readability with all conditional statements now having braces
|
|
33
|
+
- **Quote Handling** - Improved quoted field parsing with proper handling of fields containing delimiters, newlines, and special characters
|
|
34
|
+
|
|
35
|
+
### Removed
|
|
36
|
+
- **Deprecated `jsonToCsv()` function** - Use `generateJsonFileFromCsv()` instead ⚠️ **BREAKING CHANGE**
|
|
37
|
+
- **Deprecated `substr()` method** - Replaced with `slice()` for better compatibility
|
|
38
|
+
|
|
39
|
+
### Fixed
|
|
40
|
+
- Fixed handling of empty quoted fields (`""`)
|
|
41
|
+
- Fixed multi-line field parsing within quoted regions
|
|
42
|
+
- Fixed quote escaping detection (RFC 4180 compliant `""`)
|
|
43
|
+
- Fixed line ending detection (CRLF, LF, CR)
|
|
44
|
+
|
|
45
|
+
### Migration Guide
|
|
46
|
+
For users upgrading to this version:
|
|
47
|
+
- **If using semicolon-delimited files**: Explicitly set the delimiter with `.fieldDelimiter(';')`
|
|
48
|
+
- **If using `jsonToCsv()`**: Replace with `generateJsonFileFromCsv()`
|
|
49
|
+
- **Reference**: See `RFC4180_MIGRATION_GUIDE.md` for detailed migration instructions
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## [3.20.0] - Previous Release
|
|
54
|
+
|
|
55
|
+
See git history for details
|