@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.prototype instanceof _a;
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 pass, as an argument to FC(), a class that extends ClassComponent (e.g `export FC(MyComponent);`), or ensure FC() is called as a method on a ClassComponent constructor type (e.g `export MyComponent.FC()`).');
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.prototype instanceof _a;
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 pass, as an argument to FC(), a class that extends ClassComponent (e.g `export FC(MyComponent);`), or ensure FC() is called as a method on a ClassComponent constructor type (e.g `export MyComponent.FC()`).');
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cleanweb/oore",
3
- "version": "2.0.0-alpha.20",
3
+ "version": "2.0.0-alpha.21",
4
4
  "description": "A library of helpers for writing cleaner React function components with object-oriented patterns.",
5
5
  "engines": {
6
6
  "node": ">=22"