@emotion/serialize
Advanced tools
Comparing version 0.11.9 to 0.11.10
# @emotion/serialize | ||
## 0.11.10 | ||
### Patch Changes | ||
- [66cda641](https://github.com/emotion-js/emotion/commit/66cda64128631790b81e3c9df273a972358ea593) [#1478](https://github.com/emotion-js/emotion/pull/1478) Thanks [@Andarist](https://github.com/Andarist)! - Add warnings about using illegal escape sequences | ||
## 0.11.9 | ||
@@ -4,0 +10,0 @@ |
@@ -11,2 +11,3 @@ 'use strict'; | ||
var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences"; | ||
var hyphenateRegex = /[A-Z]|^ms/g; | ||
@@ -71,4 +72,4 @@ var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g; | ||
hyphenatedCache[key] = true; | ||
console.error("Using kebab-case for css properties in objects is not supported. Did you mean " + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, char) { | ||
return char.toUpperCase(); | ||
console.error("Using kebab-case for css properties in objects is not supported. Did you mean " + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, _char) { | ||
return _char.toUpperCase(); | ||
}) + "?"); | ||
@@ -246,2 +247,6 @@ } | ||
} else { | ||
if (process.env.NODE_ENV !== 'production' && strings[0] === undefined) { | ||
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR); | ||
} | ||
styles += strings[0]; | ||
@@ -255,2 +260,6 @@ } // we start at 1 since we've already handled the first arg | ||
if (stringMode) { | ||
if (process.env.NODE_ENV !== 'production' && strings[i] === undefined) { | ||
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR); | ||
} | ||
styles += strings[i]; | ||
@@ -257,0 +266,0 @@ } |
@@ -5,2 +5,3 @@ import hashString from '@emotion/hash'; | ||
var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences"; | ||
var hyphenateRegex = /[A-Z]|^ms/g; | ||
@@ -65,4 +66,4 @@ var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g; | ||
hyphenatedCache[key] = true; | ||
console.error("Using kebab-case for css properties in objects is not supported. Did you mean " + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, char) { | ||
return char.toUpperCase(); | ||
console.error("Using kebab-case for css properties in objects is not supported. Did you mean " + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, _char) { | ||
return _char.toUpperCase(); | ||
}) + "?"); | ||
@@ -240,2 +241,6 @@ } | ||
} else { | ||
if (process.env.NODE_ENV !== 'production' && strings[0] === undefined) { | ||
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR); | ||
} | ||
styles += strings[0]; | ||
@@ -249,2 +254,6 @@ } // we start at 1 since we've already handled the first arg | ||
if (stringMode) { | ||
if (process.env.NODE_ENV !== 'production' && strings[i] === undefined) { | ||
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR); | ||
} | ||
styles += strings[i]; | ||
@@ -251,0 +260,0 @@ } |
@@ -11,2 +11,3 @@ 'use strict'; | ||
var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences"; | ||
var hyphenateRegex = /[A-Z]|^ms/g; | ||
@@ -71,4 +72,4 @@ var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g; | ||
hyphenatedCache[key] = true; | ||
console.error("Using kebab-case for css properties in objects is not supported. Did you mean " + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, char) { | ||
return char.toUpperCase(); | ||
console.error("Using kebab-case for css properties in objects is not supported. Did you mean " + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, _char) { | ||
return _char.toUpperCase(); | ||
}) + "?"); | ||
@@ -246,2 +247,6 @@ } | ||
} else { | ||
if (process.env.NODE_ENV !== 'production' && strings[0] === undefined) { | ||
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR); | ||
} | ||
styles += strings[0]; | ||
@@ -255,2 +260,6 @@ } // we start at 1 since we've already handled the first arg | ||
if (stringMode) { | ||
if (process.env.NODE_ENV !== 'production' && strings[i] === undefined) { | ||
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR); | ||
} | ||
styles += strings[i]; | ||
@@ -257,0 +266,0 @@ } |
@@ -5,2 +5,3 @@ import hashString from '@emotion/hash'; | ||
var ILLEGAL_ESCAPE_SEQUENCE_ERROR = "You have illegal escape sequence in your template literal, most likely inside content's property value.\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \"content: '\\00d7';\" should become \"content: '\\\\00d7';\".\nYou can read more about this here:\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences"; | ||
var hyphenateRegex = /[A-Z]|^ms/g; | ||
@@ -65,4 +66,4 @@ var animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g; | ||
hyphenatedCache[key] = true; | ||
console.error("Using kebab-case for css properties in objects is not supported. Did you mean " + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, char) { | ||
return char.toUpperCase(); | ||
console.error("Using kebab-case for css properties in objects is not supported. Did you mean " + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, _char) { | ||
return _char.toUpperCase(); | ||
}) + "?"); | ||
@@ -240,2 +241,6 @@ } | ||
} else { | ||
if (process.env.NODE_ENV !== 'production' && strings[0] === undefined) { | ||
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR); | ||
} | ||
styles += strings[0]; | ||
@@ -249,2 +254,6 @@ } // we start at 1 since we've already handled the first arg | ||
if (stringMode) { | ||
if (process.env.NODE_ENV !== 'production' && strings[i] === undefined) { | ||
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR); | ||
} | ||
styles += strings[i]; | ||
@@ -251,0 +260,0 @@ } |
{ | ||
"name": "@emotion/serialize", | ||
"version": "0.11.9", | ||
"version": "0.11.10", | ||
"description": "serialization utils for emotion", | ||
@@ -5,0 +5,0 @@ "main": "dist/serialize.cjs.js", |
@@ -11,2 +11,7 @@ // @flow | ||
const ILLEGAL_ESCAPE_SEQUENCE_ERROR = `You have illegal escape sequence in your template literal, most likely inside content's property value. | ||
Because you write your CSS inside a JavaScript string you actually have to do double escaping, so for example "content: '\\00d7';" should become "content: '\\\\00d7';". | ||
You can read more about this here: | ||
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences` | ||
let hyphenateRegex = /[A-Z]|^ms/g | ||
@@ -325,2 +330,5 @@ let animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g | ||
} else { | ||
if (process.env.NODE_ENV !== 'production' && strings[0] === undefined) { | ||
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR) | ||
} | ||
styles += strings[0] | ||
@@ -337,2 +345,5 @@ } | ||
if (stringMode) { | ||
if (process.env.NODE_ENV !== 'production' && strings[i] === undefined) { | ||
console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR) | ||
} | ||
styles += strings[i] | ||
@@ -339,0 +350,0 @@ } |
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
62289
1595
57