Create a type predicate function that checks if input is a string matching the given pattern.
input
pattern
const isHexColor = matching(/^#[0-9a-f]{6}$/i);isHexColor('#ff0000'); // trueisHexColor('red'); // false Copy
const isHexColor = matching(/^#[0-9a-f]{6}$/i);isHexColor('#ff0000'); // trueisHexColor('red'); // false
Create a type predicate function that checks if
inputis a string matching the givenpattern.