lib/rules/no-eval.js
function isConstant(node, name) {
    switch (node.type) {
        case "Literal":
            return node.value === name;

        case "TemplateLiteral":
            return (
                node.expressions.length === 0 &&
                node.quasis[0].value.cooked === name
            );

        default:
            return false;
    }
}
function isConstant(node, name) {
    switch (node.type) {
        case "Literal":
            return node.value === name;

        case "TemplateLiteral":
            return (
                node.expressions.length === 0 &&
                node.quasis[0].value.cooked === name
            );

        default:
            return false;
    }
}
function isConstant ( node , name ) { switch ( node . type ) { case "Literal" : return node . value === name ; case "TemplateLiteral" : return ( node . expressions . length === 0 && node . quasis [ 0 ] . value . cooked === name ) ; default : return false ; } }
Checks a given node is a Literal node of the specified string value.

@param {ASTNode} node - A node to check.
@param {string} name - A name to check.
@returns {boolean} `true` if the node is a Literal node of the name.
Checks a given node is a Literal node of the specified string value .