isEqual
Determine if two values are equal
Usage
Given two values, returns true if they are equal.
import * as import _
_ from 'radashi'
import _
_.function isEqual<null>(x: null, y: null): boolean
Return true if the given values are equal.
To determine equality, Object.is() is used first. If it returns
false, we do the following special checks:
Date and Date with the same time
RegExp and RegExp with the same pattern/flags
- object with the same keys and values (recursive)
isEqual(null, null) // => trueimport _
_.function isEqual<never[]>(x: never[], y: never[]): boolean
Return true if the given values are equal.
To determine equality, Object.is() is used first. If it returns
false, we do the following special checks:
Date and Date with the same time
RegExp and RegExp with the same pattern/flags
- object with the same keys and values (recursive)
isEqual([], []) // => trueimport _
_.function isEqual<{ hello: string;}>(x: { hello: string;}, y: { hello: string;}): boolean
Return true if the given values are equal.
To determine equality, Object.is() is used first. If it returns
false, we do the following special checks:
Date and Date with the same time
RegExp and RegExp with the same pattern/flags
- object with the same keys and values (recursive)
isEqual({ hello: string
hello: 'world' }, { hello: string
hello: 'world' }) // => true
import _
_.function isEqual<string>(x: string, y: string): boolean
Return true if the given values are equal.
To determine equality, Object.is() is used first. If it returns
false, we do the following special checks:
Date and Date with the same time
RegExp and RegExp with the same pattern/flags
- object with the same keys and values (recursive)
isEqual('hello', 'world') // => falseimport _
_.function isEqual<number>(x: number, y: number): boolean
Return true if the given values are equal.
To determine equality, Object.is() is used first. If it returns
false, we do the following special checks:
Date and Date with the same time
RegExp and RegExp with the same pattern/flags
- object with the same keys and values (recursive)
isEqual(22, 'abc') // => falseError ts(2345) ―