Start of action system re-write

This commit is contained in:
Stefan Zermatten
2021-10-09 12:36:06 +02:00
parent 0097696cc8
commit 0cdec4a429
41 changed files with 783 additions and 119 deletions

View File

@@ -1,4 +1,4 @@
import resolve, { toString, traverse } from '../resolve.js';
import resolve, { toString, traverse, map } from '../resolve.js';
import constant from './constant.js';
const array = {
@@ -41,6 +41,13 @@ const array = {
fn(node);
node.values.forEach(value => traverse(value, fn));
},
map(node, fn){
const resultingNode = fn(node);
if (resultingNode === node){
node.values = node.values.map(value => map(value, fn));
}
return resultingNode;
},
}
export default array;