Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

deserialize-error

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deserialize-error - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

4

lib/index.js

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

'use strict';Object.defineProperty(exports,'__esModule',{value:true});var _typeof=typeof Symbol==='function'&&typeof Symbol.iterator==='symbol'?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==='function'&&obj.constructor===Symbol?'symbol':typeof obj};exports.default=deserializeError;exports.isSerializedError=isSerializedError;function deserializeError(obj){if(!isSerializedError(obj))return obj;var err=new Error;err.name=obj.name;err.message=obj.message;err.stack=obj.stack;return err}function isSerializedError(obj){return obj&&(typeof obj==='undefined'?'undefined':_typeof(obj))==='object'&&typeof obj.name==='string'&&typeof obj.message==='string'&&typeof obj.stack==='string'}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJkZXNlcmlhbGl6ZUVycm9yIiwiaXNTZXJpYWxpemVkRXJyb3IiLCJvYmoiLCJlcnIiLCJFcnJvciIsIm5hbWUiLCJtZXNzYWdlIiwic3RhY2siXSwibWFwcGluZ3MiOiJxU0FBd0JBLGdCLFNBU1JDLGlCLENBQUFBLGlCLENBVEQsUUFBU0QsaUJBQVQsQ0FBMkJFLEdBQTNCLENBQWdDLENBQzdDLEdBQUksQ0FBQ0Qsa0JBQWtCQyxHQUFsQixDQUFMLENBQTZCLE1BQU9BLElBQVAsQ0FDN0IsR0FBTUMsS0FBTSxHQUFJQyxNQUFoQixDQUNBRCxJQUFJRSxJQUFKLENBQVdILElBQUlHLElBQWYsQ0FDQUYsSUFBSUcsT0FBSixDQUFjSixJQUFJSSxPQUFsQixDQUNBSCxJQUFJSSxLQUFKLENBQVlMLElBQUlLLEtBQWhCLENBQ0EsTUFBT0osSUFDUixDQUVNLFFBQVNGLGtCQUFULENBQTRCQyxHQUE1QixDQUFpQyxDQUN0QyxNQUFPQSxNQUNMLE9BQU9BLElBQVAsbUNBQU9BLEdBQVAsS0FBZSxRQURWLEVBRUwsTUFBT0EsS0FBSUcsSUFBWCxHQUFvQixRQUZmLEVBR0wsTUFBT0gsS0FBSUksT0FBWCxHQUF1QixRQUhsQixFQUlMLE1BQU9KLEtBQUlLLEtBQVgsR0FBcUIsUUFDeEIiLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBkZXNlcmlhbGl6ZUVycm9yIChvYmopIHtcbiAgaWYgKCFpc1NlcmlhbGl6ZWRFcnJvcihvYmopKSByZXR1cm4gb2JqXG4gIGNvbnN0IGVyciA9IG5ldyBFcnJvcigpXG4gIGVyci5uYW1lID0gb2JqLm5hbWVcbiAgZXJyLm1lc3NhZ2UgPSBvYmoubWVzc2FnZVxuICBlcnIuc3RhY2sgPSBvYmouc3RhY2tcbiAgcmV0dXJuIGVyclxufVxuXG5leHBvcnQgZnVuY3Rpb24gaXNTZXJpYWxpemVkRXJyb3IgKG9iaikge1xuICByZXR1cm4gb2JqICYmXG4gICAgdHlwZW9mIG9iaiA9PT0gJ29iamVjdCcgJiZcbiAgICB0eXBlb2Ygb2JqLm5hbWUgPT09ICdzdHJpbmcnICYmXG4gICAgdHlwZW9mIG9iai5tZXNzYWdlID09PSAnc3RyaW5nJyAmJlxuICAgIHR5cGVvZiBvYmouc3RhY2sgPT09ICdzdHJpbmcnXG59XG4iXX0=
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var _typeof=typeof Symbol==='function'&&typeof Symbol.iterator==='symbol'?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==='function'&&obj.constructor===Symbol?'symbol':typeof obj};exports.default=deserializeError;exports.isSerializedError=isSerializedError;function deserializeError(obj){if(!isSerializedError(obj))return obj;return Object.assign(new Error,{stack:undefined},obj)}function isSerializedError(obj){return obj&&(typeof obj==='undefined'?'undefined':_typeof(obj))==='object'&&typeof obj.name==='string'&&typeof obj.message==='string'}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC5qcyJdLCJuYW1lcyI6WyJkZXNlcmlhbGl6ZUVycm9yIiwiaXNTZXJpYWxpemVkRXJyb3IiLCJvYmoiLCJPYmplY3QiLCJhc3NpZ24iLCJFcnJvciIsInN0YWNrIiwidW5kZWZpbmVkIiwibmFtZSIsIm1lc3NhZ2UiXSwibWFwcGluZ3MiOiJxU0FBd0JBLGdCLFNBS1JDLGlCLENBQUFBLGlCLENBTEQsUUFBU0QsaUJBQVQsQ0FBMkJFLEdBQTNCLENBQWdDLENBQzdDLEdBQUksQ0FBQ0Qsa0JBQWtCQyxHQUFsQixDQUFMLENBQTZCLE1BQU9BLElBQVAsQ0FDN0IsTUFBT0MsUUFBT0MsTUFBUCxDQUFjLEdBQUlDLE1BQWxCLENBQTJCLENBQUNDLE1BQU9DLFNBQVIsQ0FBM0IsQ0FBK0NMLEdBQS9DLENBQ1IsQ0FFTSxRQUFTRCxrQkFBVCxDQUE0QkMsR0FBNUIsQ0FBaUMsQ0FDdEMsTUFBT0EsTUFDTCxPQUFPQSxJQUFQLG1DQUFPQSxHQUFQLEtBQWUsUUFEVixFQUVMLE1BQU9BLEtBQUlNLElBQVgsR0FBb0IsUUFGZixFQUdMLE1BQU9OLEtBQUlPLE9BQVgsR0FBdUIsUUFDMUIiLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgZGVmYXVsdCBmdW5jdGlvbiBkZXNlcmlhbGl6ZUVycm9yIChvYmopIHtcbiAgaWYgKCFpc1NlcmlhbGl6ZWRFcnJvcihvYmopKSByZXR1cm4gb2JqXG4gIHJldHVybiBPYmplY3QuYXNzaWduKG5ldyBFcnJvcigpLCB7c3RhY2s6IHVuZGVmaW5lZH0sIG9iailcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIGlzU2VyaWFsaXplZEVycm9yIChvYmopIHtcbiAgcmV0dXJuIG9iaiAmJlxuICAgIHR5cGVvZiBvYmogPT09ICdvYmplY3QnICYmXG4gICAgdHlwZW9mIG9iai5uYW1lID09PSAnc3RyaW5nJyAmJlxuICAgIHR5cGVvZiBvYmoubWVzc2FnZSA9PT0gJ3N0cmluZydcbn1cbiJdfQ==
{
"name": "deserialize-error",
"version": "0.0.1",
"version": "0.0.2",
"description": "convert Plain Object to Error Object",

@@ -5,0 +5,0 @@ "main": "index.js",

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