Dashboard sipadu mbip
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

react-is.development.js 8.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. /** @license React v16.12.0
  2. * react-is.development.js
  3. *
  4. * Copyright (c) Facebook, Inc. and its affiliates.
  5. *
  6. * This source code is licensed under the MIT license found in the
  7. * LICENSE file in the root directory of this source tree.
  8. */
  9. 'use strict';
  10. if (process.env.NODE_ENV !== "production") {
  11. (function() {
  12. 'use strict';
  13. Object.defineProperty(exports, '__esModule', { value: true });
  14. // The Symbol used to tag the ReactElement-like types. If there is no native Symbol
  15. // nor polyfill, then a plain number is used for performance.
  16. var hasSymbol = typeof Symbol === 'function' && Symbol.for;
  17. var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
  18. var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
  19. var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
  20. var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
  21. var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
  22. var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
  23. var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
  24. // (unstable) APIs that have been removed. Can we remove the symbols?
  25. var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
  26. var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
  27. var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
  28. var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
  29. var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
  30. var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
  31. var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
  32. var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
  33. var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
  34. var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
  35. function isValidElementType(type) {
  36. return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
  37. type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_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_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE);
  38. }
  39. /**
  40. * Forked from fbjs/warning:
  41. * https://github.com/facebook/fbjs/blob/e66ba20ad5be433eb54423f2b097d829324d9de6/packages/fbjs/src/__forks__/warning.js
  42. *
  43. * Only change is we use console.warn instead of console.error,
  44. * and do nothing when 'console' is not supported.
  45. * This really simplifies the code.
  46. * ---
  47. * Similar to invariant but only logs a warning if the condition is not met.
  48. * This can be used to log issues in development environments in critical
  49. * paths. Removing the logging code for production environments will keep the
  50. * same logic and follow the same code paths.
  51. */
  52. var lowPriorityWarningWithoutStack = function () {};
  53. {
  54. var printWarning = function (format) {
  55. for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
  56. args[_key - 1] = arguments[_key];
  57. }
  58. var argIndex = 0;
  59. var message = 'Warning: ' + format.replace(/%s/g, function () {
  60. return args[argIndex++];
  61. });
  62. if (typeof console !== 'undefined') {
  63. console.warn(message);
  64. }
  65. try {
  66. // --- Welcome to debugging React ---
  67. // This error was thrown as a convenience so that you can use this stack
  68. // to find the callsite that caused this warning to fire.
  69. throw new Error(message);
  70. } catch (x) {}
  71. };
  72. lowPriorityWarningWithoutStack = function (condition, format) {
  73. if (format === undefined) {
  74. throw new Error('`lowPriorityWarningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');
  75. }
  76. if (!condition) {
  77. for (var _len2 = arguments.length, args = new Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {
  78. args[_key2 - 2] = arguments[_key2];
  79. }
  80. printWarning.apply(void 0, [format].concat(args));
  81. }
  82. };
  83. }
  84. var lowPriorityWarningWithoutStack$1 = lowPriorityWarningWithoutStack;
  85. function typeOf(object) {
  86. if (typeof object === 'object' && object !== null) {
  87. var $$typeof = object.$$typeof;
  88. switch ($$typeof) {
  89. case REACT_ELEMENT_TYPE:
  90. var type = object.type;
  91. switch (type) {
  92. case REACT_ASYNC_MODE_TYPE:
  93. case REACT_CONCURRENT_MODE_TYPE:
  94. case REACT_FRAGMENT_TYPE:
  95. case REACT_PROFILER_TYPE:
  96. case REACT_STRICT_MODE_TYPE:
  97. case REACT_SUSPENSE_TYPE:
  98. return type;
  99. default:
  100. var $$typeofType = type && type.$$typeof;
  101. switch ($$typeofType) {
  102. case REACT_CONTEXT_TYPE:
  103. case REACT_FORWARD_REF_TYPE:
  104. case REACT_LAZY_TYPE:
  105. case REACT_MEMO_TYPE:
  106. case REACT_PROVIDER_TYPE:
  107. return $$typeofType;
  108. default:
  109. return $$typeof;
  110. }
  111. }
  112. case REACT_PORTAL_TYPE:
  113. return $$typeof;
  114. }
  115. }
  116. return undefined;
  117. } // AsyncMode is deprecated along with isAsyncMode
  118. var AsyncMode = REACT_ASYNC_MODE_TYPE;
  119. var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
  120. var ContextConsumer = REACT_CONTEXT_TYPE;
  121. var ContextProvider = REACT_PROVIDER_TYPE;
  122. var Element = REACT_ELEMENT_TYPE;
  123. var ForwardRef = REACT_FORWARD_REF_TYPE;
  124. var Fragment = REACT_FRAGMENT_TYPE;
  125. var Lazy = REACT_LAZY_TYPE;
  126. var Memo = REACT_MEMO_TYPE;
  127. var Portal = REACT_PORTAL_TYPE;
  128. var Profiler = REACT_PROFILER_TYPE;
  129. var StrictMode = REACT_STRICT_MODE_TYPE;
  130. var Suspense = REACT_SUSPENSE_TYPE;
  131. var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
  132. function isAsyncMode(object) {
  133. {
  134. if (!hasWarnedAboutDeprecatedIsAsyncMode) {
  135. hasWarnedAboutDeprecatedIsAsyncMode = true;
  136. lowPriorityWarningWithoutStack$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.');
  137. }
  138. }
  139. return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
  140. }
  141. function isConcurrentMode(object) {
  142. return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
  143. }
  144. function isContextConsumer(object) {
  145. return typeOf(object) === REACT_CONTEXT_TYPE;
  146. }
  147. function isContextProvider(object) {
  148. return typeOf(object) === REACT_PROVIDER_TYPE;
  149. }
  150. function isElement(object) {
  151. return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
  152. }
  153. function isForwardRef(object) {
  154. return typeOf(object) === REACT_FORWARD_REF_TYPE;
  155. }
  156. function isFragment(object) {
  157. return typeOf(object) === REACT_FRAGMENT_TYPE;
  158. }
  159. function isLazy(object) {
  160. return typeOf(object) === REACT_LAZY_TYPE;
  161. }
  162. function isMemo(object) {
  163. return typeOf(object) === REACT_MEMO_TYPE;
  164. }
  165. function isPortal(object) {
  166. return typeOf(object) === REACT_PORTAL_TYPE;
  167. }
  168. function isProfiler(object) {
  169. return typeOf(object) === REACT_PROFILER_TYPE;
  170. }
  171. function isStrictMode(object) {
  172. return typeOf(object) === REACT_STRICT_MODE_TYPE;
  173. }
  174. function isSuspense(object) {
  175. return typeOf(object) === REACT_SUSPENSE_TYPE;
  176. }
  177. exports.typeOf = typeOf;
  178. exports.AsyncMode = AsyncMode;
  179. exports.ConcurrentMode = ConcurrentMode;
  180. exports.ContextConsumer = ContextConsumer;
  181. exports.ContextProvider = ContextProvider;
  182. exports.Element = Element;
  183. exports.ForwardRef = ForwardRef;
  184. exports.Fragment = Fragment;
  185. exports.Lazy = Lazy;
  186. exports.Memo = Memo;
  187. exports.Portal = Portal;
  188. exports.Profiler = Profiler;
  189. exports.StrictMode = StrictMode;
  190. exports.Suspense = Suspense;
  191. exports.isValidElementType = isValidElementType;
  192. exports.isAsyncMode = isAsyncMode;
  193. exports.isConcurrentMode = isConcurrentMode;
  194. exports.isContextConsumer = isContextConsumer;
  195. exports.isContextProvider = isContextProvider;
  196. exports.isElement = isElement;
  197. exports.isForwardRef = isForwardRef;
  198. exports.isFragment = isFragment;
  199. exports.isLazy = isLazy;
  200. exports.isMemo = isMemo;
  201. exports.isPortal = isPortal;
  202. exports.isProfiler = isProfiler;
  203. exports.isStrictMode = isStrictMode;
  204. exports.isSuspense = isSuspense;
  205. })();
  206. }