Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
isConnectorToken(source: string): boolean {
return (source === "" ||
RegExpUtility.getFirstMatchIndex(this.prepositionRegex, source).matched ||
RegExpUtility.getFirstMatchIndex(this.connectorRegex, source).matched);
}
}
getBetweenTokenIndex(text: string): { matched: boolean; index: number; } {
return RegExpUtility.getFirstMatchIndex(this.beforeRegex, text);
}
}
getBetweenTokenIndex(source: string): { matched: boolean; index: number; } {
return RegExpUtility.getFirstMatchIndex(this.betweenRegex, source);
}
getSwiftDayOrMonth(source: string): number {
let trimedText = source.trim().toLowerCase();
let swift = 0;
if (RegExpUtility.getFirstMatchIndex(this.nextPrefixRegex, trimedText).matched) {
swift = 1;
}
if (RegExpUtility.getFirstMatchIndex(this.previousPrefixRegex, trimedText).matched) {
swift = -1;
}
return swift;
}
isConnectorToken(source: string): boolean {
let trimmed = source.trim();
return trimmed === ""
|| RegExpUtility.getFirstMatchIndex(this.prepositionRegex, source).matched
|| RegExpUtility.getFirstMatchIndex(this.connectorRegex, source).matched;
}
}
getBetweenTokenIndex(source: string): { matched: boolean; index: number; } {
return RegExpUtility.getFirstMatchIndex(this.beforeRegex, source);
}
getSwiftYear(source: string): number {
let trimedText = source.trim().toLowerCase();
let swift = -10;
if (RegExpUtility.getFirstMatchIndex(this.nextPrefixRegex, trimedText).matched) {
swift = 1;
}
if (RegExpUtility.getFirstMatchIndex(this.previousPrefixRegex, trimedText).matched) {
swift = -1;
}
else if (RegExpUtility.getFirstMatchIndex(this.thisPrefixRegex, trimedText).matched) {
swift = 0;
}
return swift;
}
getFromTokenIndex(text: string): { matched: boolean; index: number; } {
return RegExpUtility.getFirstMatchIndex(this.fromRegex, text);
}
getFromTokenIndex(source: string): { matched: boolean; index: number; } {
return RegExpUtility.getFirstMatchIndex(this.fromRegex, source);
}
isLastCardinal(source: string): boolean {
let trimedText = source.trim().toLowerCase();
return RegExpUtility.getFirstMatchIndex(this.previousPrefixRegex, trimedText).matched;
}
}