Change ND genre ids to b64 encoded strings of genre, so as to differentiate between genre name and id (#54)

This commit is contained in:
Simon J
2021-09-21 10:53:02 +10:00
committed by GitHub
parent be4fcdff24
commit d508eaebcf
8 changed files with 68 additions and 53 deletions

17
tests/b64.test.ts Normal file
View File

@@ -0,0 +1,17 @@
import { b64Encode, b64Decode } from "../src/b64";
describe("b64", () => {
const value = "foobar100";
const encoded = Buffer.from(value).toString("base64");
describe("encode", () => {
it("should encode", () => {
expect(b64Encode(value)).toEqual(encoded);
});
});
describe("decode", () => {
it("should decode", () => {
expect(b64Decode(encoded)).toEqual(value);
});
});
});