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 |
|
36 | function isValidElementType(type) {
|
37 | return typeof type === 'string' || typeof type === 'function' ||
|
38 |
|
39 | 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);
|
40 | }
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 | var lowPriorityWarning = function () {};
|
57 |
|
58 | {
|
59 | var printWarning = function (format) {
|
60 | for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
61 | args[_key - 1] = arguments[_key];
|
62 | }
|
63 |
|
64 | var argIndex = 0;
|
65 | var message = 'Warning: ' + format.replace(/%s/g, function () {
|
66 | return args[argIndex++];
|
67 | });
|
68 | if (typeof console !== 'undefined') {
|
69 | console.warn(message);
|
70 | }
|
71 | try {
|
72 |
|
73 |
|
74 |
|
75 | throw new Error(message);
|
76 | } catch (x) {}
|
77 | };
|
78 |
|
79 | lowPriorityWarning = function (condition, format) {
|
80 | if (format === undefined) {
|
81 | throw new Error('`lowPriorityWarning(condition, format, ...args)` requires a warning ' + 'message argument');
|
82 | }
|
83 | if (!condition) {
|
84 | for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
|
85 | args[_key2 - 2] = arguments[_key2];
|
86 | }
|
87 |
|
88 | printWarning.apply(undefined, [format].concat(args));
|
89 | }
|
90 | };
|
91 | }
|
92 |
|
93 | var lowPriorityWarning$1 = lowPriorityWarning;
|
94 |
|
95 | function typeOf(object) {
|
96 | if (typeof object === 'object' && object !== null) {
|
97 | var $$typeof = object.$$typeof;
|
98 | switch ($$typeof) {
|
99 | case REACT_ELEMENT_TYPE:
|
100 | var type = object.type;
|
101 |
|
102 | switch (type) {
|
103 | case REACT_ASYNC_MODE_TYPE:
|
104 | case REACT_CONCURRENT_MODE_TYPE:
|
105 | case REACT_FRAGMENT_TYPE:
|
106 | case REACT_PROFILER_TYPE:
|
107 | case REACT_STRICT_MODE_TYPE:
|
108 | case REACT_SUSPENSE_TYPE:
|
109 | return type;
|
110 | default:
|
111 | var $$typeofType = type && type.$$typeof;
|
112 |
|
113 | switch ($$typeofType) {
|
114 | case REACT_CONTEXT_TYPE:
|
115 | case REACT_FORWARD_REF_TYPE:
|
116 | case REACT_PROVIDER_TYPE:
|
117 | return $$typeofType;
|
118 | default:
|
119 | return $$typeof;
|
120 | }
|
121 | }
|
122 | case REACT_LAZY_TYPE:
|
123 | case REACT_MEMO_TYPE:
|
124 | case REACT_PORTAL_TYPE:
|
125 | return $$typeof;
|
126 | }
|
127 | }
|
128 |
|
129 | return undefined;
|
130 | }
|
131 |
|
132 |
|
133 | var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
134 | var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
135 | var ContextConsumer = REACT_CONTEXT_TYPE;
|
136 | var ContextProvider = REACT_PROVIDER_TYPE;
|
137 | var Element = REACT_ELEMENT_TYPE;
|
138 | var ForwardRef = REACT_FORWARD_REF_TYPE;
|
139 | var Fragment = REACT_FRAGMENT_TYPE;
|
140 | var Lazy = REACT_LAZY_TYPE;
|
141 | var Memo = REACT_MEMO_TYPE;
|
142 | var Portal = REACT_PORTAL_TYPE;
|
143 | var Profiler = REACT_PROFILER_TYPE;
|
144 | var StrictMode = REACT_STRICT_MODE_TYPE;
|
145 | var Suspense = REACT_SUSPENSE_TYPE;
|
146 |
|
147 | var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
148 |
|
149 |
|
150 | function isAsyncMode(object) {
|
151 | {
|
152 | if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
153 | hasWarnedAboutDeprecatedIsAsyncMode = true;
|
154 | 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.');
|
155 | }
|
156 | }
|
157 | return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
158 | }
|
159 | function isConcurrentMode(object) {
|
160 | return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
161 | }
|
162 | function isContextConsumer(object) {
|
163 | return typeOf(object) === REACT_CONTEXT_TYPE;
|
164 | }
|
165 | function isContextProvider(object) {
|
166 | return typeOf(object) === REACT_PROVIDER_TYPE;
|
167 | }
|
168 | function isElement(object) {
|
169 | return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
170 | }
|
171 | function isForwardRef(object) {
|
172 | return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
173 | }
|
174 | function isFragment(object) {
|
175 | return typeOf(object) === REACT_FRAGMENT_TYPE;
|
176 | }
|
177 | function isLazy(object) {
|
178 | return typeOf(object) === REACT_LAZY_TYPE;
|
179 | }
|
180 | function isMemo(object) {
|
181 | return typeOf(object) === REACT_MEMO_TYPE;
|
182 | }
|
183 | function isPortal(object) {
|
184 | return typeOf(object) === REACT_PORTAL_TYPE;
|
185 | }
|
186 | function isProfiler(object) {
|
187 | return typeOf(object) === REACT_PROFILER_TYPE;
|
188 | }
|
189 | function isStrictMode(object) {
|
190 | return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
191 | }
|
192 | function isSuspense(object) {
|
193 | return typeOf(object) === REACT_SUSPENSE_TYPE;
|
194 | }
|
195 |
|
196 | exports.typeOf = typeOf;
|
197 | exports.AsyncMode = AsyncMode;
|
198 | exports.ConcurrentMode = ConcurrentMode;
|
199 | exports.ContextConsumer = ContextConsumer;
|
200 | exports.ContextProvider = ContextProvider;
|
201 | exports.Element = Element;
|
202 | exports.ForwardRef = ForwardRef;
|
203 | exports.Fragment = Fragment;
|
204 | exports.Lazy = Lazy;
|
205 | exports.Memo = Memo;
|
206 | exports.Portal = Portal;
|
207 | exports.Profiler = Profiler;
|
208 | exports.StrictMode = StrictMode;
|
209 | exports.Suspense = Suspense;
|
210 | exports.isValidElementType = isValidElementType;
|
211 | exports.isAsyncMode = isAsyncMode;
|
212 | exports.isConcurrentMode = isConcurrentMode;
|
213 | exports.isContextConsumer = isContextConsumer;
|
214 | exports.isContextProvider = isContextProvider;
|
215 | exports.isElement = isElement;
|
216 | exports.isForwardRef = isForwardRef;
|
217 | exports.isFragment = isFragment;
|
218 | exports.isLazy = isLazy;
|
219 | exports.isMemo = isMemo;
|
220 | exports.isPortal = isPortal;
|
221 | exports.isProfiler = isProfiler;
|
222 | exports.isStrictMode = isStrictMode;
|
223 | exports.isSuspense = isSuspense;
|
224 |
|
225 | Object.defineProperty(exports, '__esModule', { value: true });
|
226 |
|
227 | })));
|