alks
Version:
CLI for working with ALKS
13 lines (11 loc) • 332 B
text/typescript
import { getAccountRegex } from './getAccountRegex';
export function tryToExtractRole(account: string): string | undefined {
let match;
while ((match = getAccountRegex().exec(account))) {
if (match && account.indexOf('ALKS_') === -1) {
// ignore legacy accounts
return match[4];
}
}
return undefined;
}