Skip to content

Latest commit

 

History

History
259 lines (137 loc) · 5.37 KB

File metadata and controls

259 lines (137 loc) · 5.37 KB

Type Checking

Description of the type checking.

Import

import { is } from '@webalternatif/js-core'

API

isString

src/is.js:7-9

Parameters

  • str any

Returns boolean

isObject

src/is.js:15-17

Parameters

  • o any

Returns boolean

isFunction

src/is.js:23-25

Parameters

  • f any

Returns boolean

isPlainObject

src/is.js:31-38

Parameters

  • o any

Returns boolean

isBoolean

src/is.js:44-46

Parameters

  • b any

Returns boolean

isUndefined

src/is.js:54-56

Parameters

  • v any

Returns boolean

isArrayLike

src/is.js:62-71

Parameters

  • o any

Returns boolean

isArray

src/is.js:77-79

Parameters

  • a any

Returns boolean

isDate

src/is.js:85-87

Parameters

  • o any

Returns boolean

isEvent

src/is.js:93-95

Parameters

  • o any

Returns boolean

isInteger

src/is.js:101-103

Parameters

  • n any

Returns boolean

isFloat

src/is.js:111-113

Parameters

  • n any

Returns boolean

isScalar

src/is.js:119-123

Parameters

  • v any

Returns boolean

isEventSupported

src/is.js:129-151

Parameters

Returns boolean

isTouchDevice

src/is.js:156-158

Returns boolean

isWindow

src/is.js:170-172

Checks whether the given value is the global window object.

Parameters

  • o any Value to test

Examples

isWindow(window) // true
isWindow(globalThis) // true (in browsers)

Returns boolean true if the value is the browser window object

isDocument

src/is.js:185-187

Checks whether the given value is the global document object.

Parameters

  • o any Value to test

Examples

isDocument(document) // true (in browsers)
isDocument(window.document) // true (in browsers)
isDocument({document}) // false

Returns boolean true if the value is the browser document object

isDomElement

src/is.js:199-201

Checks whether the given value is a DOM Element.

Parameters

  • o any Value to test

Examples

const el = document.createElement('div')
isDomElement(el) // true

Returns boolean true if the value is a DOM Element