@cosmotech/core 1.10.3-dev.0 → 1.10.3

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,3 +1,13 @@
1
+ ## **1.10.3** <sub><sup>2022-12-20 (141a1b9...141a1b9)</sup></sub>
2
+
3
+ ### Bug Fixes
4
+
5
+ - fix export of CSV files with fields containing commas ([141a1b9](https://github.com/Cosmo-Tech/webapp-component-core/commit/141a1b9))
6
+
7
+ ## **1.10.2** <sub><sup>2022-12-05</sup></sub>
8
+
9
+ - update dependencies
10
+
1
11
  ## **1.10.1** <sub><sup>2022-11-04 (ed24c96...ed24c96)</sup></sub>
2
12
 
3
13
  - update dependencies
package/dist/index.cjs.js CHANGED
@@ -33865,8 +33865,10 @@ var _generateHeader = function _generateHeader(cols) {
33865
33865
  };
33866
33866
  var _generateRow = function _generateRow(row, cols) {
33867
33867
  var separator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ',';
33868
- // CSV.write(...) adds a newline at the end of the string, hence the "slice(0, -2)"
33869
- return CSVUtils.write([cols.map(col => row[col.field])], separator).slice(0, -2);
33868
+ var fields = [cols.map(col => row[col.field])];
33869
+ var csvLine = CSVUtils.write(fields, separator);
33870
+ // CSV.write(...) adds a newline at the end of the string, we need to remove it before returning the row
33871
+ return csvLine.replace(/\r?\n$/, '');
33870
33872
  };
33871
33873
  var _generateRows = function _generateRows(rows, cols) {
33872
33874
  var colSep = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ',';
package/dist/index.esm.js CHANGED
@@ -33857,8 +33857,10 @@ var _generateHeader = function _generateHeader(cols) {
33857
33857
  };
33858
33858
  var _generateRow = function _generateRow(row, cols) {
33859
33859
  var separator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ',';
33860
- // CSV.write(...) adds a newline at the end of the string, hence the "slice(0, -2)"
33861
- return CSVUtils.write([cols.map(col => row[col.field])], separator).slice(0, -2);
33860
+ var fields = [cols.map(col => row[col.field])];
33861
+ var csvLine = CSVUtils.write(fields, separator);
33862
+ // CSV.write(...) adds a newline at the end of the string, we need to remove it before returning the row
33863
+ return csvLine.replace(/\r?\n$/, '');
33862
33864
  };
33863
33865
  var _generateRows = function _generateRows(rows, cols) {
33864
33866
  var colSep = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ',';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cosmotech/core",
3
3
  "private": false,
4
- "version": "1.10.3-dev.0",
4
+ "version": "1.10.3",
5
5
  "description": "",
6
6
  "main": "dist/index.cjs.js",
7
7
  "module": "dist/index.esm.js",