API 浏览器
类型检查实用程序 (<is>)
v2.8+

提示

有关 UMD 构建的使用方法,请参阅 此处

¥For usage with the UMD build see here.

is.deepEqual(is.deepEqual)

递归检查一个对象是否等于另一个对象。还支持 Map、Set、ArrayBuffer、Regexp、Date 等。

¥Recursively checks if one Object is equal to another. Also supports Map, Set, ArrayBuffer, Regexp, Date, and many more.

import { is } from 'quasar'

const objA = { /* ... */ }
const objB = { /* ... */ }

console.log( is.deepEqual(objA, objB) ) // true or false

is.object(is.object)

import { is } from 'quasar'

const obj = { some: 'value' }
console.log( is.object(obj) ) // true

is.date(is.date)

import { is } from 'quasar'

const date = new Date()
console.log( is.date(date) ) // true

const now = Date.now()
console.log( is.date(now) ) // false

is.regexp(is.regexp)

import { is } from 'quasar'

const pattern1 = /\w+/
console.log( is.regexp(pattern1) ) // true

const pattern2 = new RegExp('\\w+')
console.log( is.regexp(pattern2) ) // true

is.number(is.number)

import { is } from 'quasar'

const myNumber = 80
console.log( is.number(myNumber) ) // true