Start of action system re-write
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user