Socket
Socket
Sign inDemoInstall

superjson

Package Overview
Dependencies
Maintainers
4
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

superjson - npm Package Compare versions

Comparing version 1.10.0 to 1.10.1

6

dist/esm/is.js

@@ -9,8 +9,8 @@ var getType = function (payload) {

export var isPlainObject = function (payload) {
if (getType(payload) !== 'Object')
if (typeof payload !== 'object' || payload === null)
return false;
if (payload === Object.prototype)
return false;
if (Object.getPrototypeOf(payload) === null)
return true;
if (payload === Object.prototype)
return false;
return (payload.constructor === Object &&

@@ -17,0 +17,0 @@ Object.getPrototypeOf(payload) === Object.prototype);

@@ -14,8 +14,8 @@ "use strict";

var isPlainObject = function (payload) {
if (getType(payload) !== 'Object')
if (typeof payload !== 'object' || payload === null)
return false;
if (payload === Object.prototype)
return false;
if (Object.getPrototypeOf(payload) === null)
return true;
if (payload === Object.prototype)
return false;
return (payload.constructor === Object &&

@@ -22,0 +22,0 @@ Object.getPrototypeOf(payload) === Object.prototype);

{
"version": "1.10.0",
"version": "1.10.1",
"license": "MIT",

@@ -4,0 +4,0 @@ "main": "dist/index.js",

@@ -36,2 +36,5 @@ import {

expect(isURL(new URL('https://example.com'))).toBe(true);
expect(isPlainObject({})).toBe(true);
// eslint-disable-next-line no-new-object
expect(isPlainObject(new Object())).toBe(true);
});

@@ -56,2 +59,7 @@

expect(isURL('https://example.com')).toBe(false);
expect(isPlainObject(null)).toBe(false);
expect(isPlainObject([])).toBe(false);
expect(isPlainObject(Object.prototype)).toBe(false);
expect(isPlainObject(Object.create(Array.prototype))).toBe(false);
});

@@ -58,0 +66,0 @@

@@ -12,5 +12,6 @@ const getType = (payload: any): string =>

): payload is { [key: string]: any } => {
if (getType(payload) !== 'Object') return false;
if (typeof payload !== 'object' || payload === null) return false;
if (payload === Object.prototype) return false;
if (Object.getPrototypeOf(payload) === null) return true;
if (payload === Object.prototype) return false;
return (

@@ -17,0 +18,0 @@ payload.constructor === Object &&

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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