MCPcopy Create free account
hub / github.com/documentationjs/documentation / toComment

Function toComment

__tests__/lib/infer/return.js:5–13  ·  view source on GitHub ↗
(fn, filename)

Source from the content-addressed store, hash-verified

3import parse from '../../../src/parsers/javascript';
4
5function toComment(fn, filename) {
6 return parse(
7 {
8 file: filename,
9 source: fn instanceof Function ? '(' + fn.toString() + ')' : fn
10 },
11 {}
12 )[0];
13}
14
15function evaluate(code, filename) {
16 return inferReturn(toComment(code, filename));

Callers 1

evaluateFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected