Skip to content

Commit fc86347

Browse files
authored
Merge pull request #255 from mrodrig/fix-254
Resolve #254 by updating doc-path to patched version
2 parents e3ab189 + 33d7047 commit fc86347

File tree

7 files changed

+20
-5
lines changed

7 files changed

+20
-5
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
],
4141
"dependencies": {
4242
"deeks": "3.1.0",
43-
"doc-path": "4.1.0"
43+
"doc-path": "4.1.1"
4444
},
4545
"devDependencies": {
4646
"@types/mocha": "10.0.1",

test/config/testCsvFilesList.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ const csvFileConfig = [
5353
{key: 'excludeKeyPattern', file: '../data/csv/excludeKeyPattern.csv'},
5454
{key: 'wildcardMatch', file: '../data/csv/wildcardMatch.csv'},
5555
{key: 'arrayIndexesAsKeys', file: '../data/csv/arrayIndexesAsKeys.csv'},
56+
{key: 'keyWithEndingDot', file:'../data/csv/keyWithEndingDot.csv'},
5657
];
5758

5859
function readCsvFile(filePath: string) {

test/config/testJsonFilesList.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,5 @@ export default {
4646
excludeKeyPattern: require('../data/json/excludeKeyPattern'),
4747
wildcardMatch: require('../data/json/wildcardMatch.json'),
4848
arrayIndexesAsKeys: require('../data/json/arrayIndexesAsKeys.json'),
49+
keyWithEndingDot: require('../data/json/keyWithEndingDot.json'),
4950
};

test/csv2json.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,12 @@ export function runTests() {
166166
const json = csv2json(csvTestData.quotedFieldWithNewline);
167167
assert.deepEqual(json, jsonTestData.quotedFieldWithNewline);
168168
});
169+
170+
// Test case for #254
171+
it('should handle keys with ending dots', () => {
172+
const json = csv2json(csvTestData.keyWithEndingDot);
173+
assert.deepEqual(json, jsonTestData.keyWithEndingDot);
174+
});
169175
});
170176

171177
describe('Error Handling', () => {

test/data/csv/keyWithEndingDot.csv

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Account No.
2+
01-1800-00

test/data/json/keyWithEndingDot.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[
2+
{
3+
"Account No.": "01-1800-00"
4+
}
5+
]

0 commit comments

Comments
 (0)