Skip to content

Commit

Permalink
Don't unescape regex for now
Browse files Browse the repository at this point in the history
  • Loading branch information
thymikee committed Feb 9, 2017
1 parent e69d5ae commit 49fd771
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/jest-snapshot/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,8 @@ const serialize = (data: any): string => {
}));
};

const unescape = (data: any): string => {
return data
.replace(/\\(")/g, '$1') // unescape double quotes
.replace(/\\([\\^$*+?.()|[\]{}])/g, '$1'); // then unescape RegExp
};
const unescape = (data: any): string =>
data.replace(/\\(")/g, '$1'); // unescape double quotes

const printBacktickString = (str: string) => {
return '`' + str.replace(/`|\\|\${/g, '\\$&') + '`';
Expand Down

0 comments on commit 49fd771

Please sign in to comment.