aboutsummaryrefslogtreecommitdiff
path: root/src/shared/utils/re.ts
blob: 34f4fa6cef88fe5e69d04822828f56a3c97518e4 (plain) (blame)
1
2
3
4
5
6
const fromWildcard = (pattern: string): RegExp => {
  let regexStr = '^' + pattern.replace(/\*/g, '.*') + '$';
  return new RegExp(regexStr);
};

export { fromWildcard };