import { type DataRef, OrRule, type Rule, type RuleTestResponse, } from '@os-team/lexical-rules'; import QuotedRule from './QuotedRule.js'; /** * The string in any quotes. */ class AnyQuotedRule implements Rule { private readonly rule: Rule; public constructor(rule: Rule) { const quotedRule = new QuotedRule(rule, '"'); const aposQuotedRule = new QuotedRule(rule, "'"); this.rule = new OrRule([quotedRule, aposQuotedRule]); } public test(ref: DataRef, pos: number): RuleTestResponse { return this.rule.test(ref, pos); } } export default AnyQuotedRule;