src/renderer/viz/expressions/utils.js
// To support literals (string and numeric) out of the box we need to cast them implicitly on constructors
To support literals (string and numeric) out of the box we need to cast them implicitly on constructors
To support literals ( string and numeric ) out of the box we need to cast them implicitly on constructors
function implicitCast (value) {
    if (_isNumber(value)) {
        return number(value);
    }
    if (typeof value === 'string') {
        return category(value);
    }
    if (Array.isArray(value)) {
        const _array = array(value);
        if (_array && _array.type === 'image-array') {
            return imageList(_array.elems);
        }
        return _array;
    }
    return value;
}
function implicitCast ( value ) { if ( _isNumber ( value ) ) { return number ( value ) ; } if ( typeof value === 'string' ) { return category ( value ) ; } if ( Array . isArray ( value ) ) { const _array = array ( value ) ; if ( _array && _array . type === 'image-array' ) { return imageList ( _array . elems ) ; } return _array ; } return value ; }
To support literals (string and numeric) out of the box we need to cast them implicitly on constructors
To support literals ( string and numeric ) out of the box we need to cast them implicitly on constructors