MCPcopy Create free account
hub / github.com/rollup/plugins / tryParse

Function tryParse

packages/commonjs/src/parse.js:1–8  ·  view source on GitHub ↗
(parse, code, id)

Source from the content-addressed store, hash-verified

1export function tryParse(parse, code, id) {
2 try {
3 return parse(code, { allowReturnOutsideFunction: true });
4 } catch (err) {
5 err.message += ` in ${id}`;
6 throw err;
7 }
8}
9
10const firstpassGlobal = /\b(?:require|module|exports|global)\b/;
11

Callers 2

transformCommonjsFunction · 0.90

Calls 1

parseFunction · 0.85

Tested by

no test coverage detected