@dynamic-entity/server 2.3.0 → 2.3.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/README.md +3 -1
- package/express.d.mts +1 -1
- package/express.d.ts +1 -1
- package/express.js +4 -3
- package/express.js.map +1 -1
- package/express.mjs +4 -3
- package/express.mjs.map +1 -1
- package/index.d.mts +2 -2
- package/index.d.ts +2 -2
- package/index.js +4 -3
- package/index.js.map +1 -1
- package/index.mjs +4 -3
- package/index.mjs.map +1 -1
- package/package.json +2 -2
- package/{write-template-B6KIIBRw.d.mts → write-template-CzKVVjgT.d.mts} +8 -2
- package/{write-template-B6KIIBRw.d.ts → write-template-CzKVVjgT.d.ts} +8 -2
package/express.mjs
CHANGED
|
@@ -651,13 +651,13 @@ function detectFormat(head) {
|
|
|
651
651
|
}
|
|
652
652
|
return "csv";
|
|
653
653
|
}
|
|
654
|
-
async function* csvRows(stream, limits, found) {
|
|
654
|
+
async function* csvRows(stream, limits, found, forced) {
|
|
655
655
|
const decoder = new TextDecoder("utf-8");
|
|
656
656
|
const maxHeader = limits.maxCellLength * limits.maxColumns + limits.maxColumns;
|
|
657
657
|
let held = "";
|
|
658
658
|
let reader = null;
|
|
659
659
|
const open = (headerLine) => {
|
|
660
|
-
found.delimiter = detectDelimiter(headerLine);
|
|
660
|
+
found.delimiter = forced ?? detectDelimiter(headerLine);
|
|
661
661
|
return createCsvReader({ delimiter: found.delimiter });
|
|
662
662
|
};
|
|
663
663
|
for await (const chunk of stream) {
|
|
@@ -716,7 +716,8 @@ async function readSheet(options) {
|
|
|
716
716
|
const { head, stream } = await peek(counted, MAGIC_BYTES);
|
|
717
717
|
const format = detectFormat(head);
|
|
718
718
|
const found = {};
|
|
719
|
-
const
|
|
719
|
+
const forced = /\.tsv$/i.test(options.filename ?? "") ? " " : void 0;
|
|
720
|
+
const rows = format === "xlsx" ? xlsxRows(stream, limits) : csvRows(stream, limits, found, forced);
|
|
720
721
|
const iterator = rows[Symbol.asyncIterator]();
|
|
721
722
|
const first = await iterator.next();
|
|
722
723
|
const headers = first.done ? [] : first.value.map(cellText);
|