• 周五. 8月 19th, 2022

5G编程聚合网

5G时代下一个聚合的编程学习网

热门标签

t.isLiteral()

admin

11月 28, 2021
function isLiteral(node, opts) {
    if (!node) return false;
    const nodeType = node.type;

    if ("StringLiteral" === nodeType ||
        "NumericLiteral" === nodeType ||
        "NullLiteral" === nodeType ||
        "BooleanLiteral" === nodeType ||
        "RegExpLiteral" === nodeType ||
        "TemplateLiteral" === nodeType ||
        "BigIntLiteral" === nodeType ||
        "DecimalLiteral" === nodeType ||
        nodeType === "Placeholder" && "StringLiteral" === node.expectedNode) {
        if (typeof opts === "undefined") {
            return true;
        } else {
            return (0, _shallowEqual.default)(node, opts);
        }
    }

    return false;
}

发表回复

您的电子邮箱地址不会被公开。