@thi.ng/csv 2.3.72 → 2.3.73
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.d.ts +26 -20
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.73",
|
|
4
4
|
"description": "Customizable, transducer-based CSV parser/object mapper and transformer",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -36,17 +36,17 @@
|
|
|
36
36
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@thi.ng/api": "^8.9.
|
|
40
|
-
"@thi.ng/checks": "^3.5.
|
|
41
|
-
"@thi.ng/strings": "^3.7.
|
|
42
|
-
"@thi.ng/transducers": "^8.9.
|
|
39
|
+
"@thi.ng/api": "^8.9.30",
|
|
40
|
+
"@thi.ng/checks": "^3.5.3",
|
|
41
|
+
"@thi.ng/strings": "^3.7.23",
|
|
42
|
+
"@thi.ng/transducers": "^8.9.12"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@microsoft/api-extractor": "^7.
|
|
46
|
-
"esbuild": "^0.20.
|
|
45
|
+
"@microsoft/api-extractor": "^7.42.3",
|
|
46
|
+
"esbuild": "^0.20.1",
|
|
47
47
|
"rimraf": "^5.0.5",
|
|
48
|
-
"typedoc": "^0.25.
|
|
49
|
-
"typescript": "^5.
|
|
48
|
+
"typedoc": "^0.25.12",
|
|
49
|
+
"typescript": "^5.4.2"
|
|
50
50
|
},
|
|
51
51
|
"keywords": [
|
|
52
52
|
"csv",
|
|
@@ -86,5 +86,5 @@
|
|
|
86
86
|
"thi.ng": {
|
|
87
87
|
"year": 2014
|
|
88
88
|
},
|
|
89
|
-
"gitHead": "
|
|
89
|
+
"gitHead": "7f3fcbd6c0462b0ce45afa141fe163d1f297fd51\n"
|
|
90
90
|
}
|
package/parse.d.ts
CHANGED
|
@@ -25,26 +25,27 @@ import type { CSVOpts, CSVRecord, CSVRow, SimpleCSVOpts } from "./api.js";
|
|
|
25
25
|
* - {@link parseCSVFromString}.
|
|
26
26
|
*
|
|
27
27
|
* @example
|
|
28
|
-
* ```ts
|
|
28
|
+
* ```ts tangle:../export/parse-csv.ts
|
|
29
29
|
* import { parseCSV, upper, float } from "@thi.ng/csv";
|
|
30
30
|
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
31
|
+
* console.log(
|
|
32
|
+
* [...parseCSV(
|
|
33
|
+
* {
|
|
34
|
+
* all: false,
|
|
35
|
+
* cols: {
|
|
36
|
+
* "country": { tx: upper },
|
|
37
|
+
* "latitude": { alias: "lat", tx: float() },
|
|
38
|
+
* "longitude": { alias: "lon", tx: float() },
|
|
39
|
+
* }
|
|
40
|
+
* },
|
|
41
|
+
* [
|
|
42
|
+
* `"country","country group","name (en)","latitude","longitude"`,
|
|
43
|
+
* `"at","eu","Austria","47.6965545","13.34598005"`,
|
|
44
|
+
* `"be","eu","Belgium","50.501045","4.47667405"`,
|
|
45
|
+
* `"bg","eu","Bulgaria","42.72567375","25.4823218"`,
|
|
46
|
+
* ]
|
|
47
|
+
* )]
|
|
48
|
+
* );
|
|
48
49
|
* // [
|
|
49
50
|
* // { country: 'AT', lat: 47.6965545, lon: 13.34598005 },
|
|
50
51
|
* // { country: 'BE', lat: 50.501045, lon: 4.47667405 },
|
|
@@ -66,10 +67,15 @@ export declare function parseCSV(opts: Partial<CSVOpts>, src: Iterable<string>):
|
|
|
66
67
|
* those used by {@link parseCSV}.
|
|
67
68
|
*
|
|
68
69
|
* @example
|
|
69
|
-
* ```ts
|
|
70
|
+
* ```ts tangle:../export/parse-csv-simple.ts
|
|
70
71
|
* import { parseCSVSimple, float } from "@thi.ng/csv";
|
|
71
72
|
*
|
|
72
|
-
*
|
|
73
|
+
* console.log(
|
|
74
|
+
* [...parseCSVSimple(
|
|
75
|
+
* { cols: [float(), null,float()]},
|
|
76
|
+
* ["a,b,c","1,2,3","4,5,6"])
|
|
77
|
+
* ]
|
|
78
|
+
* );
|
|
73
79
|
* // [ [ 1, 3 ], [ 4, 6 ] ]
|
|
74
80
|
* ```
|
|
75
81
|
*
|