Skip to main content

Function: pathSegmentError()

pathSegmentError(args): string | null

Defined in: rowPattern.ts:170

Why a well-formed pattern's path segment names no path: a unit that is not a character's canonical spelling (%41, %2F, %C3 alone, a bare @). null when every path segment names one.

Parameters​

ParameterTypeDescription
args{ names: { ancestors: (value) => string[]; buildName: (args) => string; buildPathAlias: (args) => string; isPathAliasPattern: (args) => boolean; leafType: (parsed) => string; matchPattern: (args) => boolean; parseName: (value) => NameResult<ParsedName>; pathAliasRootType: string | undefined; patternCovers: (args) => boolean; patternError: (pattern) => string | null; patternKinds: (pattern) => SegmentKind[]; patternRegex: (args) => string; patternsOverlap: (args) => boolean; patternTypes: (pattern) => string[]; prefix: string; splitPattern: (pattern) => string[]; }; pattern: string; }-
args.names{ ancestors: (value) => string[]; buildName: (args) => string; buildPathAlias: (args) => string; isPathAliasPattern: (args) => boolean; leafType: (parsed) => string; matchPattern: (args) => boolean; parseName: (value) => NameResult<ParsedName>; pathAliasRootType: string | undefined; patternCovers: (args) => boolean; patternError: (pattern) => string | null; patternKinds: (pattern) => SegmentKind[]; patternRegex: (args) => string; patternsOverlap: (args) => boolean; patternTypes: (pattern) => string[]; prefix: string; splitPattern: (pattern) => string[]; }-
args.names.ancestors(value) => string[]Every ancestor node of a name, itself first, the root last.
args.names.buildName(args) => stringBuilds a name from its containment chain, root first.
args.names.buildPathAlias(args) => stringBuilds a path alias from raw (unencoded) path segments.
args.names.isPathAliasPattern(args) => booleanWhether pattern names path aliases: it names the path node.
args.names.leafType(parsed) => stringThe leaf's type: the last step's, path for an alias.
args.names.matchPattern(args) => booleanTrue when pattern matches name or any of its ancestors.
args.names.parseName(value) => NameResult<ParsedName>Parses a name or a path alias; never a pattern.
args.names.pathAliasRootTypestring | undefined-
args.names.patternCovers(args) => booleanTrue when every name inner reaches, outer reaches. Sound: true is never wrong.
args.names.patternError(pattern) => string | nullValidates a resource pattern; null when it is well formed.
args.names.patternKinds(pattern) => SegmentKind[]The kind of each segment of a well-formed pattern, aligned with splitPattern.
args.names.patternRegex(args) => stringThe regular expression matching exactly the names matchPattern says pattern reaches, for a store that filters rows by it; JavaScript and PostgreSQL (~) read it alike.
args.names.patternsOverlap(args) => booleanTrue when some name is reached by both patterns.
args.names.patternTypes(pattern) => string[]The types a well-formed pattern names literally, for a registry to check.
args.names.prefixstring-
args.names.splitPattern(pattern) => string[]A well-formed pattern's segments, ** among them.
args.patternstring-

Returns​

string | null