From b99e9207ac3b2346e105c4ab859a8c7932c855ea Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Fri, 4 Aug 2017 13:59:33 -0400 Subject: [PATCH] reuse helper --- src/utils/stringify.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/stringify.ts b/src/utils/stringify.ts index 01eff61eba..c16ac7a937 100644 --- a/src/utils/stringify.ts +++ b/src/utils/stringify.ts @@ -1,5 +1,5 @@ export function stringify(data: string) { - return JSON.stringify(data.replace(/([^\\@#])?([@#])/g, '$1\\$2')); + return JSON.stringify(escape(data)); } export function escape(data: string) {