MCPcopy
hub / github.com/codesandbox/codesandbox-client / build

Function build

packages/app/static/js/babel.6.26.js:9141–9177  ·  view source on GitHub ↗
(props, scope, state)

Source from the content-addressed store, hash-verified

9139 }
9140
9141 function build(props, scope, state) {
9142 var nodes = [];
9143
9144 var _props = [];
9145
9146 function push() {
9147 if (!_props.length) return;
9148 nodes.push(t.arrayExpression(_props));
9149 _props = [];
9150 }
9151
9152 for (var _iterator = props, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
9153 var _ref2;
9154
9155 if (_isArray) {
9156 if (_i >= _iterator.length) break;
9157 _ref2 = _iterator[_i++];
9158 } else {
9159 _i = _iterator.next();
9160 if (_i.done) break;
9161 _ref2 = _i.value;
9162 }
9163
9164 var prop = _ref2;
9165
9166 if (t.isSpreadElement(prop)) {
9167 push();
9168 nodes.push(getSpreadLiteral(prop, scope, state));
9169 } else {
9170 _props.push(prop);
9171 }
9172 }
9173
9174 push();
9175
9176 return nodes;
9177 }
9178
9179 return {
9180 visitor: {

Callers 2

wrapFunction · 0.70
babel.6.26.jsFile · 0.70

Calls 4

getSpreadLiteralFunction · 0.85
pushMethod · 0.80
pushFunction · 0.70
nextMethod · 0.45

Tested by

no test coverage detected