Skip to content

Commit 6b5e881

Browse files
alexander-fensterstephenplusplus
authored andcommitted
Fix sample tests and system tests (#29)
1 parent 76f2778 commit 6b5e881

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

dlp/deid.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ function deidentifyWithDateShift(
155155
const csvLines = fs
156156
.readFileSync(inputCsvFile)
157157
.toString()
158-
.split('\n');
158+
.split('\n')
159+
.filter(line => line.includes(','));
159160
const csvHeaders = csvLines[0].split(',');
160161
const csvRows = csvLines.slice(1);
161162

@@ -224,6 +225,7 @@ function deidentifyWithDateShift(
224225
);
225226
csvLines[rowIndex + 1] = rowValues.join(',');
226227
});
228+
csvLines.push('');
227229
fs.writeFileSync(outputCsvFile, csvLines.join('\n'));
228230

229231
// Print status

dlp/resources/dates.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name,birth_date,register_date,credit_card
2-
Ann,01/01/1970,07/21/1996,4532908762519852
2+
Ann,01/01/1980,07/21/1996,4532908762519852
33
James,03/06/1988,04/09/2001,4301261899725540
44
Dan,08/14/1945,11/15/2011,4620761856015295
5-
Laura,11/03/1992,01/04/2017,4564981067258901
5+
Laura,11/03/1992,01/04/2017,4564981067258901
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name,birth_date,register_date,credit_card
2-
Ann,1/31/1970,8/20/1996,4532908762519852
2+
Ann,1/31/1980,8/20/1996,4532908762519852
33
James,4/5/1988,5/9/2001,4301261899725540
44
Dan,9/13/1945,12/15/2011,4620761856015295
5-
Laura,12/3/1992,2/3/2017,4564981067258901
5+
Laura,12/3/1992,2/3/2017,4564981067258901

0 commit comments

Comments
 (0)