diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-10-22 20:36:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-22 20:36:06 +0200 |
commit | 9b20cfbee8d932c2f232f6bad911fe65c8257adc (patch) | |
tree | 5974a4ecd44c224e252a28d18639f00eedb8bc33 /std | |
parent | d592c128cf42852d2ccffc45574761fd78de8fa7 (diff) |
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
Diffstat (limited to 'std')
-rw-r--r-- | std/hash/_sha3/sha3.ts | 4 | ||||
-rw-r--r-- | std/hash/sha3_test.ts | 13 | ||||
-rw-r--r-- | std/node/_fs/_fs_appendFile_test.ts | 12 | ||||
-rw-r--r-- | std/node/_fs/_fs_open_test.ts | 18 | ||||
-rw-r--r-- | std/node/_fs/_fs_stat.ts | 22 | ||||
-rw-r--r-- | std/node/_fs/_fs_stat_test.ts | 24 |
6 files changed, 55 insertions, 38 deletions
diff --git a/std/hash/_sha3/sha3.ts b/std/hash/_sha3/sha3.ts index 05b9d82e3..4aa50b900 100644 --- a/std/hash/_sha3/sha3.ts +++ b/std/hash/_sha3/sha3.ts @@ -4,6 +4,7 @@ import { Sponge } from "./sponge.ts"; import { keccakf } from "./keccakf.ts"; /** Sha3-224 hash */ +// deno-lint-ignore camelcase export class Sha3_224 extends Sponge { constructor() { super({ @@ -16,6 +17,7 @@ export class Sha3_224 extends Sponge { } /** Sha3-256 hash */ +// deno-lint-ignore camelcase export class Sha3_256 extends Sponge { constructor() { super({ @@ -28,6 +30,7 @@ export class Sha3_256 extends Sponge { } /** Sha3-384 hash */ +// deno-lint-ignore camelcase export class Sha3_384 extends Sponge { constructor() { super({ @@ -40,6 +43,7 @@ export class Sha3_384 extends Sponge { } /** Sha3-512 hash */ +// deno-lint-ignore camelcase export class Sha3_512 extends Sponge { constructor() { super({ diff --git a/std/hash/sha3_test.ts b/std/hash/sha3_test.ts index 4ff0ec63e..cfdce0553 100644 --- a/std/hash/sha3_test.ts +++ b/std/hash/sha3_test.ts @@ -6,9 +6,13 @@ import { Keccak256, Keccak384, Keccak512, + // deno-lint-ignore camelcase Sha3_224, + // deno-lint-ignore camelcase Sha3_256, + // deno-lint-ignore camelcase Sha3_384, + // deno-lint-ignore camelcase Sha3_512, Shake128, Shake256, @@ -17,6 +21,7 @@ import * as hex from "../encoding/hex.ts"; const millionAs = "a".repeat(1000000); +// deno-lint-ignore camelcase const testSetSha3_224 = [ ["", "6b4e03423667dbb73b6e15454f0eb1abd4597f9a1b078e3f5b5a6bc7"], ["abc", "e642824c3f8cf24ad09234ee7d3c766fc9a3a5168d0c94ad73b46fdf"], @@ -31,6 +36,7 @@ const testSetSha3_224 = [ [millionAs, "d69335b93325192e516a912e6d19a15cb51c6ed5c15243e7a7fd653c"], ]; +// deno-lint-ignore camelcase const testSetSha3_256 = [ ["", "a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a"], ["abc", "3a985da74fe225b2045c172d6bd390bd855f086e3e9d525b46bfe24511431532"], @@ -48,6 +54,7 @@ const testSetSha3_256 = [ ], ]; +// deno-lint-ignore camelcase const testSetSha3_384 = [ [ "", @@ -71,6 +78,7 @@ const testSetSha3_384 = [ ], ]; +// deno-lint-ignore camelcase const testSetSha3_512 = [ [ "", @@ -165,6 +173,7 @@ const testSetShake128 = [ [millionAs, "9d222c79c4ff9d092cf6ca86143aa411"], ]; +// deno-lint-ignore camelcase const testSetShake128_224 = [ ["", "7f9c2ba4e88f827d616045507605853ed73b8093f6efbc88eb1a6eac"], ["abc", "5881092dd818bf5cf8a3ddb793fbcba74097d5c526a6d35f97b83351"], @@ -175,6 +184,7 @@ const testSetShake128_224 = [ [millionAs, "9d222c79c4ff9d092cf6ca86143aa411e369973808ef97093255826c"], ]; +// deno-lint-ignore camelcase const testSetShake128_2048 = [ [ "", @@ -207,6 +217,7 @@ const testSetShake256 = [ ], ]; +// deno-lint-ignore camelcase const testSetShake256_128 = [ ["", "46b9dd2b0ba88d13233b3feb743eeb24"], ["abc", "483366601360a8771c6863080cc4114d"], @@ -217,6 +228,7 @@ const testSetShake256_128 = [ [millionAs, "3578a7a4ca9137569cdf76ed617d31bb"], ]; +// deno-lint-ignore camelcase const testSetShake256_384 = [ [ "", @@ -236,6 +248,7 @@ const testSetShake256_384 = [ ], ]; +// deno-lint-ignore camelcase const testSetShake256_512 = [ [ "", diff --git a/std/node/_fs/_fs_appendFile_test.ts b/std/node/_fs/_fs_appendFile_test.ts index f16b61599..5d9e6f96d 100644 --- a/std/node/_fs/_fs_appendFile_test.ts +++ b/std/node/_fs/_fs_appendFile_test.ts @@ -211,11 +211,11 @@ Deno.test({ name: "Sync: Data is written in Uint8Array to passed in file path", fn() { const openResourcesBeforeAppend: Deno.ResourceMap = Deno.resources(); - const test_data = new TextEncoder().encode("hello world"); - appendFileSync("_fs_appendFile_test_file_sync.txt", test_data); + const testData = new TextEncoder().encode("hello world"); + appendFileSync("_fs_appendFile_test_file_sync.txt", testData); assertEquals(Deno.resources(), openResourcesBeforeAppend); 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"); }, }); @@ -224,9 +224,9 @@ Deno.test({ name: "Async: Data is written in Uint8Array to passed in file path", async fn() { 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) => { - appendFile("_fs_appendFile_test_file.txt", test_data, (err) => { + appendFile("_fs_appendFile_test_file.txt", testData, (err) => { if (err) reject(err); else resolve(); }); @@ -234,7 +234,7 @@ Deno.test({ .then(async () => { assertEquals(Deno.resources(), openResourcesBeforeAppend); const data = await Deno.readFile("_fs_appendFile_test_file.txt"); - assertEquals(data, test_data); + assertEquals(data, testData); }) .catch((err) => { fail("No error was expected: " + err); diff --git a/std/node/_fs/_fs_open_test.ts b/std/node/_fs/_fs_open_test.ts index 4cbd58d02..16f60110e 100644 --- a/std/node/_fs/_fs_open_test.ts +++ b/std/node/_fs/_fs_open_test.ts @@ -9,7 +9,7 @@ import { join, parse } from "../../path/mod.ts"; import { existsSync } from "../../fs/mod.ts"; import { closeSync } from "./_fs_close.ts"; -const temp_dir = parse(Deno.makeTempFileSync()).dir; +const tempDir = parse(Deno.makeTempFileSync()).dir; Deno.test({ name: "ASYNC: open file", @@ -44,7 +44,7 @@ Deno.test({ Deno.test({ name: "open with flag 'a'", fn() { - const file = join(temp_dir, "some_random_file"); + const file = join(tempDir, "some_random_file"); const fd = openSync(file, "a"); assertEquals(typeof fd, "number"); assertEquals(existsSync(file), true); @@ -71,7 +71,7 @@ Deno.test({ Deno.test({ name: "open with flag 'a+'", fn() { - const file = join(temp_dir, "some_random_file2"); + const file = join(tempDir, "some_random_file2"); const fd = openSync(file, "a+"); assertEquals(typeof fd, "number"); assertEquals(existsSync(file), true); @@ -97,7 +97,7 @@ Deno.test({ Deno.test({ name: "open with flag 'as'", fn() { - const file = join(temp_dir, "some_random_file10"); + const file = join(tempDir, "some_random_file10"); const fd = openSync(file, "as"); assertEquals(existsSync(file), true); assertEquals(typeof fd, "number"); @@ -108,7 +108,7 @@ Deno.test({ Deno.test({ name: "open with flag 'as+'", fn() { - const file = join(temp_dir, "some_random_file10"); + const file = join(tempDir, "some_random_file10"); const fd = openSync(file, "as+"); assertEquals(existsSync(file), true); assertEquals(typeof fd, "number"); @@ -119,7 +119,7 @@ Deno.test({ Deno.test({ name: "open with flag 'r'", fn() { - const file = join(temp_dir, "some_random_file3"); + const file = join(tempDir, "some_random_file3"); assertThrows(() => { openSync(file, "r"); }, Error); @@ -129,7 +129,7 @@ Deno.test({ Deno.test({ name: "open with flag 'r+'", fn() { - const file = join(temp_dir, "some_random_file4"); + const file = join(tempDir, "some_random_file4"); assertThrows(() => { openSync(file, "r+"); }, Error); @@ -146,7 +146,7 @@ Deno.test({ assertEquals(Deno.readTextFileSync(file), ""); closeSync(fd); - const file2 = join(temp_dir, "some_random_file5"); + const file2 = join(tempDir, "some_random_file5"); const fd2 = openSync(file2, "w"); assertEquals(typeof fd2, "number"); assertEquals(existsSync(file2), true); @@ -185,7 +185,7 @@ Deno.test({ assertEquals(Deno.readTextFileSync(file), ""); closeSync(fd); - const file2 = join(temp_dir, "some_random_file6"); + const file2 = join(tempDir, "some_random_file6"); const fd2 = openSync(file2, "w+"); assertEquals(typeof fd2, "number"); assertEquals(existsSync(file2), true); diff --git a/std/node/_fs/_fs_stat.ts b/std/node/_fs/_fs_stat.ts index d823f7ddb..3ca2a9918 100644 --- a/std/node/_fs/_fs_stat.ts +++ b/std/node/_fs/_fs_stat.ts @@ -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; return BigInt(number); } @@ -192,16 +192,16 @@ export function convertFileInfoToBigIntStats( origin: Deno.FileInfo, ): BigIntStats { return { - dev: to_BigInt(origin.dev), - ino: to_BigInt(origin.ino), - mode: to_BigInt(origin.mode), - nlink: to_BigInt(origin.nlink), - uid: to_BigInt(origin.uid), - gid: to_BigInt(origin.gid), - rdev: to_BigInt(origin.rdev), - size: to_BigInt(origin.size) || 0n, - blksize: to_BigInt(origin.blksize), - blocks: to_BigInt(origin.blocks), + dev: toBigInt(origin.dev), + ino: toBigInt(origin.ino), + mode: toBigInt(origin.mode), + nlink: toBigInt(origin.nlink), + uid: toBigInt(origin.uid), + gid: toBigInt(origin.gid), + rdev: toBigInt(origin.rdev), + size: toBigInt(origin.size) || 0n, + blksize: toBigInt(origin.blksize), + blocks: toBigInt(origin.blocks), mtime: origin.mtime, atime: origin.atime, birthtime: origin.birthtime, diff --git a/std/node/_fs/_fs_stat_test.ts b/std/node/_fs/_fs_stat_test.ts index 925a79be2..3ba8d1cb2 100644 --- a/std/node/_fs/_fs_stat_test.ts +++ b/std/node/_fs/_fs_stat_test.ts @@ -24,7 +24,7 @@ export function assertStats(actual: Stats, expected: Deno.FileInfo) { assertEquals(actual.isSymbolicLink(), expected.isSymlink); } -function to_BigInt(num?: number | null) { +function toBigInt(num?: number | null) { if (num === undefined || num === null) return null; return BigInt(num); } @@ -33,17 +33,17 @@ export function assertStatsBigInt( actual: BigIntStats, expected: Deno.FileInfo, ) { - assertEquals(actual.dev, to_BigInt(expected.dev)); - assertEquals(actual.gid, to_BigInt(expected.gid)); - assertEquals(actual.size, to_BigInt(expected.size)); - assertEquals(actual.blksize, to_BigInt(expected.blksize)); - assertEquals(actual.blocks, to_BigInt(expected.blocks)); - assertEquals(actual.ino, to_BigInt(expected.ino)); - assertEquals(actual.gid, to_BigInt(expected.gid)); - assertEquals(actual.mode, to_BigInt(expected.mode)); - assertEquals(actual.nlink, to_BigInt(expected.nlink)); - assertEquals(actual.rdev, to_BigInt(expected.rdev)); - assertEquals(actual.uid, to_BigInt(expected.uid)); + assertEquals(actual.dev, toBigInt(expected.dev)); + assertEquals(actual.gid, toBigInt(expected.gid)); + assertEquals(actual.size, toBigInt(expected.size)); + assertEquals(actual.blksize, toBigInt(expected.blksize)); + assertEquals(actual.blocks, toBigInt(expected.blocks)); + assertEquals(actual.ino, toBigInt(expected.ino)); + assertEquals(actual.gid, toBigInt(expected.gid)); + assertEquals(actual.mode, toBigInt(expected.mode)); + assertEquals(actual.nlink, toBigInt(expected.nlink)); + assertEquals(actual.rdev, toBigInt(expected.rdev)); + assertEquals(actual.uid, toBigInt(expected.uid)); assertEquals(actual.atime?.getTime(), expected.atime?.getTime()); assertEquals(actual.mtime?.getTime(), expected.mtime?.getTime()); assertEquals(actual.birthtime?.getTime(), expected.birthtime?.getTime()); |