index.js
function propsNode (node) {
  var props = flatmap(Object.keys(node), function (key) {
    if (key == 'type' || key == 'value' || key == 'children') {
      return;
    }

    var value = node[key];

    if (key == 'data') {
      value = JSON.parse(JSON.stringify(value));
    }

    return {
      type: 'Property',
      key: {
        type: 'Identifier',
        name: key
      },
      value: literalNode(value)
    };
  });

  return props.length && {
    type: 'ObjectExpression',
    properties: props
  };
}
function propsNode (node) {
  var props = flatmap(Object.keys(node), function (key) {
    if (key == 'type' || key == 'value' || key == 'children') {
      return;
    }

    var value = node[key];

    if (key == 'data') {
      value = JSON.parse(JSON.stringify(value));
    }

    return {
      type: 'Property',
      key: {
        type: 'Identifier',
        name: key
      },
      value: literalNode(value)
    };
  });

  return props.length && {
    type: 'ObjectExpression',
    properties: props
  };
}
function propsNode ( node ) { var props = flatmap ( Object . keys ( node ) , function ( key ) { if ( key == 'type' || key == 'value' || key == 'children' ) { return ; } var value = node [ key ] ; if ( key == 'data' ) { value = JSON . parse ( JSON . stringify ( value ) ) ; } return { type : 'Property' , key : { type : 'Identifier' , name : key } , value : literalNode ( value ) } ; } ) ; return props . length && { type : 'ObjectExpression' , properties : props } ; }
Create ESTree object literal node representing Unist node properties.
Create ESTree object literal node representing Unist node properties .