From 91b106b561698e01976166620f131f9143f9614f Mon Sep 17 00:00:00 2001 From: Kazuki Ota Date: Fri, 23 Aug 2024 15:40:22 +0900 Subject: [PATCH] update (#109) --- .github/workflows/test.json | 2 +- .github/workflows/test.yaml | 2 +- README.md | 2 +- deps.pure.ts | 10 +++++----- deps.test.ts | 8 ++++---- deps.ts | 6 +++--- mod.test.ts | 23 ----------------------- src/pure/deflate.ts | 4 ++-- src/pure_ext/zip.ts | 1 + 9 files changed, 18 insertions(+), 40 deletions(-) delete mode 100644 mod.test.ts diff --git a/.github/workflows/test.json b/.github/workflows/test.json index 4335689..ae07224 100644 --- a/.github/workflows/test.json +++ b/.github/workflows/test.json @@ -45,7 +45,7 @@ } }, { "name": "run test", - "run": "deno test -A ./mod.test.ts" + "run": "deno test -A --parallel --doc ./test" }] } } diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 7e52d96..adbe5e9 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -31,4 +31,4 @@ jobs: with: deno-version: v1.x - name: run test - run: deno test -A ./mod.test.ts \ No newline at end of file + run: deno test -A --parallel --doc ./test \ No newline at end of file diff --git a/README.md b/README.md index 0b7280d..0deeaae 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Export without external modules have fewer features than full, but not susceptib Can be used from browser via [esm.sh](https://esm.sh). ```html - ``` diff --git a/deps.pure.ts b/deps.pure.ts index ab33395..3c5f84b 100644 --- a/deps.pure.ts +++ b/deps.pure.ts @@ -1,6 +1,6 @@ -export {parse, stringify} from "https://esm.sh/jsr/@std/csv@0.224.3?bundle&target=esnext"; -export {ZipReader, ZipWriter, Uint8ArrayReader, Uint8ArrayWriter} from "https://esm.sh/jsr/@zip-js/zip-js@2.7.45?bundle&target=esnext"; +export {parse, stringify} from "https://esm.sh/jsr/@std/csv@1.0.1?bundle&target=esnext"; +export {ZipReader, ZipWriter, Uint8ArrayReader, Uint8ArrayWriter} from "https://esm.sh/jsr/@zip-js/zip-js@2.7.51?bundle&target=esnext"; -// @deno-types="https://cdn.sheetjs.com/xlsx-0.20.2/package/types/index.d.ts" -export {type WorkBook as RawWorkBook, type WorkSheet as RawWorkSheet, type CellObject as RawWorkCell, set_cptable, read as sheetRead, write as sheetWrite, utils as sheetUtil} from "https://cdn.sheetjs.com/xlsx-0.20.2/package/xlsx.mjs"; -export * as excelcp from "https://cdn.sheetjs.com/xlsx-0.20.2/package/dist/cpexcel.full.mjs"; \ No newline at end of file +// @deno-types="https://cdn.sheetjs.com/xlsx-0.20.3/package/types/index.d.ts" +export {type WorkBook as RawWorkBook, type WorkSheet as RawWorkSheet, type CellObject as RawWorkCell, set_cptable, read as sheetRead, write as sheetWrite, utils as sheetUtil} from "https://cdn.sheetjs.com/xlsx-0.20.3/package/xlsx.mjs"; +export * as excelcp from "https://cdn.sheetjs.com/xlsx-0.20.3/package/dist/cpexcel.full.mjs"; \ No newline at end of file diff --git a/deps.test.ts b/deps.test.ts index a82f3f1..ed572b3 100644 --- a/deps.test.ts +++ b/deps.test.ts @@ -1,7 +1,7 @@ -export {assertEquals} from "jsr:@std/assert@0.226.0"; -export {dirname, fromFileUrl} from "jsr:@std/path@0.225.2"; -export {exists} from "jsr:@std/fs@0.229.3"; -export {delay} from "jsr:@std/async@0.224.2"; +export {assertEquals} from "jsr:@std/assert@1.0.2"; +export {dirname, fromFileUrl} from "jsr:@std/path@1.0.2"; +export {exists} from "jsr:@std/fs@1.0.1"; +export {delay} from "jsr:@std/async@1.0.3"; export {DOMParser} from "jsr:@b-fuze/deno-dom@0.1.47"; export {init as smtpTest} from "npm:smtp-tester@2.1.0"; \ No newline at end of file diff --git a/deps.ts b/deps.ts index c6faf7b..0b58fbc 100644 --- a/deps.ts +++ b/deps.ts @@ -1,6 +1,6 @@ -export {Logger, ConsoleHandler, FileHandler} from "jsr:@std/log@0.224.3"; -export {format} from "jsr:@std/datetime@0.224.1"; +export {Logger, ConsoleHandler, FileHandler} from "jsr:@std/log@0.224.5"; +export {format} from "jsr:@std/datetime@0.225.0"; export {type Element, DOMParser} from "jsr:@b-fuze/deno-dom@0.1.47"; // @deno-types="npm:@types/nodemailer@6.4.15" -export {createTransport} from "npm:nodemailer@6.9.13"; \ No newline at end of file +export {createTransport} from "npm:nodemailer@6.9.14"; \ No newline at end of file diff --git a/mod.test.ts b/mod.test.ts deleted file mode 100644 index aa7cc8e..0000000 --- a/mod.test.ts +++ /dev/null @@ -1,23 +0,0 @@ -import "./test/pure/base64.test.ts"; -import "./test/pure/byte.test.ts"; -import "./test/pure/crypto.test.ts"; -import "./test/pure/deep.test.ts"; -import "./test/pure/deflate.test.ts"; -import "./test/pure/fetch.test.ts"; -import "./test/pure/minipack.test.ts"; -import "./test/pure/primitive.test.ts"; -import "./test/pure/stream.test.ts"; -import "./test/pure/text.test.ts"; -import "./test/pure/time.test.ts"; -import "./test/pure/worker.test.ts"; - -import "./test/pure_ext/csv.test.ts"; -import "./test/pure_ext/sheet.test.ts"; -import "./test/pure_ext/zip.test.ts"; - -import "./test/deno/json.test.ts"; -import "./test/deno/process.test.ts"; - -import "./test/deno_ext/dom.test.ts"; -import "./test/deno_ext/log.test.ts"; -import "./test/deno_ext/smtp.test.ts"; \ No newline at end of file diff --git a/src/pure/deflate.ts b/src/pure/deflate.ts index a565b9f..334fd07 100644 --- a/src/pure/deflate.ts +++ b/src/pure/deflate.ts @@ -12,7 +12,7 @@ const COMPRESS_CODEC = "deflate-raw"; * const decode = await deflateDecode(encode); * ``` */ -export async function deflateEncode(data: Uint8Array, codec?: string): Promise { +export async function deflateEncode(data: Uint8Array, codec?: CompressionFormat): Promise { return await streamDecode(streamEncode(data).pipeThrough(new CompressionStream(codec ?? COMPRESS_CODEC))); } @@ -26,6 +26,6 @@ export async function deflateEncode(data: Uint8Array, codec?: string): Promise { +export async function deflateDecode(data: Uint8Array, codec?: CompressionFormat): Promise { return await streamDecode(streamEncode(data).pipeThrough(new DecompressionStream(codec ?? COMPRESS_CODEC))); } \ No newline at end of file diff --git a/src/pure_ext/zip.ts b/src/pure_ext/zip.ts index bb17432..8e6414f 100644 --- a/src/pure_ext/zip.ts +++ b/src/pure_ext/zip.ts @@ -45,6 +45,7 @@ export async function zipEncode(files: DataEntry[], pw?: string, weak?: boolean) export async function zipDecode(archive: Uint8Array, pw?: string, encode?: string): Promise { const files: DataEntry[] = []; const zip = new ZipReader(new Uint8ArrayReader(archive), { + checkPasswordOnly: false, useWebWorkers: false, filenameEncoding: encode, password: pw