New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

error-boundary-jsx

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

error-boundary-jsx - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

lib/error-boundary-jsx.cjs.js

@@ -1,1 +0,1 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react");function _classCallCheck(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),e}function _defineProperty(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _inherits(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&_setPrototypeOf(e,r)}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _setPrototypeOf(e,r){return(_setPrototypeOf=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn(e,r){return!r||"object"!=typeof r&&"function"!=typeof r?_assertThisInitialized(e):r}var DEFAULT_ERROR="Error was swallowed.",ErrorBoundary=function(e){function r(e){var t;return _classCallCheck(this,r),(t=_possibleConstructorReturn(this,_getPrototypeOf(r).call(this,e))).state={error:void 0,errorInfo:void 0},t}return _inherits(r,React.PureComponent),_createClass(r,[{key:"componentDidCatch",value:function(e,r){var t=this.props,o=t.onError,n=t.name;if("function"==typeof o)try{o(n,e,r?r.componentStack:"No stack")}catch(e){console.error(e)}this.setState({error:e||new Error(DEFAULT_ERROR),errorInfo:r})}},{key:"render",value:function(){var e=this.state,r=e.error,t=e.errorInfo,o=this.props,n=o.children,a=o.FallbackComponent;return r?a?React.createElement(a,{error:r,errorStack:t?t.componentStack:"Stack not found"}):React.createElement("h2",null,"Something went wrong."):n}}]),r}();_defineProperty(ErrorBoundary,"displayName","ErrorBoundary");var withErrorBoundary=function(e,r,t){var o=e.displayName?e.displayName:"Unnamed Component",n=function(n){return React.createElement(ErrorBoundary,{onError:r,name:o,FallbackComponent:t},React.createElement(e,n))};return n.displayName="WithErrorBoundary(".concat(o,")"),n};exports.withErrorBoundary=withErrorBoundary;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var React=require("react");function _classCallCheck(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),e}function _defineProperty(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function _inherits(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&_setPrototypeOf(e,r)}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _setPrototypeOf(e,r){return(_setPrototypeOf=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn(e,r){return!r||"object"!=typeof r&&"function"!=typeof r?_assertThisInitialized(e):r}var DEFAULT_ERROR="Error was swallowed.",ErrorBoundary=function(e){function r(e){var t;return _classCallCheck(this,r),(t=_possibleConstructorReturn(this,_getPrototypeOf(r).call(this,e))).state={error:void 0,errorInfo:void 0},t}return _inherits(r,React.PureComponent),_createClass(r,[{key:"componentDidCatch",value:function(e,r){var t=this.props,o=t.onError,n=t.name;if("function"==typeof o)try{o(n,e,r?r.componentStack:"No stack")}catch(e){console.error(e)}this.setState({error:e||new Error(DEFAULT_ERROR),errorInfo:r})}},{key:"render",value:function(){var e=this.state,r=e.error,t=e.errorInfo,o=this.props,n=o.children,a=o.FallbackComponent;return r?a?React.createElement(a,{error:r,errorStack:t?t.componentStack:"Stack not found"}):React.createElement("h2",null,"Something went wrong."):n}}]),r}();_defineProperty(ErrorBoundary,"displayName","ErrorBoundary");var withErrorBoundary=function(e,r,t){var o=e.displayName?e.displayName:"Unnamed Component",n=function(n){return React.createElement(ErrorBoundary,{onError:r,name:o,FallbackComponent:t},React.createElement(e,n))};return n.displayName="WithErrorBoundary(".concat(o,")"),n};exports.ErrorBoundary=ErrorBoundary,exports.withErrorBoundary=withErrorBoundary;

@@ -1,1 +0,1 @@

