You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

bundlet

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bundlet - npm Package Compare versions

Comparing version

to
0.1.4

104

lib/bundle.js

@@ -1,4 +0,4 @@

// Generated by CoffeeScript 1.4.0
// Generated by CoffeeScript 1.10.0
(function() {
var builtin, bundle, coffee, defaultOpts, dependsRecur, findPackageJson, fs, funclet, isExternal, jsYaml, loglet, parser, path, resolve, showDepends, topsort, transform, _;
var _, builtin, bundle, coffee, defaultOpts, dependsRecur, findPackageJson, fs, funclet, isExternal, jsYaml, loglet, parser, path, resolve, showDepends, topsort, transform;

@@ -50,3 +50,3 @@ resolve = require('browser-resolve');

return fs.readFile(packageJson, 'utf8', function(err, data) {
var parsed;
var e, error, parsed;
if (err) {

@@ -58,3 +58,4 @@ return cb(err);

return cb(null, filePath, parsed);
} catch (e) {
} catch (error) {
e = error;
return cb(e);

@@ -99,14 +100,24 @@ }

compile = function(filePath, data) {
switch (path.extname(filePath)) {
case '.coffee':
return parser.parse(coffee.compile(data));
case '.js':
return parser.parse(data);
case '.json':
return "module.exports = " + data + ";";
case '.yml':
case '.yaml':
return "module.exports = " + JSON.stringify(jsYaml.safeLoad(data)) + ";";
default:
throw new Error("unknown_file_extension: " + (path.extname(filePath)) + " @ " + filePath);
var e, error;
try {
switch (path.extname(filePath)) {
case '.coffee':
return parser.parse(coffee.compile(data));
case '.js':
return parser.parse(data);
case '.json':
return "module.exports = " + data + ";";
case '.yml':
case '.yaml':
return "module.exports = " + JSON.stringify(jsYaml.safeLoad(data)) + ";";
default:
throw new Error("unknown_file_extension: " + (path.extname(filePath)) + " @ " + filePath);
}
} catch (error) {
e = error;
throw {
error: 'compilation',
filePath: filePath,
inner: e
};
}

@@ -164,8 +175,8 @@ };

return ((function() {
var _i, _results;
_results = [];
for (i = _i = 0; 0 <= tabLevel ? _i < tabLevel : _i > tabLevel; i = 0 <= tabLevel ? ++_i : --_i) {
_results.push(' ');
var j, ref, results;
results = [];
for (i = j = 0, ref = tabLevel; 0 <= ref ? j < ref : j > ref; i = 0 <= ref ? ++j : --j) {
results.push(' ');
}
return _results;
return results;
})()).join('');

@@ -239,4 +250,4 @@ };

}).done(function(packagePath, data) {
var _ref;
options.shims = _.extend({}, options.shims || {}, ((_ref = data.bundlet) != null ? _ref.shims : void 0) || {});
var ref;
options.shims = _.extend({}, options.shims || {}, ((ref = data.bundlet) != null ? ref.shims : void 0) || {});
options.modules = builtin;

@@ -248,10 +259,16 @@ return depends(spec, options, cb);

topsort = function(mod) {
var helper, included, result;
var helper, included, recurs, result;
included = {};
result = [];
recurs = {};
helper = function(mod) {
var i, module, spec, _i, _len, _ref, _ref1;
_ref = mod.depends;
for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
_ref1 = _ref[i], spec = _ref1.spec, module = _ref1.module;
var i, j, len, module, ref, ref1, spec;
if (recurs.hasOwnProperty(mod.key)) {
console.error("topsort:circular_topology", mod.key);
return;
}
recurs[mod.key] = mod;
ref = mod.depends;
for (i = j = 0, len = ref.length; j < len; i = ++j) {
ref1 = ref[i], spec = ref1.spec, module = ref1.module;
if (!included.hasOwnProperty(module.key)) {

@@ -269,3 +286,3 @@ helper(module);

transform = function(mod) {
var buffer, content, item, mapped, _i, _len, _ref;
var buffer, content, i, item, j, len, mapped, ref;
if (mod.external) {

@@ -275,5 +292,5 @@ return "// module: " + mod.key + " \nvar " + mod.name + " = " + mod.external + ";";

buffer = [];
_ref = mod.content;
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
item = _ref[_i];
ref = mod.content;
for (i = j = 0, len = ref.length; j < len; i = ++j) {
item = ref[i];
if (typeof item === 'string') {

@@ -318,6 +335,6 @@ buffer.push(item);

showDepends = function(mods) {
var item, mod, _i, _len;
var item, j, len, mod;
loglet.log('------- MODULE DEPENDENCY ------------');
for (_i = 0, _len = mods.length; _i < _len; _i++) {
mod = mods[_i];
for (j = 0, len = mods.length; j < len; j++) {
mod = mods[j];
item = {

@@ -343,3 +360,3 @@ key: mod.key,

return dependsRecur(spec, function(err, res) {
var mod, sorted;
var e, error, mod, sorted;
if (err) {

@@ -354,11 +371,12 @@ return cb(err);

return cb(null, (function() {
var _i, _len, _results;
_results = [];
for (_i = 0, _len = sorted.length; _i < _len; _i++) {
mod = sorted[_i];
_results.push(transform(mod));
var j, len, results;
results = [];
for (j = 0, len = sorted.length; j < len; j++) {
mod = sorted[j];
results.push(transform(mod));
}
return _results;
return results;
})());
} catch (e) {
} catch (error) {
e = error;
return cb(e);

@@ -365,0 +383,0 @@ }

@@ -65,42 +65,47 @@ module.exports = (function() {

peg$c29 = function(chars) { return "'" + chars.join('') + "'"; },
peg$c30 = "\"",
peg$c31 = { type: "literal", value: "\"", description: "\"\\\"\"" },
peg$c32 = function(chars) { return '"' + chars.join('') + '"'; },
peg$c33 = { type: "other", description: "regular expression" },
peg$c34 = "/",
peg$c35 = { type: "literal", value: "/", description: "\"/\"" },
peg$c36 = function(pattern, flags) {
peg$c30 = "\\'",
peg$c31 = { type: "literal", value: "\\'", description: "\"\\\\'\"" },
peg$c32 = "\"",
peg$c33 = { type: "literal", value: "\"", description: "\"\\\"\"" },
peg$c34 = function(chars) { return '"' + chars.join('') + '"'; },
peg$c35 = "\\\"",
peg$c36 = { type: "literal", value: "\\\"", description: "\"\\\\\\\"\"" },
peg$c37 = { type: "other", description: "regular expression" },
peg$c38 = "/",
peg$c39 = { type: "literal", value: "/", description: "\"/\"" },
peg$c40 = function(pattern, flags) {
console.log('--- parse.regexp.literal', pattern, flags);
var value = new RegExp(pattern, flags);
return "/" + pattern + "/" + flags;
},
peg$c37 = /^[*\\\/[]/,
peg$c38 = { type: "class", value: "[*\\\\\\/[]", description: "[*\\\\\\/[]" },
peg$c39 = /^[\\\/[]/,
peg$c40 = { type: "class", value: "[\\\\\\/[]", description: "[\\\\\\/[]" },
peg$c41 = "\\",
peg$c42 = { type: "literal", value: "\\", description: "\"\\\\\"" },
peg$c43 = "[",
peg$c44 = { type: "literal", value: "[", description: "\"[\"" },
peg$c45 = "]",
peg$c46 = { type: "literal", value: "]", description: "\"]\"" },
peg$c47 = /^[\]\\]/,
peg$c48 = { type: "class", value: "[\\]\\\\]", description: "[\\]\\\\]" },
peg$c49 = /^[a-z]/,
peg$c50 = { type: "class", value: "[a-z]", description: "[a-z]" },
peg$c51 = function(s) { return s.substring(1, s.length - 1); },
peg$c52 = "require",
peg$c53 = { type: "literal", value: "require", description: "\"require\"" },
peg$c54 = "(",
peg$c55 = { type: "literal", value: "(", description: "\"(\"" },
peg$c56 = ")",
peg$c57 = { type: "literal", value: ")", description: "\")\"" },
peg$c58 = function(spec) { return { require: spec } },
peg$c59 = /^[ \r\n\t]/,
peg$c60 = { type: "class", value: "[ \\r\\n\\t]", description: "[ \\r\\n\\t]" },
peg$c61 = "process",
peg$c62 = { type: "literal", value: "process", description: "\"process\"" },
peg$c63 = function() { return {global: 'process', require: 'process'}; },
peg$c64 = "Buffer",
peg$c65 = { type: "literal", value: "Buffer", description: "\"Buffer\"" },
peg$c66 = function() { return {global: 'Buffer', require: 'buffer'}; },
peg$c41 = /^[*\\\/[]/,
peg$c42 = { type: "class", value: "[*\\\\\\/[]", description: "[*\\\\\\/[]" },
peg$c43 = /^[\\\/[]/,
peg$c44 = { type: "class", value: "[\\\\\\/[]", description: "[\\\\\\/[]" },
peg$c45 = "\\",
peg$c46 = { type: "literal", value: "\\", description: "\"\\\\\"" },
peg$c47 = "[",
peg$c48 = { type: "literal", value: "[", description: "\"[\"" },
peg$c49 = "]",
peg$c50 = { type: "literal", value: "]", description: "\"]\"" },
peg$c51 = /^[\]\\]/,
peg$c52 = { type: "class", value: "[\\]\\\\]", description: "[\\]\\\\]" },
peg$c53 = /^[a-z]/,
peg$c54 = { type: "class", value: "[a-z]", description: "[a-z]" },
peg$c55 = function(s) { return s.substring(1, s.length - 1); },
peg$c56 = "require",
peg$c57 = { type: "literal", value: "require", description: "\"require\"" },
peg$c58 = "(",
peg$c59 = { type: "literal", value: "(", description: "\"(\"" },
peg$c60 = ")",
peg$c61 = { type: "literal", value: ")", description: "\")\"" },
peg$c62 = function(spec) { return { require: spec } },
peg$c63 = /^[ \r\n\t]/,
peg$c64 = { type: "class", value: "[ \\r\\n\\t]", description: "[ \\r\\n\\t]" },
peg$c65 = "process",
peg$c66 = { type: "literal", value: "process", description: "\"process\"" },
peg$c67 = function() { return {global: 'process', require: 'process'}; },
peg$c68 = "Buffer",
peg$c69 = { type: "literal", value: "Buffer", description: "\"Buffer\"" },
peg$c70 = function() { return {global: 'Buffer', require: 'buffer'}; },

@@ -315,11 +320,5 @@ peg$currPos = 0,

s0 = peg$parsestring();
s0 = peg$parserequireExp();
if (s0 === peg$FAILED) {
s0 = peg$parsecomment();
if (s0 === peg$FAILED) {
s0 = peg$parserequireExp();
if (s0 === peg$FAILED) {
s0 = peg$parseglobalExp();
}
}
s0 = peg$parseglobalExp();
}

@@ -695,38 +694,47 @@

s0 = peg$currPos;
s1 = peg$currPos;
peg$silentFails++;
if (input.charCodeAt(peg$currPos) === 39) {
s2 = peg$c27;
peg$currPos++;
if (input.substr(peg$currPos, 2) === peg$c30) {
s0 = peg$c30;
peg$currPos += 2;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c28); }
s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c31); }
}
peg$silentFails--;
if (s2 === peg$FAILED) {
s1 = peg$c3;
} else {
peg$currPos = s1;
s1 = peg$c1;
}
if (s1 !== peg$FAILED) {
if (input.length > peg$currPos) {
s2 = input.charAt(peg$currPos);
if (s0 === peg$FAILED) {
s0 = peg$currPos;
s1 = peg$currPos;
peg$silentFails++;
if (input.charCodeAt(peg$currPos) === 39) {
s2 = peg$c27;
peg$currPos++;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c4); }
if (peg$silentFails === 0) { peg$fail(peg$c28); }
}
if (s2 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c5(s2);
s0 = s1;
peg$silentFails--;
if (s2 === peg$FAILED) {
s1 = peg$c3;
} else {
peg$currPos = s1;
s1 = peg$c1;
}
if (s1 !== peg$FAILED) {
if (input.length > peg$currPos) {
s2 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c4); }
}
if (s2 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c5(s2);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$c1;
}
} else {
peg$currPos = s0;
s0 = peg$c1;
}
} else {
peg$currPos = s0;
s0 = peg$c1;
}

@@ -742,7 +750,7 @@

if (input.charCodeAt(peg$currPos) === 34) {
s1 = peg$c30;
s1 = peg$c32;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c31); }
if (peg$silentFails === 0) { peg$fail(peg$c33); }
}

@@ -758,11 +766,11 @@ if (s1 !== peg$FAILED) {

if (input.charCodeAt(peg$currPos) === 34) {
s3 = peg$c30;
s3 = peg$c32;
peg$currPos++;
} else {
s3 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c31); }
if (peg$silentFails === 0) { peg$fail(peg$c33); }
}
if (s3 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c32(s2);
s1 = peg$c34(s2);
s0 = s1;

@@ -788,38 +796,47 @@ } else {

s0 = peg$currPos;
s1 = peg$currPos;
peg$silentFails++;
if (input.charCodeAt(peg$currPos) === 34) {
s2 = peg$c30;
peg$currPos++;
if (input.substr(peg$currPos, 2) === peg$c35) {
s0 = peg$c35;
peg$currPos += 2;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c31); }
s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c36); }
}
peg$silentFails--;
if (s2 === peg$FAILED) {
s1 = peg$c3;
} else {
peg$currPos = s1;
s1 = peg$c1;
}
if (s1 !== peg$FAILED) {
if (input.length > peg$currPos) {
s2 = input.charAt(peg$currPos);
if (s0 === peg$FAILED) {
s0 = peg$currPos;
s1 = peg$currPos;
peg$silentFails++;
if (input.charCodeAt(peg$currPos) === 34) {
s2 = peg$c32;
peg$currPos++;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c4); }
if (peg$silentFails === 0) { peg$fail(peg$c33); }
}
if (s2 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c5(s2);
s0 = s1;
peg$silentFails--;
if (s2 === peg$FAILED) {
s1 = peg$c3;
} else {
peg$currPos = s1;
s1 = peg$c1;
}
if (s1 !== peg$FAILED) {
if (input.length > peg$currPos) {
s2 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c4); }
}
if (s2 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c5(s2);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$c1;
}
} else {
peg$currPos = s0;
s0 = peg$c1;
}
} else {
peg$currPos = s0;
s0 = peg$c1;
}

@@ -836,7 +853,7 @@

if (input.charCodeAt(peg$currPos) === 47) {
s1 = peg$c34;
s1 = peg$c38;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c35); }
if (peg$silentFails === 0) { peg$fail(peg$c39); }
}

@@ -852,7 +869,7 @@ if (s1 !== peg$FAILED) {

if (input.charCodeAt(peg$currPos) === 47) {
s3 = peg$c34;
s3 = peg$c38;
peg$currPos++;
} else {
s3 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c35); }
if (peg$silentFails === 0) { peg$fail(peg$c39); }
}

@@ -868,3 +885,3 @@ if (s3 !== peg$FAILED) {

peg$reportedPos = s0;
s1 = peg$c36(s2, s4);
s1 = peg$c40(s2, s4);
s0 = s1;

@@ -890,3 +907,3 @@ } else {

s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c33); }
if (peg$silentFails === 0) { peg$fail(peg$c37); }
}

@@ -930,3 +947,3 @@

peg$silentFails++;
if (peg$c37.test(input.charAt(peg$currPos))) {
if (peg$c41.test(input.charAt(peg$currPos))) {
s2 = input.charAt(peg$currPos);

@@ -936,3 +953,3 @@ peg$currPos++;

s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c38); }
if (peg$silentFails === 0) { peg$fail(peg$c42); }
}

@@ -975,3 +992,3 @@ peg$silentFails--;

peg$silentFails++;
if (peg$c39.test(input.charAt(peg$currPos))) {
if (peg$c43.test(input.charAt(peg$currPos))) {
s2 = input.charAt(peg$currPos);

@@ -981,3 +998,3 @@ peg$currPos++;

s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c40); }
if (peg$silentFails === 0) { peg$fail(peg$c44); }
}

@@ -1019,7 +1036,7 @@ peg$silentFails--;

if (input.charCodeAt(peg$currPos) === 92) {
s1 = peg$c41;
s1 = peg$c45;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c42); }
if (peg$silentFails === 0) { peg$fail(peg$c46); }
}

@@ -1085,7 +1102,7 @@ if (s1 !== peg$FAILED) {

if (input.charCodeAt(peg$currPos) === 91) {
s1 = peg$c43;
s1 = peg$c47;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c44); }
if (peg$silentFails === 0) { peg$fail(peg$c48); }
}

@@ -1101,7 +1118,7 @@ if (s1 !== peg$FAILED) {

if (input.charCodeAt(peg$currPos) === 93) {
s3 = peg$c45;
s3 = peg$c49;
peg$currPos++;
} else {
s3 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c46); }
if (peg$silentFails === 0) { peg$fail(peg$c50); }
}

@@ -1133,3 +1150,3 @@ if (s3 !== peg$FAILED) {

peg$silentFails++;
if (peg$c47.test(input.charAt(peg$currPos))) {
if (peg$c51.test(input.charAt(peg$currPos))) {
s2 = input.charAt(peg$currPos);

@@ -1139,3 +1156,3 @@ peg$currPos++;

s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c48); }
if (peg$silentFails === 0) { peg$fail(peg$c52); }
}

@@ -1173,3 +1190,3 @@ peg$silentFails--;

s0 = [];
if (peg$c49.test(input.charAt(peg$currPos))) {
if (peg$c53.test(input.charAt(peg$currPos))) {
s1 = input.charAt(peg$currPos);

@@ -1179,7 +1196,7 @@ peg$currPos++;

s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c50); }
if (peg$silentFails === 0) { peg$fail(peg$c54); }
}
while (s1 !== peg$FAILED) {
s0.push(s1);
if (peg$c49.test(input.charAt(peg$currPos))) {
if (peg$c53.test(input.charAt(peg$currPos))) {
s1 = input.charAt(peg$currPos);

@@ -1189,3 +1206,3 @@ peg$currPos++;

s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c50); }
if (peg$silentFails === 0) { peg$fail(peg$c54); }
}

@@ -1204,3 +1221,3 @@ }

peg$reportedPos = s0;
s1 = peg$c51(s1);
s1 = peg$c55(s1);
}

@@ -1213,11 +1230,11 @@ s0 = s1;

function peg$parserequireExp() {
var s0, s1, s2, s3, s4, s5, s6, s7, s8;
var s0, s1, s2, s3, s4, s5, s6, s7;
s0 = peg$currPos;
if (input.substr(peg$currPos, 7) === peg$c52) {
s1 = peg$c52;
if (input.substr(peg$currPos, 7) === peg$c56) {
s1 = peg$c56;
peg$currPos += 7;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c53); }
if (peg$silentFails === 0) { peg$fail(peg$c57); }
}

@@ -1228,7 +1245,7 @@ if (s1 !== peg$FAILED) {

if (input.charCodeAt(peg$currPos) === 40) {
s3 = peg$c54;
s3 = peg$c58;
peg$currPos++;
} else {
s3 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c55); }
if (peg$silentFails === 0) { peg$fail(peg$c59); }
}

