lib/rules/prefer-template.js
function isOctalEscapeSequence(node) {

    // No need to check TemplateLiterals – would throw error with octal escape
    const isStringLiteral = node.type === "Literal" && typeof node.value === "string";

    if (!isStringLiteral) {
        return false;
    }

    const match = node.raw.match(/^([^\\]|\\[^0-7])*\\([0-7]{1,3})/u);

    if (match) {

        // \0 is actually not considered an octal
        if (match[2] !== "0" || typeof match[3] !== "undefined") {
            return true;
        }
    }
    return false;
}
function isOctalEscapeSequence(node) {

    // No need to check TemplateLiterals – would throw error with octal escape
    const isStringLiteral = node.type === "Literal" && typeof node.value === "string";

    if (!isStringLiteral) {
        return false;
    }

    const match = node.raw.match(/^([^\\]|\\[^0-7])*\\([0-7]{1,3})/u);

    if (match) {

        // \0 is actually not considered an octal
        if (match[2] !== "0" || typeof match[3] !== "undefined") {
            return true;
        }
    }
    return false;
}
function isOctalEscapeSequence ( node ) { // No need to check TemplateLiterals – would throw error with octal escape const isStringLiteral = node . type === "Literal" && typeof node . value === "string" ; if ( ! isStringLiteral ) { return false ; } const match = node . raw . match ( / ^([^\\]|\\[^0-7])*\\([0-7]{1,3}) / u ) ; if ( match ) { // \0 is actually not considered an octal if ( match [ 2 ] !== "0" || typeof match [ 3 ] !== "undefined" ) { return true ; } } return false ; }
Determines whether a given node is a octal escape sequence
@param {ASTNode} node A node to check
@returns {boolean} `true` if the node is an octal escape sequence
Determines whether a given node is a octal escape sequence