14 lines
387 B
JavaScript
14 lines
387 B
JavaScript
|
|
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')
|
||
|
|
}
|