@emotion/cache
Advanced tools
Comparing version 11.13.1 to 11.13.5
@@ -456,3 +456,16 @@ 'use strict'; | ||
var defaultStylisPlugins = [prefixer]; | ||
var getSourceMap; | ||
{ | ||
var sourceMapPattern = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g; | ||
getSourceMap = function getSourceMap(styles | ||
/*: string */ | ||
) { | ||
var matches = styles.match(sourceMapPattern); | ||
if (!matches) return; | ||
return matches[matches.length - 1]; | ||
}; | ||
} | ||
var createCache = function | ||
@@ -578,10 +591,14 @@ /*: EmotionCache */ | ||
if (serialized.map !== undefined) { | ||
currentSheet = { | ||
insert: function insert(rule | ||
/*: string */ | ||
) { | ||
sheet.insert(rule + serialized.map); | ||
} | ||
}; | ||
{ | ||
var sourceMap = getSourceMap(serialized.styles); | ||
if (sourceMap) { | ||
currentSheet = { | ||
insert: function insert(rule | ||
/*: string */ | ||
) { | ||
sheet.insert(rule + sourceMap); | ||
} | ||
}; | ||
} | ||
} | ||
@@ -588,0 +605,0 @@ |
@@ -452,3 +452,16 @@ import { StyleSheet } from '@emotion/sheet'; | ||
var defaultStylisPlugins = [prefixer]; | ||
var getSourceMap; | ||
{ | ||
var sourceMapPattern = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g; | ||
getSourceMap = function getSourceMap(styles | ||
/*: string */ | ||
) { | ||
var matches = styles.match(sourceMapPattern); | ||
if (!matches) return; | ||
return matches[matches.length - 1]; | ||
}; | ||
} | ||
var createCache = function | ||
@@ -574,10 +587,14 @@ /*: EmotionCache */ | ||
if (serialized.map !== undefined) { | ||
currentSheet = { | ||
insert: function insert(rule | ||
/*: string */ | ||
) { | ||
sheet.insert(rule + serialized.map); | ||
} | ||
}; | ||
{ | ||
var sourceMap = getSourceMap(serialized.styles); | ||
if (sourceMap) { | ||
currentSheet = { | ||
insert: function insert(rule | ||
/*: string */ | ||
) { | ||
sheet.insert(rule + sourceMap); | ||
} | ||
}; | ||
} | ||
} | ||
@@ -584,0 +601,0 @@ |
@@ -485,3 +485,16 @@ 'use strict'; | ||
var defaultStylisPlugins = [prefixer]; | ||
var getSourceMap; | ||
{ | ||
var sourceMapPattern = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g; | ||
getSourceMap = function getSourceMap(styles | ||
/*: string */ | ||
) { | ||
var matches = styles.match(sourceMapPattern); | ||
if (!matches) return; | ||
return matches[matches.length - 1]; | ||
}; | ||
} | ||
var createCache = function | ||
@@ -607,10 +620,14 @@ /*: EmotionCache */ | ||
if (serialized.map !== undefined) { | ||
currentSheet = { | ||
insert: function insert(rule | ||
/*: string */ | ||
) { | ||
sheet.insert(rule + serialized.map); | ||
} | ||
}; | ||
{ | ||
var sourceMap = getSourceMap(serialized.styles); | ||
if (sourceMap) { | ||
currentSheet = { | ||
insert: function insert(rule | ||
/*: string */ | ||
) { | ||
sheet.insert(rule + sourceMap); | ||
} | ||
}; | ||
} | ||
} | ||
@@ -673,4 +690,8 @@ | ||
if (serialized.map !== undefined) { | ||
return rules + serialized.map; | ||
{ | ||
var sourceMap = getSourceMap(serialized.styles); | ||
if (sourceMap) { | ||
return rules + sourceMap; | ||
} | ||
} | ||
@@ -677,0 +698,0 @@ |
@@ -483,3 +483,16 @@ 'use strict'; | ||
var defaultStylisPlugins = [prefixer]; | ||
var getSourceMap; | ||
{ | ||
var sourceMapPattern = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g; | ||
getSourceMap = function getSourceMap(styles | ||
/*: string */ | ||
) { | ||
var matches = styles.match(sourceMapPattern); | ||
if (!matches) return; | ||
return matches[matches.length - 1]; | ||
}; | ||
} | ||
var createCache = function | ||
@@ -579,4 +592,8 @@ /*: EmotionCache */ | ||
if (serialized.map !== undefined) { | ||
return rules + serialized.map; | ||
{ | ||
var sourceMap = getSourceMap(serialized.styles); | ||
if (sourceMap) { | ||
return rules + sourceMap; | ||
} | ||
} | ||
@@ -583,0 +600,0 @@ |
@@ -474,3 +474,16 @@ import { StyleSheet } from '@emotion/sheet'; | ||
var defaultStylisPlugins = [prefixer]; | ||
var getSourceMap; | ||
{ | ||
var sourceMapPattern = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g; | ||
getSourceMap = function getSourceMap(styles | ||
/*: string */ | ||
) { | ||
var matches = styles.match(sourceMapPattern); | ||
if (!matches) return; | ||
return matches[matches.length - 1]; | ||
}; | ||
} | ||
var createCache = function | ||
@@ -570,4 +583,8 @@ /*: EmotionCache */ | ||
if (serialized.map !== undefined) { | ||
return rules + serialized.map; | ||
{ | ||
var sourceMap = getSourceMap(serialized.styles); | ||
if (sourceMap) { | ||
return rules + sourceMap; | ||
} | ||
} | ||
@@ -574,0 +591,0 @@ |
@@ -476,3 +476,16 @@ import { StyleSheet } from '@emotion/sheet'; | ||
var defaultStylisPlugins = [prefixer]; | ||
var getSourceMap; | ||
{ | ||
var sourceMapPattern = /\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g; | ||
getSourceMap = function getSourceMap(styles | ||
/*: string */ | ||
) { | ||
var matches = styles.match(sourceMapPattern); | ||
if (!matches) return; | ||
return matches[matches.length - 1]; | ||
}; | ||
} | ||
var createCache = function | ||
@@ -598,10 +611,14 @@ /*: EmotionCache */ | ||
if (serialized.map !== undefined) { | ||
currentSheet = { | ||
insert: function insert(rule | ||
/*: string */ | ||
) { | ||
sheet.insert(rule + serialized.map); | ||
} | ||
}; | ||
{ | ||
var sourceMap = getSourceMap(serialized.styles); | ||
if (sourceMap) { | ||
currentSheet = { | ||
insert: function insert(rule | ||
/*: string */ | ||
) { | ||
sheet.insert(rule + sourceMap); | ||
} | ||
}; | ||
} | ||
} | ||
@@ -664,4 +681,8 @@ | ||
if (serialized.map !== undefined) { | ||
return rules + serialized.map; | ||
{ | ||
var sourceMap = getSourceMap(serialized.styles); | ||
if (sourceMap) { | ||
return rules + sourceMap; | ||
} | ||
} | ||
@@ -668,0 +689,0 @@ |
{ | ||
"name": "@emotion/cache", | ||
"version": "11.13.1", | ||
"version": "11.13.5", | ||
"description": "emotion's cache", | ||
@@ -86,3 +86,3 @@ "main": "dist/emotion-cache.cjs.js", | ||
"@emotion/sheet": "^1.4.0", | ||
"@emotion/utils": "^1.4.0", | ||
"@emotion/utils": "^1.4.2", | ||
"@emotion/weak-memoize": "^0.4.0", | ||
@@ -89,0 +89,0 @@ "stylis": "4.2.0" |
@@ -47,2 +47,13 @@ import { StyleSheet } from '@emotion/sheet' | ||
let getSourceMap | ||
if (isDevelopment) { | ||
let sourceMapPattern = | ||
/\/\*#\ssourceMappingURL=data:application\/json;\S+\s+\*\//g | ||
getSourceMap = (styles /*: string */) => { | ||
let matches = styles.match(sourceMapPattern) | ||
if (!matches) return | ||
return matches[matches.length - 1] | ||
} | ||
} | ||
let createCache = (options /*: Options */) /*: EmotionCache */ => { | ||
@@ -166,6 +177,10 @@ let key = options.key | ||
currentSheet = sheet | ||
if (isDevelopment && serialized.map !== undefined) { | ||
currentSheet = { | ||
insert: (rule /*: string */) => { | ||
sheet.insert(rule + serialized.map) | ||
if (isDevelopment) { | ||
let sourceMap = getSourceMap(serialized.styles) | ||
if (sourceMap) { | ||
currentSheet = { | ||
insert: (rule /*: string */) => { | ||
sheet.insert(rule + sourceMap) | ||
} | ||
} | ||
@@ -216,4 +231,7 @@ } | ||
} | ||
if (isDevelopment && serialized.map !== undefined) { | ||
return rules + serialized.map | ||
if (isDevelopment) { | ||
let sourceMap = getSourceMap(serialized.styles) | ||
if (sourceMap) { | ||
return rules + sourceMap | ||
} | ||
} | ||
@@ -220,0 +238,0 @@ return rules |
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
249053
6726
Updated@emotion/utils@^1.4.2