@cleanweb/oore 2.0.0-alpha.20 → 2.0.0-alpha.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -123,9 +123,11 @@ _a = ClassComponent;
|
|
|
123
123
|
*/
|
|
124
124
|
ClassComponent.extract = function FC(_Component, properties) {
|
|
125
125
|
const Component = _Component !== null && _Component !== void 0 ? _Component : this;
|
|
126
|
-
const isClassComponentType = Component
|
|
126
|
+
const isClassComponentType = (Component === _a
|
|
127
|
+
|| Component.prototype instanceof _a
|
|
128
|
+
|| _a.isPrototypeOf(Component));
|
|
127
129
|
if (!isClassComponentType)
|
|
128
|
-
throw new Error('Attempted to initialize ClassComponent with invalid Class type. Either
|
|
130
|
+
throw new Error('Attempted to initialize `ClassComponent` with an invalid Class type. Either call `extract()` with a class argument that extends ClassComponent (e.g `export default extract(MyComponent);`), or ensure `extract()` is called as a method on a ClassComponent constructor type (e.g `export default MyComponent.extract();`).');
|
|
129
131
|
/*************************************
|
|
130
132
|
* Begin Function Component *
|
|
131
133
|
**************************************/
|
|
@@ -123,9 +123,11 @@ _a = ClassComponent;
|
|
|
123
123
|
*/
|
|
124
124
|
ClassComponent.extract = function FC(_Component, properties) {
|
|
125
125
|
const Component = _Component !== null && _Component !== void 0 ? _Component : this;
|
|
126
|
-
const isClassComponentType = Component
|
|
126
|
+
const isClassComponentType = (Component === _a
|
|
127
|
+
|| Component.prototype instanceof _a
|
|
128
|
+
|| _a.isPrototypeOf(Component));
|
|
127
129
|
if (!isClassComponentType)
|
|
128
|
-
throw new Error('Attempted to initialize ClassComponent with invalid Class type. Either
|
|
130
|
+
throw new Error('Attempted to initialize `ClassComponent` with an invalid Class type. Either call `extract()` with a class argument that extends ClassComponent (e.g `export default extract(MyComponent);`), or ensure `extract()` is called as a method on a ClassComponent constructor type (e.g `export default MyComponent.extract();`).');
|
|
129
131
|
/*************************************
|
|
130
132
|
* Begin Function Component *
|
|
131
133
|
**************************************/
|
package/package.json
CHANGED