MCPcopy Create free account
hub / github.com/RubyLouvre/anu / build

Function build

test/babel.js:9390–9426  ·  view source on GitHub ↗
(props, scope, state)

Source from the content-addressed store, hash-verified

9388 }
9389
9390 function build(props, scope, state) {
9391 var nodes = [];
9392
9393 var _props = [];
9394
9395 function push() {
9396 if (!_props.length) return;
9397 nodes.push(t.arrayExpression(_props));
9398 _props = [];
9399 }
9400
9401 for (var _iterator = props, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
9402 var _ref2;
9403
9404 if (_isArray) {
9405 if (_i >= _iterator.length) break;
9406 _ref2 = _iterator[_i++];
9407 } else {
9408 _i = _iterator.next();
9409 if (_i.done) break;
9410 _ref2 = _i.value;
9411 }
9412
9413 var prop = _ref2;
9414
9415 if (t.isSpreadElement(prop)) {
9416 push();
9417 nodes.push(getSpreadLiteral(prop, scope, state));
9418 } else {
9419 _props.push(prop);
9420 }
9421 }
9422
9423 push();
9424
9425 return nodes;
9426 }
9427
9428 return {
9429 visitor: {

Callers 2

wrapFunction · 0.85
babel.jsFile · 0.85

Calls 2

getSpreadLiteralFunction · 0.85
pushFunction · 0.70

Tested by

no test coverage detected