@cfworker/csv 2.0.0 → 2.2.0

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/dist/encode.js CHANGED
@@ -2,7 +2,7 @@ const quote = '"';
2
2
  const quoteRegex = /"/g;
3
3
  const delimiter = ',';
4
4
  const rowDelimiter = '\r\n';
5
- const requiresQuoteRegex = /["\r\n,]/;
5
+ const requiresQuoteRegex = /["\r\n,]|(?:^\d+$)/;
6
6
  export function encode(rows, { columns } = {}) {
7
7
  const { readable, writable } = new TransformStream();
8
8
  (async () => {
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@cfworker/csv",
3
- "version": "2.0.0",
3
+ "type": "module",
4
+ "version": "2.2.0",
4
5
  "description": "Streaming CSV encoding for Cloudflare Workers and service workers",
5
6
  "sideEffects": false,
6
7
  "main": "dist/index.js",
@@ -10,7 +11,6 @@
10
11
  "files": [
11
12
  "dist/**/*",
12
13
  "src/**/*",
13
- "tsconfig.json",
14
14
  "README.md",
15
15
  "package.json"
16
16
  ],
@@ -34,6 +34,6 @@
34
34
  "esbuild": "^0.23.1",
35
35
  "mocha": "^10.7.3",
36
36
  "typescript": "^5.5.4",
37
- "wrangler": "^3.72.0"
37
+ "wrangler": "^3.72.1"
38
38
  }
39
39
  }
package/src/encode.ts CHANGED
@@ -2,7 +2,7 @@ const quote = '"';
2
2
  const quoteRegex = /"/g;
3
3
  const delimiter = ',';
4
4
  const rowDelimiter = '\r\n';
5
- const requiresQuoteRegex = /["\r\n,]/;
5
+ const requiresQuoteRegex = /["\r\n,]|(?:^\d+$)/;
6
6
 
7
7
  export interface EncodeOptions<T> {
8
8
  /**
package/tsconfig.json DELETED
@@ -1,10 +0,0 @@
1
- {
2
- "extends": "../../tsconfig-base",
3
- "compilerOptions": {
4
- "target": "ESNext",
5
- "lib": ["ESNext", "WebWorker", "Webworker.Iterable"],
6
- "outDir": "dist",
7
- "rootDir": "./src"
8
- },
9
- "include": ["src"]
10
- }