.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / postcss-value-parser / lib / walk.js
1 module.exports = function walk(nodes, cb, bubble) {
2   var i, max, node, result;
3
4   for (i = 0, max = nodes.length; i < max; i += 1) {
5     node = nodes[i];
6     if (!bubble) {
7       result = cb(node, i, nodes);
8     }
9
10     if (
11       result !== false &&
12       node.type === "function" &&
13       Array.isArray(node.nodes)
14     ) {
15       walk(node.nodes, cb, bubble);
16     }
17
18     if (bubble) {
19       cb(node, i, nodes);
20     }
21   }
22 };