"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.hasAlignment = hasAlignment;

function hasAlignment(state, alignment) {
  var _state$selection = state.selection,
      from = _state$selection.from,
      to = _state$selection.to;
  var has = false;
  state.doc.nodesBetween(from, to, function (node) {
    if (has) return false;
    if (node.attrs.textAlign === alignment) has = true;
    return !has;
  });
  return has;
}