pax_global_header00006660000000000000000000000064140172726770014527gustar00rootroot0000000000000052 comment=fee3d0924d14dea5d3a1c42303c457a4b1971f7f exorcist-2.0.0/000077500000000000000000000000001401727267700133665ustar00rootroot00000000000000exorcist-2.0.0/.github/000077500000000000000000000000001401727267700147265ustar00rootroot00000000000000exorcist-2.0.0/.github/workflows/000077500000000000000000000000001401727267700167635ustar00rootroot00000000000000exorcist-2.0.0/.github/workflows/test.yml000066400000000000000000000006231401727267700204660ustar00rootroot00000000000000name: Test on: [push, pull_request] jobs: build: runs-on: ubuntu-latest strategy: matrix: node-version: [14.x] steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} - name: install and test run: | npm install npm test exorcist-2.0.0/.gitignore000066400000000000000000000001311401727267700153510ustar00rootroot00000000000000lib-cov *.seed *.log *.csv *.dat *.out *.pid *.gz pids logs npm-debug.log node_modules exorcist-2.0.0/LICENSE000066400000000000000000000020661401727267700143770ustar00rootroot00000000000000Copyright 2014 Thorsten Lorenz. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. exorcist-2.0.0/README.md000066400000000000000000000146611401727267700146550ustar00rootroot00000000000000# exorcist [![build status](https://secure.travis-ci.org/thlorenz/exorcist.svg?branch=master)](http://travis-ci.org/thlorenz/exorcist) become a patron Externalizes the source map found inside a stream to an external `.map` file or stream. Works with both JavaScript and CSS input streams. ```js var browserify = require('browserify') , path = require('path') , fs = require('fs') , exorcist = require('exorcist') , mapfile = path.join(__dirname, 'bundle.js.map') // from a file, to a file, and send source map to its own file browserify({debug: true}) .require(require.resolve('./main'), { entry: true }) .bundle() .pipe(exorcist(mapfile)) .pipe(fs.createWriteStream(path.join(__dirname, 'bundle.js'), 'utf8')) // from a stream, to a stream, and send source map to a stream browserify([readableSourceStream], browserifyOptions) .bundle() .pipe(exorcist(targetSourceMapStream, '/url/path/to/replace/source/comment/with/bundle.js')) .pipe(writableTargetStream) ``` ### command line example ``` browserify main.js --debug | exorcist bundle.js.map > bundle.js ``` **Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)* - [Usage](#usage) - [Installation](#installation) - [API](#api) - [Integration with other tools](#integration-with-other-tools) - [License](#license) ## Usage ``` exorcist map_file [options] Externalizes the source map of the file streamed in. The source map is written as JSON to map_file, and the original file is streamed out with its sourceMappingURL set to the path of map_file (or to the value of the --url option). OPTIONS: --base -b Base path for calculating relative source paths. (default: use absolute paths) --root -r Root URL for loading relative source paths. Set as sourceRoot in the source map. (default: '') --url -u Full URL to source map. Set as sourceMappingURL in the output stream. (default: map_file) --error-on-missing -e Abort with error if no map is found in the stream. (default: warn but still pipe through source) EXAMPLE: Bundle main.js with browserify into bundle.js and externalize the map to bundle.js.map. browserify main.js --debug | exorcist bundle.js.map > bundle.js ``` ## Installation npm install exorcist ## API

exorcist(input, url, root, base, errorOnMissing) → {TransformStream}

Externalizes the source map of the file streamed in.

The source map is written as JSON to file, and the original file is streamed out with its sourceMappingURL set to the path of file (or to the value of url).

Events (in addition to stream events)

  • missing-map emitted if no map was found in the stream and errorOnMissing is falsey (the src is still piped through in this case, but no map file is written)
Parameters:
Name Type Argument Description
input String / Object

full path to the map file to which to write the extracted source map or a writable stream

url String <optional>

full URL to the map file, set as sourceMappingURL in the streaming output (default: file)

root String <optional>

root URL for loading relative source paths, set as sourceRoot in the source map (default: '')

