function Changeset(ops, oldLen, optAuthorId, optNewLen) {
  this._ops = ops;
  this._oldLen = oldLen;
  this._authorId = optAuthorId;
  this._newLen = optNewLen;
  if(this._newLen == undefined) {
    var dLen = this._ops.reduce(function(prev, next) {
      return prev + next.deltaLen();
    }, 0);

    this._newLen = oldLen + dLen;
  }
}
/*
 * Construct a new changeset object. Usually changesets are not created directly, but by a Builder.
 *
 * @param {ComponentList} ops - a list of operations
 * @param {Number} oldLen - old len of the document that changeset is applied to
 * @param? {string} optAuthorId - optional author of the changeset
 * @param? {Number} optNewLen - optional length of the document after applied changeset. If not supplied,
 *                              will be calculated from the changeset data.
 */
Construct a new changeset object. Usually changesets are not created directly, but by a Builder.
@param {ComponentList} ops - a list of operations
@param {Number} oldLen - old len of the document that changeset is applied to
@param. {string} optAuthorId - optional author of the changeset
@param. {Number} optNewLen - optional length of the document after applied changeset. If not supplied,
will be calculated from the changeset data.
Construct a new changeset object . Usually changesets are not created directly but by a Builder . @param { ComponentList } ops - a list of operations @param { Number } oldLen - old len of the document that changeset is applied to @param . { string } optAuthorId - optional author of the changeset @param . { Number } optNewLen - optional length of the document after applied changeset . If not supplied will be calculated from the changeset data .
function Changeset(ops, oldLen, optAuthorId, optNewLen) {
  this._ops = ops;
  this._oldLen = oldLen;
  this._authorId = optAuthorId;
  this._newLen = optNewLen;
  if(this._newLen == undefined) {
    var dLen = this._ops.reduce(function(prev, next) {
      return prev + next.deltaLen();
    }, 0);
    this._newLen = oldLen + dLen;
  }
}
function Changeset ( ops , oldLen , optAuthorId , optNewLen ) { this . _ops = ops ; this . _oldLen = oldLen ; this . _authorId = optAuthorId ; this . _newLen = optNewLen ; if ( this . _newLen == undefined ) { var dLen = this . _ops . reduce ( function ( prev , next ) { return prev + next . deltaLen ( ) ; } , 0 ) ; this . _newLen = oldLen + dLen ; } }
Construct a new changeset object.
Construct a new changeset object .