examples/custom_apis/combinator/combinator_api.js
function toOriginalText(item) {
    if (_.has(item, "tokenName")) {
        return item.tokenName
    } else if (item instanceof Rule) {
        return item.name
    } else if (_.isString(item)) {
        return item
    } else if (_.has(item, "toRule")) {
        return item.definition.orgText
    } else {
        throw Error(`Unexpected Argument type ${item}`)
    }
}
function toOriginalText(item) {
    if (_.has(item, "tokenName")) {
        return item.tokenName
    } else if (item instanceof Rule) {
        return item.name
    } else if (_.isString(item)) {
        return item
    } else if (_.has(item, "toRule")) {
        return item.definition.orgText
    } else {
        throw Error(`Unexpected Argument type ${item}`)
    }
}
function toOriginalText ( item ) { if ( _ . has ( item , "tokenName" ) ) { return item . tokenName } else if ( item instanceof Rule ) { return item . name } else if ( _ . isString ( item ) ) { return item } else if ( _ . has ( item , "toRule" ) ) { return item . definition . orgText } else { throw Error ( ` ${ item } ` ) } }
Attempts to reconstruct the original api usage text
for better error message purposes.
Attempts to reconstruct the original api usage text for better error message purposes .