UNPKG

1.97 kBJavaScriptView Raw
1function _classCallCheck(instance, Constructor) {
2 if (!(instance instanceof Constructor)) {
3 throw new TypeError("Cannot call a class as a function");
4 }
5}
6
7function _defineProperties(target, props) {
8 for (var i = 0; i < props.length; i++) {
9 var descriptor = props[i];
10 descriptor.enumerable = descriptor.enumerable || false;
11 descriptor.configurable = true;
12 if ("value" in descriptor) descriptor.writable = true;
13 Object.defineProperty(target, descriptor.key, descriptor);
14 }
15}
16
17function _createClass(Constructor, protoProps, staticProps) {
18 if (protoProps) _defineProperties(Constructor.prototype, protoProps);
19 if (staticProps) _defineProperties(Constructor, staticProps);
20 return Constructor;
21}
22/**
23 * Copyright IBM Corp. 2016, 2018
24 *
25 * This source code is licensed under the Apache-2.0 license found in the
26 * LICENSE file in the root directory of this source tree.
27 */
28
29
30import warning from 'warning';
31/**
32 * @param {string} name The component name.
33 * @returns {Function} A stub of removed component.
34 */
35
36var removedComponent = function removedComponent(name) {
37 var _class, _temp;
38
39 var didWarnAboutRemoval = false;
40
41 var warn = function warn() {
42 if (process.env.NODE_ENV !== "production") {
43 process.env.NODE_ENV !== "production" ? warning(didWarnAboutRemoval, "The `".concat(name, "` component has been removed.")) : void 0;
44 didWarnAboutRemoval = true;
45 }
46 };
47
48 return _temp = _class =
49 /*#__PURE__*/
50 function () {
51 function _class() {
52 _classCallCheck(this, _class);
53
54 warn();
55 }
56
57 _createClass(_class, null, [{
58 key: "create",
59 value: function create() {
60 warn();
61 }
62 }, {
63 key: "init",
64 value: function init() {
65 warn();
66 }
67 }]);
68
69 return _class;
70 }(), _class.components
71 /* #__PURE_CLASS_PROPERTY__ */
72 = new WeakMap(), _class.options
73 /* #__PURE_CLASS_PROPERTY__ */
74 = {}, _temp;
75};
76
77export default removedComponent;
\No newline at end of file