update deps, cleanup

This commit is contained in:
2026-06-01 01:05:14 +02:00
parent 4c61c067e6
commit 51c3e3d05f
22 changed files with 1590 additions and 2542 deletions
+25 -25
View File
@@ -1,38 +1,38 @@
import { describe, expect, it } from 'vitest'
import { Base64, Bytes, Hex } from '../dist/index.js'
import { Precomputed } from './values.js'
import { describe, expect, it } from "vitest";
import { Base64, Bytes, Hex } from "../src/index.js";
import { Precomputed } from "./values.js";
describe('Encoding', () => {
describe('Bytes', () => {
describe("Encoding", () => {
describe("Bytes", () => {
for (const [input, output] of Object.entries(Precomputed.Encoding.Bytes)) {
it(`Should encode ${input} to ${output}`, async () => {
expect(Bytes.encode(input).buffer).toEqual(output.buffer)
})
expect(Bytes.encode(input).buffer).toEqual(output.buffer);
});
it(`Should decode ${output} to ${input}`, async () => {
expect(Bytes.decode(output)).toEqual(input)
})
expect(Bytes.decode(output)).toEqual(input);
});
}
})
describe('Hex', () => {
});
describe("Hex", () => {
for (const [input, output] of Object.entries(Precomputed.Encoding.Hex)) {
const buffer = Bytes.encode(input)
const buffer = Bytes.encode(input);
it(`Should encode ${input} to ${output}`, async () => {
expect(Hex.encode(buffer)).toEqual(output)
})
expect(Hex.encode(buffer)).toEqual(output);
});
it(`Should decode ${output} to ${input}`, async () => {
expect(Hex.decode(output).buffer).toEqual(buffer.buffer)
})
expect(Hex.decode(output).buffer).toEqual(buffer.buffer);
});
}
})
describe('Base64', () => {
});
describe("Base64", () => {
for (const [input, output] of Object.entries(Precomputed.Encoding.Base64)) {
const buffer = Bytes.encode(input)
const buffer = Bytes.encode(input);
it(`Should encode ${input} to ${output}`, async () => {
expect(await Base64.encode(buffer)).toEqual(output)
})
expect(await Base64.encode(buffer)).toEqual(output);
});
it(`Should decode ${output} to ${input}`, async () => {
expect((await Base64.decode(output)).buffer).toEqual(buffer.buffer)
})
expect((await Base64.decode(output)).buffer).toEqual(buffer.buffer);
});
}
})
})
});
});