import { createHash } from "node:crypto"; import type { JavaScriptArtifactFile } from "../../src/domain/javascript/javascriptArtifactFiles.js"; /** Build one included JavaScript artifact from its exact source text. */ export const javaScriptWorkerSource = ( path: string, value: string, ): JavaScriptArtifactFile => ({ path, sha256: createHash("sha256").update(value).digest("hex"), container_sha256: "1".repeat(64), bytes: Buffer.byteLength(value), inventory_artifact_id: "fixture-source", kind: "javascript", unpacked: false, text: { included: true, value }, });