Module

reflection

Provides utilities for TypeScript reflection and metadata manipulation

View Source index.ts, line 7

Members

# static constant VERSION

Stores the semantic version number of the package

Current version of the reflection package

View Source index.ts, line 12

string

# static readonly exports.ReflectionKeys

Holds the constant keys used in the reflection system for accessing metadata

Enum containing metadata keys used for reflection

Properties:
Name Type Description
TYPE string

Key for accessing type metadata, value is "design:type"

View Source constants.ts, line 10

Methods

# static isEqual(a, b, propsToIgnore) → {boolean}

Performs a deep equality check between two values, handling various types including primitives, objects, arrays, dates, and more

Enhanced algorithm for deep comparison of any two values with optional ignored properties

sequenceDiagram participant Caller participant isEqual participant Recursion Caller->>isEqual: isEqual(a, b, propsToIgnore) Note over isEqual: Check simple cases (identity, null, primitives) alt a === b isEqual-->>Caller: true (with special case for +0/-0) else a or b is null isEqual-->>Caller: a === b else different types isEqual-->>Caller: false else both NaN isEqual-->>Caller: true else primitive types isEqual-->>Caller: a === b else both Date objects isEqual-->>Caller: Compare timestamps else both RegExp objects isEqual-->>Caller: Compare string representations else both Error objects isEqual-->>Caller: Compare name and message else both Arrays Note over isEqual: Check length loop For each element isEqual->>Recursion: isEqual(a[i], b[i], propsToIgnore) end else both Maps or Sets Note over isEqual: Compare size and entries else both TypedArrays Note over isEqual: Compare byte by byte else both Objects Note over isEqual: Filter keys by propsToIgnore Note over isEqual: Compare key counts loop For each key isEqual->>Recursion: isEqual(a[key], b[key], propsToIgnore) end Note over isEqual: Check Symbol properties Note over isEqual: Compare prototypes end isEqual-->>Caller: Comparison result
Parameters:
Name Type Description
a unknown

First value to compare

b unknown

Second value to compare

propsToIgnore Array.<string>

A list of property names to ignore during comparison

View Source equality.ts, line 2

Returns true if the values are deeply equal, false otherwise

boolean

Type Definitions

Object

# DecoratorMetadata

Represents the structure of metadata associated with decorators, containing a key and properties

Type definition for storing decorator metadata

Properties:
Name Type Description
key string

The identifier key for the decorator

props T

The properties/configuration of the decorator

key string
props T

View Source types.ts, line 4