@tryghost/mg-fs-utils 0.13.0 → 0.13.2
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/lib/csv.js +1 -2
- package/package.json +7 -8
package/lib/csv.js
CHANGED
|
@@ -3,7 +3,6 @@ import {parse} from 'csv-parse';
|
|
|
3
3
|
import {parse as parseSync} from 'csv-parse/sync';
|
|
4
4
|
import {createReadStream} from 'node:fs';
|
|
5
5
|
import {outputFile, ensureDirSync} from 'fs-extra/esm';
|
|
6
|
-
import {isDate} from 'date-fns';
|
|
7
6
|
import errors from '@tryghost/errors';
|
|
8
7
|
|
|
9
8
|
/**
|
|
@@ -60,7 +59,7 @@ const jsonToCSV = (data, fields = Object.keys(data[0])) => {
|
|
|
60
59
|
let fieldToAdd;
|
|
61
60
|
|
|
62
61
|
if (entry[field] !== null) {
|
|
63
|
-
if (
|
|
62
|
+
if (entry[field] instanceof Date) {
|
|
64
63
|
fieldToAdd = entry[field].toISOString();
|
|
65
64
|
} else if (entry[field] && entry[field].toString().indexOf(',') !== -1) { // If the field contains a comma, wrap it in quotes
|
|
66
65
|
fieldToAdd = `"${entry[field]}"`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryghost/mg-fs-utils",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.2",
|
|
4
4
|
"repository": "https://github.com/TryGhost/migrate/tree/main/packages/mg-fs-utils",
|
|
5
5
|
"author": "Ghost Foundation",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,22 +20,21 @@
|
|
|
20
20
|
"access": "public"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
|
-
"eslint": "8.
|
|
23
|
+
"eslint": "8.57.0",
|
|
24
24
|
"jest": "29.7.0",
|
|
25
25
|
"jest-extended": "4.0.2"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@tryghost/errors": "1.3.
|
|
28
|
+
"@tryghost/errors": "1.3.1",
|
|
29
29
|
"@tryghost/image-transform": "1.2.11",
|
|
30
30
|
"@tryghost/string": "0.2.11",
|
|
31
|
-
"@tryghost/zip": "1.1.
|
|
32
|
-
"adm-zip": "0.5.
|
|
33
|
-
"csv-parse": "5.5.
|
|
34
|
-
"date-fns": "2.30.0",
|
|
31
|
+
"@tryghost/zip": "1.1.41",
|
|
32
|
+
"adm-zip": "0.5.12",
|
|
33
|
+
"csv-parse": "5.5.5",
|
|
35
34
|
"fs-extra": "11.2.0",
|
|
36
35
|
"lodash": "4.17.21",
|
|
37
36
|
"sharp": "0.32.6",
|
|
38
37
|
"transliteration": "2.3.5"
|
|
39
38
|
},
|
|
40
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "6d66ced5547ace4095b32d0662b158b119a44fa9"
|
|
41
40
|
}
|