Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit ef1e7f3

Browse files
committed
Decaf escape-helper
1 parent a0fbdbd commit ef1e7f3

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

lib/escape-helper.coffee

Lines changed: 0 additions & 13 deletions
This file was deleted.

lib/escape-helper.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module.exports = {
2+
unescapeEscapeSequence(string) {
3+
return string.replace(/\\(.)/gm, function(match, char) {
4+
if (char === 't') {
5+
return '\t';
6+
} else if (char === 'n') {
7+
return '\n';
8+
} else if (char === 'r') {
9+
return '\r';
10+
} else if (char === '\\') {
11+
return '\\';
12+
} else {
13+
return match;
14+
}
15+
});
16+
}
17+
};

0 commit comments

Comments
 (0)