Blame view

天文台pc/tianwentai-ui/node_modules/dom-helpers/cjs/collectElements.js 386 Bytes
bc518174   王天杨   提交两个项目文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  "use strict";
  
  exports.__esModule = true;
  exports.default = collectElements;
  
  function collectElements(node, direction) {
    var nextNode = null;
    var nodes = [];
    nextNode = node ? node[direction] : null;
  
    while (nextNode && nextNode.nodeType !== 9) {
      nodes.push(nextNode);
      nextNode = nextNode[direction] || null;
    }
  
    return nodes;
  }
  
  module.exports = exports["default"];