1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | 'use strict';
|
11 |
|
12 | (function (global, factory) {
|
13 | typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
14 | typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
15 | (factory((global.ReactIs = {})));
|
16 | }(this, (function (exports) { 'use strict';
|
17 |
|
18 |
|
19 |
|
20 | var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
21 |
|
22 | var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
23 | var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
24 | var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
25 | var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
26 | var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
27 | var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
28 | var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
|
29 | var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
30 | var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
31 | var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
32 | var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
33 | var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
34 | var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
35 | var REACT_EVENT_COMPONENT_TYPE = hasSymbol ? Symbol.for('react.event_component') : 0xead5;
|
36 | var REACT_EVENT_TARGET_TYPE = hasSymbol ? Symbol.for('react.event_target') : 0xead6;
|
37 |
|
38 |
|
39 |
|
40 | function isValidElementType(type) {
|
41 | return typeof type === 'string' || typeof type === 'function' ||
|
42 |
|
43 | type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_EVENT_COMPONENT_TYPE || type.$$typeof === REACT_EVENT_TARGET_TYPE);
|
44 | }
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 | var lowPriorityWarning = function () {};
|
61 |
|
62 | {
|
63 | var printWarning = function (format) {
|
64 | for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
65 | args[_key - 1] = arguments[_key];
|
66 | }
|
67 |
|
68 | var argIndex = 0;
|
69 | var message = 'Warning: ' + format.replace(/%s/g, function () {
|
70 | return args[argIndex++];
|
71 | });
|
72 | if (typeof console !== 'undefined') {
|
73 | console.warn(message);
|
74 | }
|
75 | try {
|
76 |
|
77 |
|
78 |
|
79 | throw new Error(message);
|
80 | } catch (x) {}
|
81 | };
|
82 |
|
83 | lowPriorityWarning = function (condition, format) {
|
84 | if (format === undefined) {
|
85 | throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
|
86 | }
|
87 | if (!condition) {
|
88 | for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
89 | args[_key2 - 2] = arguments[_key2];
|
90 | }
|
91 |
|
92 | printWarning.apply(undefined, [format].concat(args));
|
93 | }
|
94 | };
|
95 | }
|
96 |
|
97 | var lowPriorityWarning$1 = lowPriorityWarning;
|
98 |
|
99 | function typeOf(object) {
|
100 | if (typeof object === 'object' && object !== null) {
|
101 | var $$typeof = object.$$typeof;
|
102 | switch ($$typeof) {
|
103 | case REACT_ELEMENT_TYPE:
|
104 | var type = object.type;
|
105 |
|
106 | switch (type) {
|
107 | case REACT_ASYNC_MODE_TYPE:
|
108 | case REACT_CONCURRENT_MODE_TYPE:
|
109 | case REACT_FRAGMENT_TYPE:
|
110 | case REACT_PROFILER_TYPE:
|
111 | case REACT_STRICT_MODE_TYPE:
|
112 | case REACT_SUSPENSE_TYPE:
|
113 | return type;
|
114 | default:
|
115 | var $$typeofType = type && type.$$typeof;
|
116 |
|
117 | switch ($$typeofType) {
|
118 | case REACT_CONTEXT_TYPE:
|
119 | case REACT_FORWARD_REF_TYPE:
|
120 | case REACT_PROVIDER_TYPE:
|
121 | return $$typeofType;
|
122 | default:
|
123 | return $$typeof;
|
124 | }
|
125 | }
|
126 | case REACT_LAZY_TYPE:
|
127 | case REACT_MEMO_TYPE:
|
128 | case REACT_PORTAL_TYPE:
|
129 | return $$typeof;
|
130 | }
|
131 | }
|
132 |
|
133 | return undefined;
|
134 | }
|
135 |
|
136 |
|
137 | var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
138 | var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
139 | var ContextConsumer = REACT_CONTEXT_TYPE;
|
140 | var ContextProvider = REACT_PROVIDER_TYPE;
|
141 | var Element = REACT_ELEMENT_TYPE;
|
142 | var ForwardRef = REACT_FORWARD_REF_TYPE;
|
143 | var Fragment = REACT_FRAGMENT_TYPE;
|
144 | var Lazy = REACT_LAZY_TYPE;
|
145 | var Memo = REACT_MEMO_TYPE;
|
146 | var Portal = REACT_PORTAL_TYPE;
|
147 | var Profiler = REACT_PROFILER_TYPE;
|
148 | var StrictMode = REACT_STRICT_MODE_TYPE;
|
149 | var Suspense = REACT_SUSPENSE_TYPE;
|
150 |
|
151 | var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
152 |
|
153 |
|
154 | function isAsyncMode(object) {
|
155 | {
|
156 | if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
157 | hasWarnedAboutDeprecatedIsAsyncMode = true;
|
158 | lowPriorityWarning$1(false, 'The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
159 | }
|
160 | }
|
161 | return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
162 | }
|
163 | function isConcurrentMode(object) {
|
164 | return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
165 | }
|
166 | function isContextConsumer(object) {
|
167 | return typeOf(object) === REACT_CONTEXT_TYPE;
|
168 | }
|
169 | function isContextProvider(object) {
|
170 | return typeOf(object) === REACT_PROVIDER_TYPE;
|
171 | }
|
172 | function isElement(object) {
|
173 | return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
174 | }
|
175 | function isForwardRef(object) {
|
176 | return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
177 | }
|
178 | function isFragment(object) {
|
179 | return typeOf(object) === REACT_FRAGMENT_TYPE;
|
180 | }
|
181 | function isLazy(object) {
|
182 | return typeOf(object) === REACT_LAZY_TYPE;
|
183 | }
|
184 | function isMemo(object) {
|
185 | return typeOf(object) === REACT_MEMO_TYPE;
|
186 | }
|
187 | function isPortal(object) {
|
188 | return typeOf(object) === REACT_PORTAL_TYPE;
|
189 | }
|
190 | function isProfiler(object) {
|
191 | return typeOf(object) === REACT_PROFILER_TYPE;
|
192 | }
|
193 | function isStrictMode(object) {
|
194 | return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
195 | }
|
196 | function isSuspense(object) {
|
197 | return typeOf(object) === REACT_SUSPENSE_TYPE;
|
198 | }
|
199 |
|
200 | exports.typeOf = typeOf;
|
201 | exports.AsyncMode = AsyncMode;
|
202 | exports.ConcurrentMode = ConcurrentMode;
|
203 | exports.ContextConsumer = ContextConsumer;
|
204 | exports.ContextProvider = ContextProvider;
|
205 | exports.Element = Element;
|
206 | exports.ForwardRef = ForwardRef;
|
207 | exports.Fragment = Fragment;
|
208 | exports.Lazy = Lazy;
|
209 | exports.Memo = Memo;
|
210 | exports.Portal = Portal;
|
211 | exports.Profiler = Profiler;
|
212 | exports.StrictMode = StrictMode;
|
213 | exports.Suspense = Suspense;
|
214 | exports.isValidElementType = isValidElementType;
|
215 | exports.isAsyncMode = isAsyncMode;
|
216 | exports.isConcurrentMode = isConcurrentMode;
|
217 | exports.isContextConsumer = isContextConsumer;
|
218 | exports.isContextProvider = isContextProvider;
|
219 | exports.isElement = isElement;
|
220 | exports.isForwardRef = isForwardRef;
|
221 | exports.isFragment = isFragment;
|
222 | exports.isLazy = isLazy;
|
223 | exports.isMemo = isMemo;
|
224 | exports.isPortal = isPortal;
|
225 | exports.isProfiler = isProfiler;
|
226 | exports.isStrictMode = isStrictMode;
|
227 | exports.isSuspense = isSuspense;
|
228 |
|
229 | Object.defineProperty(exports, '__esModule', { value: true });
|
230 |
|
231 | })));
|