npm package: @nejs/basic-extensions
Description: Basic but commonly used extensions
Author: Brielle Harrison
Latest version: 2.22.12

# @nejs/basic-extensions

## Overview

@nejs/basic-extensions is a JavaScript library that provides a collection of essential extensions
to built-in JavaScript objects like Array, Object, Function, and Reflect. These extensions are
designed to enhance the native capabilities of JavaScript objects, providing developers with
additional utility methods for common tasks and improving code readability and efficiency.

## Features

*   **Array Extensions**: Adds convenience methods to JavaScript arrays, like `first` and `last`,
    for easy access to the first and last elements.

*   **Object Extensions**: Introduces utility functions to the Object class, such as methods for
    checking object types and manipulating properties.

*   **Function Extensions**: Enriches the Function class with methods to identify function types,
    such as arrow functions, async functions, and bound functions.

*   **Reflect Extensions**: Extends the Reflect object with advanced property interaction methods,
    including checks for the presence of multiple or specific keys.

## Installation

Install @nejs/basic-extensions using npm:

```bash
npm install @nejs/basic-extensions
```

Or using yarn:

```bash
yarn add @nejs/basic-extensions
```

## Usage

This package is ESM-first (`"type": "module"`). Import directly:

```javascript
import { ArrayPrototypeExtensions } from '@nejs/basic-extensions';
```

Sub-entry points are available for classes and utilities:

```javascript
import { Descriptor, RefMap } from '@nejs/basic-extensions/classes';
import { is, has, as } from '@nejs/basic-extensions/utils';
```

CommonJS is also supported via bundled CJS output:

```javascript
const { FunctionExtensions } = require('@nejs/basic-extensions');
```

### Browser via jsdelivr

