forked from mathiasbynens/jsesc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes mathiasbynens#47 enable escaping to extended ascii
- Loading branch information
Showing
6 changed files
with
138 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
'use strict'; | ||
|
||
const regenerate = require('regenerate'); | ||
const fs = require('fs'); | ||
|
||
const set = regenerate() | ||
.addRange(0x20, 0x7E) // printable ASCII symbols | ||
.remove('"') // not `"` | ||
.remove('\'') // not `'` | ||
.remove('\\') // not `\` | ||
.remove('`'); // not '`' | ||
function createAsciiSet() { | ||
return regenerate() | ||
.addRange(0x20, 0x7E) // printable ASCII symbols | ||
.remove('"') // not `"` | ||
.remove('\'') // not `'` | ||
.remove('\\') // not `\` | ||
.remove('`'); // not '`' | ||
} | ||
|
||
const set = createAsciiSet(); | ||
|
||
const extendedSet = createAsciiSet() | ||
.addRange(0x80, 0xFE); // printable extended ASCII symbols | ||
|
||
module.exports = { | ||
'whitelist': set.toString(), | ||
'whitelistExtended': extendedSet.toString(), | ||
'version': require('../package.json').version | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters