@thi.ng/csv 2.3.84 → 2.3.86
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 +1 -1
- package/package.json +10 -10
- package/parse.js +3 -6
- package/transforms.js +1 -2
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/csv",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.86",
|
|
4
4
|
"description": "Customizable, transducer-based CSV parser/object mapper and transformer",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -36,16 +36,16 @@
|
|
|
36
36
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@thi.ng/api": "^8.11.
|
|
40
|
-
"@thi.ng/checks": "^3.6.
|
|
41
|
-
"@thi.ng/strings": "^3.7.
|
|
42
|
-
"@thi.ng/transducers": "^9.0.
|
|
39
|
+
"@thi.ng/api": "^8.11.2",
|
|
40
|
+
"@thi.ng/checks": "^3.6.4",
|
|
41
|
+
"@thi.ng/strings": "^3.7.33",
|
|
42
|
+
"@thi.ng/transducers": "^9.0.5"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@microsoft/api-extractor": "^7.43.
|
|
46
|
-
"esbuild": "^0.
|
|
47
|
-
"typedoc": "^0.25.
|
|
48
|
-
"typescript": "^5.4.
|
|
45
|
+
"@microsoft/api-extractor": "^7.43.2",
|
|
46
|
+
"esbuild": "^0.21.1",
|
|
47
|
+
"typedoc": "^0.25.13",
|
|
48
|
+
"typescript": "^5.4.5"
|
|
49
49
|
},
|
|
50
50
|
"keywords": [
|
|
51
51
|
"csv",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"thi.ng": {
|
|
86
86
|
"year": 2014
|
|
87
87
|
},
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "df34b4a9e650cc7323575356de207d78933bdcf3\n"
|
|
89
89
|
}
|
package/parse.js
CHANGED
|
@@ -61,8 +61,7 @@ function parseCSV(opts, src) {
|
|
|
61
61
|
delim,
|
|
62
62
|
quote
|
|
63
63
|
);
|
|
64
|
-
if (isQuoted)
|
|
65
|
-
return acc;
|
|
64
|
+
if (isQuoted) return acc;
|
|
66
65
|
const row = {};
|
|
67
66
|
all && collectAll(row);
|
|
68
67
|
index && collectIndexed(row);
|
|
@@ -123,8 +122,7 @@ function parseCSVSimple(opts, src) {
|
|
|
123
122
|
delim,
|
|
124
123
|
quote
|
|
125
124
|
);
|
|
126
|
-
if (isQuoted)
|
|
127
|
-
return acc;
|
|
125
|
+
if (isQuoted) return acc;
|
|
128
126
|
const row = cols ? collect() : record;
|
|
129
127
|
record = [];
|
|
130
128
|
return reduce(acc, row);
|
|
@@ -162,8 +160,7 @@ const parseLine = (line, acc, isQuoted, delim, quote) => {
|
|
|
162
160
|
curr += quote;
|
|
163
161
|
p = "";
|
|
164
162
|
continue;
|
|
165
|
-
} else if (line[i + 1] !== quote)
|
|
166
|
-
isQuoted = false;
|
|
163
|
+
} else if (line[i + 1] !== quote) isQuoted = false;
|
|
167
164
|
} else if (!isQuoted && c === delim) {
|
|
168
165
|
collectCell(acc, curr, openQuote);
|
|
169
166
|
openQuote = false;
|
package/transforms.js
CHANGED
|
@@ -13,8 +13,7 @@ const epoch = (defaultVal = 0) => (x) => {
|
|
|
13
13
|
};
|
|
14
14
|
const date = (defaultVal) => (x) => {
|
|
15
15
|
const epoch2 = Date.parse(x);
|
|
16
|
-
if (isNaN(epoch2))
|
|
17
|
-
return defaultVal;
|
|
16
|
+
if (isNaN(epoch2)) return defaultVal;
|
|
18
17
|
const res = /* @__PURE__ */ new Date();
|
|
19
18
|
res.setTime(epoch2);
|
|
20
19
|
return res;
|