Type
The Type object of the TypeManager class is designed to check and determine various data types in JavaScript. It provides methods for checking primitive types, objects, arrays, DOM nodes, and other data structures.
import { Type, LoggerBrowser } from '@bitrix24/b24jssdk'
const $logger = LoggerBrowser.build('Test', import.meta.env?.DEV === true)
const testString: any = undefined
$logger.info('isStringFilled:', Type.isStringFilled(testString), testString)
// isStringFilled: false undefined ////Methods
getTag
getTag(value: any): stringReturns a string representation of the object's type using the Object.prototype.toString method.
isString
isString(value: any): booleanChecks if the value is a string.
isStringFilled
isStringFilled(value: any): booleanReturns true if the value is a non-empty string.
isFunction
isFunction(value: any): booleanChecks if the value is a function.
isObject
isObject(value: any): booleanChecks if the value is an object or a function.
isObjectLike
isObjectLike(value: any): booleanChecks if the value is object-like (not null and of type object).
isPlainObject
isPlainObject(value: any): booleanChecks if the value is a plain object (created via {} or new Object()).
isJsonRpcRequest
isJsonRpcRequest(value: any): booleanChecks if the value is a JSON-RPC request.
isJsonRpcResponse
isJsonRpcResponse(value: any): booleanChecks if the value is a JSON-RPC response.
isBoolean
isBoolean(value: any): booleanChecks if the value is a boolean.
isNumber
isNumber(value: any): booleanChecks if the value is a number.
isInteger
isInteger(value: any): booleanChecks if the value is an integer.
isFloat
isFloat(value: any): booleanChecks if the value is a floating-point number.
isNil
isNil(value: any): booleanChecks if the value is null or undefined.
isArray
isArray(value: any): booleanChecks if the value is an array.
isArrayFilled
isArrayFilled(value: any): booleanReturns true if the value is an array and contains at least one element.
isArrayLike
isArrayLike(value: any): booleanChecks if the value is array-like (has a length property).
isDate
isDate(value: any): booleanChecks if the value is a Date object.
isDomNode
isDomNode(value: any): booleanChecks if the value is a DOM node.
isElementNode
isElementNode(value: any): booleanChecks if the value is a DOM element.
isTextNode
isTextNode(value: any): booleanChecks if the value is a DOM text node.
isMap
isMap(value: any): booleanChecks if the value is a Map object.
isSet
isSet(value: any): booleanChecks if the value is a Set object.
isWeakMap
isWeakMap(value: any): booleanChecks if the value is a WeakMap object.
isWeakSet
isWeakSet(value: any): booleanChecks if the value is a WeakSet object.
isPrototype
isPrototype(value: any): booleanChecks if the value is a prototype.
isRegExp
isRegExp(value: any): booleanChecks if the value is a regular expression.
isNull
isNull(value: any): booleanChecks if the value is null.
isUndefined
isUndefined(value: any): booleanChecks if the value is undefined.
isArrayBuffer
isArrayBuffer(value: any): booleanChecks if the value is an ArrayBuffer object.
isTypedArray
isTypedArray(value: any): booleanChecks if the value is a typed array.
isBlob
isBlob(value: any): booleanChecks if the value is a Blob object.
isFile
isFile(value: any): booleanChecks if the value is a File object.
isFormData
isFormData(value: any): booleanChecks if the value is a FormData object.
clone
clone(
obj: any,
bCopyObj: boolean = true
): anyClones an object, creating a deep copy if bCopyObj is true.