patrik-csak/license-plate-serial-generator

View on GitHub
tests/helpers/get-first-matching-pattern.ts

Summary

Maintainability
A
0 mins
Test Coverage
export default function getFirstMatchingPattern(
    string: string,
    pattern: RegExp
): string {
    const match = string.match(pattern);

    return match ? match[0] : '';
}