Function: isSortRefFeatureValue()
@kortexya/reasoninglayer / isSortRefFeatureValue
Function: isSortRefFeatureValue()
Section titled “Function: isSortRefFeatureValue()”isSortRefFeatureValue(
value):value is SortRefFeatureValue
Defined in: src/utils/discrimination.ts:48
Type guard for a sort named as a feature value ({sort_ref, sort_name?}).
Parameters
Section titled “Parameters”unknown
Any value, typically one entry of a listed term’s features.
Returns
Section titled “Returns”value is SortRefFeatureValue
true if the value is a SortRefFeatureValue.
Remarks
Section titled “Remarks”A sort value used to arrive as {term_id}, indistinguishable from a term
reference (#353). Use this guard to keep sort ids apart from term ids, for
example when collecting the term ids a rule mentions.
Example
Section titled “Example”import { isSortRefFeatureValue } from '@kortexya/reasoninglayer';
const of = rule.head.features['of'];if (isSortRefFeatureValue(of)) { console.log(of.sort_name ?? of.sort_ref);}