@@ -43,7 +43,7 @@ let getSourceMap: ((styles: string) => string | undefined) | undefined
43
43
if ( isDevelopment ) {
44
44
let sourceMapPattern =
45
45
/ \/ \* # \s s o u r c e M a p p i n g U R L = d a t a : a p p l i c a t i o n \/ j s o n ; \S + \s + \* \/ / g
46
- getSourceMap = ( styles /*: string */ ) => {
46
+ getSourceMap = styles => {
47
47
let matches = styles . match ( sourceMapPattern )
48
48
if ( ! matches ) return
49
49
return matches [ matches . length - 1 ]
@@ -69,14 +69,14 @@ let createCache = (options: Options): EmotionCache => {
69
69
// document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)
70
70
// note this very very intentionally targets all style elements regardless of the key to ensure
71
71
// that creating a cache works inside of render of a React component
72
- Array . prototype . forEach . call ( ssrStyles , ( node /* : HTMLStyleElement */ ) => {
72
+ Array . prototype . forEach . call ( ssrStyles , ( node : HTMLStyleElement ) => {
73
73
// we want to only move elements which have a space in the data-emotion attribute value
74
74
// because that indicates that it is an Emotion 11 server-side rendered style elements
75
75
// while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector
76
76
// Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)
77
77
// so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles
78
78
// will not result in the Emotion 10 styles being destroyed
79
- const dataEmotionAttribute = node . getAttribute ( 'data-emotion' )
79
+ const dataEmotionAttribute = node . getAttribute ( 'data-emotion' ) !
80
80
if ( dataEmotionAttribute . indexOf ( ' ' ) === - 1 ) {
81
81
return
82
82
}
@@ -168,7 +168,7 @@ let createCache = (options: Options): EmotionCache => {
168
168
let sourceMap = getSourceMap ( serialized . styles )
169
169
if ( sourceMap ) {
170
170
currentSheet = {
171
- insert : ( rule /*: string */ ) => {
171
+ insert : rule => {
172
172
sheet . insert ( rule + sourceMap )
173
173
}
174
174
}
0 commit comments