just-compare
Advanced tools
Comparing version 2.1.0 to 2.1.1
# just-compare | ||
## 2.1.1 | ||
### Patch Changes | ||
- Update compare types to work when the input is a generic | ||
## 2.0.2 | ||
- Performance optimization |
@@ -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" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11474
10
237