@@ -1243,18 +1260,12 @@ if (s3 !== peg$FAILED) {

if (input.charCodeAt(peg$currPos) === 41) {
s7 = peg$c56;
s7 = peg$c60;
peg$currPos++;
} else {
s7 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c57); }
if (peg$silentFails === 0) { peg$fail(peg$c61); }
}
if (s7 !== peg$FAILED) {
s8 = peg$parse_();
if (s8 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c58(s5);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$c1;
}
peg$reportedPos = s0;
s1 = peg$c62(s5);
s0 = s1;
} else {

@@ -1295,3 +1306,3 @@ peg$currPos = s0;

if (peg$c59.test(input.charAt(peg$currPos))) {
if (peg$c63.test(input.charAt(peg$currPos))) {
s0 = input.charAt(peg$currPos);

@@ -1301,3 +1312,3 @@ peg$currPos++;

s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c60); }
if (peg$silentFails === 0) { peg$fail(peg$c64); }
}

@@ -1331,12 +1342,12 @@

s0 = peg$currPos;
if (input.substr(peg$currPos, 7) === peg$c61) {
s1 = peg$c61;
if (input.substr(peg$currPos, 7) === peg$c65) {
s1 = peg$c65;
peg$currPos += 7;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c62); }
if (peg$silentFails === 0) { peg$fail(peg$c66); }
}
if (s1 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c63();
s1 = peg$c67();
}

