fast-equals
Advanced tools
Comparing version 4.0.1-beta.1 to 4.0.1-beta.2
@@ -1,27 +0,16 @@ | ||
import type { | ||
circularDeepEqual as CircularDeepEqual, | ||
circularShallowEqual as CircularShallowEqual, | ||
createCustomEqual as CreateCustomEqual, | ||
createCustomCircularEqual as CreateCustomCircularEqual, | ||
deepEqual as DeepEqual, | ||
shallowEqual as ShallowEqual, | ||
sameValueZeroEqual as SameValueZeroEqual, | ||
} from './src/index'; | ||
import type { EqualityComparator, GetComparatorOptions } from './src/types'; | ||
export type { BaseCircularMeta, GetComparatorOptions } from './src/index'; | ||
export type { CreateComparatorCreatorOptions } from './src/comparator'; | ||
export type { | ||
EqualityComparator, | ||
EqualityComparatorCreator, | ||
InternalEqualityComparator, | ||
NativeEqualityComparator, | ||
TypeEqualityComparator, | ||
} from './src/utils'; | ||
export * from './src/types'; | ||
export const circularDeepEqual: typeof CircularDeepEqual; | ||
export const circularShallowEqual: typeof CircularShallowEqual; | ||
export const createCustomEqual: typeof CreateCustomEqual; | ||
export const createCustomCircularEqual: typeof CreateCustomCircularEqual; | ||
export const deepEqual: typeof DeepEqual; | ||
export const shallowEqual: typeof ShallowEqual; | ||
export const sameValueZeroEqual: typeof SameValueZeroEqual; | ||
export function circularDeepEqual<A, B>(a: A, b: B): boolean; | ||
export function circularShallowEqual<A, B>(a: A, b: B): boolean; | ||
export function deepEqual<A, B>(a: A, b: B): boolean; | ||
export function shallowEqual<A, B>(a: A, b: B): boolean; | ||
export function sameValueZeroEqual<A, B>(a: A, b: B): boolean; | ||
export function createCustomEqual<Meta = undefined>( | ||
getComparatorOptions: GetComparatorOptions<Meta>, | ||
): EqualityComparator<Meta>; | ||
export function createCustomEqual<Meta = WeakMap<any, any>>( | ||
getComparatorOptions: GetComparatorOptions<Meta>, | ||
): EqualityComparator<Meta>; |
@@ -88,3 +88,3 @@ { | ||
"types": "index.d.ts", | ||
"version": "4.0.1-beta.1" | ||
"version": "4.0.1-beta.2" | ||
} |
import { createIsCircular } from './utils'; | ||
import type { InternalEqualityComparator } from './utils'; | ||
import type { InternalEqualityComparator } from './types'; | ||
@@ -5,0 +5,0 @@ /** |
import { isPlainObject, isPromiseLike, sameValueZeroEqual } from './utils'; | ||
import type { | ||
CreateComparatorCreatorOptions, | ||
EqualityComparator, | ||
EqualityComparatorCreator, | ||
TypeEqualityComparator, | ||
} from './utils'; | ||
} from './types'; | ||
export interface CreateComparatorCreatorOptions<Meta> { | ||
areArraysEqual: TypeEqualityComparator<any, Meta>; | ||
areDatesEqual: TypeEqualityComparator<any, Meta>; | ||
areMapsEqual: TypeEqualityComparator<any, Meta>; | ||
areObjectsEqual: TypeEqualityComparator<any, Meta>; | ||
areRegExpsEqual: TypeEqualityComparator<any, Meta>; | ||
areSetsEqual: TypeEqualityComparator<any, Meta>; | ||
createIsNestedEqual: EqualityComparatorCreator<Meta>; | ||
} | ||
const ARGUMENTS_TAG = '[object Arguments]'; | ||
@@ -20,0 +9,0 @@ const BOOLEAN_TAG = '[object Boolean]'; |
@@ -8,31 +8,15 @@ import { createComparator } from './comparator'; | ||
import { areSetsEqual, areSetsEqualCircular } from './sets'; | ||
import { | ||
createDefaultIsNestedEqual, | ||
import { createDefaultIsNestedEqual, merge, sameValueZeroEqual } from './utils'; | ||
import type { | ||
BaseCircularMeta, | ||
CreateComparatorCreatorOptions, | ||
EqualityComparator, | ||
merge, | ||
sameValueZeroEqual, | ||
} from './utils'; | ||
GetComparatorOptions, | ||
} from './types'; | ||
import type { CreateComparatorCreatorOptions } from './comparator'; | ||
export * from './types'; | ||
export { sameValueZeroEqual }; | ||
export type { CreateComparatorCreatorOptions } from './comparator'; | ||
export type { | ||
EqualityComparator, | ||
EqualityComparatorCreator, | ||
InternalEqualityComparator, | ||
NativeEqualityComparator, | ||
TypeEqualityComparator, | ||
} from './utils'; | ||
export interface BaseCircularMeta | ||
extends Pick<WeakMap<any, any>, 'delete' | 'get'> { | ||
set(key: object, value: any): BaseCircularMeta; | ||
} | ||
export type GetComparatorOptions<Meta> = ( | ||
defaultOptions: CreateComparatorCreatorOptions<Meta>, | ||
) => Partial<CreateComparatorCreatorOptions<Meta>>; | ||
const DEFAULT_CONFIG: CreateComparatorCreatorOptions<undefined> = Object.freeze( | ||
@@ -39,0 +23,0 @@ { |
import { createIsCircular } from './utils'; | ||
import type { InternalEqualityComparator } from './utils'; | ||
import type { InternalEqualityComparator } from './types'; | ||
@@ -5,0 +5,0 @@ /** |
import { createIsCircular } from './utils'; | ||
import type { InternalEqualityComparator } from './utils'; | ||
import type { InternalEqualityComparator } from './types'; | ||
@@ -5,0 +5,0 @@ interface Dictionary<Value> { |
import { createIsCircular } from './utils'; | ||
import type { InternalEqualityComparator } from './utils'; | ||
import type { InternalEqualityComparator } from './types'; | ||
@@ -5,0 +5,0 @@ /** |
@@ -1,28 +0,7 @@ | ||
export type InternalEqualityComparator<Meta> = ( | ||
a: any, | ||
b: any, | ||
indexOrKeyA: any, | ||
indexOrKeyB: any, | ||
parentA: any, | ||
parentB: any, | ||
meta: Meta, | ||
) => boolean; | ||
import { | ||
EqualityComparator, | ||
InternalEqualityComparator, | ||
TypeEqualityComparator, | ||
} from './types'; | ||
export type EqualityComparator<Meta> = Meta extends undefined | ||
? <A, B>(a: A, b: B, meta?: Meta) => boolean | ||
: <A, B>(a: A, b: B, meta: Meta) => boolean; | ||
export type EqualityComparatorCreator<Meta> = ( | ||
fn: EqualityComparator<Meta>, | ||
) => InternalEqualityComparator<Meta>; | ||
export type NativeEqualityComparator = <A, B>(a: A, b: B) => boolean; | ||
export type TypeEqualityComparator<Type, Meta> = ( | ||
a: Type, | ||
b: Type, | ||
isEqual: InternalEqualityComparator<Meta>, | ||
meta: Meta, | ||
) => boolean; | ||
/** | ||
@@ -29,0 +8,0 @@ * Default equality comparator pass-through, used as the standard `isEqual` creator for |
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
34
244871
2276