Comparing version 0.0.27 to 0.0.28
@@ -193,3 +193,3 @@ "use strict"; | ||
const component = ctor(forgoElement.props); | ||
assertIsComponent(component); | ||
assertIsComponent(ctor, component); | ||
boundary = component.error ? component : boundary; | ||
@@ -221,3 +221,3 @@ // Create new component state | ||
const component = ctor(forgoElement.props); | ||
assertIsComponent(component); | ||
assertIsComponent(ctor, component); | ||
boundary = component.error ? component : boundary; | ||
@@ -574,7 +574,7 @@ // We'll have to create a new component state | ||
*/ | ||
function assertIsComponent(component) { | ||
function assertIsComponent(ctor, component) { | ||
if (!component.render) { | ||
throw new Error("component must have a render() method."); | ||
throw new Error(`${ctor.name || "Unnamed"} component constructor must return an object having a render() function.`); | ||
} | ||
} | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "forgo", | ||
"version": "0.0.27", | ||
"version": "0.0.28", | ||
"main": "./dist", | ||
@@ -5,0 +5,0 @@ "author": "Jeswin Kumar<jeswinpk@agilehead.com>", |
@@ -432,3 +432,3 @@ declare global { | ||
const component = ctor(forgoElement.props); | ||
assertIsComponent(component); | ||
assertIsComponent(ctor, component); | ||
@@ -478,3 +478,3 @@ boundary = component.error ? component : boundary; | ||
const component = ctor(forgoElement.props); | ||
assertIsComponent(component); | ||
assertIsComponent(ctor, component); | ||
@@ -965,6 +965,13 @@ boundary = component.error ? component : boundary; | ||
*/ | ||
function assertIsComponent(component: ForgoComponent<any>) { | ||
function assertIsComponent( | ||
ctor: ForgoComponentCtor<any>, | ||
component: ForgoComponent<any> | ||
) { | ||
if (!component.render) { | ||
throw new Error("component must have a render() method."); | ||
throw new Error( | ||
`${ | ||
ctor.name || "Unnamed" | ||
} component constructor must return an object having a render() function.` | ||
); | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
87300
1534