Load the IIFE bundle directly from [jsdelivr](https://www.jsdelivr.com/) — no build step needed:

```html
<script src="https://cdn.jsdelivr.net/npm/@nejs/basic-extensions/dist/@nejs/basic-extensions.bundle.2.22.2.js"></script>
<script>
  // The bundle exposes a global `nejsBasicExtensions` object
  nejsBasicExtensions.Controls.enableAll();

  // All extensions are now active on built-in prototypes
  console.log([1, 2, 3].first); // 1
</script>
```

You can also pin to a specific version or use the `latest` tag:

```html
<!-- Pin to exact version -->
<script src="https://cdn.jsdelivr.net/npm/@nejs/basic-extensions@2.22.2/dist/@nejs/basic-extensions.bundle.2.22.2.js"></script>

<!-- Latest version (browser field from package.json) -->
<script src="https://cdn.jsdelivr.net/npm/@nejs/basic-extensions/dist/esm/basic-extensions.mjs" type="module"></script>
```

When using the ESM bundle as a module:

```html
<script type="module">
  import basicExtensions from 'https://cdn.jsdelivr.net/npm/@nejs/basic-extensions/dist/esm/basic-extensions.mjs';
  basicExtensions.Controls.enableAll();
</script>
```

Or with dynamic `await import()`:

```html
<script type="module">
  const { default: basicExtensions } = await import(
    'https://cdn.jsdelivr.net/npm/@nejs/basic-extensions/dist/esm/basic-extensions.mjs'
  );
  basicExtensions.Controls.enableAll();

  // Extensions are now active
  console.log([1, 2, 3].first); // 1
</script>
```

## Development

### Building

```bash
npm run build      # clean, patch version bump, generate types, bundle
npm run distribute # clean, minor version bump, generate types, bundle
```

The build produces:

| Output | Location | Purpose |
|--------|----------|---------|
| **ESM** | `src/` (shipped directly) | Primary module format — no compilation needed |
| **Type declarations** | `dist/types/` | Generated by `tsc --emitDeclarationOnly` |
| **CJS bundles** | `dist/cjs/*.cjs` | Generated by esbuild for CommonJS consumers |
| **Browser bundle** | `dist/@nejs/...bundle.js` | IIFE bundle generated by esbuild |

### Testing

```bash
npm test
```

### Other scripts

```bash
npm run clean     # remove dist/ and docs/
npm run browser   # build browser + CJS bundles only
npm run module    # generate type declarations only
npm run repl      # build then launch a Node REPL with extensions loaded
```

## API

<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

#### Table of Contents

*   [ArrayExtensions](#arrayextensions)
    *   [Examples](#examples)
*   [ArrayPrototypeExtensions](#arrayprototypeextensions)
    *   [Examples](#examples-1)
*   [ifArray](#ifarray)
    *   [Parameters](#parameters)
    *   [Examples](#examples-2)
*   [contains](#contains)
    *   [Parameters](#parameters-1)
*   [findEntry](#findentry)
    *   [Parameters](#parameters-2)
*   [first](#first)
*   [last](#last)
*   [isArray](#isarray)
    *   [Examples](#examples-3)
*   [ifArray](#ifarray-1)
    *   [Parameters](#parameters-3)
    *   [Examples](#examples-4)
*   [oneIs](#oneis)
    *   [Parameters](#parameters-4)
    *   [Examples](#examples-5)
*   [someAre](#someare)
    *   [Parameters](#parameters-5)
    *   [Examples](#examples-6)
*   [allAre](#allare)
    *   [Parameters](#parameters-6)
    *   [Examples](#examples-7)
*   [BigIntExtensions](#bigintextensions)
    *   [Examples](#examples-8)
    *   [isBigInt](#isbigint)
        *   [Parameters](#parameters-7)
        *   [Examples](#examples-9)
    *   [ifBigInt](#ifbigint)
        *   [Parameters](#parameters-8)
        *   [Examples](#examples-10)
*   [BigIntPrototypeExtensions](#bigintprototypeextensions)
    *   [Examples](#examples-11)
    *   [instance](#instance)
        *   [Examples](#examples-12)
    *   [isBigInt](#isbigint-1)
        *   [Examples](#examples-13)
    *   [ifBigInt](#ifbigint-1)
        *   [Parameters](#parameters-9)
        *   [Examples](#examples-14)
*   [getClassProperties](#getclassproperties)
    *   [Parameters](#parameters-10)
    *   [Examples](#examples-15)
*   [isAsync](#isasync)
    *   [Parameters](#parameters-11)
*   [ifAsync](#ifasync)
    *   [Parameters](#parameters-12)
    *   [Examples](#examples-16)
*   [isAsyncGenerator](#isasyncgenerator)
    *   [Parameters](#parameters-13)
*   [ifAsyncGenerator](#ifasyncgenerator)
    *   [Parameters](#parameters-14)
    *   [Examples](#examples-17)
*   [isBigArrow](#isbigarrow)
    *   [Parameters](#parameters-15)
*   [ifBigArrow](#ifbigarrow)
    *   [Parameters](#parameters-16)
    *   [Examples](#examples-18)
*   [isBound](#isbound)
    *   [Parameters](#parameters-17)
*   [ifBound](#ifbound)
    *   [Parameters](#parameters-18)
    *   [Examples](#examples-19)
*   [isClass](#isclass)
    *   [Parameters](#parameters-19)
*   [ifClass](#ifclass)
    *   [Parameters](#parameters-20)
    *   [Examples](#examples-20)
*   [isFunction](#isfunction)
    *   [Parameters](#parameters-21)
*   [ifFunction](#iffunction)
    *   [Parameters](#parameters-22)
    *   [Examples](#examples-21)
*   [isGenerator](#isgenerator)
    *   [Parameters](#parameters-23)
*   [ifGenerator](#ifgenerator)
    *   [Parameters](#parameters-24)
    *   [Examples](#examples-22)
*   [StringTagHasInstance](#stringtaghasinstance)
    *   [Parameters](#parameters-25)
    *   [Examples](#examples-23)
*   [FunctionExtensions](#functionextensions)
*   [isAsync](#isasync-1)
*   [ifAsync](#ifasync-1)
    *   [Parameters](#parameters-26)
    *   [Examples](#examples-24)
*   [isAsyncGenerator](#isasyncgenerator-1)
*   [ifAsyncGenerator](#ifasyncgenerator-1)
    *   [Parameters](#parameters-27)
    *   [Examples](#examples-25)
*   [isBigArrow](#isbigarrow-1)
*   [ifBigArrow](#ifbigarrow-1)
    *   [Parameters](#parameters-28)
    *   [Examples](#examples-26)
*   [isBound](#isbound-1)
*   [ifBound](#ifbound-1)
    *   [Parameters](#parameters-29)
    *   [Examples](#examples-27)
*   [isClass](#isclass-1)
*   [ifClass](#ifclass-1)
    *   [Parameters](#parameters-30)
    *   [Examples](#examples-28)
*   [isFunction](#isfunction-1)
*   [ifFunction](#iffunction-1)
    *   [Parameters](#parameters-31)
    *   [Examples](#examples-29)
*   [isGenerator](#isgenerator-1)
*   [ifGenerator](#ifgenerator-1)
    *   [Parameters](#parameters-32)
    *   [Examples](#examples-30)
*   [getClassProperties](#getclassproperties-1)
    *   [Examples](#examples-31)
*   [isThenElse](#isthenelse)
    *   [Parameters](#parameters-33)
    *   [Examples](#examples-32)
*   [maskAs](#maskas)
    *   [Parameters](#parameters-34)
*   [maskAsString](#maskasstring)
    *   [Parameters](#parameters-35)
*   [maskAsNumber](#maskasnumber)
    *   [Parameters](#parameters-36)
*   [GenericMask](#genericmask)
    *   [Parameters](#parameters-37)
*   [StringMask](#stringmask)
    *   [Parameters](#parameters-38)
*   [NumberMask](#numbermask)
    *   [Parameters](#parameters-39)
*   [blendProtos](#blendprotos)
    *   [Parameters](#parameters-40)
    *   [Examples](#examples-33)
*   [extractFrom](#extractfrom)
    *   [Parameters](#parameters-41)
    *   [Examples](#examples-34)
*   [mightContain](#mightcontain)
    *   [Parameters](#parameters-42)
    *   [Examples](#examples-35)
*   [JSONStartPattern](#jsonstartpattern)
    *   [Examples](#examples-36)
*   [isMap](#ismap)
    *   [Parameters](#parameters-43)
    *   [Examples](#examples-37)
*   [ifMap](#ifmap)
    *   [Parameters](#parameters-44)
    *   [Examples](#examples-38)
*   [isMap](#ismap-1)
    *   [Examples](#examples-39)
*   [ifMap](#ifmap-1)
    *   [Parameters](#parameters-45)
    *   [Examples](#examples-40)
*   [getKey](#getkey)
    *   [Parameters](#parameters-46)
*   [isNumber](#isnumber)
    *   [Parameters](#parameters-47)
    *   [Examples](#examples-41)
*   [areNumbers](#arenumbers)
    *   [Parameters](#parameters-48)
    *   [Examples](#examples-42)
*   [ifNumber](#ifnumber)
    *   [Parameters](#parameters-49)
    *   [Examples](#examples-43)
*   [ifNumbers](#ifnumbers)
    *   [Parameters](#parameters-50)
    *   [Examples](#examples-44)
*   [clamp](#clamp)
    *   [Parameters](#parameters-51)
    *   [Examples](#examples-45)
*   [NumberExtensions](#numberextensions)
    *   [Examples](#examples-46)
*   [instance](#instance-1)
    *   [Examples](#examples-47)
*   [isNumber](#isnumber-1)
    *   [Examples](#examples-48)
*   [ifNumber](#ifnumber-1)
    *   [Parameters](#parameters-52)
    *   [Examples](#examples-49)
*   [NumberPrototypeExtensions](#numberprototypeextensions)
    *   [Examples](#examples-50)
*   [ObjectExtensions](#objectextensions)
*   [ObjectPrototypeExtensions](#objectprototypeextensions)
    *   [Examples](#examples-51)
*   [copy](#copy)
    *   [Parameters](#parameters-53)
    *   [Examples](#examples-52)
*   [deepCopy](#deepcopy)
    *   [Parameters](#parameters-54)
    *   [Examples](#examples-53)
*   [definitionType](#definitiontype)
    *   [Examples](#examples-54)
*   [define](#define)
    *   [Parameters](#parameters-55)
    *   [Examples](#examples-55)
*   [defineAccessor](#defineaccessor)
    *   [Parameters](#parameters-56)
    *   [Examples](#examples-56)
*   [fromEntriesUsing](#fromentriesusing)
    *   [Parameters](#parameters-57)
    *   [Examples](#examples-57)
*   [getPrototypeChainEntries](#getprototypechainentries)
    *   [Parameters](#parameters-58)
    *   [Examples](#examples-58)
*   [getStringTag](#getstringtag)
    *   [Parameters](#parameters-59)
*   [getType](#gettype)
    *   [Parameters](#parameters-60)
*   [hasStringTag](#hasstringtag)
    *   [Parameters](#parameters-61)
*   [isNullDefined](#isnulldefined)
    *   [Parameters](#parameters-62)
*   [ifNullDefined](#ifnulldefined)
    *   [Parameters](#parameters-63)
    *   [Examples](#examples-59)
*   [isObject](#isobject)
    *   [Parameters](#parameters-64)
    *   [Examples](#examples-60)
*   [isPrimitive](#isprimitive)
    *   [Parameters](#parameters-65)
*   [ifPrimitive](#ifprimitive)
    *   [Parameters](#parameters-66)
    *   [Examples](#examples-61)
*   [isValidKey](#isvalidkey)
    *   [Parameters](#parameters-67)
*   [ifValidKey](#ifvalidkey)
    *   [Parameters](#parameters-68)
    *   [Examples](#examples-62)
*   [kDescriptorStore](#kdescriptorstore)
    *   [Examples](#examples-63)
*   [prekeyed](#prekeyed)
    *   [Parameters](#parameters-69)
    *   [Examples](#examples-64)
*   [stripTo](#stripto)
    *   [Parameters](#parameters-70)
*   [getPrototypeChainEntries](#getprototypechainentries-1)
    *   [Examples](#examples-65)
*   [hasStringTag](#hasstringtag-1)
    *   [Parameters](#parameters-71)
*   [getStringTag](#getstringtag-1)
    *   [Parameters](#parameters-72)
*   [stripTo](#stripto-1)
    *   [Parameters](#parameters-73)
*   [isObject](#isobject-1)
    *   [Examples](#examples-66)
*   [ifObject](#ifobject)
    *   [Parameters](#parameters-74)
    *   [Examples](#examples-67)
*   [isNullDefined](#isnulldefined-1)
    *   [Examples](#examples-68)
*   [ifNullDefined](#ifnulldefined-1)
    *   [Parameters](#parameters-75)
    *   [Examples](#examples-69)
*   [isPrimitive](#isprimitive-1)
    *   [Examples](#examples-70)
*   [ifPrimitive](#ifprimitive-1)
    *   [Parameters](#parameters-76)
    *   [Examples](#examples-71)
*   [isValidKey](#isvalidkey-1)
    *   [Examples](#examples-72)
*   [ifValidKey](#ifvalidkey-1)
    *   [Parameters](#parameters-77)
    *   [Examples](#examples-73)
*   [copyObject](#copyobject)
    *   [Parameters](#parameters-78)
    *   [Examples](#examples-74)
*   [ReflectExtensions](#reflectextensions)
    *   [hasAll](#hasall)
        *   [Parameters](#parameters-79)
    *   [hasSome](#hassome)
        *   [Parameters](#parameters-80)
    *   [metadata](#metadata)
        *   [Parameters](#parameters-81)
        *   [Examples](#examples-75)
    *   [ownDescriptors](#owndescriptors)
        *   [Parameters](#parameters-82)
    *   [entries](#entries)
        *   [Parameters](#parameters-83)
    *   [values](#values)
        *   [Parameters](#parameters-84)
*   [owner](#owner)
    *   [Examples](#examples-76)
*   [key](#key)
    *   [Examples](#examples-77)
*   [value](#value)
    *   [Examples](#examples-78)
*   [descriptor](#descriptor)
    *   [Examples](#examples-79)
*   [isReadOnly](#isreadonly)
    *   [Examples](#examples-80)
*   [isAssignable](#isassignable)
    *   [Examples](#examples-81)
*   [isAccessor](#isaccessor)
    *   [Examples](#examples-82)
*   [isData](#isdata)
    *   [Examples](#examples-83)
*   [anything](#anything)
    *   [Parameters](#parameters-85)
    *   [Examples](#examples-84)
*   [nonCaptureGroup](#noncapturegroup)
    *   [Parameters](#parameters-86)
    *   [Examples](#examples-85)
*   [captureGroup](#capturegroup)
    *   [Parameters](#parameters-87)
    *   [Examples](#examples-86)
*   [oneOf](#oneof)
    *   [Parameters](#parameters-88)
    *   [Examples](#examples-87)
*   [zeroOrMore](#zeroormore)
    *   [Parameters](#parameters-89)
    *   [Examples](#examples-88)
*   [zeroOrOne](#zeroorone)
    *   [Parameters](#parameters-90)
    *   [Examples](#examples-89)
*   [escape](#escape)
    *   [Parameters](#parameters-91)
    *   [Examples](#examples-90)
*   [null](#null)
    *   [Examples](#examples-91)
*   [bool](#bool)
    *   [Examples](#examples-92)
*   [currencySymbols](#currencysymbols)
    *   [Parameters](#parameters-92)
    *   [Examples](#examples-93)
*   [number](#number)
    *   [Examples](#examples-94)
*   [integer](#integer)
    *   [Examples](#examples-95)
*   [float](#float)
    *   [Examples](#examples-96)
*   [integer](#integer-1)
    *   [Examples](#examples-97)
*   [pretty](#pretty)
    *   [Examples](#examples-98)
*   [jsLiteral](#jsliteral)
    *   [Examples](#examples-99)
*   [SetExtensions](#setextensions)
    *   [Examples](#examples-100)
*   [SetPrototypeExtensions](#setprototypeextensions)
    *   [Examples](#examples-101)
*   [isSet](#isset)
    *   [Parameters](#parameters-93)
    *   [Examples](#examples-102)
*   [ifSet](#ifset)
    *   [Parameters](#parameters-94)
    *   [Examples](#examples-103)
*   [concat](#concat)
    *   [Parameters](#parameters-95)
*   [contains](#contains-1)
    *   [Parameters](#parameters-96)
*   [every](#every)
    *   [Parameters](#parameters-97)
*   [find](#find)
    *   [Parameters](#parameters-98)
*   [findLast](#findlast)
    *   [Parameters](#parameters-99)
*   [isSet](#isset-1)
    *   [Examples](#examples-104)
*   [ifSet](#ifset-1)
    *   [Parameters](#parameters-100)
    *   [Examples](#examples-105)
*   [length](#length)
*   [map](#map)
    *   [Parameters](#parameters-101)
*   [reduce](#reduce)
    *   [Parameters](#parameters-102)
*   [some](#some)
    *   [Parameters](#parameters-103)
*   [StringExtensions](#stringextensions)
    *   [isString](#isstring)
        *   [Parameters](#parameters-104)
    *   [ifString](#ifstring)
        *   [Parameters](#parameters-105)
        *   [Examples](#examples-106)
    *   [parenthesisPair](#parenthesispair)
    *   [squareBracketsPair](#squarebracketspair)
    *   [curlyBracketsPair](#curlybracketspair)
    *   [random36](#random36)
        *   [Examples](#examples-107)
    *   [random16](#random16)
        *   [Examples](#examples-108)
    *   [randomRGBHex](#randomrgbhex)
        *   [Parameters](#parameters-106)
        *   [Examples](#examples-109)
    *   [randomARGBHex](#randomargbhex)
        *   [Parameters](#parameters-107)
        *   [Examples](#examples-110)
    *   [randomRGBAHex](#randomrgbahex)
        *   [Parameters](#parameters-108)
        *   [Examples](#examples-111)
    *   [randomRGB](#randomrgb)
        *   [Examples](#examples-112)
    *   [randomRGBA](#randomrgba)
        *   [Parameters](#parameters-109)
        *   [Examples](#examples-113)
    *   [sgr](#sgr)
        *   [Parameters](#parameters-110)
    *   [wrap](#wrap)
        *   [Parameters](#parameters-111)
        *   [Examples](#examples-114)
*   [isString](#isstring-1)
    *   [Examples](#examples-115)
*   [ifString](#ifstring-1)
    *   [Parameters](#parameters-112)
    *   [Examples](#examples-116)
*   [instance](#instance-2)
    *   [Examples](#examples-117)
*   [extractSubstring](#extractsubstring)
    *   [Parameters](#parameters-113)
*   [StringPrototypeExtensions](#stringprototypeextensions)
*   [SymbolExtensions](#symbolextensions)
    *   [isSymbol](#issymbol)
        *   [Parameters](#parameters-114)
    *   [isRegistered](#isregistered)
        *   [Parameters](#parameters-115)
    *   [isNonRegistered](#isnonregistered)
        *   [Parameters](#parameters-116)
    *   [keys](#keys)
        *   [Examples](#examples-118)
    *   [withData](#withdata)
        *   [Parameters](#parameters-117)
        *   [Examples](#examples-119)
*   [instance](#instance-3)
    *   [Examples](#examples-120)
*   [data](#data)
    *   [Examples](#examples-121)
*   [data](#data-1)
    *   [Parameters](#parameters-118)
    *   [Examples](#examples-122)
*   [mightHaveEmbeddedJSON](#mighthaveembeddedjson)
    *   [Examples](#examples-123)
*   [for](#for)
    *   [Parameters](#parameters-119)
    *   [Examples](#examples-124)
*   [Deferred](#deferred)
    *   [Parameters](#parameters-120)
    *   [value](#value-1)
    *   [reason](#reason)
    *   [settled](#settled)
    *   [wasRejected](#wasrejected)
    *   [wasResolved](#wasresolved)
    *   [promise](#promise)
    *   [resolve](#resolve)
        *   [Parameters](#parameters-121)
    *   [reject](#reject)
        *   [Parameters](#parameters-122)
    *   [for](#for-1)
        *   [Parameters](#parameters-123)
    *   [species](#species)
*   [promise](#promise-1)
*   [reject](#reject-1)
*   [resolve](#resolve-1)
*   [settled](#settled-1)
*   [object](#object)
*   [constructor](#constructor)
    *   [Parameters](#parameters-124)
*   [isAccessor](#isaccessor-1)
*   [isData](#isdata-1)
*   [isDescriptor](#isdescriptor)
*   [configurable](#configurable)
*   [configurable](#configurable-1)
    *   [Parameters](#parameters-125)
*   [enumerable](#enumerable)
*   [enumerable](#enumerable-1)
    *   [Parameters](#parameters-126)
*   [writable](#writable)
*   [writable](#writable-1)
    *   [Parameters](#parameters-127)
*   [value](#value-2)
*   [value](#value-3)
    *   [Parameters](#parameters-128)
*   [get](#get)
*   [get](#get-1)
    *   [Parameters](#parameters-129)
*   [boundGet](#boundget)
*   [set](#set)
*   [set](#set-1)
    *   [Parameters](#parameters-130)
*   [boundSet](#boundset)
*   [hasObject](#hasobject)
*   [object](#object-1)
*   [object](#object-2)
    *   [Parameters](#parameters-131)
*   [for](#for-2)
    *   [Parameters](#parameters-132)
*   [applyTo](#applyto)
    *   [Parameters](#parameters-133)
*   [toObject](#toobject)
    *   [Parameters](#parameters-134)
*   [toPrimitive](#toprimitive)
    *   [Parameters](#parameters-135)
*   [toStringTag](#tostringtag)
*   [for](#for-3)
    *   [Parameters](#parameters-136)
*   [getData](#getdata)
    *   [Parameters](#parameters-137)
*   [getAccessor](#getaccessor)
    *   [Parameters](#parameters-138)
*   [base](#base)
    *   [Parameters](#parameters-139)
*   [accessor](#accessor)
    *   [Parameters](#parameters-140)
*   [data](#data-2)
    *   [Parameters](#parameters-141)
*   [isDescriptor](#isdescriptor-1)
    *   [Parameters](#parameters-142)
*   [isData](#isdata-2)
    *   [Parameters](#parameters-143)
*   [isAccessor](#isaccessor-2)
    *   [Parameters](#parameters-144)
*   [flexible](#flexible)
*   [enigmatic](#enigmatic)
*   [intrinsic](#intrinsic)
*   [transparent](#transparent)
*   [SHARED\_KEYS](#shared_keys)
*   [ACCESSOR\_KEYS](#accessor_keys)
*   [DATA\_KEYS](#data_keys)
*   [Iterable](#iterable)
    *   [Parameters](#parameters-145)
    *   [iterator](#iterator)
    *   [asArray](#asarray)
    *   [toStringTag](#tostringtag-1)
    *   [isIterable](#isiterable)
        *   [Parameters](#parameters-146)
*   [Iterator](#iterator-1)
    *   [Parameters](#parameters-147)
    *   [asArray](#asarray-1)
    *   [iterable](#iterable-1)
    *   [next](#next)
    *   [reset](#reset)
    *   [iterator](#iterator-2)
    *   [toStringTag](#tostringtag-2)
*   [mapEach](#mapeach)
*   [constructor](#constructor-1)
    *   [Parameters](#parameters-148)
    *   [Examples](#examples-125)
*   [parse](#parse)
    *   [Parameters](#parameters-149)
*   [validate](#validate)
    *   [Parameters](#parameters-150)
*   [tryParsers](#tryparsers)
    *   [Parameters](#parameters-151)
    *   [Examples](#examples-126)
*   [safeTryParsers](#safetryparsers)
    *   [Parameters](#parameters-152)
    *   [Examples](#examples-127)
*   [NoValidParsersFound](#novalidparsersfound)
    *   [Examples](#examples-128)
*   [ParametersMustBeArrayError](#parametersmustbearrayerror)
    *   [Examples](#examples-129)
*   [ParsersArrayMustContainParsersError](#parsersarraymustcontainparserserror)
    *   [Examples](#examples-130)
*   [toStringTag](#tostringtag-3)
    *   [Examples](#examples-131)
*   [hasInstance](#hasinstance)
    *   [Parameters](#parameters-153)
    *   [Examples](#examples-132)
*   [response](#response)
    *   [Parameters](#parameters-154)
    *   [Examples](#examples-133)
*   [ResponseType](#responsetype)
    *   [Properties](#properties)
    *   [Examples](#examples-134)
*   [nameFromType](#namefromtype)
    *   [Parameters](#parameters-155)
    *   [Examples](#examples-135)
*   [typeNames](#typenames)
    *   [Properties](#properties-1)
    *   [Examples](#examples-136)
*   [type](#type)
    *   [Properties](#properties-2)
    *   [Examples](#examples-137)
*   [apply](#apply)
*   [construct](#construct)
*   [defineProperty](#defineproperty)
*   [deleteProperty](#deleteproperty)
*   [get](#get-2)
*   [getOwnPropertyDescriptor](#getownpropertydescriptor)
*   [getPrototypeOf](#getprototypeof)
*   [has](#has)
*   [isExtensible](#isextensible)
*   [ownKeys](#ownkeys)
*   [preventExtensions](#preventextensions)
*   [set](#set-2)
*   [setPrototypeOf](#setprototypeof)
*   [RefMap](#refmap)
    *   [Parameters](#parameters-156)
    *   [objectifying](#objectifying)
        *   [Parameters](#parameters-157)
    *   [asObject](#asobject)
    *   [objectifyValues](#objectifyvalues)
    *   [objectifyValues](#objectifyvalues-1)
        *   [Parameters](#parameters-158)
    *   [get](#get-3)
        *   [Parameters](#parameters-159)
    *   [set](#set-3)
        *   [Parameters](#parameters-160)
    *   [setAll](#setall)
        *   [Parameters](#parameters-161)
    *   [clean](#clean)
    *   [entries](#entries-1)
        *   [Parameters](#parameters-162)
    *   [forEach](#foreach)
        *   [Parameters](#parameters-163)
    *   [values](#values-1)
    *   [hasValue](#hasvalue)
        *   [Parameters](#parameters-164)
    *   [filter](#filter)
        *   [Parameters](#parameters-165)
    *   [find](#find-1)
        *   [Parameters](#parameters-166)
    *   [map](#map-1)
        *   [Parameters](#parameters-167)
    *   [iterator](#iterator-3)
    *   [toStringTag](#tostringtag-4)
*   [isValidReference](#isvalidreference)
    *   [Parameters](#parameters-168)
*   [RefSet](#refset)
    *   [objectifying](#objectifying-1)
        *   [Parameters](#parameters-169)
    *   [objectifyValues](#objectifyvalues-2)
    *   [objectifyValues](#objectifyvalues-3)
        *   [Parameters](#parameters-170)
    *   [add](#add)
        *   [Parameters](#parameters-171)
    *   [addAll](#addall)
        *   [Parameters](#parameters-172)
    *   [clean](#clean-1)
    *   [entries](#entries-2)
        *   [Parameters](#parameters-173)
    *   [forEach](#foreach-1)
        *   [Parameters](#parameters-174)
    *   [values](#values-2)
    *   [keys](#keys-1)
    *   [has](#has-1)
        *   [Parameters](#parameters-175)
    *   [contains](#contains-2)
        *   [Parameters](#parameters-176)
    *   [filter](#filter-1)
        *   [Parameters](#parameters-177)
    *   [find](#find-2)
        *   [Parameters](#parameters-178)
    *   [map](#map-2)
        *   [Parameters](#parameters-179)
    *   [toStringTag](#tostringtag-5)
*   [Symkeys](#symkeys)
    *   [Parameters](#parameters-180)
    *   [Examples](#examples-138)
    *   [add](#add-1)
        *   [Parameters](#parameters-181)
        *   [Examples](#examples-139)
    *   [data](#data-3)
        *   [Parameters](#parameters-182)
        *   [Examples](#examples-140)
    *   [deleteData](#deletedata)
        *   [Parameters](#parameters-183)
        *   [Examples](#examples-141)
    *   [hasData](#hasdata)
        *   [Parameters](#parameters-184)
        *   [Examples](#examples-142)
    *   [setData](#setdata)
        *   [Parameters](#parameters-185)
        *   [Examples](#examples-143)
    *   [token](#token)
        *   [Parameters](#parameters-186)
        *   [Examples](#examples-144)
    *   [separator](#separator)
        *   [Examples](#examples-145)
    *   [symbols](#symbols)
        *   [Examples](#examples-146)
    *   [calculateName](#calculatename)
        *   [Parameters](#parameters-187)
        *   [Examples](#examples-147)
    *   [isSymkey](#issymkey)
        *   [Parameters](#parameters-188)
        *   [Examples](#examples-148)
    *   [token](#token-1)
        *   [Examples](#examples-149)
    *   [kDataKey](#kdatakey)
    *   [kPrototype](#kprototype)
    *   [kDomain](#kdomain)
        *   [Examples](#examples-150)
    *   [kSeparator](#kseparator)
        *   [Examples](#examples-151)
*   [AsyncIterable](#asynciterable)
    *   [Parameters](#parameters-189)
    *   [asyncIterator](#asynciterator)
    *   [toStringTag](#tostringtag-6)
    *   [isAsyncIterable](#isasynciterable)
        *   [Parameters](#parameters-190)
*   [AsyncIterator](#asynciterator-1)
    *   [Parameters](#parameters-191)
    *   [asArray](#asarray-2)
    *   [asyncIterable](#asynciterable-1)
    *   [next](#next-1)
    *   [reset](#reset-1)
    *   [asyncIterator](#asynciterator-2)
    *   [toStringTag](#tostringtag-7)

### ArrayExtensions

`ArrayExtensions` is a constant that applies a patch to the global
`Array` constructor. This patch extends the `Array` with additional
methods and properties, enhancing its functionality.

The `Patch` function takes two arguments: the target object to be patched
(in this case, `Array`), and an object containing the methods and
properties to be added to the target object.

Type: Patch

#### Examples

```javascript
// Using a method added by ArrayExtensions
const arr = [1, 2, 3];
console.log(Array.ifArray(arr, 'Array', 'Not Array')); // Output: 'Array'
```

### ArrayPrototypeExtensions

`ArrayPrototypeExtensions` is a constant that applies a patch to the
Array prototype. This patch extends the Array prototype with additional
methods and properties, enhancing its functionality.

The `Patch` function takes two arguments: the target object to be patched
(in this case, `Array.prototype`), and an object containing the methods
and properties to be added to the target object.

Type: Patch

#### Examples

```javascript
// Using a method added by ArrayPrototypeExtensions
const arr = [1, 2, 3];
console.log(arr.ifArray('Array', 'Not Array')); // Output: 'Array'
```

### ifArray

Checks if the provided value is an array and returns one of two
provided values based on the result. This function is a convenience
method for performing conditional operations based on the type of
the provided value.

Type: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)

#### Parameters

*   `value` **any** The value to be checked.
*   `thenValue` **([function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) | any)** The value to be returned if the
    provided value is an array.
*   `elseValue` **([function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) | any)** The value to be returned if the
    provided value is not an array.

#### Examples

```javascript
const arr = [1, 2, 3];
console.log(ArrayExtensions.ifArray(arr, 'Array', 'Not Array'));
// Output: 'Array'

const notArr = "I'm not an array";
console.log(ArrayExtensions.ifArray(notArr, 'Array', 'Not Array'));
// Output: 'Not Array'
```

Returns **any** Returns `thenValue` if the provided value is an array,
otherwise returns `elseValue`.

### contains

Sometimes defining even a short function for the invocation of `find`
can be troublesome. This helper function performs that job for you. If
the specified element is in the array, `true` will be returned.

#### Parameters

*   `value` **any** the value to search for. This value must triple equals
    the array element in order to return true.

Returns **any** true if the exact element exists in the array, false otherwise

### findEntry

The `findEntry` function searches the entries of the object and returns
the `[index, value]` entry array for the first matching value found.

#### Parameters

*   `findFn` **[function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** a function that takes the element to be checked
    and returns a boolean value

Returns **any** if `findFn` returns `true`, an array with two elements, the first
being the index, the second being the value, is returned.

### first

A getter property that returns the first element of the array. If the
array is empty, it returns `undefined`. This property is useful for
scenarios where you need to quickly access the first item of an array
without the need for additional checks or method calls.

Returns **any** The first element of the array or `undefined` if the array
is empty.

### last

A getter property that returns the last element of the array. It
calculates the last index based on the array's length. If the array is
empty, it returns `undefined`. This property is beneficial when you need
to access the last item in an array, improving code readability and
avoiding manual index calculation.

Returns **any** The last element of the array or `undefined` if the
array is empty.

### isArray

A getter property that checks if the current context (`this`) is an
array. This is a convenience method that wraps the native
`Array.isArray` function.

Type: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)

#### Examples

```javascript
const arr = [1, 2, 3];
console.log(arr.isArray); // Output: true

const notArr = "I'm not an array";
console.log(notArr.isArray); // Output: false
```

Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `true` if the current context is an array,
`false` otherwise.

### ifArray

Checks if the current context (`this`) is an array and returns one of
two provided values based on the result. This function is a convenience
method for performing conditional operations based on the type of
the current context.

Type: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)

#### Parameters

*   `thenValue` **([function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) | any)** The value to be returned if the
    current context is an array.
*   `elseValue` **([function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function) | any)** The value to be returned if the
    current context is not an array.

#### Examples

```javascript
const arr = [1, 2, 3];
console.log(arr.ifArray('Array', 'Not Array')); // Output: 'Array'

const notArr = "I'm not an array";
console.log(notArr.ifArray('Array', 'Not Array')); // Output: 'Not Array'
```

Returns **any** Returns `thenValue` if the current context is an array,
otherwise returns `elseValue`.

### oneIs

Checks if at least one element in the array is equal to the provided
value. This method uses the `Array.prototype.some` function to iterate
over the array and compare each element with the provided value.

Type: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)

#### Parameters

*   `value` **any** The value to be compared with the array elements.
*   `doubleEqualsOkay` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** A flag indicating whether to
    use loose equality (`==`) or strict equality (`===`) for the comparison.
    If `true`, loose equality is used. If `false`, strict equality is used. (optional, default `true`)

#### Examples

```javascript
const arr = [1, 2, 3];
console.log(arr.oneIs(2)); // Output: true

const arr2 = ['1', '2', '3'];
console.log(arr2.oneIs(2, false)); // Output: false
```

Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returns `true` if at least one element in the array
is equal to the provided value, otherwise `false`.

### someAre

Checks if some elements in the array are included in the provided values.
This method uses the `Array.prototype.some` function to iterate over the
array and checks if any of the elements are included in the provided values.

Type: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)

#### Parameters

*   `values` **...any** The values to be checked against the array elements.

#### Examples

```javascript
const arr = [1, 2, 3];
console.log(arr.someAre(2, 4)); // Output: true

const arr2 = ['1', '2', '3'];
console.log(arr2.someAre(4, 5)); // Output: false
```

Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returns `true` if at least one element in the array
is included in the provided values, otherwise `false`.

### allAre

Checks if all elements in the array are equal to the provided value.
This method uses the `Array.prototype.every` function to iterate over
the array and compare each element with the provided value.

Type: [function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)

#### Parameters

*   `value` **any** The value to be compared with the array elements.
*   `doubleEqualsOkay` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** A flag indicating whether to
    use loose equality (`==`) or strict equality (`===`) for the comparison.
    If `true`, loose equality is used. If `false`, strict equality is used. (optional, default `true`)

#### Examples

```javascript
const arr = [2, 2, 2];
console.log(arr.allAre(2)); // Output: true

const arr2 = ['2', '2', '2'];
console.log(arr2.allAre(2, false)); // Output: false
```

Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returns `true` if all elements in the array are equal
to the provided value, otherwise `false`.

### BigIntExtensions

`BigIntExtensions` is a patch for the JavaScript built-in `BigInt` class.
It adds utility methods to the `BigInt` class without modifying the global
namespace directly. This patch includes methods for checking if a value is
a `BigInt` and conditionally returning a value based on whether the supplied
value is a `BigInt` or not.

Type: Patch

#### Examples

```javascript
import { BigIntExtensions } from 'big.int.extension.js'

BigIntExtensions.apply()
// Now the `BigInt` class has additional methods available
```

#### isBigInt

Determines if the supplied `value` is a `BigInt`. This check is
performed by first checking the `typeof` the `value` and then
checking to see if the `value` is an `instanceof` `BigInt`

##### Parameters

*   `value` **any** The value that needs to be checked to determine
    if it is a `BigInt` or not

##### Examples

```javascript
const bigInt = 1234567890123456789012345678901234567890n
isBigInt(bigInt) // true
isBigInt(1234567890123456789012345678901234567890) // false
isBigInt('1234567890123456789012345678901234567890') // false
isBigInt(BigInt('1234567890123456789012345678901234567890')) // true
```

Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `true` if the supplied `value` is a `BigInt`,
`false` otherwise

#### ifBigInt

Conditionally returns a value based on whether the supplied
`value` is a `BigInt` or not. If the `value` is a `BigInt`,
the `thenValue` will be returned. If it is not a `BigInt`,
the `elseValue` will be returned instead.

##### Parameters

*   `value` **any** The value to check to determine if it is a
    `BigInt`
*   `thenValue` **any** The value to return if the supplied
    `value` is a `BigInt`
*   `elseValue` **any** The value to return if the supplied
    `value` is not a `BigInt`

##### Examples

```javascript
const bigInt = 1234567890123456789012345678901234567890n
const num = 42
ifBigInt(bigInt, 'is a BigInt', 'not a BigInt')
// 'is a BigInt'
ifBigInt(num, 'is a BigInt', 'not a BigInt')
// 'not a BigInt'
```

Returns **any** Either the `thenValue` or `elseValue` depending
on if the supplied `value` is a `BigInt`

### BigIntPrototypeExtensions

`BigIntPrototypeExtensions` is a patch for the JavaScript built-in
`BigInt.prototype`. It adds utility methods to the `BigInt` prototype
without modifying the global namespace directly. This patch includes
methods for checking if a value is a BigInt and conditionally returning
a value based on whether the supplied value is a BigInt or not.

Type: Patch

#### Examples

```javascript
import { BigIntPrototypeExtensions } from 'big.int.extension.js'

BigIntPrototypeExtensions.apply()
// Now the `BigInt` prototype has additional methods available
```

#### instance

A getter method that returns an object representation of the BigInt
instance.

This method wraps the BigInt instance in an object, allowing it to be
treated as an object. The returned object is created using the `Object()`
constructor, which takes the BigInt instance as its argument.

Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)

##### Examples

```javascript
const bigInt = 1234567890123456789012345678901234567890n
console.log(typeof bigInt)           // 'bigint'
console.log(typeof bigInt.instance)  // 'object'
```

#### isBigInt

A getter method that checks if the current instance is a BigInt.

This method uses the `pIsBigInt` function from the `BigIntExtensions`
patch to determine if the current instance (`this`) is a BigInt.

Type: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)

##### Examples

```javascript
const bigInt = 1234567890123456789012345678901234567890n
console.log(bigInt.isBigInt) // Output: true

const notBigInt = 42
console.log(notBigInt.isBigInt) // Output: false
```

#### ifBigInt

Checks if the current object is a BigInt and returns the corresponding
value based on the result.

This method uses the `pIfBigInt` function from the `BigIntExtensions`
patch to determine if the current object (`this`) is a BigInt. If it is
a BigInt, the `thenValue` is returned. Otherwise, the `elseValue` is
returned.

##### Parameters

*   `thenValue` **any** The value to return if the current object
    is a BigInt.
*   `elseValue` **any** The value to return if the current object
    is not a BigInt.

##### Examples

```javascript
const bigInt = 1234567890123456789012345678901234567890n
// 'Is a BigInt'
console.log(bigInt.ifBigInt('Is a BigInt', 'Not a BigInt'))

const notBigInt = 42
// 'Not a BigInt'
console.log(notBigInt.ifBigInt('Is a BigInt', 'Not a BigInt'))
```

Returns **any** The `thenValue` if the current object is a BigInt, or
the `elseValue` if it is not a BigInt.

### getClassProperties

Retrieves the properties of a function and its prototype.

This method uses the `Reflect.ownKeys` function to get all the keys
(including non-enumerable and symbol keys) of the function and its
prototype. It then uses `Object.getOwnPropertyDescriptor` to get the
property descriptors for each key. The descriptors include information
about the property's value, writability, enumerability, and
configurability.

#### Parameters

*   `fn` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** The function whose properties are to be retrieved.

#### Examples

```javascript
function MyFunction() {}
MyFunction.myProp = 'hello';
MyFunction.prototype.myProtoProp = 'world';

const result = getClassProperties(MyFunction);
console.log(result);
// Output: [MyFunction, { myProp: { value: 'hello', writable: true,
// enumerable: true, configurable: true } }, MyFunction.prototype,
// { myProtoProp: { value: 'world', writable: true, enumerable: true,
// configurable: true } }]
```

Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)** An array containing the function itself, its property
descriptors, its prototype, and the prototype's property descriptors.

### isAsync

Determines if a given value is an asynchronous function. It checks if the
value is an instance of `Function` and if its string representation
includes the keyword 'Async'. This method is particularly useful for
identifying async functions.

#### Parameters

*   `value` **any** The value to be checked.

Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returns `true` if the value is an async function,
otherwise `false`.

### ifAsync

*   **See**: [isThenElse](isThenElse)

The `ifAsync` function checks if a given value is an async function and
returns one of two provided values based on the result. This function is
a convenience method for performing conditional operations based on the
type of a value.

#### Parameters

*   `value` **any** The value to be checked. If this is an async function,
    `thenValue` is returned, otherwise `elseValue` is returned.
*   `thenValue` **any** The value to be returned if `value` is an async
    function.
*   `elseValue` **any** The value to be returned if `value` is not an
    async function.

#### Examples

```javascript
// Suppose we have an async function and a regular function
async function asyncFunc() { return 'I am async'; }
function regularFunc() { return 'I am regular'; }

// Using ifAsync
console.log(Function.ifAsync(asyncFunc, 'Async', 'Not Async'));
// Output: 'Async'
console.log(Function.ifAsync(regularFunc, 'Async', 'Not Async'));
// Output: 'Not Async'
```

Returns **any** Returns `thenValue` if `value` is an async function,
otherwise returns `elseValue`.

### isAsyncGenerator

The function checks if a given value is an async generator function

#### Parameters

*   `value` **any** The `value` parameter is the value that we want to
    check if it is a generator function.

Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `true` if the value is an instance of a function and
its string tag is 'AsyncGeneratorFunction', otherwise it returns `false`.

### ifAsyncGenerator

The `ifAsyncGenerator` function checks if a given value is an async
generator function and returns one of two provided values based on the
result. This function is a convenience method for performing conditional
operations based on the type of a value.

#### Parameters

*   `value` **any** The value to be checked. If this is an async
    generator function, `thenValue` is returned, otherwise `elseValue` is
    returned.
*   `thenValue` **any** The value to be returned if `value` is an async
    generator function.
*   `elseValue` **any** The value to be returned if `value` is not an
    async generator function.

#### Examples

```javascript
// Suppose we have an async generator function and a regular function
async function* asyncGenFunc() { yield 'I am async'; }
function regularFunc() { return 'I am regular'; }

// Using ifAsyncGenerator
console.log(Function.ifAsyncGenerator(asyncGenFunc, 'Async', 'Not Async'));
// Output: 'Async'
console.log(Function.ifAsyncGenerator(regularFunc, 'Async', 'Not Async'));
// Output: 'Not Async'
```

Returns **any** Returns `thenValue` if `value` is an async generator
function, otherwise returns `elseValue`.

### isBigArrow

Checks if a given value is an arrow function. It verifies if the value is
an instance of `Function`, if its string representation includes the '=>'
symbol, and if it lacks a prototype, which is a characteristic of arrow
functions in JavaScript.

#### Parameters

*   `value` **any** The value to be checked.

Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returns `true` if the value is an arrow function,
otherwise `false`.

### ifBigArrow

The `ifBigArrow` function checks if a given value is an arrow function
and returns one of two provided values based on the result. This function
is a convenience method for performing conditional operations based on
the type of a value.

#### Parameters

*   `value` **any** The value to be checked. If this is an arrow function,
    `thenValue` is returned, otherwise `elseValue` is returned.
*   `thenValue` **any** The value to be returned if `value` is an arrow
    function.
*   `elseValue` **any** The value to be returned if `value` is not an
    arrow function.

#### Examples

```javascript
// Suppose we have an arrow function and a regular function
const arrowFunc = () => 'I am an arrow function';
function regularFunc() { return 'I am a regular function'; }

// Using ifBigArrow
console.log(Function.ifBigArrow(arrowFunc, 'Arrow', 'Not Arrow'));
// Output: 'Arrow'
console.log(Function.ifBigArrow(regularFunc, 'Arrow', 'Not Arrow'));
// Output: 'Not Arrow'
```

Returns **any** Returns `thenValue` if `value` is an arrow function,
otherwise returns `elseValue`.

### isBound

Determines if a given value is a bound function. Bound functions are
created using the `Function.prototype.bind` method, which allows setting
the `this` value at the time of binding. This method checks if the value
is an instance of `Function`, if its string representation starts with
'bound', and if it lacks a `prototype` property. These characteristics
are indicative of bound functions in JavaScript.

#### Parameters

*   `value` **any** The value to be checked, typically a function.

Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returns `true` if the value is a bound function,
otherwise `false`. Bound functions have a specific format in their
string representation and do not have their own `prototype` property.

### ifBound

The `ifBound` function checks if a given value is a bound function and
returns one of two provided values based on the result. This function
is a convenience method for performing conditional operations based on
the type of a value.

#### Parameters

*   `value` **any** The value to be checked. If this is a bound function,
    `thenValue` is returned, otherwise `elseValue` is returned.
*   `thenValue` **any** The value to be returned if `value` is a bound
    function.
*   `elseValue` **any** The value to be returned if `value` is not a
    bound function.

#### Examples

```javascript
// Suppose we have a bound function and a regular function
const boundFunc = function() { return this.x }.bind({x: 'I am bound'});
function regularFunc() { return 'I am a regular function'; }

// Using ifBound
console.log(Function.ifBound(boundFunc, 'Bound', 'Not Bound'));
// Output: 'Bound'
console.log(Function.ifBound(regularFunc, 'Bound', 'Not Bound'));
// Output: 'Not Bound'
```

Returns **any** Returns `thenValue` if `value` is a bound function,
otherwise returns `elseValue`.

### isClass

Determines if a given value is a class. It checks if the value is an
instance of `Function` and if its string representation includes the
keyword 'class'. This method is useful for distinguishing classes from
other function types in JavaScript.

#### Parameters

*   `value` **any** The value to be checked.

Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returns `true` if the value is a class, otherwise
`false`.

### ifClass

The `ifClass` function checks if a given value is a class and returns
one of two provided values based on the result. This function is a
convenience method for performing conditional operations based on the
type of a value.

#### Parameters

*   `value` **any** The value to be checked. If this is a class,
    `thenValue` is returned, otherwise `elseValue` is returned.
*   `thenValue` **any** The value to be returned if `value` is a class.
*   `elseValue` **any** The value to be returned if `value` is not a
    class.

#### Examples

```javascript
// Suppose we have a class and a regular function
class MyClass {}
function myFunction() {}

// Using ifClass
console.log(Function.ifClass(MyClass, 'Class', 'Not Class'));
// Output: 'Class'
console.log(Function.ifClass(myFunction, 'Class', 'Not Class'));
// Output: 'Not Class'
```

Returns **any** Returns `thenValue` if `value` is a class, otherwise returns
`elseValue`.

### isFunction

Checks if a given value is a regular function. This method verifies if
the value is an instance of `Function`, which includes regular functions,
classes, and async functions but excludes arrow functions.

#### Parameters

*   `value` **any** The value to be checked.

Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returns `true` if the value is a regular function,
otherwise `false`.

### ifFunction

The `ifFunction` method checks if a given value is a regular function
and returns one of two provided values based on the result. This method
is a convenience for performing conditional operations based on the
type of a value.

#### Parameters

*   `value` **any** The value to be checked. If this is a function,
    `thenValue` is returned, otherwise `elseValue` is returned.
*   `thenValue` **any** The value to be returned if `value` is a function.
*   `elseValue` **any** The value to be returned if `value` is not a
    function.

#### Examples

```javascript
// Suppose we have a function and a non-function value
function myFunction() {}
let notFunction = "I'm not a function";

// Using ifFunction
console.log(Function.ifFunction(myFunction, 'Function', 'Not Function'));
// Output: 'Function'
console.log(Function.ifFunction(notFunction, 'Function', 'Not Function'));
// Output: 'Not Function'
```

Returns **any** Returns `thenValue` if `value` is a function, otherwise
returns `elseValue`.

### isGenerator

The function checks if a given value is a generator function

#### Parameters

*   `value` **any** The `value` parameter is the value that we want to
    check if it is a generator function.

Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `true` if the value is an instance of a function and
its string tag is 'GeneratorFunction', otherwise it returns `false`.

### ifGenerator

The `ifGenerator` method checks if a given value is a generator function
and returns one of two provided values based on the result. This method
is a convenience for performing conditional operations based on the
type of a value.

#### Parameters

*   `value` **any** The value to be checked. If this is a generator
    function, `thenValue` is returned, otherwise `elseValue` is returned.
*   `thenValue` **any** The value to be returned if `value` is a generator
    function.
*   `elseValue` **any** The value to be returned if `value` is not a
    generator function.

#### Examples

```javascript
// Suppose we have a generator function and a non-generator function
function* myGenerator() {}
function myFunction() {}

// Using ifGenerator
console.log(Function.ifGenerator(myGenerator, 'Generator', 'Not Generator'));
// Output: 'Generator'
console.log(Function.ifGenerator(myFunction, 'Generator', 'Not Generator'));
// Output: 'Not Generator'
```

Returns **any** Returns `thenValue` if `value` is a generator function,
otherwise returns `elseValue`.

### StringTagHasInstance

This method modifies the behavior of the `instanceof` operator for a
given class. It does this by defining a custom `Symbol.hasInstance`
method on the class. The custom method checks if the string tag of the
instance matches the name of the class or if the instance is part of
the prototype chain of the class.

#### Parameters

*   `Class` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** The class for which to modify the behavior
    of the `instanceof` operator.

#### Examples

```javascript
// Suppose we have a class `MyClass`
class MyClass {}

// And an instance of the class
const myInstance = new MyClass();

// Before applying `StringTagHasInstance`, `instanceof` works as usual
console.log(myInstance instanceof MyClass); // Output: true

// Now we apply `StringTagHasInstance` to `MyClass`
FunctionExtensions.patches.StringTagHasInstance(MyClass);

// `instanceof` now checks the string tag and the prototype chain
console.log(myInstance instanceof MyClass); // Output: true
```

### FunctionExtensions

The `FunctionExtensions` class is a patch applied to the built-in JavaScript
`Function` constructor. It extends `Function` with additional utility methods
for determining the specific type or nature of function-like objects. These
methods allow developers to distinguish between classes, regular functions,
async functions, and arrow functions in a more intuitive and straightforward
manner. This class is part of the `@nejs/extension` library and enhances the
capabilities of function handling and introspection in JavaScript.

### isAsync

Determines if a given value is an asynchronous function. It checks if the
value is an instance of `Function` and if its string representation
includes the keyword 'Async'. This method is particularly useful for
identifying async functions.

Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returns `true` if the value is an async function,
otherwise `false`.

### ifAsync

*   **See**: [Function.ifAsync](Function.ifAsync)

The `ifAsync` method checks if the current function is asynchronous and
returns one of two provided values based on the result. This method is
a convenience for performing conditional operations based on the
type of a function.

#### Parameters

*   `thenValue` **any** The value to be returned if the function is
    asynchronous.
*   `elseValue` **any** The value to be returned if the function is not
    asynchronous.

#### Examples

```javascript
// Suppose we have an async function and a non-async function
async function myAsyncFunction() {}
function myFunction() {}

// Using ifAsync
console.log(myAsyncFunction.ifAsync('Async', 'Not Async'));
// Output: 'Async'
console.log(myFunction.ifAsync('Async', 'Not Async'));
// Output: 'Not Async'
```

Returns **any** Returns `thenValue` if the function is asynchronous,
otherwise returns `elseValue`.

### isAsyncGenerator

The function checks if a given value is an async generator function

Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `true` if the value is an instance of a function and
its string tag is 'AsyncGeneratorFunction', otherwise it returns `false`.

### ifAsyncGenerator

*   **See**: [Function.ifAsyncGenerator](Function.ifAsyncGenerator)

The `ifAsyncGenerator` method checks if the current function is an
asynchronous generator and returns one of two provided values based on
the result. This method is a convenience for performing conditional
operations based on the type of a function.

#### Parameters

*   `thenValue` **any** The value to be returned if the function is an
    asynchronous generator.
*   `elseValue` **any** The value to be returned if the function is not
    an asynchronous generator.

#### Examples

```javascript
// Suppose we have an async generator function and a non-async function
async function* myAsyncGeneratorFunction() {}
function myFunction() {}

// Using ifAsyncGenerator
console.log(myAsyncGeneratorFunction.ifAsyncGenerator(
  'Async Generator', 'Not Async Generator'
));
// Output: 'Async Generator'
console.log(myFunction.ifAsyncGenerator(
  'Async Generator', 'Not Async Generator'
));
// Output: 'Not Async Generator'
```

Returns **any** Returns `thenValue` if the function is an asynchronous
generator, otherwise returns `elseValue`.

### isBigArrow

Checks if a given value is an arrow function. It verifies if the value is
an instance of `Function`, if its string representation includes the '=>'
symbol, and if it lacks a prototype, which is a characteristic of arrow
functions in JavaScript.

Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returns `true` if the value is an arrow function,
otherwise `false`.

### ifBigArrow

Checks if the current function is a "big arrow" function and
returns one of two provided values based on the result.

A "big arrow" function is an arrow function that is not bound
to a specific context and does not have its own `this` value.

#### Parameters

*   `thenValue` **any** The value to be returned if the function
    is a "big arrow" function.
*   `elseValue` **any** The value to be returned if the function
    is not a "big arrow" function.

#### Examples

```javascript
// Suppose we have a "big arrow" function and a regular function
const bigArrowFn = () => {}
function regularFn() {}

// Using ifBigArrow
console.log(bigArrowFn.ifBigArrow('Big Arrow', 'Not Big Arrow'))
// Output: 'Big Arrow'
console.log(regularFn.ifBigArrow('Big Arrow', 'Not Big Arrow'))
// Output: 'Not Big Arrow'
```

Returns **any** Returns `thenValue` if the function is a "big arrow"
function, otherwise returns `elseValue`.

### isBound

Determines if a given value is a bound function. Bound functions are
created using the `Function.prototype.bind` method, which allows setting
the `this` value at the time of binding. This method checks if the value
is an instance of `Function`, if its string representation starts with
'bound', and if it lacks a `prototype` property. These characteristics
are indicative of bound functions in JavaScript.

Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returns `true` if the value is a bound function,
otherwise `false`. Bound functions have a specific format in their
string representation and do not have their own `prototype` property.

### ifBound

Checks if the current function is bound and returns one of two
provided values based on the result.

A bound function is a function that has a fixed `this` value and
may have preset arguments. It is created using the
`Function.prototype.bind` method.

#### Parameters

*   `thenValue` **any** The value to be returned if the function
    is bound.
*   `elseValue` **any** The value to be returned if the function
    is not bound.

#### Examples

```javascript
// Suppose we have a bound function and a regular function
const boundFn = function() {}.bind(null)
function regularFn() {}

// Using ifBound
console.log(boundFn.ifBound('Bound', 'Not Bound'))
// Output: 'Bound'
console.log(regularFn.ifBound('Bound', 'Not Bound'))
// Output: 'Not Bound'
```

Returns **any** Returns `thenValue` if the function is bound,
otherwise returns `elseValue`.

### isClass

Determines if a given value is a class. It checks if the value is an
instance of `Function` and if its string representation includes the
keyword 'class'. This method is useful for distinguishing classes from
other function types in JavaScript.

Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returns `true` if the value is a class, otherwise
`false`.

### ifClass

Checks if the current function is a class and returns one of two
provided values based on the result.

A class is a special type of function in JavaScript that is
defined using the `class` keyword. It serves as a blueprint for
creating objects and encapsulates data and behavior.

#### Parameters

*   `thenValue` **any** The value to be returned if the function
    is a class.
*   `elseValue` **any** The value to be returned if the function
    is not a class.

#### Examples

```javascript
// Suppose we have a class and a regular function
class MyClass {}
function myFunction() {}

// Using ifClass
console.log(MyClass.ifClass('Class', 'Not Class'))
// Output: 'Class'
console.log(myFunction.ifClass('Class', 'Not Class'))
// Output: 'Not Class'
```

Returns **any** Returns `thenValue` if the function is a class,
otherwise returns `elseValue`.

### isFunction

Checks if a given value is a regular function. This method verifies if
the value is an instance of `Function`, which includes regular functions,
classes, and async functions but excludes arrow functions.

Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Returns `true` if the value is a regular function,
otherwise `false`.

### ifFunction

Checks if the current function is a regular function and returns
one of two provided values based on the result.

A regular function is an instance of `Function`, which includes
regular functions, classes, and async functions but excludes
arrow functions.

#### Parameters

*   `thenValue` **any** The value to be returned if the function
    is a regular function.
*   `elseValue` **any** The value to be returned if the function
    is not a regular function.

#### Examples

```javascript
// Suppose we have a regular function and an arrow function
function regularFunction() {}
const arrowFunction = () => {}

// Using ifFunction
console.log(regularFunction.ifFunction('Regular', 'Not Regular'))
// Output: 'Regular'
console.log(arrowFunction.ifFunction('Regular', 'Not Regular'))
// Output: 'Not Regular'
```

Returns **any** Returns `thenValue` if the function is a regular
function, otherwise returns `elseValue`.

### isGenerator

The function checks if a given value is a generator function

Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `true` if the value is an instance of a function and
its string tag is 'GeneratorFunction', otherwise it returns `false`.

### ifGenerator

Checks if the current function is a generator function and
returns one of two provided values based on the result.

A generator function is a special type of function that can be
paused and resumed, allowing it to yield multiple values over
time rather than returning a single value.

#### Parameters

*   `thenValue` **any** The value to be returned if the
    function is a generator function.
*   `elseValue` **any** The value to be returned if the
    function is not a generator function.

#### Examples

```javascript
// Suppose we have a generator function and a regular function
function* generatorFunction() {
  yield 1
  yield 2
  yield 3
}
function regularFunction() {}

// Using ifGenerator
console.log(generatorFunction.ifGenerator('Generator', 'Regular'))
// Output: 'Generator'
console.log(regularFunction.ifGenerator('Generator', 'Regular'))
// Output: 'Regular'
```

Returns **any** Returns `thenValue` if the function is a
generator function, otherwise returns `elseValue`.

### getClassProperties

Retrieves the properties of the current function and its prototype.

This method uses the `getClassProperties` function from the
`FunctionExtensions.patches` object to get all the properties of the
current function and its prototype. The properties include both
enumerable and non-enumerable properties, as well as properties
defined with symbols.

#### Examples

```javascript
// Suppose we have a function with a property and a prototype property
function MyFunction() {}
MyFunction.myProp = 'hello';
MyFunction.prototype.myProtoPro