HalsteadArray
Index
Constructors
constructor
Initializes HalsteadArray by normalizing any Halstead properties converting them into TraitHalstead instances.
Parameters
metric: string
The name of Halstead metric being stored.
data: any
An array of Halstead properties.
Returns default
Accessors
length
Returns the length of wrapped TraitHalstead data
Returns number
metric
Returns the associated metric type.
Returns string
type
Returns the typeof data being wrapped.
Returns string | number | bigint | boolean | symbol | undefined | object | function
Methods
forEach
Allows custom processing of TraitHalstead data.
Parameters
callback: () => void
A custom method to process each TraitHalstead data.
thisArg: any
The this
thisscope to run callback with.
Returns void
get
Returns a TraitHalstead entry at the given index.
Parameters
index: number
Index to access.
Returns default
valueOf
Returns an array of evaluated TraitHalstead data as the value of the
identifierfield of the wrapped data. Additionally the TraitHalstead filter function is invoked with the given parameters removing any values that fail the filter test.Parameters
rest...params: any
Provides parameters which are forwarded onto any data stored as a function. Normally
paramsshould be thecurrent AST node, parent AST node, ... optional data.
Returns string[]
Provides a wrapper around an array of Halstead property object hashes which should contain an
identifierfield and potentially afilterfield.