@cfworker/csv 1.12.5 → 2.0.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.d.ts CHANGED
@@ -6,4 +6,4 @@ export interface Column<T, K extends keyof T> {
6
6
  label: string;
7
7
  format: (value: T[K], row: T) => unknown;
8
8
  }
9
- export declare function encode<T>(rows: T[], { columns }?: EncodeOptions<T>): ReadableStream;
9
+ export declare function encode<T extends {}>(rows: T[], { columns }?: EncodeOptions<T>): ReadableStream;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cfworker/csv",
3
- "version": "1.12.5",
3
+ "version": "2.0.0",
4
4
  "description": "Streaming CSV encoding for Cloudflare Workers and service workers",
5
5
  "sideEffects": false,
6
6
  "main": "dist/index.js",
@@ -24,14 +24,16 @@
24
24
  "scripts": {
25
25
  "build": "tsc --build",
26
26
  "clean": "tsc --build --clean",
27
- "test": "cfworker test test/**/*.spec.ts"
27
+ "pretest": "esbuild test/test.ts --target=esnext --bundle --format=esm --conditions=worker,browser --outdir=dist-test --ignore-annotations",
28
+ "test": "node ../../test.mjs"
28
29
  },
29
30
  "devDependencies": {
30
- "@cfworker/dev": "^1.14.1",
31
- "@types/chai": "^4.3.3",
32
- "@types/mocha": "^9.1.1",
33
- "chai": "^4.3.6",
34
- "mocha": "^10.0.0",
35
- "typescript": "^4.7.4"
31
+ "@types/chai": "^4.3.17",
32
+ "@types/mocha": "^10.0.7",
33
+ "chai": "^5.1.1",
34
+ "esbuild": "^0.23.1",
35
+ "mocha": "^10.7.3",
36
+ "typescript": "^5.5.4",
37
+ "wrangler": "^3.72.0"
36
38
  }
37
39
  }
package/src/encode.ts CHANGED
@@ -23,7 +23,7 @@ export interface Column<T, K extends keyof T> {
23
23
  * @param options
24
24
  * @returns
25
25
  */
26
- export function encode<T>(
26
+ export function encode<T extends {}>(
27
27
  rows: T[],
28
28
  { columns }: EncodeOptions<T> = {}
29
29
  ): ReadableStream {
package/tsconfig.json CHANGED
@@ -1,14 +1,8 @@
1
1
  {
2
2
  "extends": "../../tsconfig-base",
3
3
  "compilerOptions": {
4
- "target": "ES2021",
4
+ "target": "ESNext",
5
5
  "lib": ["ESNext", "WebWorker", "Webworker.Iterable"],
6
- "types": [
7
- "chai",
8
- "mocha",
9
- "@cfworker/worker-types",
10
- "@cloudflare/workers-types"
11
- ],
12
6
  "outDir": "dist",
13
7
  "rootDir": "./src"
14
8
  },