base String <optional>

base path for calculating relative source paths (default: use absolute paths)

errorOnMissing Boolean <optional>

when truthy, causes 'error' to be emitted instead of 'missing-map' if no map was found in the stream (default: falsey)

Source:
Returns:

transform stream into which to pipe the code containing the source map

Type
TransformStream
*generated with [docme](https://github.com/thlorenz/docme)*
## Integration with other tools - [using exorcist with gulp](https://github.com/thlorenz/exorcist/wiki/Recipes#gulp) ## License MIT exorcist-2.0.0/bin/000077500000000000000000000000001401727267700141365ustar00rootroot00000000000000exorcist-2.0.0/bin/exorcist.js000066400000000000000000000022351401727267700163360ustar00rootroot00000000000000#!/usr/bin/env node 'use strict'; var minimist = require('minimist') , fs = require('fs') , path = require('path') , exorcist = require('../') ; function onerror(err) { console.error(err.toString()); process.exit(err.errno || 1); } function usage() { var usageFile = path.join(__dirname, 'usage.txt'); fs.createReadStream(usageFile).pipe(process.stdout); return; } (function damnYouEsprima() { var argv = minimist(process.argv.slice(2) , { boolean: [ 'h', 'help', 'e', 'error-on-missing' ] , string: [ 'url', 'u', 'root', 'r', 'base', 'b' ] }); if (argv.h || argv.help) return usage(); var mapfile = argv._.shift(); if (!mapfile) { console.error('Missing map file'); return usage(); } var url = argv.url || argv.u , root = argv.root || argv.r , base = argv.base || argv.b , errorOnMissing = argv.errorOnMissing || argv.e || argv['error-on-missing']; mapfile = path.resolve(mapfile); process.stdin .pipe(exorcist(mapfile, url, root, base, errorOnMissing)) .on('error', onerror) .on('missing-map', console.error.bind(console)) .pipe(process.stdout); })() exorcist-2.0.0/bin/usage.txt000066400000000000000000000020671401727267700160100ustar00rootroot00000000000000usage: exorcist map_file [options] Externalizes the source map of the file streamed in. The source map is written as JSON to map_file, and the original file is streamed out with its sourceMappingURL set to the path of map_file (or to the value of the --url option). OPTIONS: --base -b Base path for calculating relative source paths. (default: use absolute paths) --root -r Root URL for loading relative source paths. Set as sourceRoot in the source map. (default: '') --url -u Full URL to source map. Set as sourceMappingURL in the output stream. (default: map_file) --error-on-missing -e Abort with error if no map is found in the stream. (default: warn but still pipe through source) EXAMPLE: Bundle main.js with browserify into bundle.js and externalize the map to bundle.js.map. browserify main.js --debug | exorcist bundle.js.map > bundle.js exorcist-2.0.0/example/000077500000000000000000000000001401727267700150215ustar00rootroot00000000000000exorcist-2.0.0/example/bar.js000066400000000000000000000001301401727267700161150ustar00rootroot00000000000000'use strict'; var go = module.exports = function () { return 'hey, I am bar'; }; exorcist-2.0.0/example/build.js000066400000000000000000000007361401727267700164640ustar00rootroot00000000000000'use strict'; var browserify = require('browserify') , path = require('path') , fs = require('fs') , exorcist = require('../') , mapfile = path.join(__dirname, 'bundle.js.map') browserify() .require(require.resolve('./main'), { entry: true }) .bundle({ debug: true }) .on('end', function () { console.log('all done, open index.html') }) .pipe(exorcist(mapfile)) .pipe(fs.createWriteStream(path.join(__dirname, 'bundle.js'), 'utf8')) exorcist-2.0.0/example/build.sh000066400000000000000000000002031401727267700164470ustar00rootroot00000000000000#!/usr/bin/env sh rm -f bundle.* ../node_modules/.bin/browserify main.js -d | node ../bin/exorcist.js bundle.js.map > bundle.js exorcist-2.0.0/example/foo.js000066400000000000000000000001571401727267700161450ustar00rootroot00000000000000'use strict'; var bar = require('./bar'); var go = module.exports = function () { console.log(bar()); }; exorcist-2.0.0/example/index.html000066400000000000000000000003641401727267700170210ustar00rootroot00000000000000 Exorcist Example

Open dev tools, look for output printed to console and investigate sources tab

exorcist-2.0.0/example/main.js000066400000000000000000000000631401727267700163020ustar00rootroot00000000000000'use strict'; var foo = require('./foo'); foo(); exorcist-2.0.0/index.js000066400000000000000000000062731401727267700150430ustar00rootroot00000000000000'use strict'; var mold = require('mold-source-map') , path = require('path') , fs = require('fs') , mkdirp = require('mkdirp') , isStream = require('is-stream') , fs = require('fs'); function separate(src, url, root, base) { src.sourceRoot(root || src.sourcemap.getProperty('sourceRoot') || ''); if (base) { src.mapSources(mold.mapPathRelativeTo(base)); } var json = src.toJSON(2); var comment = ''; var commentRx = /^\s*\/(\/|\*)[@#]\s+sourceMappingURL/mg; var commentMatch = commentRx.exec(src.source); var commentBlock = (commentMatch && commentMatch[1] === '*'); if (commentBlock) { comment = '/*# sourceMappingURL=' + url + ' */'; } else { comment = '//# sourceMappingURL=' + url; } return { json: json, comment: comment } } var go = module.exports = /** * * Externalizes the source map of the file streamed in. * * The source map is written as JSON to `file`, and the original file is streamed out with its * `sourceMappingURL` set to the path of `file` (or to the value of `url`). * * #### Events (in addition to stream events) * * - `missing-map` emitted if no map was found in the stream and errorOnMissing is falsey * (the src is still piped through in this case, but no map file is written) * * @name exorcist * @function * @param {String|Object} input file path or writable stream where the source map will be written * @param {String=} url full URL to the map file, set as `sourceMappingURL` in the streaming output (default: file) * @param {String=} root root URL for loading relative source paths, set as `sourceRoot` in the source map (default: '') * @param {String=} base base path for calculating relative source paths (default: use absolute paths) * @param {Boolean=} errorOnMissing when truthy, causes 'error' to be emitted instead of 'missing-map' if no map was found in the stream (default: falsey) * @return {TransformStream} transform stream into which to pipe the code containing the source map */ function exorcist(input, url, root, base, errorOnMissing) { var missingMapMsg = "The code that you piped into exorcist contains no source map!"; var stream = mold.transform(function(src, write) { if (!src.sourcemap) { if (errorOnMissing) return stream.emit('error', new Error(missingMapMsg)); stream.emit( 'missing-map' , missingMapMsg + '\n' + 'Therefore it was piped through as is and no external map file generated.' ); return write(src.source); } if (isStream(input) && isStream.writable(stream)) { return stream.emit('error', new Error('Must provide a writable stream')); } if (isStream(input) && typeof url !== 'string') { return stream.emit('error', new Error('map file URL is required when using stream output')); } url = url || path.basename(input) var separated = separate(src, url, root, base); if (isStream(input)) { return input.end(separated.json, 'utf8', done); } mkdirp(path.dirname(input)) .then(() => fs.writeFile(input, separated.json, 'utf8', done)) .catch(done); function done(err) { if (err) return stream.emit('error', err); write(separated.comment); } }); return stream; } exorcist-2.0.0/package.json000066400000000000000000000017641401727267700156640ustar00rootroot00000000000000{ "name": "exorcist", "version": "2.0.0", "description": "Externalizes the source map found inside a stream to an external `.js.map` file", "bin": { "exorcist": "bin/exorcist.js" }, "main": "index.js", "scripts": { "test": "tap test/*.js" }, "repository": { "type": "git", "url": "git://github.com/thlorenz/exorcist.git" }, "homepage": "https://github.com/thlorenz/exorcist", "dependencies": { "is-stream": "^2.0.0", "minimist": "^1.2.5", "mkdirp": "^1.0.4", "mold-source-map": "^0.4.0" }, "devDependencies": { "browserify": "^17.0.0", "nave": "^3.2.2", "proxyquire": "^2.1.3", "tap": "^14.11.0", "through2": "~4.0.2" }, "keywords": [ "source-map", "source", "map", "external", "mapfile", "browserify", "browserify-tool" ], "author": { "name": "Thorsten Lorenz", "email": "thlorenz@gmx.de", "url": "http://thlorenz.com" }, "license": "MIT", "engine": { "node": ">=14" } } exorcist-2.0.0/test/000077500000000000000000000000001401727267700143455ustar00rootroot00000000000000exorcist-2.0.0/test/exorcist.js000066400000000000000000000253141401727267700165500ustar00rootroot00000000000000'use strict'; /*jshint asi: true */ var test = require('tap').test var fs = require('fs'); var through = require('through2'); var proxyquire = require('proxyquire'); var exorcist = require('../') var fixtures = __dirname + '/fixtures'; var scriptMapfile = fixtures + '/bundle.js.map'; var styleMapfile = fixtures + '/to.css.map'; // This base path is baken into the source maps in the fixtures. var base = '/Users/thlorenz/dev/projects/exorcist'; function cleanup() { if (fs.existsSync(scriptMapfile)) fs.unlinkSync(scriptMapfile); if (fs.existsSync(styleMapfile)) fs.unlinkSync(styleMapfile); } test('\nwhen piping a bundle generated with browserify through exorcist without adjusting properties', function (t) { t.on('end', cleanup); var data = '' fs.createReadStream(fixtures + '/bundle.js') .pipe(exorcist(scriptMapfile)) .pipe(through(onread, onflush)); function onread(d, _, cb) { data += d; cb(); } function onflush(cb) { var lines = data.split('\n') lines.pop(); // Trailing newline t.equal(lines.length, 25, 'pipes entire bundle including prelude, sources and source map url') t.equal(lines.pop(), '//# sourceMappingURL=bundle.js.map', 'last line as source map url pointing to .js.map file') var map = JSON.parse(fs.readFileSync(scriptMapfile, 'utf8')); t.equal(map.file, 'generated.js', 'leaves file name unchanged') t.equal(map.sources.length, 4, 'maps 4 source files') t.equal(map.sources[0].indexOf(base), 0, 'uses absolute source paths') t.equal(map.sourcesContent.length, 4, 'includes 4 source contents') t.equal(map.mappings.length, 106, 'maintains mappings') t.equal(map.sourceRoot, '', 'if source root missing, use empty string') cb(); t.end() } }) test('\nwhen piping a bundle generated with browserify through exorcist and adjusting url', function (t) { t.on('end', cleanup); var data = '' fs.createReadStream(fixtures + '/bundle.js') .pipe(exorcist(scriptMapfile, 'http://my.awseome.site/bundle.js.map')) .pipe(through(onread, onflush)); function onread(d, _, cb) { data += d; cb(); } function onflush(cb) { var lines = data.split('\n') lines.pop(); // Trailing newline t.equal(lines.length, 25, 'pipes entire bundle including prelude, sources and source map url') t.equal(lines.pop(), '//# sourceMappingURL=http://my.awseome.site/bundle.js.map', 'last line as source map url pointing to .js.map file at url set to supplied url') var map = JSON.parse(fs.readFileSync(scriptMapfile, 'utf8')); t.equal(map.file, 'generated.js', 'leaves file name unchanged') t.equal(map.sources.length, 4, 'maps 4 source files') t.equal(map.sourcesContent.length, 4, 'includes 4 source contents') t.equal(map.mappings.length, 106, 'maintains mappings') t.equal(map.sourceRoot, '', 'if source root missing, use empty string') cb(); t.end() } }) test('\nwhen piping a bundle generated with browserify through exorcist and adjusting root and url', function (t) { t.on('end', cleanup); var data = '' fs.createReadStream(fixtures + '/bundle.js') .pipe(exorcist(scriptMapfile, 'http://my.awseome.site/bundle.js.map', 'http://my.awesome.site/src')) .pipe(through(onread, onflush)); function onread(d, _, cb) { data += d; cb(); } function onflush(cb) { var lines = data.split('\n') lines.pop(); // Trailing newline t.equal(lines.length, 25, 'pipes entire bundle including prelude, sources and source map url') t.equal(lines.pop(), '//# sourceMappingURL=http://my.awseome.site/bundle.js.map', 'last line as source map url pointing to .js.map file at url set to supplied url') var map = JSON.parse(fs.readFileSync(scriptMapfile, 'utf8')); t.equal(map.file, 'generated.js', 'leaves file name unchanged') t.equal(map.sources.length, 4, 'maps 4 source files') t.equal(map.sourcesContent.length, 4, 'includes 4 source contents') t.equal(map.mappings.length, 106, 'maintains mappings') t.equal(map.sourceRoot, 'http://my.awesome.site/src', 'adapts source root') cb(); t.end() } }) test('\nwhen piping a bundle generated with browserify through exorcist and adjusting root, url, and base', function (t) { t.on('end', cleanup); var data = '' fs.createReadStream(fixtures + '/bundle.js') .pipe(exorcist(scriptMapfile, 'http://my.awseome.site/bundle.js.map', 'http://my.awesome.site/src', base)) .pipe(through(onread, onflush)); function onread(d, _, cb) { data += d; cb(); } function onflush(cb) { var lines = data.split('\n') lines.pop(); // Trailing newline t.equal(lines.length, 25, 'pipes entire bundle including prelude, sources and source map url') t.equal(lines.pop(), '//# sourceMappingURL=http://my.awseome.site/bundle.js.map', 'last line as source map url pointing to .js.map file at url set to supplied url') var map = JSON.parse(fs.readFileSync(scriptMapfile, 'utf8')); t.equal(map.file, 'generated.js', 'leaves file name unchanged') t.equal(map.sources.length, 4, 'maps 4 source files') t.equal(map.sources[0].indexOf(base), -1, 'uses relative source paths') t.equal(map.sourcesContent.length, 4, 'includes 4 source contents') t.equal(map.mappings.length, 106, 'maintains mappings') t.equal(map.sourceRoot, 'http://my.awesome.site/src', 'adapts source root') cb(); t.end() } }) test('\nwhen piping a bundle generated with browserify to a map file in a directory that does not exist', function (t) { t.on('end', cleanup); var badPathScriptMapfile = fixtures + '/noexists/bundle.js.map'; fs.createReadStream(fixtures + '/bundle.js') .pipe(exorcist(badPathScriptMapfile)) .on('error', t.end) .on('end', function () { var map = JSON.parse(fs.readFileSync(badPathScriptMapfile, 'utf8')); t.ok(map); fs.unlinkSync(badPathScriptMapfile); t.end(); }) }) test('\nwhen piping a bundle generated with browserify and the write fails', function (t) { t.on('end', cleanup); var expectedErr = new Error('File write failed') var ex = proxyquire('../', { fs: { writeFile: function (file, content, enc, callback) { callback(expectedErr) } } }) fs.createReadStream(fixtures + '/bundle.js') .pipe(ex(scriptMapfile)) .on('error', function (err) { t.equal(err, expectedErr) t.end(); }) }) test('\nwhen piping a bundle generated with browserify thats missing a map through exorcist and errorOnMissing is truthy' , function (t) { t.on('end', cleanup); var data = '' fs.createReadStream(fixtures + '/bundle.nomap.js') .pipe(exorcist(scriptMapfile, undefined, undefined, undefined, true)) .on('error', onerror); function onerror(err) { t.type(err, 'Error'); t.end(); } }) test('\nwhen piping a bundle generated with browserify thats missing a map through exorcist and errorOnMissing is falsey' , function (t) { t.on('end', cleanup); var data = '' var missingMapEmitted = false; fs.createReadStream(fixtures + '/bundle.nomap.js') .pipe(exorcist(scriptMapfile)) .on('missing-map', function () { missingMapEmitted = true }) .pipe(through(onread, onflush)); function onread(d, _, cb) { data += d; cb(); } function onflush(cb) { var lines = data.split('\n') t.equal(lines.length, 25, 'pipes entire bundle including prelude') t.ok(missingMapEmitted, 'emits missing-map event') cb(); t.end() } }) test('\nwhen performing a stylish exorcism', function (t) { t.on('end', cleanup); var data = '' fs.createReadStream(fixtures + '/to.css') .pipe(exorcist(styleMapfile)) .pipe(through(onread, onflush)); function onread(d, _, cb) { data += d; cb(); } function onflush(cb) { var lines = data.split('\n') t.equal(lines.length, 22, 'pipes entire style including prelude, sources and source map url') t.equal(lines.pop(), '/*# sourceMappingURL=to.css.map */', 'last line as source map url pointing to .css.map file') var map = JSON.parse(fs.readFileSync(styleMapfile, 'utf8')); t.equal(map.file, 'to.css', 'leaves file name unchanged') t.equal(map.sources.length, 2, 'maps 4 source files') t.equal(map.sourcesContent.length, 2, 'includes 4 source contents') t.equal(map.mappings.length, 214, 'maintains mappings') t.equal(map.sourceRoot, '', 'if source root missing, use empty string') cb(); t.end(); } }) test('\nwhen piping a bundle generated with browserify with preexisting source root', function(t) { t.on('end', cleanup); fs.createReadStream(fixtures + '/bundle.withroot.js') .pipe(exorcist(scriptMapfile)) .pipe(through(onread, onflush)); function onread(_, __, cb) { cb(); } function onflush(cb) { var map = JSON.parse(fs.readFileSync(scriptMapfile, 'utf8')); t.equal(map.sourceRoot, base, 'leaves source root value in place') cb(); t.end(); } }); test('\nwhen piping a bundle generated with browserify through exorcist without adjusting properties and sending source map to stream', function (t) { t.on('end', cleanup); var data = '' var map = '' fs.createReadStream(fixtures + '/bundle.js') .pipe(exorcist(through(onreadMap, onflushMap), 'bundle.js.map')) .pipe(through(onread, onflush)); function onread(d, _, cb) { data += d; cb(); } function onflush(cb) { var lines = data.split('\n') lines.pop(); // Trailing newline t.equal(lines.length, 25, 'pipes entire bundle including prelude, sources and source map url') t.equal(lines.pop(), '//# sourceMappingURL=bundle.js.map', 'last line as source map url pointing to .js.map file') cb(); t.end() } function onreadMap(d, _, cb) { map += d; cb(); } function onflushMap(cb) { map = JSON.parse(map); t.equal(map.file, 'generated.js', 'leaves file name unchanged') t.equal(map.sources.length, 4, 'maps 4 source files') t.equal(map.sources[0].indexOf(base), 0, 'uses absolute source paths') t.equal(map.sourcesContent.length, 4, 'includes 4 source contents') t.equal(map.mappings.length, 106, 'maintains mappings') t.equal(map.sourceRoot, '', 'leaves source root an empty string') cb(); } }) test('\nwhen piping a browserify bundle thru exorcist sending source map to a stream with missing required url', function (t) { t.on('end', cleanup); var exorcistStream = exorcist(through(onread)) // this is missing the URL as second argument .on('error', function (err) { t.ok(/map file URL is required/.test(err.message)); t.end(); }) .on('end', function () { t.fail('should have emitted an error about missing url'); }); fs.createReadStream(fixtures + '/bundle.js').pipe(exorcistStream); function onread(d, _, cb) { cb(); } }) exorcist-2.0.0/test/fixtures/000077500000000000000000000000001401727267700162165ustar00rootroot00000000000000exorcist-2.0.0/test/fixtures/bundle.js000066400000000000000000000045621401727267700200340ustar00rootroot00000000000000(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o