getArguments.js 370 B

12345678910111213141516171819202122
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. exports.default = getArguments;
  6. function getArguments(node) {
  7. const list = [[]];
  8. for (const child of node.nodes) {
  9. if (child.type !== 'div') {
  10. list[list.length - 1].push(child);
  11. } else {
  12. list.push([]);
  13. }
  14. }
  15. return list;
  16. }
  17. module.exports = exports.default;