@@ -1346,12 +1357,12 @@ s0 = s1;

s0 = peg$currPos;
if (input.substr(peg$currPos, 6) === peg$c64) {
s1 = peg$c64;
if (input.substr(peg$currPos, 6) === peg$c68) {
s1 = peg$c68;
peg$currPos += 6;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c65); }
if (peg$silentFails === 0) { peg$fail(peg$c69); }
}
if (s1 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c66();
s1 = peg$c70();
}

@@ -1358,0 +1369,0 @@ s0 = s1;

@@ -5,3 +5,3 @@ {

"description": "client-side Javascript packager.",
"version": "0.1.3",
"version": "0.1.4",
"repository": {

@@ -8,0 +8,0 @@ "type": "git",

@@ -65,42 +65,47 @@ module.exports = (function() {

peg$c29 = function(chars) { return "'" + chars.join('') + "'"; },
peg$c30 = "\"",
peg$c31 = { type: "literal", value: "\"", description: "\"\\\"\"" },
peg$c32 = function(chars) { return '"' + chars.join('') + '"'; },
peg$c33 = { type: "other", description: "regular expression" },
peg$c34 = "/",
peg$c35 = { type: "literal", value: "/", description: "\"/\"" },
peg$c36 = function(pattern, flags) {
peg$c30 = "\\'",
peg$c31 = { type: "literal", value: "\\'", description: "\"\\\\'\"" },
peg$c32 = "\"",
peg$c33 = { type: "literal", value: "\"", description: "\"\\\"\"" },
peg$c34 = function(chars) { return '"' + chars.join('') + '"'; },
peg$c35 = "\\\"",
peg$c36 = { type: "literal", value: "\\\"", description: "\"\\\\\\\"\"" },
peg$c37 = { type: "other", description: "regular expression" },
peg$c38 = "/",
peg$c39 = { type: "literal", value: "/", description: "\"/\"" },
peg$c40 = function(pattern, flags) {
console.log('--- parse.regexp.literal', pattern, flags);
var value = new RegExp(pattern, flags);
return "/" + pattern + "/" + flags;
},
peg$c37 = /^[*\\\/[]/,
peg$c38 = { type: "class", value: "[*\\\\\\/[]", description: "[*\\\\\\/[]" },
peg$c39 = /^[\\\/[]/,
peg$c40 = { type: "class", value: "[\\\\\\/[]", description: "[\\\\\\/[]" },
peg$c41 = "\\",
peg$c42 = { type: "literal", value: "\\", description: "\"\\\\\"" },
peg$c43 = "[",
peg$c44 = { type: "literal", value: "[", description: "\"[\"" },
peg$c45 = "]",
peg$c46 = { type: "literal", value: "]", description: "\"]\"" },
peg$c47 = /^[\]\\]/,
peg$c48 = { type: "class", value: "[\\]\\\\]", description: "[\\]\\\\]" },
peg$c49 = /^[a-z]/,
peg$c50 = { type: "class", value: "[a-z]", description: "[a-z]" },
peg$c51 = function(s) { return s.substring(1, s.length - 1); },
peg$c52 = "require",
peg$c53 = { type: "literal", value: "require", description: "\"require\"" },
peg$c54 = "(",
peg$c55 = { type: "literal", value: "(", description: "\"(\"" },
peg$c56 = ")",
peg$c57 = { type: "literal", value: ")", description: "\")\"" },
peg$c58 = function(spec) { return { require: spec } },
peg$c59 = /^[ \r\n\t]/,
peg$c60 = { type: "class", value: "[ \\r\\n\\t]", description: "[ \\r\\n\\t]" },
peg$c61 = "process",
peg$c62 = { type: "literal", value: "process", description: "\"process\"" },
peg$c63 = function() { return {global: 'process', require: 'process'}; },
peg$c64 = "Buffer",
peg$c65 = { type: "literal", value: "Buffer", description: "\"Buffer\"" },
peg$c66 = function() { return {global: 'Buffer', require: 'buffer'}; },
peg$c41 = /^[*\\\/[]/,
peg$c42 = { type: "class", value: "[*\\\\\\/[]", description: "[*\\\\\\/[]" },
peg$c43 = /^[\\\/[]/,
peg$c44 = { type: "class", value: "[\\\\\\/[]", description: "[\\\\\\/[]" },
peg$c45 = "\\",
peg$c46 = { type: "literal", value: "\\", description: "\"\\\\\"" },
peg$c47 = "[",
peg$c48 = { type: "literal", value: "[", description: "\"[\"" },
peg$c49 = "]",
peg$c50 = { type: "literal", value: "]", description: "\"]\"" },
peg$c51 = /^[\]\\]/,
peg$c52 = { type: "class", value: "[\\]\\\\]", description: "[\\]\\\\]" },
peg$c53 = /^[a-z]/,
peg$c54 = { type: "class", value: "[a-z]", description: "[a-z]" },
peg$c55 = function(s) { return s.substring(1, s.length - 1); },
peg$c56 = "require",
peg$c57 = { type: "literal", value: "require", description: "\"require\"" },
peg$c58 = "(",
peg$c59 = { type: "literal", value: "(", description: "\"(\"" },
peg$c60 = ")",
peg$c61 = { type: "literal", value: ")", description: "\")\"" },
peg$c62 = function(spec) { return { require: spec } },
peg$c63 = /^[ \r\n\t]/,
peg$c64 = { type: "class", value: "[ \\r\\n\\t]", description: "[ \\r\\n\\t]" },
peg$c65 = "process",
peg$c66 = { type: "literal", value: "process", description: "\"process\"" },
peg$c67 = function() { return {global: 'process', require: 'process'}; },
peg$c68 = "Buffer",
peg$c69 = { type: "literal", value: "Buffer", description: "\"Buffer\"" },
peg$c70 = function() { return {global: 'Buffer', require: 'buffer'}; },

@@ -315,11 +320,5 @@ peg$currPos = 0,

s0 = peg$parsestring();
s0 = peg$parserequireExp();
if (s0 === peg$FAILED) {
s0 = peg$parsecomment();
if (s0 === peg$FAILED) {
s0 = peg$parserequireExp();
if (s0 === peg$FAILED) {
s0 = peg$parseglobalExp();
}
}
s0 = peg$parseglobalExp();
}

@@ -695,38 +694,47 @@

s0 = peg$currPos;
s1 = peg$currPos;
peg$silentFails++;
if (input.charCodeAt(peg$currPos) === 39) {
s2 = peg$c27;
peg$currPos++;
if (input.substr(peg$currPos, 2) === peg$c30) {
s0 = peg$c30;
peg$currPos += 2;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c28); }
s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c31); }
}
peg$silentFails--;
if (s2 === peg$FAILED) {
s1 = peg$c3;
} else {
peg$currPos = s1;
s1 = peg$c1;
}
if (s1 !== peg$FAILED) {
if (input.length > peg$currPos) {
s2 = input.charAt(peg$currPos);
if (s0 === peg$FAILED) {
s0 = peg$currPos;
s1 = peg$currPos;
peg$silentFails++;
if (input.charCodeAt(peg$currPos) === 39) {
s2 = peg$c27;
peg$currPos++;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c4); }
if (peg$silentFails === 0) { peg$fail(peg$c28); }
}
if (s2 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c5(s2);
s0 = s1;
peg$silentFails--;
if (s2 === peg$FAILED) {
s1 = peg$c3;
} else {
peg$currPos = s1;
s1 = peg$c1;
}
if (s1 !== peg$FAILED) {
if (input.length > peg$currPos) {
s2 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c4); }
}
if (s2 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c5(s2);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$c1;
}
} else {
peg$currPos = s0;
s0 = peg$c1;
}
} else {
peg$currPos = s0;
s0 = peg$c1;
}

@@ -742,7 +750,7 @@

if (input.charCodeAt(peg$currPos) === 34) {
s1 = peg$c30;
s1 = peg$c32;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c31); }
if (peg$silentFails === 0) { peg$fail(peg$c33); }
}

@@ -758,11 +766,11 @@ if (s1 !== peg$FAILED) {

if (input.charCodeAt(peg$currPos) === 34) {
s3 = peg$c30;
s3 = peg$c32;
peg$currPos++;
} else {
s3 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c31); }
if (peg$silentFails === 0) { peg$fail(peg$c33); }
}
if (s3 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c32(s2);
s1 = peg$c34(s2);
s0 = s1;

@@ -788,38 +796,47 @@ } else {

s0 = peg$currPos;
s1 = peg$currPos;
peg$silentFails++;
if (input.charCodeAt(peg$currPos) === 34) {
s2 = peg$c30;
peg$currPos++;
if (input.substr(peg$currPos, 2) === peg$c35) {
s0 = peg$c35;
peg$currPos += 2;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c31); }
s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c36); }
}
peg$silentFails--;
if (s2 === peg$FAILED) {
s1 = peg$c3;
} else {
peg$currPos = s1;
s1 = peg$c1;
}
if (s1 !== peg$FAILED) {
if (input.length > peg$currPos) {
s2 = input.charAt(peg$currPos);
if (s0 === peg$FAILED) {
s0 = peg$currPos;
s1 = peg$currPos;
peg$silentFails++;
if (input.charCodeAt(peg$currPos) === 34) {
s2 = peg$c32;
peg$currPos++;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c4); }
if (peg$silentFails === 0) { peg$fail(peg$c33); }
}
if (s2 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c5(s2);
s0 = s1;
peg$silentFails--;
if (s2 === peg$FAILED) {
s1 = peg$c3;
} else {
peg$currPos = s1;
s1 = peg$c1;
}
if (s1 !== peg$FAILED) {
if (input.length > peg$currPos) {
s2 = input.charAt(peg$currPos);
peg$currPos++;
} else {
s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c4); }
}
if (s2 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c5(s2);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$c1;
}
} else {
peg$currPos = s0;
s0 = peg$c1;
}
} else {
peg$currPos = s0;
s0 = peg$c1;
}

