function transform(node) {
  /**
   * Combine adjacent text and inline nodes before processing so they can
   * share marks.
   */
  const combinedChildren = node.nodes && combineTextAndInline(node.nodes);

  /**
   * Call `transform` recursively on child nodes, and flatten the resulting
   * array.
   */
  const children = !isEmpty(combinedChildren) && flatMap(combinedChildren, transform);

  /**
   * Run individual nodes through conversion factories.
   */
  return ['text'].includes(node.object) ? convertTextNode(node) : convertNode(node, children);
}
function transform(node) {
  /**
   * Combine adjacent text and inline nodes before processing so they can
   * share marks.
   */
  const combinedChildren = node.nodes && combineTextAndInline(node.nodes);

  /**
   * Call `transform` recursively on child nodes, and flatten the resulting
   * array.
   */
  const children = !isEmpty(combinedChildren) && flatMap(combinedChildren, transform);

  /**
   * Run individual nodes through conversion factories.
   */
  return ['text'].includes(node.object) ? convertTextNode(node) : convertNode(node, children);
}
function transform ( node ) { /**
   * Combine adjacent text and inline nodes before processing so they can
   * share marks.
   */ const combinedChildren = node . nodes && combineTextAndInline ( node . nodes ) ; /**
   * Call `transform` recursively on child nodes, and flatten the resulting
   * array.
   */ const children = ! isEmpty ( combinedChildren ) && flatMap ( combinedChildren , transform ) ; /**
   * Run individual nodes through conversion factories.
   */ return [ 'text' ] . includes ( node . object ) ? convertTextNode ( node ) : convertNode ( node , children ) ; }
The transform function mimics the approach of a Remark plugin for
conformity with the other serialization functions. This function converts
Slate nodes to MDAST nodes, and recursively calls itself to process child
nodes to arbitrary depth.
The transform function mimics the approach of a Remark plugin for conformity with the other serialization functions . This function converts Slate nodes to MDAST nodes and recursively calls itself to process child nodes to arbitrary depth .
Transform a node recursively.