lib/validators/axis_specifier.ts
import {
AxisSpecifier,
ANCESTOR,
ANCESTOR_OR_SELF,
ATTRIBUTE,
CHILD,
DESCENDANT,
DESCENDANT_OR_SELF,
FOLLOWING,
FOLLOWING_SIBLING,
NAMESPACE,
PARENT,
PRECEDING,
PRECEDING_SIBLING,
SELF
} from "../axis_specifier";
export function isValid (specifier: string): specifier is AxisSpecifier {
return specifier == ANCESTOR ||
specifier == ANCESTOR_OR_SELF ||
specifier == ATTRIBUTE ||
specifier == CHILD ||
specifier == DESCENDANT ||
specifier == DESCENDANT_OR_SELF ||
specifier == FOLLOWING ||
specifier == FOLLOWING_SIBLING ||
specifier == NAMESPACE ||
specifier == PARENT ||
specifier == PRECEDING ||
specifier == PRECEDING_SIBLING ||
specifier == SELF;
}