MCPcopy
hub / github.com/google/zx / transform

Function transform

scripts/build-js.mjs:112–121  ·  view source on GitHub ↗
(contents, file)

Source from the content-addressed store, hash-verified

110 if: !hybrid,
111 pattern: /\.js$/,
112 transform(contents, file) {
113 const { name } = path.parse(file)
114 const _contents = contents
115 .toString()
116 .replace(
117 '} = __module__',
118 `} = globalThis.Deno ? globalThis.require("./${name}.cjs") : __module__`
119 )
120 return injectCode(_contents, `import "./deno.js"`)
121 },
122 },
123 {
124 on: 'end',

Callers

nothing calls this directly

Calls 2

parseMethod · 0.80
toStringMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…