Utility module for object, type checking, and data manipulation functions. Provides helper methods for working with objects, arrays, types, and cloning.
Methods
static export isObject(obj) → boolean
Checks if the given value is an object.
| Name | Type | Description |
|---|---|---|
obj |
* |
The value to check. |
static export isArray(obj) → boolean
Checks if the given value is an array.
| Name | Type | Description |
|---|---|---|
obj |
* |
The value to check. |
static export isNumber(obj) → boolean
Checks if the given value is a number.
| Name | Type | Description |
|---|---|---|
obj |
* |
The value to check. |
static export isInteger(obj) → boolean
Checks if the given value is an integer.
| Name | Type | Description |
|---|---|---|
obj |
* |
The value to check. |
static export isString(obj) → boolean
Checks if the given value is a string.
| Name | Type | Description |
|---|---|---|
obj |
* |
The value to check. |
static export isFunction(obj) → boolean
Checks if the given value is a function.
| Name | Type | Description |
|---|---|---|
obj |
* |
The value to check. |
static export isSymbol(obj) → boolean
Checks if the given value is a symbol.
| Name | Type | Description |
|---|---|---|
obj |
* |
The value to check. |
static export isElement(obj) → boolean
Checks if the given value is a DOM element.
| Name | Type | Description |
|---|---|---|
obj |
* |
The value to check. |
static export isDomFragment(obj) → boolean
Checks if the given value is a DOM fragment.
| Name | Type | Description |
|---|---|---|
obj |
* |
The value to check. |
static export isNode(obj) → boolean
Checks if the given value is a DOM node.
| Name | Type | Description |
|---|---|---|
obj |
* |
The value to check. |
static export isNodeList(obj) → boolean
Checks if the given value is a NodeList.
| Name | Type | Description |
|---|---|---|
obj |
* |
The value to check. |
static export isRegex(obj) → boolean
Checks if the given value is a regular expression.
| Name | Type | Description |
|---|---|---|
obj |
* |
The value to check. |
static export isDate(obj) → boolean
Checks if the given value is a Date.
| Name | Type | Description |
|---|---|---|
obj |
* |
The value to check. |
static export isBoolean(obj) → boolean
Checks if the given value is a boolean.
| Name | Type | Description |
|---|---|---|
obj |
* |
The value to check. |
static export isUndefined(obj) → boolean
Checks if the given value is undefied.
| Name | Type | Description |
|---|---|---|
obj |
* |
The value to check. |
static export isEmpty(obj, nonEnumerableopt) → boolean
Checks if the given value is empty.
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
obj |
* |
The value to check. |
||
nonEnumerable |
boolean | optional | false |
If true, checks non-enumerable properties as well. |
static export clone(obj, wmopt) → *
Deeply clones an object with optional support for tracking references to prevent cyclic references.
| Name | Type | Attributes | Description |
|---|---|---|---|
obj |
* |
The object to clone. |
|
wm |
WeakMap | optional |
A WeakMap to track references and prevent cyclic references. |
static export extend(…sources) → Object
Extends a target object with properties from one or more source objects. Supports deep cloning and cyclic reference tracking using a WeakMap.
| Name | Type | Attributes | Description |
|---|---|---|---|
sources |
Object | repeatable |
The source objects from which to copy properties. |
private, static _extend(target, source, refMapopt) → *
Internal helper function to recursively extend objects. Handles various data types and prevents cyclic references using a WeakMap.
| Name | Type | Attributes | Description |
|---|---|---|---|
target |
* |
The target object to extend. |
|
source |
* |
The source object providing properties. |
|
refMap |
WeakMap | optional |
A WeakMap to track references and handle cyclic structures. |