0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-03 17:34:47 -05:00

upgrade: deno_doc, deno_lint, dprint, swc (#8077)

- deno_doc 0.1.13
- deno_lint 0.2.5
- dprint-plugin-typescript 0.32.6
- swc_bundler 0.12.0
- swc_ecmascript 0.11.1
This commit is contained in:
Bartek Iwańczuk 2020-10-22 20:36:06 +02:00 committed by GitHub
parent d592c128cf
commit 9b20cfbee8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 86 additions and 69 deletions

52
Cargo.lock generated
View file

@ -484,9 +484,9 @@ dependencies = [
[[package]] [[package]]
name = "deno_doc" name = "deno_doc"
version = "0.1.12" version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "26dac7a61e642eb1604d2c7fa401063f8ea7ba70bcf7ed7918e2c7cfba182ac3" checksum = "43f2838195edbfc5604bdf668a80921c9d8a3e9be6b913ded856a560353aec65"
dependencies = [ dependencies = [
"futures", "futures",
"lazy_static", "lazy_static",
@ -510,9 +510,9 @@ dependencies = [
[[package]] [[package]]
name = "deno_lint" name = "deno_lint"
version = "0.2.4" version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24a67c1765c1c4e5d6352e980950cbf62743cdd759e4869aecc8d4b265c7e2df" checksum = "5c06a21dfcb8144754fab1165ceb637a3abe13f3d58885976f9b9892be7f5dc0"
dependencies = [ dependencies = [
"lazy_static", "lazy_static",
"log", "log",
@ -592,9 +592,9 @@ dependencies = [
[[package]] [[package]]
name = "dprint-plugin-typescript" name = "dprint-plugin-typescript"
version = "0.32.5" version = "0.32.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd05e0ea3e40e5a67c1098195fe9e508c09e9d943cb4a83fd5a92d2d6cf3fe24" checksum = "9c5b6a8ba5f3aa6e9ae503e8ca19ce1072194282b5b96d5afbd42537c8b68522"
dependencies = [ dependencies = [
"dprint-core", "dprint-core",
"serde", "serde",
@ -1140,9 +1140,9 @@ dependencies = [
[[package]] [[package]]
name = "jsdoc" name = "jsdoc"
version = "0.7.0" version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fdd68439473eb90046bf17e8adaf982b1d2cb177e176905fe5325cc70701096e" checksum = "6b7ba145aff1448ead0e6c40841ddcec6e8868ba91895f92b77343f788f54db2"
dependencies = [ dependencies = [
"nom", "nom",
"serde", "serde",
@ -2271,9 +2271,9 @@ dependencies = [
[[package]] [[package]]
name = "swc_bundler" name = "swc_bundler"
version = "0.11.3" version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5dabc79c5bf47498e16a01134846fbb677dd9c7233c591710587d76bd30cbe02" checksum = "901b76ba88dc57267bb7fc6900cd805ad51a2e97588400b1f76eb5a10f9ff464"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"crc", "crc",
@ -2333,9 +2333,9 @@ dependencies = [
[[package]] [[package]]
name = "swc_ecma_codegen" name = "swc_ecma_codegen"
version = "0.37.0" version = "0.38.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b419db5f9bef7d02950df68ba7efc2f2bfb25e54d6e261c7fb5339991b8babed" checksum = "582d052f72df0013ccf4e4fe2077f5c61b918b788ed3b4a1996c30211f535e9b"
dependencies = [ dependencies = [
"bitflags", "bitflags",
"num-bigint", "num-bigint",
@ -2361,9 +2361,9 @@ dependencies = [
[[package]] [[package]]
name = "swc_ecma_dep_graph" name = "swc_ecma_dep_graph"
version = "0.5.0" version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7db36df7b12941f466f42d0a945c2ec364b171b3ff555fb877c904da7bb553c" checksum = "51f954f752db6666090a95e49a7ffcf23c825fe94be9095b0d7bec4fc26e1c4f"
dependencies = [ dependencies = [
"swc_atoms", "swc_atoms",
"swc_common", "swc_common",
@ -2373,9 +2373,9 @@ dependencies = [
[[package]] [[package]]
name = "swc_ecma_parser" name = "swc_ecma_parser"
version = "0.39.0" version = "0.40.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "310a37e3a148fe43ea60a61313bd61211d33f44e21d772b5d733d2788534a6e5" checksum = "9df01dea2cb40f7b242c479ac583353f17f82a0ef30ae3ee89d9a2f503ad596c"
dependencies = [ dependencies = [
"either", "either",
"enum_kind", "enum_kind",
@ -2407,9 +2407,9 @@ dependencies = [
[[package]] [[package]]
name = "swc_ecma_transforms" name = "swc_ecma_transforms"
version = "0.26.1" version = "0.27.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f03b0469dc1152e7483537a81d378bc32b7bd43e849b03d9a8d95bc0bda5e004" checksum = "27ecc38cd778c4e5e1b7786ee73d5921e2799a7f3529803f63a75cde936389e7"
dependencies = [ dependencies = [
"Inflector", "Inflector",
"arrayvec", "arrayvec",
@ -2469,9 +2469,9 @@ dependencies = [
[[package]] [[package]]
name = "swc_ecma_visit" name = "swc_ecma_visit"
version = "0.19.0" version = "0.19.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fd3ae418cb75a360fbd33b5cfc8dbb87bea84122afc24bdf286fba74ea8f0f91" checksum = "221496af0bf3f55ee5bb99d1b776844b6cbbca3fdd574169d5e3a3ab5d4acad9"
dependencies = [ dependencies = [
"num-bigint", "num-bigint",
"swc_atoms", "swc_atoms",
@ -2482,9 +2482,9 @@ dependencies = [
[[package]] [[package]]
name = "swc_ecmascript" name = "swc_ecmascript"
version = "0.10.1" version = "0.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2e45301deb76f64b4a1b9800a42c674bdf0950e96784405a336d045382712ac" checksum = "6daadf581c50c59197b56ba12d6eea8279809cc0b591d7250ffd59e4f18c9580"
dependencies = [ dependencies = [
"swc_ecma_ast", "swc_ecma_ast",
"swc_ecma_codegen", "swc_ecma_codegen",
@ -2509,9 +2509,9 @@ dependencies = [
[[package]] [[package]]
name = "swc_visit" name = "swc_visit"
version = "0.2.0" version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b95ece564c6d6bf980140cedd960697226098800f2de07dad6a140c2dbdcc742" checksum = "4ca9ac0c9177cbc3ae943f7fa1126831b00b68c49c24a0c07f45647e120871d8"
dependencies = [ dependencies = [
"either", "either",
"swc_visit_macros", "swc_visit_macros",
@ -2519,9 +2519,9 @@ dependencies = [
[[package]] [[package]]
name = "swc_visit_macros" name = "swc_visit_macros"
version = "0.2.0" version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59a75265aea70df7a405e2aafb104c976017fe9a54e7b770017d0583873a3cff" checksum = "d86b27648c524b340cb535375d52a84efdfb7e864082ca5955cea3932e0b8ea4"
dependencies = [ dependencies = [
"Inflector", "Inflector",
"pmutil", "pmutil",

View file

@ -30,8 +30,8 @@ winapi = "0.3.9"
[dependencies] [dependencies]
deno_core = { path = "../core", version = "0.64.0" } deno_core = { path = "../core", version = "0.64.0" }
deno_doc = "0.1.12" deno_doc = "0.1.13"
deno_lint = "0.2.4" deno_lint = "0.2.5"
deno_web = { path = "../op_crates/web", version = "0.15.1" } deno_web = { path = "../op_crates/web", version = "0.15.1" }
deno_fetch = { path = "../op_crates/fetch", version = "0.7.1" } deno_fetch = { path = "../op_crates/fetch", version = "0.7.1" }
@ -43,7 +43,7 @@ clap = "2.33.3"
dissimilar = "1.0.2" dissimilar = "1.0.2"
dlopen = "0.1.8" dlopen = "0.1.8"
encoding_rs = "0.8.24" encoding_rs = "0.8.24"
dprint-plugin-typescript = "0.32.5" dprint-plugin-typescript = "0.32.6"
filetime = "0.2.12" filetime = "0.2.12"
http = "0.2.1" http = "0.2.1"
indexmap = "1.6.0" indexmap = "1.6.0"
@ -61,9 +61,9 @@ rustyline-derive = "0.3.1"
serde = { version = "1.0.116", features = ["derive"] } serde = { version = "1.0.116", features = ["derive"] }
sys-info = "0.7.0" sys-info = "0.7.0"
sourcemap = "6.0.1" sourcemap = "6.0.1"
swc_bundler = "=0.11.3" swc_bundler = "=0.12.0"
swc_common = { version = "=0.10.4", features = ["sourcemap"] } swc_common = { version = "=0.10.4", features = ["sourcemap"] }
swc_ecmascript = { version = "=0.10.1", features = ["codegen", "dep_graph", "parser", "react", "transforms", "visit"] } swc_ecmascript = { version = "=0.11.1", features = ["codegen", "dep_graph", "parser", "react", "transforms", "visit"] }
tempfile = "3.1.0" tempfile = "3.1.0"
termcolor = "1.1.0" termcolor = "1.1.0"
tokio = { version = "0.2.22", features = ["full"] } tokio = { version = "0.2.22", features = ["full"] }

View file

@ -4,6 +4,7 @@ import { Sponge } from "./sponge.ts";
import { keccakf } from "./keccakf.ts"; import { keccakf } from "./keccakf.ts";
/** Sha3-224 hash */ /** Sha3-224 hash */
// deno-lint-ignore camelcase
export class Sha3_224 extends Sponge { export class Sha3_224 extends Sponge {
constructor() { constructor() {
super({ super({
@ -16,6 +17,7 @@ export class Sha3_224 extends Sponge {
} }
/** Sha3-256 hash */ /** Sha3-256 hash */
// deno-lint-ignore camelcase
export class Sha3_256 extends Sponge { export class Sha3_256 extends Sponge {
constructor() { constructor() {
super({ super({
@ -28,6 +30,7 @@ export class Sha3_256 extends Sponge {
} }
/** Sha3-384 hash */ /** Sha3-384 hash */
// deno-lint-ignore camelcase
export class Sha3_384 extends Sponge { export class Sha3_384 extends Sponge {
constructor() { constructor() {
super({ super({
@ -40,6 +43,7 @@ export class Sha3_384 extends Sponge {
} }
/** Sha3-512 hash */ /** Sha3-512 hash */
// deno-lint-ignore camelcase
export class Sha3_512 extends Sponge { export class Sha3_512 extends Sponge {
constructor() { constructor() {
super({ super({

View file

@ -6,9 +6,13 @@ import {
Keccak256, Keccak256,
Keccak384, Keccak384,
Keccak512, Keccak512,
// deno-lint-ignore camelcase
Sha3_224, Sha3_224,
// deno-lint-ignore camelcase
Sha3_256, Sha3_256,
// deno-lint-ignore camelcase
Sha3_384, Sha3_384,
// deno-lint-ignore camelcase
Sha3_512, Sha3_512,
Shake128, Shake128,
Shake256, Shake256,
@ -17,6 +21,7 @@ import * as hex from "../encoding/hex.ts";
const millionAs = "a".repeat(1000000); const millionAs = "a".repeat(1000000);
// deno-lint-ignore camelcase
const testSetSha3_224 = [ const testSetSha3_224 = [
["", "6b4e03423667dbb73b6e15454f0eb1abd4597f9a1b078e3f5b5a6bc7"], ["", "6b4e03423667dbb73b6e15454f0eb1abd4597f9a1b078e3f5b5a6bc7"],
["abc", "e642824c3f8cf24ad09234ee7d3c766fc9a3a5168d0c94ad73b46fdf"], ["abc", "e642824c3f8cf24ad09234ee7d3c766fc9a3a5168d0c94ad73b46fdf"],
@ -31,6 +36,7 @@ const testSetSha3_224 = [
[millionAs, "d69335b93325192e516a912e6d19a15cb51c6ed5c15243e7a7fd653c"], [millionAs, "d69335b93325192e516a912e6d19a15cb51c6ed5c15243e7a7fd653c"],
]; ];
// deno-lint-ignore camelcase
const testSetSha3_256 = [ const testSetSha3_256 = [
["", "a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a"], ["", "a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a"],
["abc", "3a985da74fe225b2045c172d6bd390bd855f086e3e9d525b46bfe24511431532"], ["abc", "3a985da74fe225b2045c172d6bd390bd855f086e3e9d525b46bfe24511431532"],
@ -48,6 +54,7 @@ const testSetSha3_256 = [
], ],
]; ];
// deno-lint-ignore camelcase
const testSetSha3_384 = [ const testSetSha3_384 = [
[ [
"", "",
@ -71,6 +78,7 @@ const testSetSha3_384 = [
], ],
]; ];
// deno-lint-ignore camelcase
const testSetSha3_512 = [ const testSetSha3_512 = [
[ [
"", "",
@ -165,6 +173,7 @@ const testSetShake128 = [
[millionAs, "9d222c79c4ff9d092cf6ca86143aa411"], [millionAs, "9d222c79c4ff9d092cf6ca86143aa411"],
]; ];
// deno-lint-ignore camelcase
const testSetShake128_224 = [ const testSetShake128_224 = [
["", "7f9c2ba4e88f827d616045507605853ed73b8093f6efbc88eb1a6eac"], ["", "7f9c2ba4e88f827d616045507605853ed73b8093f6efbc88eb1a6eac"],
["abc", "5881092dd818bf5cf8a3ddb793fbcba74097d5c526a6d35f97b83351"], ["abc", "5881092dd818bf5cf8a3ddb793fbcba74097d5c526a6d35f97b83351"],
@ -175,6 +184,7 @@ const testSetShake128_224 = [
[millionAs, "9d222c79c4ff9d092cf6ca86143aa411e369973808ef97093255826c"], [millionAs, "9d222c79c4ff9d092cf6ca86143aa411e369973808ef97093255826c"],
]; ];
// deno-lint-ignore camelcase
const testSetShake128_2048 = [ const testSetShake128_2048 = [
[ [
"", "",
@ -207,6 +217,7 @@ const testSetShake256 = [
], ],
]; ];
// deno-lint-ignore camelcase
const testSetShake256_128 = [ const testSetShake256_128 = [
["", "46b9dd2b0ba88d13233b3feb743eeb24"], ["", "46b9dd2b0ba88d13233b3feb743eeb24"],
["abc", "483366601360a8771c6863080cc4114d"], ["abc", "483366601360a8771c6863080cc4114d"],
@ -217,6 +228,7 @@ const testSetShake256_128 = [
[millionAs, "3578a7a4ca9137569cdf76ed617d31bb"], [millionAs, "3578a7a4ca9137569cdf76ed617d31bb"],
]; ];
// deno-lint-ignore camelcase
const testSetShake256_384 = [ const testSetShake256_384 = [
[ [
"", "",
@ -236,6 +248,7 @@ const testSetShake256_384 = [
], ],
]; ];
// deno-lint-ignore camelcase
const testSetShake256_512 = [ const testSetShake256_512 = [
[ [
"", "",

View file

@ -211,11 +211,11 @@ Deno.test({
name: "Sync: Data is written in Uint8Array to passed in file path", name: "Sync: Data is written in Uint8Array to passed in file path",
fn() { fn() {
const openResourcesBeforeAppend: Deno.ResourceMap = Deno.resources(); const openResourcesBeforeAppend: Deno.ResourceMap = Deno.resources();
const test_data = new TextEncoder().encode("hello world"); const testData = new TextEncoder().encode("hello world");
appendFileSync("_fs_appendFile_test_file_sync.txt", test_data); appendFileSync("_fs_appendFile_test_file_sync.txt", testData);
assertEquals(Deno.resources(), openResourcesBeforeAppend); assertEquals(Deno.resources(), openResourcesBeforeAppend);
const data = Deno.readFileSync("_fs_appendFile_test_file_sync.txt"); const data = Deno.readFileSync("_fs_appendFile_test_file_sync.txt");
assertEquals(data, test_data); assertEquals(data, testData);
Deno.removeSync("_fs_appendFile_test_file_sync.txt"); Deno.removeSync("_fs_appendFile_test_file_sync.txt");
}, },
}); });
@ -224,9 +224,9 @@ Deno.test({
name: "Async: Data is written in Uint8Array to passed in file path", name: "Async: Data is written in Uint8Array to passed in file path",
async fn() { async fn() {
const openResourcesBeforeAppend: Deno.ResourceMap = Deno.resources(); const openResourcesBeforeAppend: Deno.ResourceMap = Deno.resources();
const test_data = new TextEncoder().encode("hello world"); const testData = new TextEncoder().encode("hello world");
await new Promise((resolve, reject) => { await new Promise((resolve, reject) => {
appendFile("_fs_appendFile_test_file.txt", test_data, (err) => { appendFile("_fs_appendFile_test_file.txt", testData, (err) => {
if (err) reject(err); if (err) reject(err);
else resolve(); else resolve();
}); });
@ -234,7 +234,7 @@ Deno.test({
.then(async () => { .then(async () => {
assertEquals(Deno.resources(), openResourcesBeforeAppend); assertEquals(Deno.resources(), openResourcesBeforeAppend);
const data = await Deno.readFile("_fs_appendFile_test_file.txt"); const data = await Deno.readFile("_fs_appendFile_test_file.txt");
assertEquals(data, test_data); assertEquals(data, testData);
}) })
.catch((err) => { .catch((err) => {
fail("No error was expected: " + err); fail("No error was expected: " + err);

View file

@ -9,7 +9,7 @@ import { join, parse } from "../../path/mod.ts";
import { existsSync } from "../../fs/mod.ts"; import { existsSync } from "../../fs/mod.ts";
import { closeSync } from "./_fs_close.ts"; import { closeSync } from "./_fs_close.ts";
const temp_dir = parse(Deno.makeTempFileSync()).dir; const tempDir = parse(Deno.makeTempFileSync()).dir;
Deno.test({ Deno.test({
name: "ASYNC: open file", name: "ASYNC: open file",
@ -44,7 +44,7 @@ Deno.test({
Deno.test({ Deno.test({
name: "open with flag 'a'", name: "open with flag 'a'",
fn() { fn() {
const file = join(temp_dir, "some_random_file"); const file = join(tempDir, "some_random_file");
const fd = openSync(file, "a"); const fd = openSync(file, "a");
assertEquals(typeof fd, "number"); assertEquals(typeof fd, "number");
assertEquals(existsSync(file), true); assertEquals(existsSync(file), true);
@ -71,7 +71,7 @@ Deno.test({
Deno.test({ Deno.test({
name: "open with flag 'a+'", name: "open with flag 'a+'",
fn() { fn() {
const file = join(temp_dir, "some_random_file2"); const file = join(tempDir, "some_random_file2");
const fd = openSync(file, "a+"); const fd = openSync(file, "a+");
assertEquals(typeof fd, "number"); assertEquals(typeof fd, "number");
assertEquals(existsSync(file), true); assertEquals(existsSync(file), true);
@ -97,7 +97,7 @@ Deno.test({
Deno.test({ Deno.test({
name: "open with flag 'as'", name: "open with flag 'as'",
fn() { fn() {
const file = join(temp_dir, "some_random_file10"); const file = join(tempDir, "some_random_file10");
const fd = openSync(file, "as"); const fd = openSync(file, "as");
assertEquals(existsSync(file), true); assertEquals(existsSync(file), true);
assertEquals(typeof fd, "number"); assertEquals(typeof fd, "number");
@ -108,7 +108,7 @@ Deno.test({
Deno.test({ Deno.test({
name: "open with flag 'as+'", name: "open with flag 'as+'",
fn() { fn() {
const file = join(temp_dir, "some_random_file10"); const file = join(tempDir, "some_random_file10");
const fd = openSync(file, "as+"); const fd = openSync(file, "as+");
assertEquals(existsSync(file), true); assertEquals(existsSync(file), true);
assertEquals(typeof fd, "number"); assertEquals(typeof fd, "number");
@ -119,7 +119,7 @@ Deno.test({
Deno.test({ Deno.test({
name: "open with flag 'r'", name: "open with flag 'r'",
fn() { fn() {
const file = join(temp_dir, "some_random_file3"); const file = join(tempDir, "some_random_file3");
assertThrows(() => { assertThrows(() => {
openSync(file, "r"); openSync(file, "r");
}, Error); }, Error);
@ -129,7 +129,7 @@ Deno.test({
Deno.test({ Deno.test({
name: "open with flag 'r+'", name: "open with flag 'r+'",
fn() { fn() {
const file = join(temp_dir, "some_random_file4"); const file = join(tempDir, "some_random_file4");
assertThrows(() => { assertThrows(() => {
openSync(file, "r+"); openSync(file, "r+");
}, Error); }, Error);
@ -146,7 +146,7 @@ Deno.test({
assertEquals(Deno.readTextFileSync(file), ""); assertEquals(Deno.readTextFileSync(file), "");
closeSync(fd); closeSync(fd);
const file2 = join(temp_dir, "some_random_file5"); const file2 = join(tempDir, "some_random_file5");
const fd2 = openSync(file2, "w"); const fd2 = openSync(file2, "w");
assertEquals(typeof fd2, "number"); assertEquals(typeof fd2, "number");
assertEquals(existsSync(file2), true); assertEquals(existsSync(file2), true);
@ -185,7 +185,7 @@ Deno.test({
assertEquals(Deno.readTextFileSync(file), ""); assertEquals(Deno.readTextFileSync(file), "");
closeSync(fd); closeSync(fd);
const file2 = join(temp_dir, "some_random_file6"); const file2 = join(tempDir, "some_random_file6");
const fd2 = openSync(file2, "w+"); const fd2 = openSync(file2, "w+");
assertEquals(typeof fd2, "number"); assertEquals(typeof fd2, "number");
assertEquals(existsSync(file2), true); assertEquals(existsSync(file2), true);

View file

@ -183,7 +183,7 @@ export function convertFileInfoToStats(origin: Deno.FileInfo): Stats {
}; };
} }
function to_BigInt(number?: number | null) { function toBigInt(number?: number | null) {
if (number === null || number === undefined) return null; if (number === null || number === undefined) return null;
return BigInt(number); return BigInt(number);
} }
@ -192,16 +192,16 @@ export function convertFileInfoToBigIntStats(
origin: Deno.FileInfo, origin: Deno.FileInfo,
): BigIntStats { ): BigIntStats {
return { return {
dev: to_BigInt(origin.dev), dev: toBigInt(origin.dev),
ino: to_BigInt(origin.ino), ino: toBigInt(origin.ino),
mode: to_BigInt(origin.mode), mode: toBigInt(origin.mode),
nlink: to_BigInt(origin.nlink), nlink: toBigInt(origin.nlink),
uid: to_BigInt(origin.uid), uid: toBigInt(origin.uid),
gid: to_BigInt(origin.gid), gid: toBigInt(origin.gid),
rdev: to_BigInt(origin.rdev), rdev: toBigInt(origin.rdev),
size: to_BigInt(origin.size) || 0n, size: toBigInt(origin.size) || 0n,
blksize: to_BigInt(origin.blksize), blksize: toBigInt(origin.blksize),
blocks: to_BigInt(origin.blocks), blocks: toBigInt(origin.blocks),
mtime: origin.mtime, mtime: origin.mtime,
atime: origin.atime, atime: origin.atime,
birthtime: origin.birthtime, birthtime: origin.birthtime,

View file

@ -24,7 +24,7 @@ export function assertStats(actual: Stats, expected: Deno.FileInfo) {
assertEquals(actual.isSymbolicLink(), expected.isSymlink); assertEquals(actual.isSymbolicLink(), expected.isSymlink);
} }
function to_BigInt(num?: number | null) { function toBigInt(num?: number | null) {
if (num === undefined || num === null) return null; if (num === undefined || num === null) return null;
return BigInt(num); return BigInt(num);
} }
@ -33,17 +33,17 @@ export function assertStatsBigInt(
actual: BigIntStats, actual: BigIntStats,
expected: Deno.FileInfo, expected: Deno.FileInfo,
) { ) {
assertEquals(actual.dev, to_BigInt(expected.dev)); assertEquals(actual.dev, toBigInt(expected.dev));
assertEquals(actual.gid, to_BigInt(expected.gid)); assertEquals(actual.gid, toBigInt(expected.gid));
assertEquals(actual.size, to_BigInt(expected.size)); assertEquals(actual.size, toBigInt(expected.size));
assertEquals(actual.blksize, to_BigInt(expected.blksize)); assertEquals(actual.blksize, toBigInt(expected.blksize));
assertEquals(actual.blocks, to_BigInt(expected.blocks)); assertEquals(actual.blocks, toBigInt(expected.blocks));
assertEquals(actual.ino, to_BigInt(expected.ino)); assertEquals(actual.ino, toBigInt(expected.ino));
assertEquals(actual.gid, to_BigInt(expected.gid)); assertEquals(actual.gid, toBigInt(expected.gid));
assertEquals(actual.mode, to_BigInt(expected.mode)); assertEquals(actual.mode, toBigInt(expected.mode));
assertEquals(actual.nlink, to_BigInt(expected.nlink)); assertEquals(actual.nlink, toBigInt(expected.nlink));
assertEquals(actual.rdev, to_BigInt(expected.rdev)); assertEquals(actual.rdev, toBigInt(expected.rdev));
assertEquals(actual.uid, to_BigInt(expected.uid)); assertEquals(actual.uid, toBigInt(expected.uid));
assertEquals(actual.atime?.getTime(), expected.atime?.getTime()); assertEquals(actual.atime?.getTime(), expected.atime?.getTime());
assertEquals(actual.mtime?.getTime(), expected.mtime?.getTime()); assertEquals(actual.mtime?.getTime(), expected.mtime?.getTime());
assertEquals(actual.birthtime?.getTime(), expected.birthtime?.getTime()); assertEquals(actual.birthtime?.getTime(), expected.birthtime?.getTime());