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

@augment-vir/common

Package Overview
Dependencies
Maintainers
1
Versions
222
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@augment-vir/common - npm Package Compare versions

Comparing version 9.3.2 to 10.0.0

3

dist/cjs/augments/object/object.d.ts

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

import { Jsonifiable } from 'type-fest';
export type PartialWithNullable<T extends object> = {

@@ -5,3 +6,3 @@ [Prop in keyof T]?: T[Prop] | null | undefined;

export declare function isObject(input: any): input is NonNullable<object>;
export declare function areJsonEqual(a: object, b: object): boolean;
export declare function areJsonEqual(a: Jsonifiable, b: Jsonifiable): boolean;
/** The input here must be serializable otherwise JSON parsing errors will be thrown */

@@ -8,0 +9,0 @@ export declare function copyThroughJson<T>(input: T): T;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.copyThroughJson = exports.areJsonEqual = exports.isObject = void 0;
const error_1 = require("../error");
const object_entries_1 = require("./object-entries");

@@ -11,8 +12,16 @@ function isObject(input) {

try {
const sortedAEntries = (0, object_entries_1.getEntriesSortedByKey)(a);
const sortedBEntries = (0, object_entries_1.getEntriesSortedByKey)(b);
return JSON.stringify(sortedAEntries) === JSON.stringify(sortedBEntries);
if (a === b) {
return true;
}
if (isObject(a) && isObject(b)) {
const sortedAEntries = (0, object_entries_1.getEntriesSortedByKey)(a);
const sortedBEntries = (0, object_entries_1.getEntriesSortedByKey)(b);
return JSON.stringify(sortedAEntries) === JSON.stringify(sortedBEntries);
}
else {
return JSON.stringify(a) === JSON.stringify(b);
}
}
catch (error) {
console.error(`Failed to compare objects using JSON.stringify`);
console.error(`Failed to compare objects using JSON.stringify: ${(0, error_1.extractErrorMessage)(error)}`);
throw error;

@@ -19,0 +28,0 @@ }

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

import { Jsonifiable } from 'type-fest';
export type PartialWithNullable<T extends object> = {

@@ -5,3 +6,3 @@ [Prop in keyof T]?: T[Prop] | null | undefined;

export declare function isObject(input: any): input is NonNullable<object>;
export declare function areJsonEqual(a: object, b: object): boolean;
export declare function areJsonEqual(a: Jsonifiable, b: Jsonifiable): boolean;
/** The input here must be serializable otherwise JSON parsing errors will be thrown */

@@ -8,0 +9,0 @@ export declare function copyThroughJson<T>(input: T): T;

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

import { extractErrorMessage } from '../error';
import { getEntriesSortedByKey } from './object-entries';

@@ -7,8 +8,16 @@ export function isObject(input) {

try {
const sortedAEntries = getEntriesSortedByKey(a);
const sortedBEntries = getEntriesSortedByKey(b);
return JSON.stringify(sortedAEntries) === JSON.stringify(sortedBEntries);
if (a === b) {
return true;
}
if (isObject(a) && isObject(b)) {
const sortedAEntries = getEntriesSortedByKey(a);
const sortedBEntries = getEntriesSortedByKey(b);
return JSON.stringify(sortedAEntries) === JSON.stringify(sortedBEntries);
}
else {
return JSON.stringify(a) === JSON.stringify(b);
}
}
catch (error) {
console.error(`Failed to compare objects using JSON.stringify`);
console.error(`Failed to compare objects using JSON.stringify: ${extractErrorMessage(error)}`);
throw error;

@@ -15,0 +24,0 @@ }

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

import { Jsonifiable } from 'type-fest';
export type PartialWithNullable<T extends object> = {

@@ -5,3 +6,3 @@ [Prop in keyof T]?: T[Prop] | null | undefined;

export declare function isObject(input: any): input is NonNullable<object>;
export declare function areJsonEqual(a: object, b: object): boolean;
export declare function areJsonEqual(a: Jsonifiable, b: Jsonifiable): boolean;
/** The input here must be serializable otherwise JSON parsing errors will be thrown */

@@ -8,0 +9,0 @@ export declare function copyThroughJson<T>(input: T): T;

{
"name": "@augment-vir/common",
"version": "9.3.2",
"version": "10.0.0",
"homepage": "https://github.com/electrovir/augment-vir/tree/main/packages/common",

@@ -5,0 +5,0 @@ "bugs": {

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