Files
X-Financial/web/tests/helpers/sourceSurface.mjs

14 lines
387 B
JavaScript
Raw Normal View History

import { readFileSync } from 'node:fs'
import { fileURLToPath } from 'node:url'
export function readSourceFile(relativePath) {
return readFileSync(
fileURLToPath(new URL(`../../src/${relativePath}`, import.meta.url)),
'utf8'
)
}
export function readSourceSurface(relativePaths = []) {
return relativePaths.map((relativePath) => readSourceFile(relativePath)).join('\n')
}