@emotion/use-insertion-effect-with-fallbacks
Advanced tools
Comparing version 1.0.1 to 1.1.0
'use strict'; | ||
if (process.env.NODE_ENV === "production") { | ||
module.exports = require("./emotion-use-insertion-effect-with-fallbacks.cjs.prod.js"); | ||
} else { | ||
module.exports = require("./emotion-use-insertion-effect-with-fallbacks.cjs.dev.js"); | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
var React = require('react'); | ||
function _interopNamespace(e) { | ||
if (e && e.__esModule) return e; | ||
var n = Object.create(null); | ||
if (e) { | ||
Object.keys(e).forEach(function (k) { | ||
if (k !== 'default') { | ||
var d = Object.getOwnPropertyDescriptor(e, k); | ||
Object.defineProperty(n, k, d.get ? d : { | ||
enumerable: true, | ||
get: function () { return e[k]; } | ||
}); | ||
} | ||
}); | ||
} | ||
n["default"] = e; | ||
return Object.freeze(n); | ||
} | ||
var React__namespace = /*#__PURE__*/_interopNamespace(React); | ||
var isBrowser = typeof document !== 'undefined'; | ||
var syncFallback = function syncFallback(create) { | ||
return create(); | ||
}; | ||
var useInsertionEffect = React__namespace['useInsertion' + 'Effect'] ? React__namespace['useInsertion' + 'Effect'] : false; | ||
var useInsertionEffectAlwaysWithSyncFallback = !isBrowser ? syncFallback : useInsertionEffect || syncFallback; | ||
var useInsertionEffectWithLayoutFallback = useInsertionEffect || React__namespace.useLayoutEffect; | ||
exports.useInsertionEffectAlwaysWithSyncFallback = useInsertionEffectAlwaysWithSyncFallback; | ||
exports.useInsertionEffectWithLayoutFallback = useInsertionEffectWithLayoutFallback; |
{ | ||
"name": "@emotion/use-insertion-effect-with-fallbacks", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "A wrapper package that uses `useInsertionEffect` or a fallback for it", | ||
"main": "dist/emotion-use-insertion-effect-with-fallbacks.cjs.js", | ||
"module": "dist/emotion-use-insertion-effect-with-fallbacks.esm.js", | ||
"browser": { | ||
"./dist/emotion-use-insertion-effect-with-fallbacks.esm.js": "./dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js" | ||
}, | ||
"license": "MIT", | ||
@@ -27,7 +24,27 @@ "repository": "https://github.com/emotion-js/emotion/tree/main/packages/use-insertion-effect-with-fallbacks", | ||
".": { | ||
"module": { | ||
"worker": "./dist/emotion-use-insertion-effect-with-fallbacks.worker.esm.js", | ||
"browser": "./dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js", | ||
"default": "./dist/emotion-use-insertion-effect-with-fallbacks.esm.js" | ||
"types": { | ||
"import": "./dist/emotion-use-insertion-effect-with-fallbacks.cjs.mjs", | ||
"default": "./dist/emotion-use-insertion-effect-with-fallbacks.cjs.js" | ||
}, | ||
"edge-light": { | ||
"module": "./dist/emotion-use-insertion-effect-with-fallbacks.edge-light.esm.js", | ||
"import": "./dist/emotion-use-insertion-effect-with-fallbacks.edge-light.cjs.mjs", | ||
"default": "./dist/emotion-use-insertion-effect-with-fallbacks.edge-light.cjs.js" | ||
}, | ||
"worker": { | ||
"module": "./dist/emotion-use-insertion-effect-with-fallbacks.edge-light.esm.js", | ||
"import": "./dist/emotion-use-insertion-effect-with-fallbacks.edge-light.cjs.mjs", | ||
"default": "./dist/emotion-use-insertion-effect-with-fallbacks.edge-light.cjs.js" | ||
}, | ||
"workerd": { | ||
"module": "./dist/emotion-use-insertion-effect-with-fallbacks.edge-light.esm.js", | ||
"import": "./dist/emotion-use-insertion-effect-with-fallbacks.edge-light.cjs.mjs", | ||
"default": "./dist/emotion-use-insertion-effect-with-fallbacks.edge-light.cjs.js" | ||
}, | ||
"browser": { | ||
"module": "./dist/emotion-use-insertion-effect-with-fallbacks.browser.esm.js", | ||
"import": "./dist/emotion-use-insertion-effect-with-fallbacks.browser.cjs.mjs", | ||
"default": "./dist/emotion-use-insertion-effect-with-fallbacks.browser.cjs.js" | ||
}, | ||
"module": "./dist/emotion-use-insertion-effect-with-fallbacks.esm.js", | ||
"import": "./dist/emotion-use-insertion-effect-with-fallbacks.cjs.mjs", | ||
@@ -38,10 +55,11 @@ "default": "./dist/emotion-use-insertion-effect-with-fallbacks.cjs.js" | ||
}, | ||
"preconstruct": { | ||
"exports": { | ||
"envConditions": [ | ||
"browser", | ||
"worker" | ||
] | ||
"imports": { | ||
"#is-browser": { | ||
"edge-light": "./src/conditions/false.js", | ||
"workerd": "./src/conditions/false.js", | ||
"worker": "./src/conditions/false.js", | ||
"browser": "./src/conditions/true.js", | ||
"default": "./src/conditions/is-browser.js" | ||
} | ||
} | ||
} |
import * as React from 'react' | ||
import isBrowser from '#is-browser' | ||
const isBrowser = typeof document !== 'undefined' | ||
const syncFallback = create => create() | ||
@@ -6,0 +5,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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
9791
16
139
1
1