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

just-compare

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

just-compare - npm Package Compare versions

Comparing version 2.1.0 to 2.1.1

yarn-error.log

6

CHANGELOG.md
# just-compare
## 2.1.1
### Patch Changes
- Update compare types to work when the input is a generic
## 2.0.2
- Performance optimization

12

index.d.ts

@@ -7,12 +7,12 @@ // Definitions by: Justy Robles <https://github.com/justyrobles>

declare function compare<T1 extends object, T2 extends T1>(
value1: Exclude<T1, Primitive>,
value2: Exclude<T2, Primitive>
declare function compare<T1 extends object, T2 extends object & T1>(
value1: T1,
value2: T2
): boolean;
declare function compare<T1 extends T2, T2 extends object>(
value1: Exclude<T1, Primitive>,
value2: Exclude<T2, Primitive>
declare function compare<T1 extends object & T2, T2 extends object>(
value1: T1,
value2: T2
): boolean;
export default compare;

@@ -48,2 +48,3 @@ import compare from "./index";

compare(NaN, NaN);
const compareIt = <T extends object>(a: T, b: T) => compare(a, b);

@@ -64,2 +65,6 @@ // Not okay

// @ts-expect-error
compare(obj1, num1);
// @ts-expect-error
compare(num1, obj1);
// @ts-expect-error
compare(NaN, "abc");

@@ -66,0 +71,0 @@ // @ts-expect-error

{
"name": "just-compare",
"version": "2.1.0",
"version": "2.1.1",
"description": "compare two collections",

@@ -9,2 +9,3 @@ "main": "index.js",

".": {
"types": "./index.d.ts",
"require": "./index.js",

@@ -11,0 +12,0 @@ "default": "./index.mjs"

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