The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/server/lib/ldap/operations/substring.ts

13 lines
430 B

export type LDAPVariableSubString = {
operation: 'substring';
start: number;
end?: number;
};
export function executeSubstring(input: string, operation: LDAPVariableSubString): string | undefined {
if (typeof operation.start !== 'number' || (operation.end !== undefined && typeof operation.end !== 'number')) {
throw new Error('Invalid SUBSTRING operation.');
}
return input.substring(operation.start, operation.end);
}