safe-stable-stringify
Advanced tools
Comparing version 2.3.0 to 2.3.1
# Changelog | ||
## v2.3.1 | ||
- Fix `invalid regexp group` error in browsers or environments that do not support the negative lookbehind regular expression assertion. | ||
## v2.3.0 | ||
@@ -4,0 +8,0 @@ |
@@ -21,5 +21,5 @@ 'use strict' | ||
// eslint-disable-next-line | ||
const strEscapeSequencesRegExp = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/ | ||
const strEscapeSequencesRegExp = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/ | ||
// eslint-disable-next-line | ||
const strEscapeSequencesReplacer = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?<![\ud800-\udbff])[\udc00-\udfff]/g | ||
const strEscapeSequencesReplacer = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/g | ||
@@ -44,2 +44,6 @@ // Escaped special characters. Use empty strings to fill up unused entries. | ||
function escapeFn (str) { | ||
if (str.length === 2) { | ||
const charCode = str.charCodeAt(1) | ||
return `${str[0]}\\u${charCode.toString(16)}` | ||
} | ||
const charCode = str.charCodeAt(0) | ||
@@ -46,0 +50,0 @@ return meta.length > charCode |
{ | ||
"name": "safe-stable-stringify", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"description": "Deterministic and safely JSON.stringify to quickly serialize JavaScript objects", | ||
@@ -5,0 +5,0 @@ "exports": { |
33288
620