@@ -836,7 +853,7 @@

if (input.charCodeAt(peg$currPos) === 47) {
s1 = peg$c34;
s1 = peg$c38;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c35); }
if (peg$silentFails === 0) { peg$fail(peg$c39); }
}

@@ -852,7 +869,7 @@ if (s1 !== peg$FAILED) {

if (input.charCodeAt(peg$currPos) === 47) {
s3 = peg$c34;
s3 = peg$c38;
peg$currPos++;
} else {
s3 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c35); }
if (peg$silentFails === 0) { peg$fail(peg$c39); }
}

@@ -868,3 +885,3 @@ if (s3 !== peg$FAILED) {

peg$reportedPos = s0;
s1 = peg$c36(s2, s4);
s1 = peg$c40(s2, s4);
s0 = s1;

@@ -890,3 +907,3 @@ } else {

s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c33); }
if (peg$silentFails === 0) { peg$fail(peg$c37); }
}

@@ -930,3 +947,3 @@

peg$silentFails++;
if (peg$c37.test(input.charAt(peg$currPos))) {
if (peg$c41.test(input.charAt(peg$currPos))) {
s2 = input.charAt(peg$currPos);

@@ -936,3 +953,3 @@ peg$currPos++;

s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c38); }
if (peg$silentFails === 0) { peg$fail(peg$c42); }
}

