MCPcopy Index your code
hub / github.com/developit/microbundle / Program

Function Program

src/lib/transform-fast-rest.js:69–91  ·  view source on GitHub ↗
(path, state)

Source from the content-addressed store, hash-verified

67 name: 'transform-fast-rest',
68 visitor: {
69 Program(path, state) {
70 const childState = new Map();
71 const useHelper = state.opts.helper === true; // defaults to false
72
73 if (!useHelper) {
74 let inlineHelper;
75 if (state.opts.literal === false) {
76 inlineHelper = template.expression.ast`Array.prototype.slice`;
77 } else {
78 inlineHelper = template.expression.ast`[].slice`;
79 }
80 childState.set('slice', inlineHelper);
81 }
82
83 path.traverse(VISITOR, childState);
84
85 const name = childState.get('slice');
86 if (name && useHelper) {
87 const helper = slice({ IDENT: name });
88 t.addComment(helper.declarations[0].init, 'leading', '#__PURE__');
89 path.unshiftContainer('body', helper);
90 }
91 },
92 },
93 };
94}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…