Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@emotion/core

Package Overview
Dependencies
Maintainers
2
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@emotion/core - npm Package Compare versions

Comparing version 0.4.1 to 0.5.0

30

dist/index.cjs.js

@@ -11,29 +11,12 @@ 'use strict';

var hydration = {
shouldHydrate: false
};
if (utils.isBrowser) {
hydration.shouldHydrate = !!document.querySelector('[data-more]');
}
function _set() {}
function _get() {
return true;
}
if (process.env.NODE_ENV === 'test' || !utils.isBrowser) {
// $FlowFixMe
Object.defineProperty(hydration, 'shouldHydrate', {
set: _set,
get: _get
});
} // $FlowFixMe
// $FlowFixMe
var CSSContext = React.createContext(null);
var defaultCache = createCache();
function consumer(instance, func) {
return React.createElement(CSSContext.Consumer, null, function (context) {
if (context === null) {
if (utils.isBrowser && process.env.NODE_ENV !== 'test') {
return func(defaultCache);
}
if (instance.emotionCache === undefined) {

@@ -52,5 +35,4 @@ instance.emotionCache = createCache();

exports.hydration = hydration;
exports.CSSContext = CSSContext;
exports.consumer = consumer;
//# sourceMappingURL=index.cjs.js.map

31

dist/index.es.js

@@ -5,29 +5,12 @@ import { isBrowser } from '@emotion/utils';

var hydration = {
shouldHydrate: false
};
if (isBrowser) {
hydration.shouldHydrate = !!document.querySelector('[data-more]');
}
function _set() {}
function _get() {
return true;
}
if (process.env.NODE_ENV === 'test' || !isBrowser) {
// $FlowFixMe
Object.defineProperty(hydration, 'shouldHydrate', {
set: _set,
get: _get
});
} // $FlowFixMe
// $FlowFixMe
var CSSContext = createContext(null);
var defaultCache = createCache();
function consumer(instance, func) {
return createElement(CSSContext.Consumer, null, function (context) {
if (context === null) {
if (isBrowser && process.env.NODE_ENV !== 'test') {
return func(defaultCache);
}
if (instance.emotionCache === undefined) {

@@ -46,3 +29,3 @@ instance.emotionCache = createCache();

export { hydration, CSSContext, consumer };
export { CSSContext, consumer };
//# sourceMappingURL=index.es.js.map
{
"name": "@emotion/core",
"version": "0.4.1",
"version": "0.5.0",
"main": "dist/index.cjs.js",

@@ -18,10 +18,10 @@ "module": "dist/index.es.js",

"dependencies": {
"@emotion/cache": "^0.4.1",
"@emotion/cache": "^0.5.0",
"@emotion/sheet": "^0.2.0",
"@emotion/types": "^0.2.3",
"@emotion/utils": "^0.4.1",
"emotion-utils": "^9.0.1"
"@emotion/types": "^0.5.0",
"@emotion/utils": "^0.5.0",
"emotion-utils": "^9.1.0"
},
"peerDependencies": {
"react": ">=16.3.0 || >=16.3.0-alpha.0"
"react": ">=16.3.0"
},

@@ -28,0 +28,0 @@ "devDependencies": {

@@ -9,3 +9,3 @@ // @flow

export type ProviderProps<T> = {
type ProviderProps<T> = {
value: T,

@@ -15,14 +15,14 @@ children?: React.Node

export type ConsumerProps<T> = {
type ConsumerProps<T> = {
children: RenderFn<T> | [RenderFn<T>]
}
export type ConsumerState<T> = {
type ConsumerState<T> = {
value: T
}
export type Provider<T> = React.Component<ProviderProps<T>>
export type Consumer<T> = React.Component<ConsumerProps<T>, ConsumerState<T>>
type Provider<T> = React.Component<ProviderProps<T>>
type Consumer<T> = React.Component<ConsumerProps<T>, ConsumerState<T>>
export type Context<T> = {
type Context<T> = {
Provider: Class<Provider<T>>,

@@ -32,19 +32,7 @@ Consumer: Class<Consumer<T>>

export let hydration = { shouldHydrate: false }
if (isBrowser) {
hydration.shouldHydrate = !!document.querySelector('[data-more]')
}
if (process.env.NODE_ENV === 'test' || !isBrowser) {
// $FlowFixMe
Object.defineProperty(hydration, 'shouldHydrate', {
set: () => {},
get: () => true
})
}
// $FlowFixMe
export const CSSContext: Context<CSSContextType> = React.createContext(null)
let defaultCache = createCache()
export function consumer(

@@ -58,2 +46,5 @@ instance: { emotionCache?: CSSContextType },

if (context === null) {
if (isBrowser && process.env.NODE_ENV !== 'test') {
return func(defaultCache)
}
if (instance.emotionCache === undefined) {

@@ -60,0 +51,0 @@ instance.emotionCache = createCache()

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc