change document to text and binary content
Some checks failed
Build and release / Build (push) Failing after 1m12s
Build and release / update-release-draft (push) Has been skipped
Build and release / Release (push) Has been skipped

This commit is contained in:
Morten Olsen
2025-12-10 22:06:15 +01:00
parent 25f614a730
commit 1255639058
7 changed files with 40 additions and 20 deletions

View File

@@ -0,0 +1,14 @@
const base64ToMaybeBuffer = (input?: string | null | Buffer) => {
if (input === null) {
return input;
}
if (!input) {
return undefined;
}
if (typeof input === 'object') {
return input;
}
return Buffer.from(input, 'base64');
};
export { base64ToMaybeBuffer };

View File

@@ -1,9 +1,13 @@
import deepEqual from 'deep-equal';
const compareObjectKeys = <T extends Record<string, unknown>>(a: T, b: T, keys: (keyof T)[]) => {
const compareObjectKeys = <A extends Record<string, unknown>, B extends Record<string, unknown>>(
a: A,
b: B,
keys: (keyof (A & B))[],
) => {
for (const key of keys) {
const avalue = a[key];
const bvalue = b[key];
const avalue = a[key as keyof A];
const bvalue = b[key as keyof B];
if (!deepEqual(avalue, bvalue)) {
return false;
}