@databiosphere/findable-ui 21.1.0 → 21.1.1
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
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [21.1.1](https://github.com/DataBiosphere/findable-ui/compare/v21.1.0...v21.1.1) (2025-01-31)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* quote values in tsv export when they contain syntactic characters ([#314](https://github.com/DataBiosphere/findable-ui/issues/314)) ([#315](https://github.com/DataBiosphere/findable-ui/issues/315)) ([d6832a5](https://github.com/DataBiosphere/findable-ui/commit/d6832a56f5245281e635902000dcecaab62c155f))
|
|
9
|
+
|
|
3
10
|
## [21.1.0](https://github.com/DataBiosphere/findable-ui/compare/v21.0.0...v21.1.0) (2025-01-30)
|
|
4
11
|
|
|
5
12
|
|
|
@@ -63,11 +63,17 @@ function formatDataToTSV(data) {
|
|
|
63
63
|
.map((row) => {
|
|
64
64
|
return row
|
|
65
65
|
.map((data) => {
|
|
66
|
-
//
|
|
67
|
-
if (
|
|
68
|
-
return
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
// Use empty string in place of undefined and null.
|
|
67
|
+
if (data === undefined || data === null)
|
|
68
|
+
return "";
|
|
69
|
+
// Convert to string.
|
|
70
|
+
const dataString = Array.isArray(data)
|
|
71
|
+
? data.join(", ")
|
|
72
|
+
: String(data);
|
|
73
|
+
// Quote if necessary.
|
|
74
|
+
return /[\t\r\n"]/.test(dataString)
|
|
75
|
+
? `"${dataString.replaceAll('"', '""')}"`
|
|
76
|
+
: dataString;
|
|
71
77
|
})
|
|
72
78
|
.join("\t");
|
|
73
79
|
})
|
package/package.json
CHANGED
|
@@ -99,11 +99,16 @@ function formatDataToTSV(data: TableData[][]): string {
|
|
|
99
99
|
.map((row) => {
|
|
100
100
|
return row
|
|
101
101
|
.map((data) => {
|
|
102
|
-
//
|
|
103
|
-
if (
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
102
|
+
// Use empty string in place of undefined and null.
|
|
103
|
+
if (data === undefined || data === null) return "";
|
|
104
|
+
// Convert to string.
|
|
105
|
+
const dataString = Array.isArray(data)
|
|
106
|
+
? data.join(", ")
|
|
107
|
+
: String(data);
|
|
108
|
+
// Quote if necessary.
|
|
109
|
+
return /[\t\r\n"]/.test(dataString)
|
|
110
|
+
? `"${dataString.replaceAll('"', '""')}"`
|
|
111
|
+
: dataString;
|
|
107
112
|
})
|
|
108
113
|
.join("\t");
|
|
109
114
|
})
|