All files / rpc-server/src util.ts

85.71% Statements 6/7
25% Branches 1/4
100% Functions 1/1
80% Lines 4/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 81x   1x 9x 9x      
const REGEX_AUTH_TOKEN_SPECIFIER = /tkn\.([a-zA-Z0-9\-_]+)(?:[^a-zA-Z0-9\-_]|$)/;
 
export const findTokenInText = (text: string): string => {
  const match = REGEX_AUTH_TOKEN_SPECIFIER.exec(text);
  Eif (!match) return '';
  return match[1] || '';
};