@@ -975,3 +992,3 @@ peg$silentFails--;

peg$silentFails++;
if (peg$c39.test(input.charAt(peg$currPos))) {
if (peg$c43.test(input.charAt(peg$currPos))) {
s2 = input.charAt(peg$currPos);

@@ -981,3 +998,3 @@ peg$currPos++;

s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c40); }
if (peg$silentFails === 0) { peg$fail(peg$c44); }
}

@@ -1019,7 +1036,7 @@ peg$silentFails--;

if (input.charCodeAt(peg$currPos) === 92) {
s1 = peg$c41;
s1 = peg$c45;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c42); }
if (peg$silentFails === 0) { peg$fail(peg$c46); }
}

@@ -1085,7 +1102,7 @@ if (s1 !== peg$FAILED) {

if (input.charCodeAt(peg$currPos) === 91) {
s1 = peg$c43;
s1 = peg$c47;
peg$currPos++;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c44); }
if (peg$silentFails === 0) { peg$fail(peg$c48); }
}

@@ -1101,7 +1118,7 @@ if (s1 !== peg$FAILED) {

if (input.charCodeAt(peg$currPos) === 93) {
s3 = peg$c45;
s3 = peg$c49;
peg$currPos++;
} else {
s3 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c46); }
if (peg$silentFails === 0) { peg$fail(peg$c50); }
}

