Restructure project files

This commit is contained in:
ewin 2025-07-29 19:04:14 -04:00
parent 107fa221c9
commit 8f07661fb2
Signed by: erin
SSH key fingerprint: SHA256:swjoHhREbZPbWe+gyJNi24d4NAxJSyUIm3fpZj4z3wc
6 changed files with 6 additions and 5 deletions

View file

@ -1,30 +0,0 @@
// misc helpers
import {execSync} from 'node:child_process';
/**
* Converts a string from UTF-8 to base64.
* @param {string} str
* @returns {string}
*/
const toBase64 = str => Buffer.from(str, 'utf-8').toString('base64');
/**
* terrible terrible terrible string diff helper for debugging
* @param {string} a
* @param {string} b
*/
export function diff (a, b) {
// base64 input strings before passing to shell to avoid escaping issues
// https://stackoverflow.com/a/60221847
// use tail to cut off useless file info lines
execSync(String.raw`bash <<- EOF
diff --color=always -u \
<(echo "${toBase64(a)}" | base64 -d) \
<(echo "${toBase64(b)}" | base64 -d) \
| tail -n +3
EOF`, {
// display result directly in terminal
stdio: 'inherit',
});
}