Skip to content

Commit 3a7d637

Browse files
committed
fix(): fix safe regex types
1 parent 49c4c19 commit 3a7d637

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/resolvers/projectPatterns.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ResolverContextWithUser } from '../types/graphql';
22
import { ApolloError } from 'apollo-server-express';
33
import { ProjectEventGroupingPatternsDBScheme } from '@hawk.so/types';
4-
import { isSafeRegex } from 'safe-regex';
4+
import safe from 'safe-regex';
55

66
/**
77
* Type that represents payload for create project pattern mutation
@@ -73,7 +73,7 @@ function validateNewEventGroupingPattern(
7373
/**
7474
* Check if pattern is safe RegExp
7575
*/
76-
if (!isSafeRegex(newEventGroupingPattern)) {
76+
if (!safe(newEventGroupingPattern)) {
7777
throw new ApolloError('Invalid regular expression pattern');
7878
}
7979

0 commit comments

Comments
 (0)