function getNormalizedLiteral(node, defaultValue) {
    if (node.type === "Literal") {
        return node;
    }

    if (looksLikeLiteral(node)) {
        return {
            type: "Literal",
            value: -node.argument.value,
            raw: `-${node.argument.value}`
        };
    }

    if (defaultValue) {
        return {
            type: "Literal",
            value: defaultValue,
            raw: String(defaultValue)
        };
    }

    return null;
}
function getNormalizedLiteral(node, defaultValue) {
    if (node.type === "Literal") {
        return node;
    }

    if (looksLikeLiteral(node)) {
        return {
            type: "Literal",
            value: -node.argument.value,
            raw: `-${node.argument.value}`
        };
    }

    if (defaultValue) {
        return {
            type: "Literal",
            value: defaultValue,
            raw: String(defaultValue)
        };
    }

    return null;
}
function getNormalizedLiteral ( node , defaultValue ) { if ( node . type === "Literal" ) { return node ; } if ( looksLikeLiteral ( node ) ) { return { type : "Literal" , value : - node . argument . value , raw : ` ${ node . argument . value } ` } ; } if ( defaultValue ) { return { type : "Literal" , value : defaultValue , raw : String ( defaultValue ) } ; } return null ; }
Attempts to derive a Literal node from nodes that are treated like literals.
@param {ASTNode} node Node to normalize.
@param {number} [defaultValue] The default value to be returned if the node
is not a Literal.
@returns {ASTNode} One of the following options.
1. The original node if the node is already a Literal
2. A normalized Literal node with the negative number as the value if the
node represents a negative number literal.
3. The Literal node which has the `defaultValue` argument if it exists.
4. Otherwise `null`.
Attempts to derive a Literal node from nodes that are treated like literals .
Get normalized literal