UNPKG

braid-design-system

Version:
14 lines (13 loc) 569 B
"use strict"; const REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"); const LEGACY_REACT_ELEMENT_TYPE = Symbol.for("react.element"); const REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"); const isReactElementType = (value) => { if (typeof value !== "object" || value === null) { return false; } const $$typeof = value.$$typeof; return $$typeof === REACT_ELEMENT_TYPE || $$typeof === LEGACY_REACT_ELEMENT_TYPE; }; const isFragment = (value) => isReactElementType(value) && value.type === REACT_FRAGMENT_TYPE; exports.isFragment = isFragment;