можно избавиться от ошибки добавив скобки:
return value == null ? (name.local ? attrNullNS : attrNull) : (typeof value === "function" ? (name.local ? attrFunctionNS : attrFunction) : (name.local ? attrConstantNS : attrConstant));
ну а если if/else
if (value == null) {
    if (name.local) {
        return attrNullNS;
    } else {
        return attrNull;
    }
} else if (typeof value === "function") {
    if (name.local) {
        return attrFunctionNS;
    } else {
        return attrFunction;
    }
} else if (name.local) {
    return attrConstantNS;
} else {
    return attrConstant;
}