import{createElement as r,PureComponent as e}from"react";function t(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function n(r){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)})(r)}function o(r,e){return(o=Object.setPrototypeOf||function(r,e){return r.__proto__=e,r})(r,e)}function a(r,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(r){if(void 0===r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}(r):e}var i,c,u,f=function(i){function c(r){var e;return function(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),(e=a(this,n(c).call(this,r))).state={error:void 0,errorInfo:void 0},e}var u,f,l;return function(r,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&o(r,e)}(c,e),u=c,(f=[{key:"componentDidCatch",value:function(r,e){var t=this.props,n=t.onError,o=t.name;if("function"==typeof n)try{n(o,r,e?e.componentStack:"No stack")}catch(r){console.error(r)}this.setState({error:r||new Error("Error was swallowed."),errorInfo:e})}},{key:"render",value:function(){var e=this.state,t=e.error,n=e.errorInfo,o=this.props,a=o.children,i=o.FallbackComponent;return t?i?r(i,{error:t,errorStack:n?n.componentStack:"Stack not found"}):r("h2",null,"Something went wrong."):a}}])&&t(u.prototype,f),l&&t(u,l),c}();u="ErrorBoundary",(c="displayName")in(i=f)?Object.defineProperty(i,c,{value:u,enumerable:!0,configurable:!0,writable:!0}):i[c]=u;var l=function(e,t,n){var o=e.displayName?e.displayName:"Unnamed Component",a=function(a){return r(f,{onError:t,name:o,FallbackComponent:n},r(e,a))};return a.displayName="WithErrorBoundary(".concat(o,")"),a};export{l as withErrorBoundary};
import{createElement as r,PureComponent as e}from"react";function t(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,n.key,n)}}function n(r){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)})(r)}function o(r,e){return(o=Object.setPrototypeOf||function(r,e){return r.__proto__=e,r})(r,e)}function a(r,e){return!e||"object"!=typeof e&&"function"!=typeof e?function(r){if(void 0===r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}(r):e}var i,c,u,f=function(i){function c(r){var e;return function(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),(e=a(this,n(c).call(this,r))).state={error:void 0,errorInfo:void 0},e}var u,f,l;return function(r,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&o(r,e)}(c,e),u=c,(f=[{key:"componentDidCatch",value:function(r,e){var t=this.props,n=t.onError,o=t.name;if("function"==typeof n)try{n(o,r,e?e.componentStack:"No stack")}catch(r){console.error(r)}this.setState({error:r||new Error("Error was swallowed."),errorInfo:e})}},{key:"render",value:function(){var e=this.state,t=e.error,n=e.errorInfo,o=this.props,a=o.children,i=o.FallbackComponent;return t?i?r(i,{error:t,errorStack:n?n.componentStack:"Stack not found"}):r("h2",null,"Something went wrong."):a}}])&&t(u.prototype,f),l&&t(u,l),c}();u="ErrorBoundary",(c="displayName")in(i=f)?Object.defineProperty(i,c,{value:u,enumerable:!0,configurable:!0,writable:!0}):i[c]=u;var l=function(e,t,n){var o=e.displayName?e.displayName:"Unnamed Component",a=function(a){return r(f,{onError:t,name:o,FallbackComponent:n},r(e,a))};return a.displayName="WithErrorBoundary(".concat(o,")"),a};export{f as ErrorBoundary,l as withErrorBoundary};

@@ -1,1 +0,1 @@

!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],r):r((e=e||self).errorBoundary={},e.React)}(this,(function(e,r){"use strict";function t(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,r){return(o=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function a(e,r){return!r||"object"!=typeof r&&"function"!=typeof r?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):r}var i,c,u,f=function(e){function i(e){var r;return function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,i),(r=a(this,n(i).call(this,e))).state={error:void 0,errorInfo:void 0},r}var c,u,f;return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&o(e,r)}(i,e),c=i,(u=[{key:"componentDidCatch",value:function(e,r){var t=this.props,n=t.onError,o=t.name;if("function"==typeof n)try{n(o,e,r?r.componentStack:"No stack")}catch(e){console.error(e)}this.setState({error:e||new Error("Error was swallowed."),errorInfo:r})}},{key:"render",value:function(){var e=this.state,t=e.error,n=e.errorInfo,o=this.props,a=o.children,i=o.FallbackComponent;return t?i?r.createElement(i,{error:t,errorStack:n?n.componentStack:"Stack not found"}):r.createElement("h2",null,"Something went wrong."):a}}])&&t(c.prototype,u),f&&t(c,f),i}(r.PureComponent);u="ErrorBoundary",(c="displayName")in(i=f)?Object.defineProperty(i,c,{value:u,enumerable:!0,configurable:!0,writable:!0}):i[c]=u;e.withErrorBoundary=function(e,t,n){var o=e.displayName?e.displayName:"Unnamed Component",a=function(a){return r.createElement(f,{onError:t,name:o,FallbackComponent:n},r.createElement(e,a))};return a.displayName="WithErrorBoundary(".concat(o,")"),a},Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],r):r((e=e||self).errorBoundary={},e.React)}(this,(function(e,r){"use strict";function t(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function n(e){return(n=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function o(e,r){return(o=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function a(e,r){return!r||"object"!=typeof r&&"function"!=typeof r?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):r}var i,c,u,f=function(e){function i(e){var r;return function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,i),(r=a(this,n(i).call(this,e))).state={error:void 0,errorInfo:void 0},r}var c,u,f;return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),r&&o(e,r)}(i,e),c=i,(u=[{key:"componentDidCatch",value:function(e,r){var t=this.props,n=t.onError,o=t.name;if("function"==typeof n)try{n(o,e,r?r.componentStack:"No stack")}catch(e){console.error(e)}this.setState({error:e||new Error("Error was swallowed."),errorInfo:r})}},{key:"render",value:function(){var e=this.state,t=e.error,n=e.errorInfo,o=this.props,a=o.children,i=o.FallbackComponent;return t?i?r.createElement(i,{error:t,errorStack:n?n.componentStack:"Stack not found"}):r.createElement("h2",null,"Something went wrong."):a}}])&&t(c.prototype,u),f&&t(c,f),i}(r.PureComponent);u="ErrorBoundary",(c="displayName")in(i=f)?Object.defineProperty(i,c,{value:u,enumerable:!0,configurable:!0,writable:!0}):i[c]=u;e.ErrorBoundary=f,e.withErrorBoundary=function(e,t,n){var o=e.displayName?e.displayName:"Unnamed Component",a=function(a){return r.createElement(f,{onError:t,name:o,FallbackComponent:n},r.createElement(e,a))};return a.displayName="WithErrorBoundary(".concat(o,")"),a},Object.defineProperty(e,"__esModule",{value:!0})}));
export { default as withErrorBoundary } from './withErrorBoundary';
export { default as ErrorBoundary } from './ErrorBoundary';
export * from './ErrorBoundary';
{
"name": "error-boundary-jsx",
"description": "React (JS) string formatting",
"version": "1.0.0",
"version": "1.0.1",
"license": "MIT",

@@ -6,0 +6,0 @@ "author": "Nicky Shannon @nickyshannon",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc