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

fast-equals

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast-equals - npm Package Compare versions

Comparing version 4.0.1-beta.1 to 4.0.1-beta.2

src/types.ts

39

index.d.ts

@@ -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

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