MCPcopy
hub / github.com/lebab/lebab / createDestructPattern

Function createDestructPattern

src/transform/destructParam.js:124–129  ·  view source on GitHub ↗
(exs)

Source from the content-addressed store, hash-verified

122// and parsing it with Recast and extracting the ObjectPatter node.
123// Feeding this back to Recast will preserve the formatting.
124function createDestructPattern(exs) {
125 const props = uniqPropNames(exs).join(', ');
126 const js = `function foo({${props}}) {};`;
127 const ast = parse(js, {parser});
128 return ast.program.body[0].params[0];
129}

Callers 1

enterFunction · 0.85

Calls 2

uniqPropNamesFunction · 0.85
parseFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…