New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-intersection-observer

Package Overview
Dependencies
Maintainers
0
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-intersection-observer - npm Package Compare versions

Comparing version 9.14.0 to 9.14.1

8

package.json
{
"name": "react-intersection-observer",
"version": "9.14.0",
"version": "9.14.1",
"description": "Monitor if a component is inside the viewport, using IntersectionObserver API",

@@ -117,3 +117,3 @@ "type": "commonjs",

"devDependencies": {
"@arethetypeswrong/cli": "^0.17.1",
"@arethetypeswrong/cli": "^0.17.2",
"@biomejs/biome": "^1.9.4",

@@ -123,3 +123,3 @@ "@size-limit/preset-small-lib": "^11.1.6",

"@testing-library/react": "^16.1.0",
"@types/react": "^19.0.1",
"@types/react": "^19.0.2",
"@types/react-dom": "^19.0.2",

@@ -129,3 +129,3 @@ "@vitejs/plugin-react": "^4.3.4",

"@vitest/coverage-istanbul": "^2.1.8",
"lint-staged": "^15.2.11",
"lint-staged": "^15.3.0",
"microbundle": "^0.15.1",

@@ -132,0 +132,0 @@ "npm-run-all": "^4.1.5",

@@ -1,7 +0,1 @@

declare global {
var IS_REACT_ACT_ENVIRONMENT: boolean;
var jest: {
fn: typeof vi.fn;
} | undefined;
}
/**

@@ -8,0 +2,0 @@ * Create a custom IntersectionObserver mock, allowing us to intercept the `observe` and `unobserve` calls.

@@ -42,9 +42,5 @@ "use strict";

var DeprecatedReactTestUtils = __toESM(require("react-dom/test-utils"));
var act3 = (
// @ts-ignore - Older versions of React don't have the `act` method, so TypeScript will complain about it
typeof React.act === "function" ? React.act : DeprecatedReactTestUtils.act
);
var isMocking = false;
var observers = /* @__PURE__ */ new Map();
if (typeof beforeAll !== "undefined" && typeof afterEach !== "undefined") {
if (typeof window !== "undefined" && typeof beforeAll !== "undefined" && typeof afterEach !== "undefined") {
beforeAll(() => {

@@ -60,2 +56,9 @@ if (typeof jest !== "undefined") setupIntersectionMocking(jest.fn);

}
function getActFn() {
if (!(typeof window !== "undefined" && // @ts-ignore
window.IS_REACT_ACT_ENVIRONMENT)) {
return void 0;
}
return typeof React.act === "function" ? React.act : DeprecatedReactTestUtils.act;
}
function warnOnMissingSetup() {

@@ -113,7 +116,2 @@ if (isMocking) return;

}
function getIsReactActEnvironment() {
return Boolean(
typeof window !== "undefined" && window.IS_REACT_ACT_ENVIRONMENT
);
}
function triggerIntersection(elements, trigger, observer, item) {

@@ -154,4 +152,4 @@ var _a;

}
if (act3 && getIsReactActEnvironment())
act3(() => item.callback(entries, observer));
const act3 = getActFn();
if (act3) act3(() => item.callback(entries, observer));
else item.callback(entries, observer);

@@ -158,0 +156,0 @@ }

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