static checkCompatibility()

in src/internal/BinaryUtils.ts [357:376]


    static checkCompatibility(value, type) {
        if (!type) {
            return;
        }
        const typeCode = BinaryUtils.getTypeCode(type);
        if (value === null) {
            if (!BinaryUtils.isNullable(typeCode)) {
                throw IgniteClientError.typeCastError(BinaryUtils.TYPE_CODE.NULL, typeCode);
            }
            return;
        }
        else if (BinaryUtils.isStandardType(typeCode)) {
            BinaryUtils.checkStandardTypeCompatibility(value, typeCode, type);
            return;
        }
        const valueTypeCode = BinaryUtils.getTypeCode(BinaryUtils.calcObjectType(value));
        if (typeCode !== valueTypeCode) {
            throw IgniteClientError.typeCastError(valueTypeCode, typeCode);
        }
    }