sekisho 0.3.0 → 0.3.1
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.
- package/dist/factory.cjs +1 -1
- package/dist/factory.d.ts +1 -1
- package/dist/factory.mjs +1 -1
- package/package.json +1 -1
package/dist/factory.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,"__esModule",{value:!0});var
|
|
1
|
+
"use client";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("foxact/create-stackless-error"),t=require("react");exports.createSekisho=function(s){let o=new WeakSet;class n extends Error{constructor(e){super(e),this.digest="BAILOUT_TO_CLIENT_SIDE_RENDERING",this.name=s??"SekishoGuardError",o.add(this)}}function i(e){return"object"==typeof e&&null!==e&&o.has(e)}class a extends t.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}render(){let r=this.state.error;if(null===r)return this.props.children;if(i(r)){let{fallback:t,fallbackComponent:s}=this.props;return s?e.jsx(s,{error:r}):t}throw r}}return[function(e){throw r.createStacklessError(()=>new n(e))},a,i,n]};
|
package/dist/factory.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ type SekishoGuardBoundaryProps = React.PropsWithChildren & ({
|
|
|
23
23
|
}>;
|
|
24
24
|
});
|
|
25
25
|
interface SekishoGuardBoundaryState {
|
|
26
|
-
|
|
26
|
+
error: unknown | null;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Creates a paired guard throw function, error boundary component, type guard,
|
package/dist/factory.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";import{jsx as r}from"react/jsx-runtime";import{createStacklessError as t}from"foxact/create-stackless-error";import{Component as e}from"react";function o(o){let s=new WeakSet;class n extends Error{constructor(r){super(r),this.digest="BAILOUT_TO_CLIENT_SIDE_RENDERING",this.name=o??"SekishoGuardError",s.add(this)}}function i(r){return
|
|
1
|
+
"use client";import{jsx as r}from"react/jsx-runtime";import{createStacklessError as t}from"foxact/create-stackless-error";import{Component as e}from"react";function o(o){let s=new WeakSet;class n extends Error{constructor(r){super(r),this.digest="BAILOUT_TO_CLIENT_SIDE_RENDERING",this.name=o??"SekishoGuardError",s.add(this)}}function i(r){return"object"==typeof r&&null!==r&&s.has(r)}return[function(r){throw t(()=>new n(r))},class extends e{constructor(r){super(r),this.state={error:null}}static getDerivedStateFromError(r){return{error:r}}render(){let t=this.state.error;if(null===t)return this.props.children;if(i(t)){let{fallback:e,fallbackComponent:o}=this.props;return o?r(o,{error:t}):e}throw t}},i,n]}export{o as createSekisho};
|