Sets up a function to lazy load the configuration when any of the other functions are called. This function can be set after some initial registration. It will be discarded immediately after its used.
Provides access to services.
Compares two values, determining if they are equal, less than, or greater than each other.
This function is designed to handle a wide range of data types, offering flexibility in comparison strategies based on the type and content of the values provided. It supports basic types directly and offers a mechanism for comparing custom data types through converters and comparers.
When using data types that you know don't naturally work with the above, we recommend running them through the DataTypeConversionService first to change their data type and lookup key to something that does.
let convertedResult = services.dataTypeConverterService.convert(value, LookupKey.Integer);
if (convertedResult.failed)
return ComparisonResult.Undetermined;
let comparisonResult = services.dataTypeComparerService.compare(convertedResult.value, 5, LookupKey.Integer, null);
Many Condition objects use this compare() function, such as RangeCondition, EqualToValueCondition, etc. They have these properties on their Config objects to provide conversion prior to comparision:
Some good examples of using conversionLookupKey and secondConversionLookupKey are:
Comparison is performed as follows:
The first value to compare.
The second value to compare.
A lookup key indicating how to interpret value1
or null if no such hint is needed.
A lookup key indicating how to interpret value2
or null if no such hint is needed.
The result of the comparison. The ComparersResult enum has these values: Equal, NotEqual, LessThan, GreaterThan, Undetermined. Expect booleans to report Equal or NotEqual, and other types to report Equals, LessThan, or GreaterThan. Expect Undetermined when types are mismatched or unsupported.
Returns a comparer that supports both values or null if not.
The first value to compare.
The second value to compare.
A lookup key indicating how to interpret value1
or null if no such hint is needed.
A lookup key indicating how to interpret value2
or null if no such hint is needed.
Registers an instance of the interface supported by this service. It may replace an existing one, as determined by the subclass. Replace supported on: IDataTypeIdentifier
Returns the full collection.
If the user needs to abandon this instance, they should use this to clean up active resources (like timers) and to release memory that would stall the garbage collector from disposing this object. It should assign any object reference to undefined as a strong indicator that the object has been disposed.
Generated using TypeDoc v0.25.12
A service for changing the comparing two values using IDataTypeComparer instances.
Used by Conditions to compare two values when those values don't naturally work with the JavaScript comparison operators. Due to the Converter's ability to prepare most values for the default comparison function, these aren't often created.