Preparing search index...
The search index is not available
@neozen/zen - v
Settings
Member Visibility
Protected
Inherited
External
Theme
OS
Light
Dark
@neozen/zen
isInt32Array
Function isInt32Array
is
Int32
Array
(
value
)
:
value
is
Int32Array
Parameters
value
:
unknown
Returns
value
is
Int32Array
@neozen/zen
set
Prop
Sets a *value* to an *object*, to a given *path* that's either:
Set
Prop
Options
Options interface for [ `z.setProp` ](../functions/setProp.html )
set
Prop_
Default
Options
Default options for [ `z.setProp` ](../functions/setProp.html )
get
Prop
Gets a value from an Object, with a given path. If no valid path exists, `undefined` is returned.
Get
Prop
Options
Options interface for [ `z.getProp` ](../functions/getProp.html )
get
Prop_
Default
Options
Default options for [ `z.getProp` ](../functions/getProp.html )
is
Disjoint
Returns true if there are no common values between the elements of the two Arrays or Sets (i.e their intersection is empty)
Is
Disjoint
Options
Options interface for [ `z.isDisjoint` ](../functions/isDisjoint.html )
is
Disjoint_
Default
Options
Default options for [ `z.isDisjoint` ](../functions/isDisjoint.html )
is
Ref
Disjoint
Given two Property Bags (i.e any z.isRef, incl Objects, Arrays, Set, Maps, Symbols, Boxed primitives etc), it returns `true` if there are **NO common/shared References** in their entries/elements/properties.
Is
Ref
Disjoint
Options
Options interface for [ `z.isRefDisjoint` ](../functions/isRefDisjoint.html )
is
Ref
Disjoint_
Default
Options
Default options for [ `z.isRefDisjoint` ](../functions/isRefDisjoint.html )
get
Refs
Gets a flat list of all references of an isMany value (Array, Object, Set, Map etc) & returns them as an array.
Get
Refs
Options
Options type for [ `z.getRefs` ](../functions/getRefs.html )
get
Refs_
Default
Options
Default options for [ `z.getRefs` ](../functions/getRefs.html )
is
Equal
Deeply compares 2 input values, returning `true` if they are considered equal, with loads of awesome options!
Is
Equal
Options
Options interface for [ `z.isEqual` ](../functions/isEqual.html )
Is
Equal
Customizer
Callback
Customizer callback type for [ `z.isEqual` ](../functions/isEqual.html ).
is
Equal_
Default
Options
Default options for [ `z.isEqual` ](../functions/isEqual.html ) *
arrayize
Places value in a new array, if it's not already an array.
keys
`keys()` returns an array of: **a)** Nestedly occurring `keys` or `indexes` (eg `Set` keys, array indexes etc) or **b)** `props` of the input value (props on all objects), including symbols, own & inherited, enumerable & nonEnumerable! The returned props can be filtered by prop type (string or symbol), enumerability, own/inherited, top-level props etc.
keysS
A Simplified typings version of `keys()` that returns only `string` or `symbol` props types of the input value, based on the options.
Keys
Returns either or both a) the NestedKeys along with b) the Props of the Tinput, based on the `KeysOptions` passed.
KeysS
IKeys
Options
Options interface for z.keys
IKeys_
Default
Options
keys_
Default
Options
Inspectable
Nested
Only these types have **Inspectable Nested Keys** (separate from their props), that can be inspected at runtime (without affecting the input value).
is
Inspectable
Nested
values
Returns an array of either OR both of:
Values
Returns either or both A) the `InsideValues` (i.e Nested Values) along with B) PropsValues of the Tinput, based on the `KeysOptions` passed.
each
Iterate over the (many) items of a value, calling the callback for each item. Think of `_.each()` or `Array.forEach()`, but more powerful via [ `z.loop()` ](../functions/loop.html ). Hence, it works with ANY value, not just arrays and objects, but also `Map`, `Set`, `Iterator`, `Generator` & even `AsyncIterators` (where it returns a promise resolving when iteration ends!
Each
Iteratee
Each
Async
Iteratee
take
Takes `n` elements from the beginning of the value ( `Array`, `Object`, `Set`, `Map` etc). If `n` is a function, it stops as soon as it returns `false` or `z.STOP`.
map
Map over the (many) items of **any possible input value**, returning a new instance of the same input value type (if possible), with the results of calling the projector/mapping function on every "nested" element of the input value (for collections like Objects, Arrays, Maps, Sets but also for Iterators, Generators, AsyncIterators etc).
IMap
Options
filter
Filter over the (many) items of a value and returning of **a new instance of the value**, containing the elements that pass the filter with [ `isPass` ](../functions/isPass.html ) (an elaborate kind of truthy). Value can be `Object`, `Array`, `Map`, `Iterators` and many more.
clone
Creates a perfect shallow clone of whatever value is given (and can be perfectly cloned :)
function
Type
Determine the type of function: class definition OR function (and what kind)
Function
Type
Names
Function
Types
FUNCTION_
TYPE_
NAMES
is
Agree
Checks if `value` is in agreement with an `agreement` - see below.
is
Any
Number
Checks and returns true, if value is any kind of a "real number", a good candidate for `Number()` :
is
Array
Buffer
Checks if value ia an ArrayBuffer
is
Set
Equal
Returns true if the two passed Sets or Arrays representing sets of items, are set-equal (i.e. they contain the same items, irrespective of items order).
is
Async
Function
Checks if value is declared as an [ `AsyncFunction` ](../types/AsyncFunction.html ). This includes only `async () => Promise<any>` declarations, but NOT normal functions that returns a Promise (i.e `() => Promise<any>` ).
Async
Function
is
Async
Generator
Checks if value is an `AsyncGenerator`, i.e `Object [Generator] {}`, what a `GeneratorFunction` returns:
is
Async
Generator
Function
Checks if value is a `AsyncGeneratorFunction`, eg `async function* () {}` When you call an `AsyncGeneratorFunction`, it returns an `AsyncGenerator`, that you can loop with `for await (const x of asyncGenerator()) {}`, or better yet `for await (const [item] of z.loop(asyncGenerator())) {}`
is
Big
Int
Checks if value is *BigInt*
is
Boxed
Primitive
Checks if value is a boxed primitive. Boxed primitives are:
is
Boxed
Boolean
is
Boxed
Number
is
Boxed
String
is
Class
Check if a value is a class (instead of a "normal" function), with a type guard, so you can `new value()` without TS errors.
class
Type
Class
Type
Names
CLASS_
TYPE_
NAMES
is
User
Class
Returns true if the value is a **user class** only, as opposed to a "normal" functions OR non user-defined class, i.e the internal ones like Promise, Object, Array, Set, Map etc
SYSTEM_
CLASSES
constructor
Returns the `constructor` of an Object value, if it exists.
is
System
Class
Returns true if the value is a **user class** only, as opposed to a "normal" functions OR non user-defined class, i.e the internal ones like Promise, Object, Array, Set, Map etc
System
Classes
Just a stub - not working to matching exclusively System classes, it matches everything!
is
Enumerable
is
Exact
Shortcut of [ `z.isEqual` ](../functions/isEqual.html ) with forced options
is
True
Returns true if the value is strict `true` OR `new Boolean(true)`
is
Ok
Returns true if value is a **Zen truthy**, defined as `!_.isBad(value)`, which includes:
is
Truthy
Returns if value is strict *JS truthy*, i.e `!!value`, along with `value !== z.NOTHING` && not `new Boolean(false)` @todo: type guard
is
Strict
True
Returns true if value is strict `true`
is
False
Returns true if the value is strict `false`, including `new Boolean(false)`
is
Bad
Returns true if value is **zen falsey**, a.k.a bad, which includes
is
Falsy
Returns true if value is `JS falsy`, i.e `!value`, but also if `value === z.NOTHING` or `new Boolean(false)`
is
Strict
False
Returns true if value is strict `false`
is
Function
Check if the value is a function, using the `typeof` operator.
is
Generator
Checks if value is a `Generator` i.e `Object [Generator] {}`, what a `GeneratorFunction` returns
is
Generator
Function
Checks and returns `true`, if value is either a:
is
Instance
Checks if value passed is a **user class instance**, created with `new MyClass()`, as opposed to Plain/POJSO Objects, i.e an object created as literal `{}` or by `Object.create()` or `new Object()`.
is
Iqual
Shortcut of [ `z.isEqual` ](../functions/isEqual.html ) with forced options =
is
Plain
Iterator
Checks if value is a **plain** Iterator.
is
Ixact
Shortcut of [ `z.isEqual` ](../functions/isEqual.html ) with forced options =
is
Like
Shortcut of [ `z.isEqual` ](../functions/isEqual.html ) with forced options
is
Map
Iterator
Checks if value is a Map Iterator - includes `map.entries()`, `map.values()`, `map.keys()`, `map[Symbol.iterator]()` etc.
Map
Iterator
Keys
Map
Iterator
Values
Map
Iterator
Entries
is
Native
Error
Checks if the value is an instance of Native (i.e built-in) Error
is
Many
Returns `true` if the data type is a natural holder of other items, also known as a "collection" (eg Array, Object, Set, Map) but Many is also Iterator, Generator, arguments etc, hence the name `isMany` instead of `isCollection`.
is
Many
Type
Many
Supposedly matches any type that can hold many items, including system types like Array, Set, Map, Iterator, Generator, arguments etc.
Many
Names
Many
System
All system types that are Many, everything but your own pojsos / plain objects & instances.
Many
System
Names
MANY_
NAMES
MANY_
SYSTEM_
NAMES
is
Number
Checks if value is either a [strict number](../functions/isStrictNumber.html ) OR `BigInt` OR `Infinity`, excluding only `NaN` s & boxed `new Number('123')`.
is
Number
String
Check if value is a **string number**, like `'123'` or `'123.456'`
Number
String
A Number value, but as a string
isPOJSObject
Checks and returns true if value is a POJSO Object (Plain Old JS Object), such as object literal {} or object created by `Object.create()` etc, but NOT instances (eg `new MyClass()` ).
is
Primitive
Returns `true` if the data type is a Primitive, according to the [definition of "primitive" in JavaScript](https://developer.mozilla.org/en-US/docs/Glossary/Primitive)
is
Primitive
Type
Returns `true` if `theType` is a name of a Primitive
Primitive
Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive), also including the pseudo type `void`.
Primitive
Names
The names of the primitive types: 'string', 'number', 'boolean', 'undefined', 'null', 'symbol', 'bigint' ( `void` is not included, it's a pseudo type)
PRIMITIVE_
NAMES
is
Promise
Checks if a value is a Promise. Its 2024 and we still need this ;-(
If
Promise
Is
Promise
Unwrap
Promise
Unwraps the "awaited type" of the Promise, but only once (unlike Awaited which is recursive). Non-promise "thenables" should resolve to `never`. This DOESNT emulate the behavior of `await`, it just unwraps the type of top-level Promise.
is
Real
Function
Checks if value passed is any kind of Function, but excluding Classes. Uses z.isFunction that works for async generator functions (unlike lodash).
is
Ref
Returns `true` if the data type is a Reference type.
is
Real
Object
Returns `true` if input value passed is any kind of **real object** (a.k.a. a hash) in any form, such as object literal {}, class instance (instantiated with new MyClass), object created by `Object.create()` with or without a specified prototype etc).
If
Real
Object
Is
Real
Object
Returns `true` if the value is a **realObject** as defined in [ `isRealObject()` ](../functions/isRealObject.html )
is
Set
Iterator
Set
Iterator
Entries
Set
Iterator
Keys
Set
Iterator
Values
is
Strict
Number
Check if value is a **strict number**, excluding NaNs & boxed `new Number('123'), BigInt & Infinity.
is
Typed
Array
Checks if the value is a [ `TypedArray` ](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) adding the **correct type guard**, that lodash lacks.
typed
Array
Type
Typed
Array
Names
Typed
Array
Number
Typed
Array
Big
Int
Typed
Array
Number
Names
Typed
Array
Big
Int
Names
TYPED_
ARRAY_
NAMES
TYPED_
ARRAY_
NUMBER_
NAMES
TYPED_
ARRAY_
BIGINT_
NAMES
is
Typed
Array
Big
Int
is
Big
Int64
Array
is
Big
Uint64
Array
is
Typed
Array
Number
is
Int8
Array
is
Uint8
Array
is
Uint8
Clamped
Array
is
Int16
Array
is
Uint16
Array
is
Int32
Array
is
Uint32
Array
is
Float32
Array
is
Float64
Array
is
Typed
Array
Name
is
Any
Array
Returns true if the value is an array of any type, including TypedArrays.
loop
@todo: Write docs for `loop()` - accepts any input value (usually a "collection" or a container of other nested items) and returns a Generator (actually a LoopGenerator) blah blah
Iloop
Meta
Iloop
Callbacks
The sole purpose of callbacks to exist here in `IloopCallbacks`, separately from [ `ILoopOptions` ](../interfaces/ILoopOptions.html ), is due to a Zen/TypeScript limitation, that doesn't properly infer the type of a callback's arguments (it ignores the options, probably cause they belong to same type interface before it has been initialized).
Filter
Callback
Map
Callback
Map
Keys
Callback
Take
Callback
Items
Callback
IFilter
Only
Options
Filter
Return
ILoop
Options
Options interface for z.keys
Loop
Values
Get the loop items (a.k.a values), depending on the input value type and options
Loop
Keys
Get the loop keys, depending on the input value type and options.
ILoop_
Default
Options
LOOP_
SYMBOL
Async
Loop
Generator
Loop
Generator
Tloop
Callback
Names
loop
Callback
Names
loop_
Default
Options
is
Loop
Generator
is
Async
Loop
Generator
number
Enum
To
Number
Val
Returns the validated & existing `number value` part of a "numeric" enum (the right hand-side), given either side (the string or number part) of a "numeric" enum.
number
Enum
To
String
Key
Returns the validated & existing enum "string key" part of a "numeric" enum (the string at left hand side), given either side (the string or number part) of a "numeric" enum.
is
Data
View
Check if value is a DataView
real
Object
Type
Determine the type of an [ `z.isRealObject` ](../functions/isRealObject.html ): an `'instance'` of a class or a plain `'pojso'` object.
Real
Object
Type
Names
REAL_
OBJECT_
TYPE_
NAMES
instance
Type
Given an instance, it returns the class type: 'systemClass' | 'userClass'
Instance
Type
Names
INSTANCE_
TYPE_
NAMES
type
Returns the **type name** of the value passed, similar to the flawed [ `typeof` ](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/typeof), but in a much richer, fine-grained & *non-Bad Parts* manner, recognising & many more distinct "real" types.
is
Type
Returns `true` if the type name passed is a valid type name
Type
Names
TYPE_
NAMES
real
Type
The most fine-grained and granular version of `z.type()`, returning the **Real-World Type Name** of the value passed, not just a general type:
is
Real
Type
Returns `true` if the type name passed is a valid type name
Real
Type
Names
REAL_
TYPE_
NAMES
is
Any
Just
Iterator
Checks if value is any kind of `Iterator` or `AsyncIterator`, including `Generator` and `AsyncGenerator`, but **excluding** standard Iterables (that are legally also Iterators) like `Array`, `Set` & `Map`, that have their own [ `z.type` ](../functions/type ) and are more than Any Just Iterator.
STOP
Use `return STOP` or `return STOP(returnValue)` to stop iteration in callback functions, like `map`, `filter`, `take` etc.
is
Stop
Returns if value is a `STOP` or `STOP()` (i.e a `Stop` instance with a returnValue, the last of the iteration).
Stop
Class
An instance that represents a stopping of iteration, carrying an optional "return" value.
Stop
NOTHING
A Symbol that represents the absense of at value at runtime - similar idea to `never` type in TypeScript.
is
Nothing
Returns if value is a `z.NOTHING`, i.e the absence of any value, in the ZenType/ZenDas world.
is
Pass
Returns if value is passing, used in various filters and projections.
Data
View
Type
Array
Buffer
Cursor
Create an `ArrayBufferCursor` to get an iterator-like reader for an ArrayBuffer. It implements the `DataView` methods under the hood.
map
Keys
Map over the (many) keys/indexes of **any possible input value**, returning a new instance of the same input value type (if possible), with the results of calling the projector/mapping function on every "nested" key/prop/index of the input value.
reduce
Reduce
Callback
find
Find and return an item, as soon as `findCb` returns `true` (not truthy).
find
Key
Find and return an item, as soon as `findCb` returns `true` (not truthy).
type
Is
True
Check a type is `true` Useful with `IsEqual`, for a strict type check
type
Is
False
Check a type is `false` Useful with `IsEqual`, for a strict type check
Any
Any kind of value falls into one of these types, either a single value or a many values holder.
Async
Iterator
Or
Generator
Iterator
Or
Generator
Generator
Type
Typed
Array
Exact
Typed
Array
Value
Type
Returns the value used in the TypedArray, i.e number or bigint
Value
Of
Strict
Like type-fest's `ValueOf` but:
Is
Nesting
Object
Returns `true` if the input value is a `NestingObject` :
If
Nesting
Object
is
Nesting
Object
Checks if input is a Nesting Object - it follows IsNestingObject type
Inside
Values
InsideValues
Inside
Keys
Like `InsideValue`, but for the keys of the nested values.
Generator
Return
Type
Gets the value type of a Generator or AsyncGenerator
Object
Prop
Types
Props of an object: string and symbol only, unlike number in Arrays indexes, or primitive/objects in Map & Set keys
Symbol
Object
Needed because of TS2538: Type symbol cannot be used as an index type
Property
Bag
PropBag helper type - all Pojsos, instances, functions & IArguments that dont have plain props, instead "special" keys/indexes (like array have indexes, maps have keys, sets have values as keys, etc.)
If
If Condition is true, then return Then, else return Else
If
And
If both Conditions are true, then return Then, else return Else
If
Or
If either Condition is true, then return Then, else return Else
If
Extends
If T1 extends T2, then return Then (default true), else return Else (default false)
Not
Negates the passed boolean
Is
Any
Or
Unknown
Returns true if T is any or unknown, otherwise returns false
If
Any
Or
Unknown
If T is any or unknown, then return Then, else return Else
Is
Undefined
If
Undefined
Is
Any
Or
Unknown
Or
Undefined
Returns true if T is any, unknown, undefined
If
Any
Or
Unknown
Or
Undefined
If T is any, unknown, undefined, then return Then, else return Else
Is
Absent
Returns true if T is any, unknown, undefined, null, never, void
If
Absent
If T is any, unknown, undefined, null, never, void, then return Then, else return Else
Is
Prop
True
Returns `true` if TpropName on the Tobject is `true`, `false` if it is `false`, otherwise (if its undefined etc), it returns `Tdefault` (that it self defaults to `false` )
Is
Prop
False
Props
Of
Known
Prototype
Get the prototype chain's props of `Tinput`, according to the `TkeysOptions` passed, so we can exclude them from the instance props.
Props
Values
Of
Known
Prototype
Get the props values based on KeysOptions
NO_
TYPE_
CHANGE
Base
Type
Returns the BaseType of the Tinput, i.e the base type without extra props, but maintaining the same type, including the Type of any Nested values.
Props
Of
Base
Type
Get all the props of a default known system's object (i.e effectively, its prototype).
Props
Of
String
Or
Symbol
Basic
Props
Returns `string` or `symbol` types, based on the options
Props
Strict
Like Props, excluding props of the BaseType (only own)
Props
Get ALL the props of Tinput object, based on the KeysOptions passed
Props
Values
Props
Of
Prop
Type
A type helper to extract the prop names, of props with a matching `TpropType`, i.e the type of the props (i.e `string` or `symbol` ) from any value type.
Props
String
Props
Symbol
Instance
Type
All
Like InstanceType<T>, but also works for private constructors:
Method
Names
Extract the method key names from a class
Prop
Names
Extract the non-method key names from a class
Just
Methods
Extract the methods from a class, return a new structure with methods only.
Just
Props
Create a new type from an object type extracting just properties, not methods.
Unliteral
Convert all literal types to their base type, eg 'foobar' => string, 123 => number, true => boolean, etc.
Single
System
Names
Single
System
SINGLE_
SYSTEM_
NAMES
Single
Names
SINGLE_
NAMES
Single
Matches all Single values, as defined in ZenType. This includes all Primitive types and all TSystemSingles.
Is
Single
If
Single
Single
Or
Weak
Matches a Single or a WeakSet or WeakMap (BUT unfortunately also Set & Map). So, it is BROKEN! Use `IsSingleOrWeak` instead that works fine!
Is
Single
Or
Weak
Returns true if T is a Single or a WeakSet or WeakMap.
If
Single
Or
Weak
Is
Boxed
Primitive
If
Boxed
Primitive
is
Single
Or
Weak
is
Single
Returns `true` if the data type is a "single" or "plain" value, in terms of NOT naturally/normally having compound or "Many" items (eg props, array items etc) inside it that we can iterate over.
is
Single
Type