@@ -1133,3 +1150,3 @@ if (s3 !== peg$FAILED) {

peg$silentFails++;
if (peg$c47.test(input.charAt(peg$currPos))) {
if (peg$c51.test(input.charAt(peg$currPos))) {
s2 = input.charAt(peg$currPos);

@@ -1139,3 +1156,3 @@ peg$currPos++;

s2 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c48); }
if (peg$silentFails === 0) { peg$fail(peg$c52); }
}

@@ -1173,3 +1190,3 @@ peg$silentFails--;

s0 = [];
if (peg$c49.test(input.charAt(peg$currPos))) {
if (peg$c53.test(input.charAt(peg$currPos))) {
s1 = input.charAt(peg$currPos);

@@ -1179,7 +1196,7 @@ peg$currPos++;

s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c50); }
if (peg$silentFails === 0) { peg$fail(peg$c54); }
}
while (s1 !== peg$FAILED) {
s0.push(s1);
if (peg$c49.test(input.charAt(peg$currPos))) {
if (peg$c53.test(input.charAt(peg$currPos))) {
s1 = input.charAt(peg$currPos);

@@ -1189,3 +1206,3 @@ peg$currPos++;

s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c50); }
if (peg$silentFails === 0) { peg$fail(peg$c54); }
}

@@ -1204,3 +1221,3 @@ }

