MCPcopy
hub / github.com/protectwise/troika / stringifyFunction

Function stringifyFunction

packages/troika-worker-utils/src/WorkerModules.js:121–128  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

119 * @param fn
120 */
121export function stringifyFunction(fn) {
122 let str = fn.toString()
123 // If it was defined in object method/property format, it needs to be modified
124 if (!/^function/.test(str) && /^\w+\s*\(/.test(str)) {
125 str = 'function ' + str
126 }
127 return str
128}
129
130
131function getWorker(workerId) {

Callers 2

defineWorkerModuleFunction · 0.85
getWorkerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected