yoastseo
Version:
Yoast client-side content analysis
32 lines (31 loc) • 663 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
/**
* Interpreters a score and gives it a particular rating.
*
* @param {Number} score The score to interpreter.
* @returns {string} The rating, given based on the score.
*/
const ScoreToRating = function (score) {
if (score === -1) {
return "error";
}
if (score === 0) {
return "feedback";
}
if (score <= 4) {
return "bad";
}
if (score > 4 && score <= 7) {
return "ok";
}
if (score > 7) {
return "good";
}
return "";
};
var _default = exports.default = ScoreToRating;
//# sourceMappingURL=scoreToRating.js.map