Comparing version 0.0.22 to 0.0.23
# code-red changelog | ||
## 0.0.23 | ||
* Unescape sigils in literals ([#16](https://github.com/Rich-Harris/code-red/pull/16)) | ||
## 0.0.22 | ||
@@ -4,0 +8,0 @@ |
@@ -7,2 +7,6 @@ (function (global, factory) { | ||
// generate an ID that is, to all intents and purposes, unique | ||
const id = (Math.round(Math.random() * 1e20)).toString(36); | ||
const re = new RegExp(`_${id}_(?:(\\d+)|(AT)|(HASH))_(\\w+)?`, 'g'); | ||
function handle(node, state) { | ||
@@ -1285,3 +1289,7 @@ const handler = handlers[node.type]; | ||
// str.replace(/\\u(\d{4})/g, (m, n) => String.fromCharCode(+n)) | ||
c(JSON.stringify(node.value), node) | ||
c(JSON.stringify(node.value).replace(re, (_m, _i, at, hash, name) => { | ||
if (at) return '@' + name; | ||
if (hash) return '#' + name; | ||
throw new Error(`this shouldn't happen`); | ||
}), node) | ||
]; | ||
@@ -1387,6 +1395,2 @@ } | ||
// generate an ID that is, to all intents and purposes, unique | ||
const id = (Math.round(Math.random() * 1e20)).toString(36); | ||
const re = new RegExp(`_${id}_(?:(\\d+)|(AT)|(HASH))_(\\w+)?`, 'g'); | ||
const sigils = { | ||
@@ -1393,0 +1397,0 @@ '@': 'AT', |
{ | ||
"name": "code-red", | ||
"description": "code-red", | ||
"version": "0.0.22", | ||
"version": "0.0.23", | ||
"repository": "Rich-Harris/code-red", | ||
@@ -6,0 +6,0 @@ "main": "dist/code-red.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
78930
10
2766