parent
08ac66a656
commit
a20fc3c111
1 changed files with 2 additions and 8 deletions
|
|
@ -1,5 +1,3 @@
|
|||
const UNICODE_ESCAPE_PATTERN = /\\u([0-9a-f]{4})/gi;
|
||||
|
||||
function alias(rule, value) {
|
||||
const result = {
|
||||
type: "ALIAS",
|
||||
|
|
@ -172,12 +170,8 @@ function normalize(value) {
|
|||
};
|
||||
case RegExp:
|
||||
return {
|
||||
type: 'PATTERN',
|
||||
value: value.source
|
||||
.replace(
|
||||
UNICODE_ESCAPE_PATTERN,
|
||||
(match, group) => String.fromCharCode(parseInt(group, 16))
|
||||
)
|
||||
type: 'PATTERN',
|
||||
value: value.source
|
||||
};
|
||||
case ReferenceError:
|
||||
throw value
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue