%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /www/specpages-backup/node_modules/less/lib/less/visitors/
Upload File :
Create Path :
Current File : //www/specpages-backup/node_modules/less/lib/less/visitors/visitor.js.map

{"version":3,"file":"visitor.js","sourceRoot":"","sources":["../../../src/less/visitors/visitor.js"],"names":[],"mappings":";;;;;AAAA,iDAA2B;AAC3B,IAAM,UAAU,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;AACzC,IAAI,WAAW,GAAG,KAAK,CAAC;AAExB,SAAS,KAAK,CAAC,IAAI;IACf,OAAO,IAAI,CAAC;AAChB,CAAC;AAED,SAAS,cAAc,CAAC,MAAM,EAAE,MAAM;IAClC,qDAAqD;IACrD,IAAI,GAAG,CAAC;IAER,IAAI,KAAK,CAAC;IACV,KAAK,GAAG,IAAI,MAAM,EAAE;QAChB,4BAA4B;QAC5B,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QACpB,QAAQ,OAAO,KAAK,EAAE;YAClB,KAAK,UAAU;gBACX,wEAAwE;gBACxE,kBAAkB;gBAClB,IAAI,KAAK,CAAC,SAAS,IAAI,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE;oBACzC,KAAK,CAAC,SAAS,CAAC,SAAS,GAAG,MAAM,EAAE,CAAC;iBACxC;gBACD,MAAM;YACV,KAAK,QAAQ;gBACT,MAAM,GAAG,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;gBACvC,MAAM;SAEb;KACJ;IACD,OAAO,MAAM,CAAC;AAClB,CAAC;AAED;IACI,iBAAY,cAAc;QACtB,IAAI,CAAC,eAAe,GAAG,cAAc,CAAC;QACtC,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;QACxB,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QAEzB,IAAI,CAAC,WAAW,EAAE;YACd,cAAc,CAAC,cAAI,EAAE,CAAC,CAAC,CAAC;YACxB,WAAW,GAAG,IAAI,CAAC;SACtB;IACL,CAAC;IAED,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C;aACJ;SACJ;QAED,OAAO,GAAG,CAAC;IACf,CAAC;IACL,cAAC;AAAD,CAAC,AAvID,IAuIC;AAED,kBAAe,OAAO,CAAC","sourcesContent":["import tree from '../tree';\nconst _visitArgs = { visitDeeper: true };\nlet _hasIndexed = false;\n\nfunction _noop(node) {\n    return node;\n}\n\nfunction indexNodeTypes(parent, ticker) {\n    // add .typeIndex to tree node types for lookup table\n    let key;\n\n    let child;\n    for (key in parent) { \n        /* eslint guard-for-in: 0 */\n        child = parent[key];\n        switch (typeof child) {\n            case 'function':\n                // ignore bound functions directly on tree which do not have a prototype\n                // or aren't nodes\n                if (child.prototype && child.prototype.type) {\n                    child.prototype.typeIndex = ticker++;\n                }\n                break;\n            case 'object':\n                ticker = indexNodeTypes(child, ticker);\n                break;\n        \n        }\n    }\n    return ticker;\n}\n\nclass Visitor {\n    constructor(implementation) {\n        this._implementation = implementation;\n        this._visitInCache = {};\n        this._visitOutCache = {};\n\n        if (!_hasIndexed) {\n            indexNodeTypes(tree, 1);\n            _hasIndexed = true;\n        }\n    }\n\n    visit(node) {\n        if (!node) {\n            return node;\n        }\n\n        const nodeTypeIndex = node.typeIndex;\n        if (!nodeTypeIndex) {\n            // MixinCall args aren't a node type?\n            if (node.value && node.value.typeIndex) {\n                this.visit(node.value);\n            }\n            return node;\n        }\n\n        const impl = this._implementation;\n        let func = this._visitInCache[nodeTypeIndex];\n        let funcOut = this._visitOutCache[nodeTypeIndex];\n        const visitArgs = _visitArgs;\n        let fnName;\n\n        visitArgs.visitDeeper = true;\n\n        if (!func) {\n            fnName = `visit${node.type}`;\n            func = impl[fnName] || _noop;\n            funcOut = impl[`${fnName}Out`] || _noop;\n            this._visitInCache[nodeTypeIndex] = func;\n            this._visitOutCache[nodeTypeIndex] = funcOut;\n        }\n\n        if (func !== _noop) {\n            const newNode = func.call(impl, node, visitArgs);\n            if (node && impl.isReplacing) {\n                node = newNode;\n            }\n        }\n\n        if (visitArgs.visitDeeper && node) {\n            if (node.length) {\n                for (var i = 0, cnt = node.length; i < cnt; i++) {\n                    if (node[i].accept) {\n                        node[i].accept(this);\n                    }\n                }\n            } else if (node.accept) {\n                node.accept(this);\n            }\n        }\n\n        if (funcOut != _noop) {\n            funcOut.call(impl, node);\n        }\n\n        return node;\n    }\n\n    visitArray(nodes, nonReplacing) {\n        if (!nodes) {\n            return nodes;\n        }\n\n        const cnt = nodes.length;\n        let i;\n\n        // Non-replacing\n        if (nonReplacing || !this._implementation.isReplacing) {\n            for (i = 0; i < cnt; i++) {\n                this.visit(nodes[i]);\n            }\n            return nodes;\n        }\n\n        // Replacing\n        const out = [];\n        for (i = 0; i < cnt; i++) {\n            const evald = this.visit(nodes[i]);\n            if (evald === undefined) { continue; }\n            if (!evald.splice) {\n                out.push(evald);\n            } else if (evald.length) {\n                this.flatten(evald, out);\n            }\n        }\n        return out;\n    }\n\n    flatten(arr, out) {\n        if (!out) {\n            out = [];\n        }\n\n        let cnt;\n        let i;\n        let item;\n        let nestedCnt;\n        let j;\n        let nestedItem;\n\n        for (i = 0, cnt = arr.length; i < cnt; i++) {\n            item = arr[i];\n            if (item === undefined) {\n                continue;\n            }\n            if (!item.splice) {\n                out.push(item);\n                continue;\n            }\n\n            for (j = 0, nestedCnt = item.length; j < nestedCnt; j++) {\n                nestedItem = item[j];\n                if (nestedItem === undefined) {\n                    continue;\n                }\n                if (!nestedItem.splice) {\n                    out.push(nestedItem);\n                } else if (nestedItem.length) {\n                    this.flatten(nestedItem, out);\n                }\n            }\n        }\n\n        return out;\n    }\n}\n\nexport default Visitor;\n"]}

Zerion Mini Shell 1.0