peg$reportedPos = s0;
s1 = peg$c51(s1);
s1 = peg$c55(s1);
}

@@ -1213,11 +1230,11 @@ s0 = s1;

function peg$parserequireExp() {
var s0, s1, s2, s3, s4, s5, s6, s7, s8;
var s0, s1, s2, s3, s4, s5, s6, s7;
s0 = peg$currPos;
if (input.substr(peg$currPos, 7) === peg$c52) {
s1 = peg$c52;
if (input.substr(peg$currPos, 7) === peg$c56) {
s1 = peg$c56;
peg$currPos += 7;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c53); }
if (peg$silentFails === 0) { peg$fail(peg$c57); }
}

@@ -1228,7 +1245,7 @@ if (s1 !== peg$FAILED) {

if (input.charCodeAt(peg$currPos) === 40) {
s3 = peg$c54;
s3 = peg$c58;
peg$currPos++;
} else {
s3 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c55); }
if (peg$silentFails === 0) { peg$fail(peg$c59); }
}

@@ -1243,18 +1260,12 @@ if (s3 !== peg$FAILED) {

if (input.charCodeAt(peg$currPos) === 41) {
s7 = peg$c56;
s7 = peg$c60;
peg$currPos++;
} else {
s7 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c57); }
if (peg$silentFails === 0) { peg$fail(peg$c61); }
}
if (s7 !== peg$FAILED) {
s8 = peg$parse_();
if (s8 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c58(s5);
s0 = s1;
} else {
peg$currPos = s0;
s0 = peg$c1;
}
peg$reportedPos = s0;
s1 = peg$c62(s5);
s0 = s1;
} else {

@@ -1295,3 +1306,3 @@ peg$currPos = s0;

if (peg$c59.test(input.charAt(peg$currPos))) {
if (peg$c63.test(input.charAt(peg$currPos))) {
s0 = input.charAt(peg$currPos);

@@ -1301,3 +1312,3 @@ peg$currPos++;

s0 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c60); }
if (peg$silentFails === 0) { peg$fail(peg$c64); }
}

@@ -1331,12 +1342,12 @@

s0 = peg$currPos;
if (input.substr(peg$currPos, 7) === peg$c61) {
s1 = peg$c61;
if (input.substr(peg$currPos, 7) === peg$c65) {
s1 = peg$c65;
peg$currPos += 7;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c62); }
if (peg$silentFails === 0) { peg$fail(peg$c66); }
}
if (s1 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c63();
s1 = peg$c67();
}

@@ -1346,12 +1357,12 @@ s0 = s1;

s0 = peg$currPos;
if (input.substr(peg$currPos, 6) === peg$c64) {
s1 = peg$c64;
if (input.substr(peg$currPos, 6) === peg$c68) {
s1 = peg$c68;
peg$currPos += 6;
} else {
s1 = peg$FAILED;
if (peg$silentFails === 0) { peg$fail(peg$c65); }
if (peg$silentFails === 0) { peg$fail(peg$c69); }
}
if (s1 !== peg$FAILED) {
peg$reportedPos = s0;
s1 = peg$c66();
s1 = peg$c70();
}

@@ -1358,0 +1369,0 @@ s0 = s1;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet