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

Commit

Permalink
Decaf escape-helper
Browse files Browse the repository at this point in the history
  • Loading branch information
sadick254 committed Oct 30, 2020
1 parent a0fbdbd commit ef1e7f3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
13 changes: 0 additions & 13 deletions lib/escape-helper.coffee

This file was deleted.

17 changes: 17 additions & 0 deletions lib/escape-helper.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module.exports = {
unescapeEscapeSequence(string) {
return string.replace(/\\(.)/gm, function(match, char) {
if (char === 't') {
return '\t';
} else if (char === 'n') {
return '\n';
} else if (char === 'r') {
return '\r';
} else if (char === '\\') {
return '\\';
} else {
return match;
}
});
}
};

0 comments on commit ef1e7f3

Please sign in to comment.