Socket
Socket
Sign inDemoInstall

react-is

Package Overview
Dependencies
0
Maintainers
4
Versions
1606
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 19.0.0-canary-adb717393-20240411 to 19.0.0-canary-db913d8e17-20240422

2

cjs/react-is.development.js

@@ -44,3 +44,3 @@ /**

var enableRenderableContext = true; // -----------------------------------------------------------------------------
var enableRenderableContext = true; // Enables the `initialValue` option for `useDeferredValue`
// stuff. Intended to enable React core members to more easily debug scheduling

@@ -47,0 +47,0 @@ // issues in DEV builds.

/**
* @license React
* react-is.production.min.js
* react-is.production.js
*

@@ -11,70 +11,24 @@ * Copyright (c) Meta Platforms, Inc. and affiliates.

'use strict';
// ATTENTION
// When adding new symbols to this file,
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
// The Symbol used to tag the ReactElement-like types.
const REACT_ELEMENT_TYPE = Symbol.for('react.element');
const REACT_PORTAL_TYPE = Symbol.for('react.portal');
const REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
const REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
const REACT_PROFILER_TYPE = Symbol.for('react.profiler');
const REACT_PROVIDER_TYPE = Symbol.for('react.provider'); // TODO: Delete with enableRenderableContext
const REACT_CONSUMER_TYPE = Symbol.for('react.consumer');
const REACT_CONTEXT_TYPE = Symbol.for('react.context');
const REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
const REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
const REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
const REACT_MEMO_TYPE = Symbol.for('react.memo');
const REACT_LAZY_TYPE = Symbol.for('react.lazy');
const REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
// -----------------------------------------------------------------------------
const enableScopeAPI = false; // Experimental Create Event Handle API.
const enableTransitionTracing = false; // No known bugs, but needs performance testing
const enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
const enableRenderableContext = true; // -----------------------------------------------------------------------------
// stuff. Intended to enable React core members to more easily debug scheduling
// issues in DEV builds.
const enableDebugTracing = false;
const REACT_CLIENT_REFERENCE = Symbol.for('react.client.reference');
function isValidElementType(type) {
if (typeof type === 'string' || typeof type === 'function') {
return true;
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableTransitionTracing ) {
return true;
}
if (typeof type === 'object' && type !== null) {
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || !enableRenderableContext || type.$$typeof === REACT_CONSUMER_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
// types supported by any Flight configuration anywhere since
// we don't know which Flight build this will end up being used
// with.
type.$$typeof === REACT_CLIENT_REFERENCE || type.getModuleId !== undefined) {
return true;
}
}
return false;
}
"use strict";
var REACT_ELEMENT_TYPE = Symbol.for("react.element"),
REACT_PORTAL_TYPE = Symbol.for("react.portal"),
REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"),
REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"),
REACT_PROFILER_TYPE = Symbol.for("react.profiler");
Symbol.for("react.provider");
var REACT_CONSUMER_TYPE = Symbol.for("react.consumer"),
REACT_CONTEXT_TYPE = Symbol.for("react.context"),
REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"),
REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"),
REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"),
REACT_MEMO_TYPE = Symbol.for("react.memo"),
REACT_LAZY_TYPE = Symbol.for("react.lazy"),
REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"),
REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
function typeOf(object) {
if (typeof object === 'object' && object !== null) {
const $$typeof = object.$$typeof;
if ("object" === typeof object && null !== object) {
var $$typeof = object.$$typeof;
switch ($$typeof) {
case REACT_ELEMENT_TYPE:
const type = object.type;
switch (type) {
switch (((object = object.type), object)) {
case REACT_FRAGMENT_TYPE:

@@ -85,8 +39,5 @@ case REACT_PROFILER_TYPE:

case REACT_SUSPENSE_LIST_TYPE:
return type;
return object;
default:
const $$typeofType = type && type.$$typeof;
switch ($$typeofType) {
switch (((object = object && object.$$typeof), object)) {
case REACT_CONTEXT_TYPE:

@@ -96,21 +47,9 @@ case REACT_FORWARD_REF_TYPE:

case REACT_MEMO_TYPE:
return $$typeofType;
return object;
case REACT_CONSUMER_TYPE:
{
return $$typeofType;
}
// Fall through
case REACT_PROVIDER_TYPE:
// Fall through
return object;
default:
return $$typeof;
}
}
case REACT_PORTAL_TYPE:

@@ -120,83 +59,76 @@ return $$typeof;

}
return undefined;
}
const ContextConsumer = REACT_CONSUMER_TYPE ;
const ContextProvider = REACT_CONTEXT_TYPE ;
const Element = REACT_ELEMENT_TYPE;
const ForwardRef = REACT_FORWARD_REF_TYPE;
const Fragment = REACT_FRAGMENT_TYPE;
const Lazy = REACT_LAZY_TYPE;
const Memo = REACT_MEMO_TYPE;
const Portal = REACT_PORTAL_TYPE;
const Profiler = REACT_PROFILER_TYPE;
const StrictMode = REACT_STRICT_MODE_TYPE;
const Suspense = REACT_SUSPENSE_TYPE;
const SuspenseList = REACT_SUSPENSE_LIST_TYPE;
function isContextConsumer(object) {
{
return typeOf(object) === REACT_CONSUMER_TYPE;
}
}
function isContextProvider(object) {
{
return typeOf(object) === REACT_CONTEXT_TYPE;
}
}
function isElement(object) {
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
}
function isForwardRef(object) {
exports.ContextConsumer = REACT_CONSUMER_TYPE;
exports.ContextProvider = REACT_CONTEXT_TYPE;
exports.Element = REACT_ELEMENT_TYPE;
exports.ForwardRef = REACT_FORWARD_REF_TYPE;
exports.Fragment = REACT_FRAGMENT_TYPE;
exports.Lazy = REACT_LAZY_TYPE;
exports.Memo = REACT_MEMO_TYPE;
exports.Portal = REACT_PORTAL_TYPE;
exports.Profiler = REACT_PROFILER_TYPE;
exports.StrictMode = REACT_STRICT_MODE_TYPE;
exports.Suspense = REACT_SUSPENSE_TYPE;
exports.SuspenseList = REACT_SUSPENSE_LIST_TYPE;
exports.isContextConsumer = function (object) {
return typeOf(object) === REACT_CONSUMER_TYPE;
};
exports.isContextProvider = function (object) {
return typeOf(object) === REACT_CONTEXT_TYPE;
};
exports.isElement = function (object) {
return (
"object" === typeof object &&
null !== object &&
object.$$typeof === REACT_ELEMENT_TYPE
);
};
exports.isForwardRef = function (object) {
return typeOf(object) === REACT_FORWARD_REF_TYPE;
}
function isFragment(object) {
};
exports.isFragment = function (object) {
return typeOf(object) === REACT_FRAGMENT_TYPE;
}
function isLazy(object) {
};
exports.isLazy = function (object) {
return typeOf(object) === REACT_LAZY_TYPE;
}
function isMemo(object) {
};
exports.isMemo = function (object) {
return typeOf(object) === REACT_MEMO_TYPE;
}
function isPortal(object) {
};
exports.isPortal = function (object) {
return typeOf(object) === REACT_PORTAL_TYPE;
}
function isProfiler(object) {
};
exports.isProfiler = function (object) {
return typeOf(object) === REACT_PROFILER_TYPE;
}
function isStrictMode(object) {
};
exports.isStrictMode = function (object) {
return typeOf(object) === REACT_STRICT_MODE_TYPE;
}
function isSuspense(object) {
};
exports.isSuspense = function (object) {
return typeOf(object) === REACT_SUSPENSE_TYPE;
}
function isSuspenseList(object) {
};
exports.isSuspenseList = function (object) {
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
}
exports.ContextConsumer = ContextConsumer;
exports.ContextProvider = ContextProvider;
exports.Element = Element;
exports.ForwardRef = ForwardRef;
exports.Fragment = Fragment;
exports.Lazy = Lazy;
exports.Memo = Memo;
exports.Portal = Portal;
exports.Profiler = Profiler;
exports.StrictMode = StrictMode;
exports.Suspense = Suspense;
exports.SuspenseList = SuspenseList;
exports.isContextConsumer = isContextConsumer;
exports.isContextProvider = isContextProvider;
exports.isElement = isElement;
exports.isForwardRef = isForwardRef;
exports.isFragment = isFragment;
exports.isLazy = isLazy;
exports.isMemo = isMemo;
exports.isPortal = isPortal;
exports.isProfiler = isProfiler;
exports.isStrictMode = isStrictMode;
exports.isSuspense = isSuspense;
exports.isSuspenseList = isSuspenseList;
exports.isValidElementType = isValidElementType;
exports.typeOf = typeOf;
};
exports.isValidElementType = function (type) {
return "string" === typeof type ||
"function" === typeof type ||
type === REACT_FRAGMENT_TYPE ||
type === REACT_PROFILER_TYPE ||
type === REACT_STRICT_MODE_TYPE ||
type === REACT_SUSPENSE_TYPE ||
type === REACT_SUSPENSE_LIST_TYPE ||
type === REACT_OFFSCREEN_TYPE ||
("object" === typeof type &&
null !== type &&
(type.$$typeof === REACT_LAZY_TYPE ||
type.$$typeof === REACT_MEMO_TYPE ||
type.$$typeof === REACT_CONTEXT_TYPE ||
type.$$typeof === REACT_CONSUMER_TYPE ||
type.$$typeof === REACT_FORWARD_REF_TYPE ||
type.$$typeof === REACT_CLIENT_REFERENCE ||
void 0 !== type.getModuleId))
? !0
: !1;
};
exports.typeOf = typeOf;
'use strict';
if (process.env.NODE_ENV === 'production') {
module.exports = require('./cjs/react-is.production.min.js');
module.exports = require('./cjs/react-is.production.js');
} else {
module.exports = require('./cjs/react-is.development.js');
}
{
"name": "react-is",
"version": "19.0.0-canary-adb717393-20240411",
"version": "19.0.0-canary-db913d8e17-20240422",
"description": "Brand checking of React Elements.",

@@ -24,5 +24,4 @@ "main": "index.js",

"index.js",
"cjs/",
"umd/"
"cjs/"
]
}
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc