import { getSchemaTypeNameByName } from "./get-schema-type-name-by-name.js";
import { isMarkActive } from "./is-mark-active.js";
import { isNodeActive } from "./is-node-active.js";
function isActive(state, name, attributes = {}) {
  if (!name) {
    return isNodeActive(state, null, attributes) || isMarkActive(state, null, attributes);
  }
  const schemaType = getSchemaTypeNameByName(name, state.schema);
  if (schemaType === "node") {
    return isNodeActive(state, name, attributes);
  }
  if (schemaType === "mark") {
    return isMarkActive(state, name, attributes);
  }
  return false;
}
export {
  isActive
};
//# sourceMappingURL=is-active.js.map
