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O,MAA8C,qBAAd,EAAK,MAAoD,mBAArB,EAAK,OAAO,KAI5N,GAAmB,wBAAd,EAAK,MAAgD,wBAAd,EAAK,MAAwD,iBAArB,EAAK,OAAO,MAAgD,mBAArB,EAAK,OAAO,KAMrH,oBAAd,EAAK,OACZ,EAAK,OAAO,yBAA2B,EAAQ,kBAAoB,EAAK,SAAW,6CACnF,EAAS,KAAK,EAAK,UARkJ,CACrK,IAAI,EAAI,oBAAsB,EAAQ,KAAO,EAAK,SAAW,MACpC,gBAArB,EAAK,OAAO,KACZ,EAAK,OAAO,GACP,EAAK,OAAO,EAAI,KACzB,EAAS,KAAK,EAAK,IACvB,MARI,EAAS,KAAK,EAAK,KACnB,EAAK,OAAO,mBAAqB,EAAQ,KAAO,EAAK,SAAW,KAWxE,CAeJ","file":"/npm/coverify@1.5.1/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/coverify@1.5.1/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","'use strict';\n\nvar falafel = require('falafel');\nvar through = require('through2');\nvar sourceMap = require('source-map');\nvar convertSourceMap = require('convert-source-map');\nvar slash = require('slash');\n\nmodule.exports = function (file, opts) {\n    if (typeof file === 'object') {\n        opts = file;\n        file = undefined;\n    }\n    if (!opts) { opts = {}; }\n    var outputFn = opts.output || 'console.log';\n\n    var expected = [];\n\n    var chunks = [];\n    var stream = through(write, end);\n    return stream;\n\n    function write(buf, enc, next) { chunks.push(buf); next(); }\n\n    function end() {\n        var body = Buffer.concat(chunks)\n            .toString('utf8')\n            .replace(/^#!/, '//#!');\n        if (file.match(/\\.json$/)) {\n            this.push('module.exports=' + body);\n            this.push(null);\n            return;\n        }\n\n        var fopts = {\n            locations: true,\n            ecmaVersion: opts.ecmaVersion || 9\n        };\n        try { var src = String(falafel(body, fopts, walk)); } catch (err) { return onerror(err, file, body); }\n        var sfile = JSON.stringify(JSON.stringify(file));\n\n        var origBody = body;\n        var bodySourceMap = convertSourceMap.fromSource(body);\n        if (bodySourceMap && bodySourceMap.sourcemap.mappings) {\n            bodySourceMap = new sourceMap.SourceMapConsumer(bodySourceMap.sourcemap);\n            origBody = bodySourceMap.sourceContentFor(slash(file));\n            var originalLoc = function originalLocation(loc) {\n                var pos = bodySourceMap.originalPositionFor(loc);\n                if (pos.line && pos.column) {\n                    return { line: pos.line, column: pos.column };\n                }\n            };\n            expected = expected.map(function (loc) {\n                var origStart = originalLoc(loc.start);\n                var origEnd = originalLoc(loc.end);\n                if (origStart && origEnd) {\n                    return { start: originalLoc(loc.start), end: originalLoc(loc.end) };\n                } else { return false; }\n            });\n        }\n\n        var lines = origBody.split('\\n');\n        var lineOffsets = [];\n        var offset = 0;\n        for (var i = 0; i < lines.length; i++) {\n            lineOffsets[i] = offset;\n            offset += lines[i].length + 1;\n        }\n        expected = expected.map(function (loc) {\n            if (!loc) { return false; }\n            return [\n                lineOffsets[loc.start.line - 1] + loc.start.column,\n                lineOffsets[loc.end.line - 1] + loc.end.column\n            ];\n        });\n\n        /* eslint-disable no-useless-concat */\n        this.push(outputFn + '(\"COVERAGE \" + ' + sfile + ' + \" \" + ' + JSON.stringify(JSON.stringify(expected)) + ');' + 'var __coverage = ' + JSON.stringify(expected.reduce(function (acc, x, ix) {\n            acc[ix] = x;\n            return acc;\n        }, {})) + ';' + 'var __coverageFunction = function () {' + 'var a=[].slice.call(arguments);' + 'a.splice(-1, 0, \"__coverageWrap\");' + 'var f=Function.apply(this, a);' + 'return function(){' + 'var b=[].slice.call(arguments);' + 'b.push(__coverageWrap);' + 'return f.apply(this, b);' + '}' + '};' + '__coverageFunction.prototype = Function.prototype;' + 'var __coverageWrap = function (index) {' + 'if (__coverage[index]) ' + outputFn + '(\"COVERED \" + ' + sfile + ' + \" \" + index);' + 'delete __coverage[index];' + 'return function (x) { return x }' + '};' + '(function (Function) {\\n');\n        /* eslint-enable no-useless-concat */\n        this.push(src);\n        this.push('\\n})(__coverageFunction)');\n        this.push(null);\n    }\n\n    function walk(node) {\n        var index = expected.length;\n        if (node.type === 'VariableDeclarator' && node.init) {\n            expected.push(node.init.loc);\n            node.init.update('(__coverageWrap(' + index + ')(' + node.init.source() + '))');\n        } else if ((/Expression$/).test(node.type) && node.parent.type !== 'UnaryExpression' && node.parent.type !== 'AssignmentExpression' && node.parent.type !== 'UpdateExpression' && (node.type !== 'MemberExpression' || node.parent.type !== 'CallExpression'\n        )) {\n            expected.push(node.loc);\n            node.update('(__coverageWrap(' + index + ')(' + node.source() + '))');\n        } else if ((node.type === 'ExpressionStatement' || node.type === 'VariableDeclaration') && node.parent.type !== 'ForStatement' && node.parent.type !== 'ForInStatement') {\n            var s = '{ __coverageWrap(' + index + ');' + node.source() + '\\n}';\n            if (node.parent.type === 'IfStatement') {\n                node.update(s);\n            } else { node.update(s + ';'); }\n            expected.push(node.loc);\n        } else if (node.type === 'ReturnStatement') {\n            node.update('return __coverageWrap(' + index + ')(function () {' + node.source() + '}).apply(this, [].slice.call(arguments));');\n            expected.push(node.loc);\n        }\n    }\n\n    function onerror(err, file, body) {\n        if (err && err.lineNumber !== undefined) {\n            var lines = body.split('\\n');\n            var line = lines[err.lineNumber - 1];\n\n            var msg = err.description + '\\n\\n' + file + ':' + err.lineNumber + '\\n' + line + '\\n' + Array(err.column).join(' ') + '^';\n            var e = new Error(msg);\n            e.lineNumber = err.lineNumber;\n            e.column = err.column;\n            e.line = line;\n            stream.emit('error', e);\n        } else { stream.emit('error', err); }\n    }\n};\n"]}