Skip to content

Commit

Permalink
Merge pull request #255 from mrodrig/fix-254
Browse files Browse the repository at this point in the history
Resolve #254 by updating doc-path to patched version
  • Loading branch information
mrodrig authored Mar 21, 2024
2 parents e3ab189 + 33d7047 commit fc86347
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 5 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
],
"dependencies": {
"deeks": "3.1.0",
"doc-path": "4.1.0"
"doc-path": "4.1.1"
},
"devDependencies": {
"@types/mocha": "10.0.1",
Expand Down
1 change: 1 addition & 0 deletions test/config/testCsvFilesList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const csvFileConfig = [
{key: 'excludeKeyPattern', file: '../data/csv/excludeKeyPattern.csv'},
{key: 'wildcardMatch', file: '../data/csv/wildcardMatch.csv'},
{key: 'arrayIndexesAsKeys', file: '../data/csv/arrayIndexesAsKeys.csv'},
{key: 'keyWithEndingDot', file:'../data/csv/keyWithEndingDot.csv'},
];

function readCsvFile(filePath: string) {
Expand Down
1 change: 1 addition & 0 deletions test/config/testJsonFilesList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@ export default {
excludeKeyPattern: require('../data/json/excludeKeyPattern'),
wildcardMatch: require('../data/json/wildcardMatch.json'),
arrayIndexesAsKeys: require('../data/json/arrayIndexesAsKeys.json'),
keyWithEndingDot: require('../data/json/keyWithEndingDot.json'),
};
6 changes: 6 additions & 0 deletions test/csv2json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,12 @@ export function runTests() {
const json = csv2json(csvTestData.quotedFieldWithNewline);
assert.deepEqual(json, jsonTestData.quotedFieldWithNewline);
});

// Test case for #254
it('should handle keys with ending dots', () => {
const json = csv2json(csvTestData.keyWithEndingDot);
assert.deepEqual(json, jsonTestData.keyWithEndingDot);
});
});

describe('Error Handling', () => {
Expand Down
2 changes: 2 additions & 0 deletions test/data/csv/keyWithEndingDot.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Account No.
01-1800-00
5 changes: 5 additions & 0 deletions test/data/json/keyWithEndingDot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[
{
"Account No.": "01-1800-00"
}
]

0 comments on commit fc86347

Please sign in to comment.