umd/fieldstack.js
/**
   * Converts from a tree raw state back to  draft raw state
   */
Converts from a tree raw state back to  draft raw state
Converts from a tree raw state back to draft raw state
function fromRawTreeStateToRawState(draftTreeState) {
    var blocks = draftTreeState.blocks;
    var transformedBlocks = [];
    !Array.isArray(blocks) ? invariant_1(false, 'Invalid raw state') : void 0;
    if (!Array.isArray(blocks) || !blocks.length) {
      return draftTreeState;
    }
    traverseInDepthOrder(blocks, function (block) {
      var newBlock = _extends$10({}, block);
      if (isListBlock(block)) {
        newBlock.depth = newBlock.depth || 0;
        addDepthToChildren(block);
      }
      delete newBlock.children;
      transformedBlocks.push(newBlock);
    });
    draftTreeState.blocks = transformedBlocks;
    return _extends$10({}, draftTreeState, {
      blocks: transformedBlocks
    });
  }
function fromRawTreeStateToRawState ( draftTreeState ) { var blocks = draftTreeState . blocks ; var transformedBlocks = [ ] ; ! Array . isArray ( blocks ) ? invariant_1 ( false , 'Invalid raw state' ) : void 0 ; if ( ! Array . isArray ( blocks ) || ! blocks . length ) { return draftTreeState ; } traverseInDepthOrder ( blocks , function ( block ) { var newBlock = _extends$10 ( { } , block ) ; if ( isListBlock ( block ) ) { newBlock . depth = newBlock . depth || 0 ; addDepthToChildren ( block ) ; } delete newBlock . children ; transformedBlocks . push ( newBlock ) ; } ) ; draftTreeState . blocks = transformedBlocks ; return _extends$10 ( { } , draftTreeState , { blocks : transformedBlocks } ) ; }
Converts from a tree raw state back to  draft raw state
Converts from a tree raw state back to draft raw state