({id, node, mode}: MarkdownCode, resolvers: Resolvers, params?: Params)
| 481 | // changes, the sha is already included in the transpiled code, and hence will |
| 482 | // likewise be re-evaluated. |
| 483 | function transpileCode({id, node, mode}: MarkdownCode, resolvers: Resolvers, params?: Params): string { |
| 484 | const hash = createHash("sha256"); |
| 485 | for (const f of node.files) hash.update(resolvers.resolveFile(f.name)); |
| 486 | return `${transpileJavaScript(node, {id, mode, params, ...resolvers})} // ${hash.digest("hex")}`; |
| 487 | } |
| 488 | |
| 489 | function getFiles({files, resolveFile}: Resolvers): Map<string, string> { |
| 490 | return new Map(Array.from(files, (f) => [f, resolveFile(f)])); |
no test coverage detected