MCPcopy Index your code
hub / github.com/browserify/rustify / iterate

Function iterate

lib/transform.js:61–86  ·  view source on GitHub ↗
(val, done)

Source from the content-addressed store, hash-verified

59 })
60
61 function iterate (val, done) {
62 if (/\.rs$/.test(val.filename)) {
63 handleCode(val)
64 } else {
65 val.filename = path.join(cachedir, 'file.rs')
66 mkdirp(cachedir, function (err) {
67 if (err) return done(err)
68 fs.writeFile(val.filename, val.code, function (err) {
69 if (err) return done(err)
70 handleCode(val)
71 })
72 })
73 }
74
75 function handleCode (val) {
76 rustify(val.filename, val.code, outdir, function (err, buf) {
77 if (err) return done(err)
78 var center = []
79 buf.forEach((c) => center.push(c))
80 var str = `new Uint8Array(${JSON.stringify(center)})`
81
82 val.node.update(str)
83 done()
84 })
85 }
86 }
87
88 function extractNodes (node) {
89 var res = extractTemplateNodes(node)

Callers

nothing calls this directly

Calls 1

handleCodeFunction · 0.85

Tested by

no test coverage detected