You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

19 lines
324 B

'use strict';
var visit = require('unist-util-visit');
module.exports = removePosition;
/* Remove `position`s from `tree`. */
function removePosition(node, force) {
visit(node, force ? hard : soft);
return node;
}
function hard(node) {
delete node.position;
}
function soft(node) {
node.position = undefined;
}