diff --git a/node_modules/abbrev/package.json b/node_modules/abbrev/package.json index 38e7f25c..e997ac01 100644 --- a/node_modules/abbrev/package.json +++ b/node_modules/abbrev/package.json @@ -39,6 +39,7 @@ "type": "range" }, "_requiredBy": [ + "/istanbul", "/nopt" ], "_resolved": "http://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", diff --git a/node_modules/big-integer/.npmignore b/node_modules/big-integer/.npmignore new file mode 100644 index 00000000..31905cf9 --- /dev/null +++ b/node_modules/big-integer/.npmignore @@ -0,0 +1,17 @@ +/.travis.yml +/.npmignore +/.gitignore +/spec +/benchmark +/big-integer*.tgz +/my.conf.js +/node_modules +/*.csproj* +/*.sh +/*.suo +/bin +/coverage +/*.bat +/obj +/Properties +/Web.* diff --git a/node_modules/big-integer/BigInteger.js b/node_modules/big-integer/BigInteger.js index ec9b6d1b..b6347bfe 100644 --- a/node_modules/big-integer/BigInteger.js +++ b/node_modules/big-integer/BigInteger.js @@ -301,7 +301,7 @@ var bigInt = (function (undefined) { function multiplyKaratsuba(x, y) { var n = Math.max(x.length, y.length); - + if (n <= 30) return multiplyLong(x, y); n = Math.ceil(n / 2); @@ -822,6 +822,24 @@ var bigInt = (function (undefined) { }; SmallInteger.prototype.isProbablePrime = BigInteger.prototype.isProbablePrime; + BigInteger.prototype.modInv = function (n) { + var t = bigInt.zero, newT = bigInt.one, r = parseValue(n), newR = this.abs(), q, lastT, lastR; + while (!newR.equals(bigInt.zero)) { + q = r.divide(newR); + lastT = t; + lastR = r; + t = newT; + r = newR; + newT = lastT.subtract(q.multiply(newT)); + newR = lastR.subtract(q.multiply(newR)); + } + if (t.compare(0) === -1) { + t = t.add(n); + } + return t; + } + SmallInteger.prototype.modInv = BigInteger.prototype.modInv; + BigInteger.prototype.next = function () { var value = this.value; if (this.sign) { @@ -1114,7 +1132,7 @@ var bigInt = (function (undefined) { return this.value; }; SmallInteger.prototype.toJSNumber = SmallInteger.prototype.valueOf; - + function parseStringValue(v) { if (isPrecise(+v)) { var x = +v; @@ -1153,7 +1171,7 @@ var bigInt = (function (undefined) { trim(r); return new BigInteger(r, sign); } - + function parseNumberValue(v) { if (isPrecise(v)) { if (v !== truncate(v)) throw new Error(v + " is not an integer."); diff --git a/node_modules/big-integer/BigInteger.min.js b/node_modules/big-integer/BigInteger.min.js index a9d12def..222d2c09 100644 --- a/node_modules/big-integer/BigInteger.min.js +++ b/node_modules/big-integer/BigInteger.min.js @@ -1,33 +1 @@ -var bigInt=function(E){function k(a,b){if("undefined"===typeof a)return k[0];if("undefined"!==typeof b){var c;if(10===+b)c=l(a);else{c=b;var n=k[0],f=k[1],d=a.length;if(2<=c&&36>=c&&d<=ga/Math.log(c))c=new e(parseInt(a,c));else{c=l(c);var d=[],g,h="-"===a[0];for(g=h?1:0;g=u)d.push(l(q));else if(97<=u&&122>=u)d.push(l(q.charCodeAt(0)-87));else if("<"===q){q=g;do g++;while(">"!==a[g]);d.push(l(a.slice(q+1,g)))}else throw Error(q+ -" is not a valid character");}d.reverse();for(g=0;ga;this.isSmall=!0}function w(a){return-9007199254740992a}function z(a){return 1E7>a?[a]:1E14>a?[a%1E7,Math.floor(a/1E7)]:[a%1E7,Math.floor(a/1E7)%1E7,Math.floor(a/1E14)]}function y(a){D(a);var b=a.length;if(4>b&&0>A(a,P))switch(b){case 0:return 0; -case 1:return a[0];case 2:return a[0]+1E7*a[1];default:return a[0]+1E7*(a[1]+1E7*a[2])}return a}function D(a){for(var b=a.length;0===a[--b];);a.length=b+1}function K(a){for(var b=Array(a),c=-1;++c=b.length?S(a, -b):S(b,a)}function L(a,b){var c=a.length,d=Array(c),f,e;for(e=0;eh?(h+=1E7,e=1):e=0,f[g]=h;for(g=d;gh)h+=1E7;else{f[g++]=h;break}f[g]=h}for(;gg?g+1E7:g;f=y(f);return"number"===typeof f?(c&&(f=-f),new e(f)):new d(f,c)}function Q(a,b){var c=a.length,d=b.length,f=K(c+d),e,g,h,k;for(h=0;h=c)return Q(a,b);var c=Math.ceil(c/2),d=a.slice(c),f=a.slice(0,c),e=b.slice(c),g=b.slice(0,c),h=N(f,g),k=N(d,e),d=N(F(f,d),F(g,e)),c=F(F(h,T(G(G(d,h),k),c)),T(k,2*c));D(c);return c}function U(a,b,c){return 1E7>a?new d(H(b,a),c):new d(Q(b,z(a)),c)}function V(a){var b=a.length,c=K(b+b),d,f,e,g;for(e=0;ec)return c=W(f,c),f=y(c[0]),c=c[1],a.sign&&(c=-c),"number"===typeof f?(a.sign!==n.sign&&(f=-f),[new e(f),new e(c)]):[new d(f,a.sign!==n.sign),new e(c)];c=z(c)}var m=A(f,c);if(-1=== -m)return[k[0],a];if(0===m)return[k[a.sign===n.sign?1:-1],k[0]];if(200>=f.length+c.length){var g=c,h=f.length;c=g.length;var m=K(g.length),q=g[c-1],u=Math.ceil(1E7/(2*q)),f=H(f,u),g=H(g,u),p,r,x,t,v,w;f.length<=h&&f.push(0);g.push(0);q=g[c-1];for(p=h-c;0<=p;p--){h=9999999;f[p+c]!==q&&(h=Math.floor((1E7*f[p+c]+f[p+c-1])/q));x=r=0;v=g.length;for(t=0;tx?(f[p+t]=x+1E7,x=-1):(f[p+t]=x,x=0);for(;0!==x;){--h;for(t=r=0;tr?(f[p+t]=r+1E7,r=0):(f[p+t]=r,r=1);x+=r}m[p]=h}f=W(f,u)[0];c=[y(m),y(f)]}else{m=f.length;q=c.length;u=[];for(g=[];m;)if(g.unshift(f[--m]),0>A(g,c))u.push(0);else{h=g.length;p=1E7*g[h-1]+g[h-2];r=1E7*c[q-1]+c[q-2];h>q&&(p=1E7*(p+1));h=Math.ceil(p/r);do{p=H(c,h);if(0>=A(p,g))break;h--}while(h);u.push(h);g=G(g,p)}u.reverse();c=[y(u),y(g)]}f=c[0];n=a.sign!==n.sign;c=c[1];m=a.sign;"number"===typeof f?(n&&(f=-f),f=new e(f)):f=new d(f,n);"number"===typeof c?(m&&(c=-c),c=new e(c)):c=new d(c,m);return[f, -c]}function A(a,b){if(a.length!==b.length)return a.length>b.length?1:-1;for(var c=a.length-1;0<=c;c--)if(a[c]!==b[c])return a[c]>b[c]?1:-1;return 0}function X(a){a=a.abs();if(a.isUnit())return!1;if(a.equals(2)||a.equals(3)||a.equals(5))return!0;if(a.isEven()||a.isDivisibleBy(3)||a.isDivisibleBy(5))return!1;if(a.lesser(25))return!0}function Y(a){return("number"===typeof a||"string"===typeof a)&&1E7>=+Math.abs(a)||a instanceof d&&1>=a.value.length}function R(a,b,c){b=l(b);var d=a.isNegative(),e=b.isNegative(), -m=d?a.not():a,g=e?b.not():b;b=[];a=[];for(var h=!1,k=!1;!h||!k;)m.isZero()?(h=!0,b.push(d?1:0)):d?b.push(m.isEven()?1:0):b.push(m.isEven()?0:1),g.isZero()?(k=!0,a.push(e?1:0)):e?a.push(g.isEven()?1:0):a.push(g.isEven()?0:1),m=m.over(2),g=g.over(2);d=[];for(e=0;e=a[0]?"0123456789abcdefghijklmnopqrstuvwxyz".charAt(a[0]):"<"+a+">"}function da(a,b){b=bigInt(b);if(b.isZero()){if(a.isZero())return"0";throw Error("Cannot convert nonzero numbers to base 0.");}if(b.equals(-1))return a.isZero()?"0":a.isNegative()?Array(1-a).join("10"):"1"+Array(+a).join("01");var c="";a.isNegative()&&b.isPositive()&&(c="-",a=a.abs());if(b.equals(1))return a.isZero()?"0":c+Array(+a+1).join(1); -for(var d=[],e=a,k;e.isNegative()||0<=e.compareAbs(b);)k=e.divmod(b),e=k.quotient,k=k.remainder,k.isNegative()&&(k=b.minus(k).abs(),e=e.next()),d.push(ca(k));d.push(ca(e));return c+d.reverse().join("")}function ea(a){if(w(+a)){var b=+a;if(b===B(b))return new e(b);throw"Invalid integer: "+a;}(b="-"===a[0])&&(a=a.slice(1));var c=a.split(/e/i);if(2a)throw Error("Cannot include negative exponent part for integers");a=c+=Array(a+1).join("0")}if(!/^([0-9][0-9]*)$/.test(a))throw Error("Invalid integer: "+a);for(var c=[],n=a.length,f=n-7;0f&&(f=0),n-=7;D(c);return new d(c,b)}function l(a){if("number"===typeof a){if(w(a)){if(a!==B(a))throw Error(a+" is not an integer.");a=new e(a)}else a=ea(a.toString()); -return a}return"string"===typeof a?ea(a):a}var P=z(9007199254740992),ga=Math.log(9007199254740992);d.prototype=Object.create(k.prototype);e.prototype=Object.create(k.prototype);d.prototype.add=function(a){a=l(a);if(this.sign!==a.sign)return this.subtract(a.negate());var b=this.value,c=a.value;return a.isSmall?new d(L(b,Math.abs(c)),this.sign):new d(F(b,c),this.sign)};d.prototype.plus=d.prototype.add;e.prototype.add=function(a){a=l(a);var b=this.value;if(0>b!==a.sign)return this.subtract(a.negate()); -var c=a.value;if(a.isSmall){if(w(b+c))return new e(b+c);c=z(Math.abs(c))}return new d(L(c,Math.abs(b)),0>b)};e.prototype.plus=e.prototype.add;d.prototype.subtract=function(a){var b=l(a);if(this.sign!==b.sign)return this.add(b.negate());a=this.value;var c=b.value;if(b.isSmall)return M(a,Math.abs(c),this.sign);b=this.sign;0<=A(a,c)?a=G(a,c):(a=G(c,a),b=!b);a=y(a);"number"===typeof a?(b&&(a=-a),a=new e(a)):a=new d(a,b);return a};d.prototype.minus=d.prototype.subtract;e.prototype.subtract=function(a){a= -l(a);var b=this.value;if(0>b!==a.sign)return this.add(a.negate());var c=a.value;return a.isSmall?new e(b-c):M(c,Math.abs(b),0<=b)};e.prototype.minus=e.prototype.subtract;d.prototype.negate=function(){return new d(this.value,!this.sign)};e.prototype.negate=function(){var a=this.sign,b=new e(-this.value);b.sign=!a;return b};d.prototype.abs=function(){return new d(this.value,!1)};e.prototype.abs=function(){return new e(Math.abs(this.value))};d.prototype.multiply=function(a){var b=l(a);a=this.value;var c= -b.value,e=this.sign!==b.sign;if(b.isSmall){if(0===c)return k[0];if(1===c)return this;if(-1===c)return this.negate();c=Math.abs(c);if(1E7>c)return new d(H(a,c),e);c=z(c)}var b=a.length,f=c.length;return 0<-.012*b-.012*f+1.5E-5*b*f?new d(N(a,c),e):new d(Q(a,c),e)};d.prototype.times=d.prototype.multiply;e.prototype._multiplyBySmall=function(a){return w(a.value*this.value)?new e(a.value*this.value):U(Math.abs(a.value),z(Math.abs(this.value)),this.sign!==a.sign)};d.prototype._multiplyBySmall=function(a){return 0=== -a.value?k[0]:1===a.value?this:-1===a.value?this.negate():U(Math.abs(a.value),this.value,this.sign!==a.sign)};e.prototype.multiply=function(a){return l(a)._multiplyBySmall(this)};e.prototype.times=e.prototype.multiply;d.prototype.square=function(){return new d(V(this.value),!1)};e.prototype.square=function(){var a=this.value*this.value;return w(a)?new e(a):new d(V(z(Math.abs(this.value))),!1)};d.prototype.divmod=function(a){a=I(this,a);return{quotient:a[0],remainder:a[1]}};e.prototype.divmod=d.prototype.divmod; -d.prototype.divide=function(a){return I(this,a)[0]};e.prototype.over=e.prototype.divide=d.prototype.over=d.prototype.divide;d.prototype.mod=function(a){return I(this,a)[1]};e.prototype.remainder=e.prototype.mod=d.prototype.remainder=d.prototype.mod;d.prototype.pow=function(a){var b=l(a),c=this.value;a=b.value;var d;if(0===a)return k[1];if(0===c)return k[0];if(1===c)return k[1];if(-1===c)return b.isEven()?k[1]:k[-1];if(b.sign)return k[0];if(!b.isSmall)throw Error("The exponent "+b.toString()+" is too large."); -if(this.isSmall&&w(d=Math.pow(c,a)))return new e(B(d));d=this;for(b=k[1];;){a&1&&(b=b.times(d),--a);if(0===a)break;a/=2;d=d.square()}return b};e.prototype.pow=d.prototype.pow;d.prototype.modPow=function(a,b){a=l(a);b=l(b);if(b.isZero())throw Error("Cannot take modPow with modulus 0");for(var c=k[1],d=this.mod(b);a.isPositive();){if(d.isZero())return k[0];a.isOdd()&&(c=c.multiply(d).mod(b));a=a.divide(2);d=d.square().mod(b)}return c};e.prototype.modPow=d.prototype.modPow;d.prototype.compareAbs=function(a){a= -l(a);return a.isSmall?1:A(this.value,a.value)};e.prototype.compareAbs=function(a){a=l(a);var b=Math.abs(this.value),c=a.value;return a.isSmall?(c=Math.abs(c),b===c?0:b>c?1:-1):-1};d.prototype.compare=function(a){if(Infinity===a)return-1;if(-Infinity===a)return 1;a=l(a);return this.sign!==a.sign?a.sign?1:-1:a.isSmall?this.sign?-1:1:A(this.value,a.value)*(this.sign?-1:1)};d.prototype.compareTo=d.prototype.compare;e.prototype.compare=function(a){if(Infinity===a)return-1;if(-Infinity===a)return 1;a=l(a); -var b=this.value,c=a.value;return a.isSmall?b==c?0:b>c?1:-1:0>b!==a.sign?0>b?-1:1:0>b?1:-1};e.prototype.compareTo=e.prototype.compare;d.prototype.equals=function(a){return 0===this.compare(a)};e.prototype.eq=e.prototype.equals=d.prototype.eq=d.prototype.equals;d.prototype.notEquals=function(a){return 0!==this.compare(a)};e.prototype.neq=e.prototype.notEquals=d.prototype.neq=d.prototype.notEquals;d.prototype.greater=function(a){return 0this.compare(a)};e.prototype.lt=e.prototype.lesser=d.prototype.lt=d.prototype.lesser;d.prototype.greaterOrEquals=function(a){return 0<=this.compare(a)};e.prototype.geq=e.prototype.greaterOrEquals=d.prototype.geq=d.prototype.greaterOrEquals;d.prototype.lesserOrEquals=function(a){return 0>=this.compare(a)};e.prototype.leq=e.prototype.lesserOrEquals=d.prototype.leq=d.prototype.lesserOrEquals;d.prototype.isEven=function(){return 0===(this.value[0]& -1)};e.prototype.isEven=function(){return 0===(this.value&1)};d.prototype.isOdd=function(){return 1===(this.value[0]&1)};e.prototype.isOdd=function(){return 1===(this.value&1)};d.prototype.isPositive=function(){return!this.sign};e.prototype.isPositive=function(){return 0this.value};d.prototype.isUnit=function(){return!1};e.prototype.isUnit=function(){return 1===Math.abs(this.value)};d.prototype.isZero= -function(){return!1};e.prototype.isZero=function(){return 0===this.value};d.prototype.isDivisibleBy=function(a){a=l(a);var b=a.value;return 0===b?!1:1===b?!0:2===b?this.isEven():this.mod(a).equals(k[0])};e.prototype.isDivisibleBy=d.prototype.isDivisibleBy;d.prototype.isPrime=function(){var a=X(this);if(a!==E)return a;for(var a=this.abs(),b=a.prev(),c=[2,3,5,7,11,13,17,19],d=b,e,l,g,h;d.isEven();)d=d.divide(2);for(g=0;ga+1?new e(a+1):new d(P,!1)};d.prototype.prev=function(){var a=this.value;return this.sign?new d(L(a,1),!0):M(a,1,this.sign)};e.prototype.prev=function(){var a=this.value;return-9007199254740992=v[v.length-1];)v.push(2*v[v.length-1]);var J=v.length,fa=v[J-1];d.prototype.shiftLeft=function(a){if(!Y(a))throw Error(String(a)+" is too large for shifting.");a=+a;if(0>a)return this.shiftRight(-a); -for(var b=this;a>=J;)b=b.multiply(fa),a-=J-1;return b.multiply(v[a])};e.prototype.shiftLeft=d.prototype.shiftLeft;d.prototype.shiftRight=function(a){var b;if(!Y(a))throw Error(String(a)+" is too large for shifting.");a=+a;if(0>a)return this.shiftLeft(-a);for(b=this;a>=J;){if(b.isZero())return b;b=I(b,fa);b=b[1].isNegative()?b[0].prev():b[0];a-=J-1}b=I(b,v[a]);return b[1].isNegative()?b[0].prev():b[0]};e.prototype.shiftRight=d.prototype.shiftRight;d.prototype.not=function(){return this.negate().prev()}; -e.prototype.not=d.prototype.not;d.prototype.and=function(a){return R(this,a,function(a,c){return a&c})};e.prototype.and=d.prototype.and;d.prototype.or=function(a){return R(this,a,function(a,c){return a|c})};e.prototype.or=d.prototype.or;d.prototype.xor=function(a){return R(this,a,function(a,c){return a^c})};e.prototype.xor=d.prototype.xor;d.prototype.toString=function(a){a===E&&(a=10);if(10!==a)return da(this,a);a=this.value;for(var b=a.length,c=String(a[--b]),d;0<=--b;)d=String(a[b]),c+="0000000".slice(d.length)+ -d;return(this.sign?"-":"")+c};e.prototype.toString=function(a){a===E&&(a=10);return 10!=a?da(this,a):String(this.value)};d.prototype.valueOf=function(){return+this.toString()};d.prototype.toJSNumber=d.prototype.valueOf;e.prototype.valueOf=function(){return this.value};e.prototype.toJSNumber=e.prototype.valueOf;for(var C=0;1E3>C;C++)k[C]=new e(C),00?Math.floor(e):Math.ceil(e)}function v(e,n){var r=e.length,i=n.length,s=new Array(r),o=0,u=t,a,f;for(f=0;f=u?1:0,s[f]=a-o*u;while(f0&&s.push(o),s}function m(e,t){return e.length>=t.length?v(e,t):v(t,e)}function g(e,n){var r=e.length,i=new Array(r),s=t,o,u;for(u=0;u0)i[u++]=n%s,n=Math.floor(n/s);return i}function y(e,n){var r=e.length,i=n.length,s=new Array(r),o=0,u=t,a,f;for(a=0;a=0?r=y(e,t):(r=y(t,e),n=!n),r=c(r),typeof r=="number"?(n&&(r=-r),new a(r)):new u(r,n)}function w(e,n,r){var i=e.length,s=new Array(i),o=-n,f=t,l,h;for(l=0;l0)i[a++]=o%s,o=Math.floor(o/s);return i}function x(e,t){var n=[];while(t-->0)n.push(0);return n.concat(e)}function T(e,t){var n=Math.max(e.length,t.length);if(n<=30)return E(e,t);n=Math.ceil(n/2);var r=e.slice(n),i=e.slice(0,n),s=t.slice(n),o=t.slice(0,n),u=T(i,o),a=T(r,s),f=T(m(i,r),m(o,s)),l=m(m(u,x(y(y(f,u),a),n)),x(a,2*n));return h(l),l}function N(e,t){return-0.012*e-.012*t+15e-6*e*t>0}function C(e,n,r){return e=0;d--){h=s-1,f[d+i]!==u&&(h=Math.floor((f[d+i]*s+f[d+i-1])/u)),v=0,m=0,y=l.length;for(g=0;gi&&(l=(l+1)*u),a=Math.ceil(l/h);do{p=S(n,a);if(_(p,o)<=0)break;a--}while(a);s.push(a),o=y(o,p)}return s.reverse(),[c(s),c(o)]}function O(e,n){var r=e.length,i=p(r),s=t,o,u,a,f;a=0;for(o=r-1;o>=0;--o)f=a*s+e[o],u=d(f/n),a=f-u*n,i[o]=u|0;return[i,a|0]}function M(e,n){var r,i=Y(n),s=e.value,f=i.value,h;if(f===0)throw new Error("Cannot divide by zero");if(e.isSmall)return i.isSmall?[new a(d(s/f)),new a(s%f)]:[o[0],e];if(i.isSmall){if(f===1)return[e,o[0]];if(f==-1)return[e.negate(),o[0]];var p=Math.abs(f);if(pt.length?1:-1;for(var n=e.length-1;n>=0;n--)if(e[n]!==t[n])return e[n]>t[n]?1:-1;return 0}function D(e){var t=e.abs();if(t.isUnit())return!1;if(t.equals(2)||t.equals(3)||t.equals(5))return!0;if(t.isEven()||t.isDivisibleBy(3)||t.isDivisibleBy(5))return!1;if(t.lesser(25))return!0}function j(e){return(typeof e=="number"||typeof e=="string")&&+Math.abs(e)<=t||e instanceof u&&e.value.length<=1}function F(e,t,n){t=Y(t);var r=e.isNegative(),i=t.isNegative(),s=r?e.not():e,o=i?t.not():t,u=[],a=[],f=!1,l=!1;while(!f||!l)s.isZero()?(f=!0,u.push(r?1:0)):r?u.push(s.isEven()?1:0):u.push(s.isEven()?0:1),o.isZero()?(l=!0,a.push(i?1:0)):i?a.push(o.isEven()?1:0):a.push(o.isEven()?0:1),s=s.over(2),o=o.over(2);var c=[];for(var h=0;h=0;h--){var p=l?s.value[h]:t,v=d(Math.random()*p);f.unshift(v),v"}function K(e,t){t=bigInt(t);if(t.isZero()){if(e.isZero())return"0";throw new Error("Cannot convert nonzero numbers to base 0.")}if(t.equals(-1))return e.isZero()?"0":e.isNegative()?(new Array(1-e)).join("10"):"1"+(new Array(+e)).join("01");var n="";e.isNegative()&&t.isPositive()&&(n="-",e=e.abs());if(t.equals(1))return e.isZero()?"0":n+(new Array(+e+1)).join(1);var r=[],i=e,s;while(i.isNegative()||i.compareAbs(t)>=0){s=i.divmod(t),i=s.quotient;var o=s.remainder;o.isNegative()&&(o=t.minus(o).abs(),i=i.next()),r.push(J(o))}return r.push(J(i)),n+r.reverse().join("")}function Q(e){if(f(+e)){var t=+e;if(t===d(t))return new a(t);throw"Invalid integer: "+e}var r=e[0]==="-";r&&(e=e.slice(1));var i=e.split(/e/i);if(i.length>2)throw new Error("Invalid integer: "+i.join("e"));if(i.length===2){var s=i[1];s[0]==="+"&&(s=s.slice(1)),s=+s;if(s!==d(s)||!f(s))throw new Error("Invalid integer: "+s+" is not a valid exponent.");var o=i[0],l=o.indexOf(".");l>=0&&(s-=o.length-l-1,o=o.slice(0,l)+o.slice(l+1));if(s<0)throw new Error("Cannot include negative exponent part for integers");o+=(new Array(s+1)).join("0"),e=o}var c=/^([0-9][0-9]*)$/.test(e);if(!c)throw new Error("Invalid integer: "+e);var p=[],v=e.length,m=n,g=v-m;while(v>0)p.push(+e.slice(g,v)),g-=m,g<0&&(g=0),v-=m;return h(p),new u(p,r)}function G(e){if(f(e)){if(e!==d(e))throw new Error(e+" is not an integer.");return new a(e)}return Q(e.toString())}function Y(e){return typeof e=="number"?G(e):typeof e=="string"?Q(e):e}var t=1e7,n=7,r=9007199254740992,i=l(r),s=Math.log(r);u.prototype=Object.create(o.prototype),a.prototype=Object.create(o.prototype),u.prototype.add=function(e){var t,n=Y(e);if(this.sign!==n.sign)return this.subtract(n.negate());var r=this.value,i=n.value;return n.isSmall?new u(g(r,Math.abs(i)),this.sign):new u(m(r,i),this.sign)},u.prototype.plus=u.prototype.add,a.prototype.add=function(e){var t=Y(e),n=this.value;if(n<0!==t.sign)return this.subtract(t.negate());var r=t.value;if(t.isSmall){if(f(n+r))return new a(n+r);r=l(Math.abs(r))}return new u(g(r,Math.abs(n)),n<0)},a.prototype.plus=a.prototype.add,u.prototype.subtract=function(e){var t=Y(e);if(this.sign!==t.sign)return this.add(t.negate());var n=this.value,r=t.value;return t.isSmall?w(n,Math.abs(r),this.sign):b(n,r,this.sign)},u.prototype.minus=u.prototype.subtract,a.prototype.subtract=function(e){var t=Y(e),n=this.value;if(n<0!==t.sign)return this.add(t.negate());var r=t.value;return t.isSmall?new a(n-r):w(r,Math.abs(n),n>=0)},a.prototype.minus=a.prototype.subtract,u.prototype.negate=function(){return new u(this.value,!this.sign)},a.prototype.negate=function(){var e=this.sign,t=new a(-this.value);return t.sign=!e,t},u.prototype.abs=function(){return new u(this.value,!1)},a.prototype.abs=function(){return new a(Math.abs(this.value))},u.prototype.multiply=function(e){var n,r=Y(e),i=this.value,s=r.value,a=this.sign!==r.sign,f;if(r.isSmall){if(s===0)return o[0];if(s===1)return this;if(s===-1)return this.negate();f=Math.abs(s);if(fr?1:-1):-1},u.prototype.compare=function(e){if(e===Infinity)return-1;if(e===-Infinity)return 1;var t=Y(e),n=this.value,r=t.value;return this.sign!==t.sign?t.sign?1:-1:t.isSmall?this.sign?-1:1:_(n,r)*(this.sign?-1:1)},u.prototype.compareTo=u.prototype.compare,a.prototype.compare=function(e){if(e===Infinity)return-1;if(e===-Infinity)return 1;var t=Y(e),n=this.value,r=t.value;return t.isSmall?n==r?0:n>r?1:-1:n<0!==t.sign?n<0?-1:1:n<0?1:-1},a.prototype.compareTo=a.prototype.compare,u.prototype.equals=function(e){return this.compare(e)===0},a.prototype.eq=a.prototype.equals=u.prototype.eq=u.prototype.equals,u.prototype.notEquals=function(e){return this.compare(e)!==0},a.prototype.neq=a.prototype.notEquals=u.prototype.neq=u.prototype.notEquals,u.prototype.greater=function(e){return this.compare(e)>0},a.prototype.gt=a.prototype.greater=u.prototype.gt=u.prototype.greater,u.prototype.lesser=function(e){return this.compare(e)<0},a.prototype.lt=a.prototype.lesser=u.prototype.lt=u.prototype.lesser,u.prototype.greaterOrEquals=function(e){return this.compare(e)>=0},a.prototype.geq=a.prototype.greaterOrEquals=u.prototype.geq=u.prototype.greaterOrEquals,u.prototype.lesserOrEquals=function(e){return this.compare(e)<=0},a.prototype.leq=a.prototype.lesserOrEquals=u.prototype.leq=u.prototype.lesserOrEquals,u.prototype.isEven=function(){return(this.value[0]&1)===0},a.prototype.isEven=function(){return(this.value&1)===0},u.prototype.isOdd=function(){return(this.value[0]&1)===1},a.prototype.isOdd=function(){return(this.value&1)===1},u.prototype.isPositive=function(){return!this.sign},a.prototype.isPositive=function(){return this.value>0},u.prototype.isNegative=function(){return this.sign},a.prototype.isNegative=function(){return this.value<0},u.prototype.isUnit=function(){return!1},a.prototype.isUnit=function(){return Math.abs(this.value)===1},u.prototype.isZero=function(){return!1},a.prototype.isZero=function(){return this.value===0},u.prototype.isDivisibleBy=function(e){var t=Y(e),n=t.value;return n===0?!1:n===1?!0:n===2?this.isEven():this.mod(t).equals(o[0])},a.prototype.isDivisibleBy=u.prototype.isDivisibleBy,u.prototype.isPrime=function(){var t=D(this);if(t!==e)return t;var n=this.abs(),r=n.prev(),i=[2,3,5,7,11,13,17,19],s=r,u,a,f,l;while(s.isEven())s=s.divide(2);for(f=0;f-r?new a(e-1):new u(i,!0)};var P=[1];while(P[P.length-1]<=t)P.push(2*P[P.length-1]);var H=P.length,B=P[H-1];u.prototype.shiftLeft=function(e){if(!j(e))throw new Error(String(e)+" is too large for shifting.");e=+e;if(e<0)return this.shiftRight(-e);var t=this;while(e>=H)t=t.multiply(B),e-=H-1;return t.multiply(P[e])},a.prototype.shiftLeft=u.prototype.shiftLeft,u.prototype.shiftRight=function(e){var t;if(!j(e))throw new Error(String(e)+" is too large for shifting.");e=+e;if(e<0)return this.shiftLeft(-e);var n=this;while(e>=H){if(n.isZero())return n;t=M(n,B),n=t[1].isNegative()?t[0].prev():t[0],e-=H-1}return t=M(n,P[e]),t[1].isNegative()?t[0].prev():t[0]},a.prototype.shiftRight=u.prototype.shiftRight,u.prototype.not=function(){return this.negate().prev()},a.prototype.not=u.prototype.not,u.prototype.and=function(e){return F(this,e,function(e,t){return e&t})},a.prototype.and=u.prototype.and,u.prototype.or=function(e){return F(this,e,function(e,t){return e|t})},a.prototype.or=u.prototype.or,u.prototype.xor=function(e){return F(this,e,function(e,t){return e^t})},a.prototype.xor=u.prototype.xor;var I=1<<30,q=(t&-t)*(t&-t)|I,$=function(e,t){var n=o[0],r=o[1],i=e.length;if(2<=t&&t<=36&&i<=s/Math.log(t))return new a(parseInt(e,t));t=Y(t);var u=[],f,l=e[0]==="-";for(f=l?1:0;f");u.push(Y(e.slice(p+1,f)))}}u.reverse();for(f=0;f=0)o=String(n[r]),i+=s.slice(o.length)+o;var u=this.sign?"-":"";return u+i},a.prototype.toString=function(t){return t===e&&(t=10),t!=10?K(this,t):String(this.value)},u.prototype.valueOf=function(){return+this.toString()},u.prototype.toJSNumber=u.prototype.valueOf,a.prototype.valueOf=function(){return this.value},a.prototype.toJSNumber=a.prototype.valueOf;for(var Z=0;Z<1e3;Z++)o[Z]=new a(Z),Z>0&&(o[-Z]=new a(-Z));return o.one=o[1],o.zero=o[0],o.minusOne=o[-1],o.max=U,o.min=z,o.gcd=W,o.lcm=X,o.isInstance=function(e){return e instanceof u||e instanceof a},o.randBetween=V,o}();typeof module!="undefined"&&module.hasOwnProperty("exports")&&(module.exports=bigInt); \ No newline at end of file diff --git a/node_modules/big-integer/LICENSE b/node_modules/big-integer/LICENSE deleted file mode 100644 index cf1ab25d..00000000 --- a/node_modules/big-integer/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -This is free and unencumbered software released into the public domain. - -Anyone is free to copy, modify, publish, use, compile, sell, or -distribute this software, either in source code form or as a compiled -binary, for any purpose, commercial or non-commercial, and by any -means. - -In jurisdictions that recognize copyright laws, the author or authors -of this software dedicate any and all copyright interest in the -software to the public domain. We make this dedication for the benefit -of the public at large and to the detriment of our heirs and -successors. We intend this dedication to be an overt act of -relinquishment in perpetuity of all present and future rights to this -software under copyright law. - -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 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. - -For more information, please refer to diff --git a/node_modules/big-integer/README.md b/node_modules/big-integer/README.md index 6d9ee851..51eb657d 100644 --- a/node_modules/big-integer/README.md +++ b/node_modules/big-integer/README.md @@ -280,6 +280,13 @@ Performs division and returns the remainder, disregarding the quotient. The sign [View benchmarks for this method](http://peterolson.github.io/BigInteger.js/benchmark/#Division) +#### `modInv(mod)` + +Finds the [multiplicative inverse](https://en.wikipedia.org/wiki/Modular_multiplicative_inverse) of the number modulo `mod`. + + - `bigInt(3).modInv(11)` => `4` + - `bigInt(42).modInv(2017)` => `1969` + #### `modPow(exp, mod)` Takes the number to the power `exp` modulo `mod`. diff --git a/node_modules/big-integer/bower.json b/node_modules/big-integer/bower.json new file mode 100644 index 00000000..c7c7291c --- /dev/null +++ b/node_modules/big-integer/bower.json @@ -0,0 +1,30 @@ +{ + "name": "big-integer", + "description": "An arbitrary length integer library for Javascript", + "main": "./BigInteger.js", + "authors": [ + "Peter Olson" + ], + "license": "Unlicense", + "keywords": [ + "math", + "big", + "bignum", + "bigint", + "biginteger", + "integer", + "arbitrary", + "precision", + "arithmetic" + ], + "homepage": "https://github.com/peterolson/BigInteger.js", + "ignore": [ + "**/.*", + "node_modules", + "bower_components", + "test", + "coverage", + "spec", + "tests" + ] +} diff --git a/node_modules/big-integer/package.json b/node_modules/big-integer/package.json index 5e9e0dd2..b604dbe6 100644 --- a/node_modules/big-integer/package.json +++ b/node_modules/big-integer/package.json @@ -14,20 +14,20 @@ ] ], "_from": "big-integer@>=1.6.7 <2.0.0", - "_id": "big-integer@1.6.15", + "_id": "big-integer@1.6.16", "_inCache": true, "_installable": true, "_location": "/big-integer", - "_nodeVersion": "0.12.3", + "_nodeVersion": "4.4.5", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/big-integer-1.6.15.tgz_1460079231162_0.7087579960934818" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/big-integer-1.6.16.tgz_1473665148825_0.5824211346916854" }, "_npmUser": { "name": "peterolson", "email": "peter.e.c.olson+npm@gmail.com" }, - "_npmVersion": "2.9.1", + "_npmVersion": "2.15.5", "_phantomChildren": {}, "_requested": { "raw": "big-integer@^1.6.7", @@ -41,8 +41,8 @@ "_requiredBy": [ "/bplist-parser" ], - "_resolved": "http://registry.npmjs.org/big-integer/-/big-integer-1.6.15.tgz", - "_shasum": "33d27d3b7388dfcc4b86d3130c10740cec01fb9e", + "_resolved": "http://registry.npmjs.org/big-integer/-/big-integer-1.6.16.tgz", + "_shasum": "0ca30b58013db46b10084a09242ca1d8954724cc", "_shrinkwrap": null, "_spec": "big-integer@^1.6.7", "_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/bplist-parser", @@ -68,13 +68,13 @@ }, "directories": {}, "dist": { - "shasum": "33d27d3b7388dfcc4b86d3130c10740cec01fb9e", - "tarball": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.15.tgz" + "shasum": "0ca30b58013db46b10084a09242ca1d8954724cc", + "tarball": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.16.tgz" }, "engines": { "node": ">=0.6" }, - "gitHead": "cda5bcce74c3a4eb34951201d50c1b8776a56eca", + "gitHead": "09b50ab4e701a2ec4d403fa3ecf12ae327227190", "homepage": "https://github.com/peterolson/BigInteger.js#readme", "keywords": [ "math", @@ -105,5 +105,5 @@ "scripts": { "test": "karma start my.conf.js" }, - "version": "1.6.15" + "version": "1.6.16" } diff --git a/node_modules/cordova-common/RELEASENOTES.md b/node_modules/cordova-common/RELEASENOTES.md index 01037d41..02dbcee8 100644 --- a/node_modules/cordova-common/RELEASENOTES.md +++ b/node_modules/cordova-common/RELEASENOTES.md @@ -20,6 +20,19 @@ --> # Cordova-common Release Notes +### 1.5.1 (Oct 12, 2016) +* [CB-12002](https://issues.apache.org/jira/browse/CB-12002) Add `getAllowIntents()` to `ConfigParser` +* [CB-11998](https://issues.apache.org/jira/browse/CB-11998) `cordova platform add` error with `cordova-common@1.5.0` + +### 1.5.0 (Oct 06, 2016) +* [CB-11776](https://issues.apache.org/jira/browse/CB-11776) Add test case for different `edit-config` targets +* [CB-11908](https://issues.apache.org/jira/browse/CB-11908) Add `edit-config` to `config.xml` +* [CB-11936](https://issues.apache.org/jira/browse/CB-11936) Support four new **App Transport Security (ATS)** keys +* update `config.xml` location if it is a **Android Studio** project. +* use `array` methods and `object.keys` for iterating. avoiding `for-in` loops +* [CB-11517](https://issues.apache.org/jira/browse/CB-11517) Allow `.folder` matches +* [CB-11776](https://issues.apache.org/jira/browse/CB-11776) check `edit-config` target exists + ### 1.4.1 (Aug 09, 2016) * Add general purpose `ConfigParser.getAttribute` API * [CB-11653](https://issues.apache.org/jira/browse/CB-11653) moved `findProjectRoot` from `cordova-lib` to `cordova-common` @@ -27,6 +40,9 @@ * [CB-11645](https://issues.apache.org/jira/browse/CB-11645) added check to see if `getEditConfig` exists before trying to use it * [CB-9825](https://issues.apache.org/jira/browse/CB-9825) framework tag spec parsing +### 1.4.0 (Jul 12, 2016) +* [CB-11023](https://issues.apache.org/jira/browse/CB-11023) Add edit-config functionality + ### 1.3.0 (May 12, 2016) * [CB-11259](https://issues.apache.org/jira/browse/CB-11259): Improving prepare and build logging * [CB-11194](https://issues.apache.org/jira/browse/CB-11194) Improve cordova load time diff --git a/node_modules/cordova-common/package.json b/node_modules/cordova-common/package.json index cc3d9fcb..e81f4784 100644 --- a/node_modules/cordova-common/package.json +++ b/node_modules/cordova-common/package.json @@ -2,49 +2,49 @@ "_args": [ [ { - "raw": "cordova-common@^1.4.0", + "raw": "cordova-common@^1.5.0", "scope": null, "escapedName": "cordova-common", "name": "cordova-common", - "rawSpec": "^1.4.0", - "spec": ">=1.4.0 <2.0.0", + "rawSpec": "^1.5.0", + "spec": ">=1.5.0 <2.0.0", "type": "range" }, "/Users/steveng/repo/cordova/cordova-android" ] ], - "_from": "cordova-common@>=1.4.0 <2.0.0", - "_id": "cordova-common@1.4.1", + "_from": "cordova-common@>=1.5.0 <2.0.0", + "_id": "cordova-common@1.5.1", "_inCache": true, "_installable": true, "_location": "/cordova-common", - "_nodeVersion": "6.2.2", + "_nodeVersion": "6.6.0", "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/cordova-common-1.4.1.tgz_1471306335501_0.6723270947113633" + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/cordova-common-1.5.1.tgz_1476725179180_0.39604957425035536" }, "_npmUser": { "name": "stevegill", "email": "stevengill97@gmail.com" }, - "_npmVersion": "3.9.5", + "_npmVersion": "3.10.3", "_phantomChildren": {}, "_requested": { - "raw": "cordova-common@^1.4.0", + "raw": "cordova-common@^1.5.0", "scope": null, "escapedName": "cordova-common", "name": "cordova-common", - "rawSpec": "^1.4.0", - "spec": ">=1.4.0 <2.0.0", + "rawSpec": "^1.5.0", + "spec": ">=1.5.0 <2.0.0", "type": "range" }, "_requiredBy": [ "/" ], - "_resolved": "file:cordova-dist-dev/CB-11690/cordova-common-1.4.1.tgz", - "_shasum": "8b4f07b3199b398fff553b32bff66676ecd30ab9", + "_resolved": "file:cordova-dist/tools/cordova-common-1.5.1.tgz", + "_shasum": "6770de0d6200ad6f94a1abe8939b5bd9ece139e3", "_shrinkwrap": null, - "_spec": "cordova-common@^1.4.0", + "_spec": "cordova-common@^1.5.0", "_where": "/Users/steveng/repo/cordova/cordova-android", "author": { "name": "Apache Software Foundation" @@ -79,8 +79,8 @@ }, "directories": {}, "dist": { - "shasum": "8b4f07b3199b398fff553b32bff66676ecd30ab9", - "tarball": "https://registry.npmjs.org/cordova-common/-/cordova-common-1.4.1.tgz" + "shasum": "6770de0d6200ad6f94a1abe8939b5bd9ece139e3", + "tarball": "https://registry.npmjs.org/cordova-common/-/cordova-common-1.5.1.tgz" }, "engineStrict": true, "engines": { @@ -127,5 +127,5 @@ "jshint": "node node_modules/jshint/bin/jshint src && node node_modules/jshint/bin/jshint spec", "test": "npm run jshint && npm run jasmine" }, - "version": "1.4.1" + "version": "1.5.1" } diff --git a/node_modules/cordova-common/src/ConfigChanges/ConfigChanges.js b/node_modules/cordova-common/src/ConfigChanges/ConfigChanges.js index e5b09a78..6a80730a 100644 --- a/node_modules/cordova-common/src/ConfigChanges/ConfigChanges.js +++ b/node_modules/cordova-common/src/ConfigChanges/ConfigChanges.js @@ -148,6 +148,11 @@ function add_plugin_changes(pluginInfo, plugin_vars, is_top_level, should_increm } else { var isConflictingInfo = is_conflicting(edit_config_changes, platform_config.config_munge, self, plugin_force); + + if (isConflictingInfo.conflictWithConfigxml) { + throw new Error(pluginInfo.id + + ' cannot be added. changes in this plugin conflicts with changes in config.xml. Conflicts must be resolved before plugin can be added.'); + } if (plugin_force) { CordovaLogger.get().log(CordovaLogger.WARN, '--force is used. edit-config will overwrite conflicts if any. Conflicting plugins may not work as expected.'); @@ -170,7 +175,67 @@ function add_plugin_changes(pluginInfo, plugin_vars, is_top_level, should_increm config_munge = self.generate_plugin_config_munge(pluginInfo, plugin_vars, edit_config_changes); } } - // global munge looks at all plugins' changes to config files + + self = munge_helper(should_increment, self, platform_config, config_munge); + + // Move to installed/dependent_plugins + self.platformJson.addPlugin(pluginInfo.id, plugin_vars || {}, is_top_level); + return self; +} + + +// Handle edit-config changes from config.xml +PlatformMunger.prototype.add_config_changes = add_config_changes; +function add_config_changes(config, should_increment) { + var self = this; + var platform_config = self.platformJson.root; + + var config_munge; + var edit_config_changes = null; + if(config.getEditConfigs) { + edit_config_changes = config.getEditConfigs(self.platform); + } + + if (!edit_config_changes || edit_config_changes.length === 0) { + // There are no edit-config changes to add, return here + return self; + } + else { + var isConflictingInfo = is_conflicting(edit_config_changes, platform_config.config_munge, self, true /*always force overwrite other edit-config*/); + + if(isConflictingInfo.conflictFound) { + var conflict_munge; + var conflict_file; + + if (Object.keys(isConflictingInfo.configxmlMunge.files).length !== 0) { + // silently remove conflicting config.xml munges so new munges can be added + conflict_munge = mungeutil.decrement_munge(platform_config.config_munge, isConflictingInfo.configxmlMunge); + for (conflict_file in conflict_munge.files) { + self.apply_file_munge(conflict_file, conflict_munge.files[conflict_file], /* remove = */ true); + } + } + if (Object.keys(isConflictingInfo.conflictingMunge.files).length !== 0) { + CordovaLogger.get().log(CordovaLogger.WARN, 'Conflict found, edit-config changes from config.xml will overwrite plugin.xml changes'); + + // remove conflicting plugin.xml munges + conflict_munge = mungeutil.decrement_munge(platform_config.config_munge, isConflictingInfo.conflictingMunge); + for (conflict_file in conflict_munge.files) { + self.apply_file_munge(conflict_file, conflict_munge.files[conflict_file], /* remove = */ true); + } + } + } + // Add config.xml edit-config munges + config_munge = self.generate_config_xml_munge(config, edit_config_changes, 'config.xml'); + } + + self = munge_helper(should_increment, self, platform_config, config_munge); + + // Move to installed/dependent_plugins + return self; +} + +function munge_helper(should_increment, self, platform_config, config_munge) { + // global munge looks at all changes to config files // TODO: The should_increment param is only used by cordova-cli and is going away soon. // If should_increment is set to false, avoid modifying the global_munge (use clone) @@ -196,11 +261,10 @@ function add_plugin_changes(pluginInfo, plugin_vars, is_top_level, should_increm }); /* jshint loopfunc:false */ } + self.apply_file_munge(file, munge.files[file]); } - // Move to installed/dependent_plugins - self.platformJson.addPlugin(pluginInfo.id, plugin_vars || {}, is_top_level); return self; } @@ -221,6 +285,39 @@ function reapply_global_munge () { return self; } +// generate_plugin_config_munge +// Generate the munge object from config.xml +PlatformMunger.prototype.generate_config_xml_munge = generate_config_xml_munge; +function generate_config_xml_munge(config, edit_config_changes, type) { + + var munge = { files: {} }; + var changes = edit_config_changes; + var id; + + if(!changes) { + return munge; + } + + if (type === 'config.xml') { + id = type; + } + else { + id = config.id; + } + + changes.forEach(function(change) { + change.xmls.forEach(function(xml) { + // 1. stringify each xml + var stringified = (new et.ElementTree(xml)).write({xml_declaration:false}); + // 2. add into munge + if (change.mode) { + mungeutil.deep_add(munge, change.file, change.target, { xml: stringified, count: 1, mode: change.mode, id: id }); + } + }); + }); + return munge; +} + // generate_plugin_config_munge // Generate the munge object from plugin.xml + vars @@ -335,7 +432,9 @@ function generate_plugin_config_munge(pluginInfo, vars, edit_config_changes) { } // 2. add into munge if (change.mode) { - mungeutil.deep_add(munge, change.file, change.target, { xml: stringified, count: 1, mode: change.mode, plugin: pluginInfo.id }); + if (change.mode !== 'remove') { + mungeutil.deep_add(munge, change.file, change.target, { xml: stringified, count: 1, mode: change.mode, plugin: pluginInfo.id }); + } } else { mungeutil.deep_add(munge, change.target, change.parent, { xml: stringified, count: 1, after: change.after }); @@ -348,7 +447,9 @@ function generate_plugin_config_munge(pluginInfo, vars, edit_config_changes) { function is_conflicting(editchanges, config_munge, self, force) { var files = config_munge.files; var conflictFound = false; + var conflictWithConfigxml = false; var conflictingMunge = { files: {} }; + var configxmlMunge = { files: {} }; var conflictingParent; var conflictingPlugin; @@ -378,23 +479,43 @@ function is_conflicting(editchanges, config_munge, self, force) { conflictingParent = editchange.target; } - if (target.length !== 0) { - // conflict has been found, exit and throw an error + if (target && target.length !== 0) { + // conflict has been found conflictFound = true; - if (!force) { - // since there has been modifications to the attributes at this target, - // the current plugin should not modify the attributes - conflictingPlugin = target[0].plugin; - return; - } - // need to find all conflicts when --force is used, track conflicting munges - mungeutil.deep_add(conflictingMunge, editchange.file, conflictingParent, target[0]); + if (editchange.id === 'config.xml') { + if (target[0].id === 'config.xml') { + // Keep track of config.xml/config.xml edit-config conflicts + mungeutil.deep_add(configxmlMunge, editchange.file, conflictingParent, target[0]); + } + else { + // Keep track of config.xml x plugin.xml edit-config conflicts + mungeutil.deep_add(conflictingMunge, editchange.file, conflictingParent, target[0]); + } + } + else { + if (target[0].id === 'config.xml') { + // plugin.xml cannot overwrite config.xml changes even if --force is used + conflictWithConfigxml = true; + return; + } + + if (force) { + // Need to find all conflicts when --force is used, track conflicting munges + mungeutil.deep_add(conflictingMunge, editchange.file, conflictingParent, target[0]); + } + else { + // plugin cannot overwrite other plugin changes without --force + conflictingPlugin = target[0].plugin; + return; + } + } } } }); - return {conflictFound: conflictFound, conflictingPlugin: conflictingPlugin, conflictingMunge: conflictingMunge}; + return {conflictFound: conflictFound, conflictingPlugin: conflictingPlugin, conflictingMunge: conflictingMunge, + configxmlMunge: configxmlMunge, conflictWithConfigxml:conflictWithConfigxml}; } // Go over the prepare queue and apply the config munges for each plugin diff --git a/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js b/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js index 179d54d1..4a580087 100644 --- a/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js +++ b/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js @@ -110,6 +110,9 @@ ConfigFile.prototype.graft_child = function ConfigFile_graft_child(selector, xml case 'overwrite': result = modules.xml_helpers.graftXMLOverwrite(self.data, xml_to_graft, selector, xml_child); break; + case 'remove': + result= true; + break; default: result = modules.xml_helpers.graftXML(self.data, xml_to_graft, selector, xml_child.after); } @@ -137,6 +140,9 @@ ConfigFile.prototype.prune_child = function ConfigFile_prune_child(selector, xml case 'overwrite': result = modules.xml_helpers.pruneXMLRestore(self.data, selector, xml_child); break; + case 'remove': + result = modules.xml_helpers.prunXMLRemove(self.data, selector, xml_to_graft); + break; default: result = modules.xml_helpers.pruneXML(self.data, xml_to_graft, selector); } @@ -193,6 +199,12 @@ function resolveConfigFilePath(project_dir, platform, file) { return filepath; } + // XXX this checks for android studio projects + // only if none of the options above are satisfied does this get called + if(platform === 'android' && !fs.existsSync(filepath)) { + filepath = path.join(project_dir, 'app', 'src', 'main', 'res', 'xml', 'config.xml'); + } + // None of the special cases matched, returning project_dir/file. return filepath; } diff --git a/node_modules/cordova-common/src/ConfigParser/ConfigParser.js b/node_modules/cordova-common/src/ConfigParser/ConfigParser.js index 195164a9..6e74ce3d 100644 --- a/node_modules/cordova-common/src/ConfigParser/ConfigParser.js +++ b/node_modules/cordova-common/src/ConfigParser/ConfigParser.js @@ -448,10 +448,19 @@ ConfigParser.prototype = { return accesses.map(function(access){ var minimum_tls_version = access.attrib['minimum-tls-version']; /* String */ var requires_forward_secrecy = access.attrib['requires-forward-secrecy']; /* Boolean */ + var requires_certificate_transparency = access.attrib['requires-certificate-transparency']; /* Boolean */ + var allows_arbitrary_loads_in_web_content = access.attrib['allows-arbitrary-loads-in-web-content']; /* Boolean */ + var allows_arbitrary_loads_in_media = access.attrib['allows-arbitrary-loads-in-media']; /* Boolean */ + var allows_local_networking = access.attrib['allows-local-networking']; /* Boolean */ + return { 'origin': access.attrib.origin, 'minimum_tls_version': minimum_tls_version, - 'requires_forward_secrecy' : requires_forward_secrecy + 'requires_forward_secrecy' : requires_forward_secrecy, + 'requires_certificate_transparency' : requires_certificate_transparency, + 'allows_arbitrary_loads_in_web_content' : allows_arbitrary_loads_in_web_content, + 'allows_arbitrary_loads_in_media' : allows_arbitrary_loads_in_media, + 'allows_local_networking' : allows_local_networking }; }); }, @@ -461,13 +470,44 @@ ConfigParser.prototype = { return allow_navigations.map(function(allow_navigation){ var minimum_tls_version = allow_navigation.attrib['minimum-tls-version']; /* String */ var requires_forward_secrecy = allow_navigation.attrib['requires-forward-secrecy']; /* Boolean */ + var requires_certificate_transparency = allow_navigation.attrib['requires-certificate-transparency']; /* Boolean */ + return { 'href': allow_navigation.attrib.href, 'minimum_tls_version': minimum_tls_version, - 'requires_forward_secrecy' : requires_forward_secrecy + 'requires_forward_secrecy' : requires_forward_secrecy, + 'requires_certificate_transparency' : requires_certificate_transparency }; }); }, + /* Get all the allow-intent tags */ + getAllowIntents: function() { + var allow_intents = this.doc.findall('./allow-intent'); + return allow_intents.map(function(allow_intent){ + return { + 'href': allow_intent.attrib.href + }; + }); + }, + /* Get all edit-config tags */ + getEditConfigs: function(platform) { + var platform_tag = this.doc.find('./platform[@name="' + platform + '"]'); + var platform_edit_configs = platform_tag ? platform_tag.findall('edit-config') : []; + + var edit_configs = this.doc.findall('edit-config').concat(platform_edit_configs); + + return edit_configs.map(function(tag) { + var editConfig = + { + file : tag.attrib['file'], + target : tag.attrib['target'], + mode : tag.attrib['mode'], + id : 'config.xml', + xmls : tag.getchildren() + }; + return editConfig; + }); + }, write:function() { fs.writeFileSync(this.path, this.doc.write({indent: 4}), 'utf-8'); } diff --git a/node_modules/cordova-common/src/FileUpdater.js b/node_modules/cordova-common/src/FileUpdater.js index a09f39c2..8b6876bf 100644 --- a/node_modules/cordova-common/src/FileUpdater.js +++ b/node_modules/cordova-common/src/FileUpdater.js @@ -285,14 +285,14 @@ function mergeAndUpdateDir(sourceDirs, targetDir, options, log) { } // Scan the files in each of the source directories. - var sourceMaps = []; - for (var i in sourceDirs) { - var sourceFullPath = path.join(rootDir, sourceDirs[i]); - if (!fs.existsSync(sourceFullPath)) { - throw new Error("Source directory does not exist: " + sourceDirs[i]); - } - sourceMaps[i] = mapDirectory(rootDir, sourceDirs[i], include, exclude); - } + var sourceMaps = sourceDirs.map(function (sourceDir) { + return path.join(rootDir, sourceDir); + }).map(function (sourcePath) { + if (!fs.existsSync(sourcePath)) { + throw new Error("Source directory does not exist: " + sourcePath); + } + return mapDirectory(rootDir, path.relative(rootDir, sourcePath), include, exclude); + }); // Scan the files in the target directory, if it exists. var targetMap = {}; @@ -331,46 +331,40 @@ function mapDirectory(rootDir, subDir, include, exclude) { function mapSubdirectory(rootDir, subDir, relativeDir, include, exclude, dirMap) { var itemMapped = false; var items = fs.readdirSync(path.join(rootDir, subDir, relativeDir)); - for (var i in items) { - var relativePath = path.join(relativeDir, items[i]); - // Skip any files or directories (and everything under) that match an exclude glob. - if (matchGlobArray(relativePath, exclude)) { - continue; - } + items.forEach(function(item) { + var relativePath = path.join(relativeDir, item); + if(!matchGlobArray(relativePath, exclude)) { + // Stats obtained here (required at least to know where to recurse in directories) + // are saved for later, where the modified times may also be used. This minimizes + // the number of file I/O operations performed. + var fullPath = path.join(rootDir, subDir, relativePath); + var stats = fs.statSync(fullPath); - // Stats obtained here (required at least to know where to recurse in directories) - // are saved for later, where the modified times may also be used. This minimizes - // the number of file I/O operations performed. - var fullPath = path.join(rootDir, subDir, relativePath); - var stats = fs.statSync(fullPath); - - if (stats.isDirectory()) { - // Directories are included if either something under them is included or they - // match an include glob. - if (mapSubdirectory(rootDir, subDir, relativePath, include, exclude, dirMap) || - matchGlobArray(relativePath, include)) { - dirMap[relativePath] = { subDir: subDir, stats: stats }; - itemMapped = true; - } - } else if (stats.isFile()) { - // Files are included only if they match an include glob. - if (matchGlobArray(relativePath, include)) { - dirMap[relativePath] = { subDir: subDir, stats: stats }; - itemMapped = true; + if (stats.isDirectory()) { + // Directories are included if either something under them is included or they + // match an include glob. + if (mapSubdirectory(rootDir, subDir, relativePath, include, exclude, dirMap) || + matchGlobArray(relativePath, include)) { + dirMap[relativePath] = { subDir: subDir, stats: stats }; + itemMapped = true; + } + } else if (stats.isFile()) { + // Files are included only if they match an include glob. + if (matchGlobArray(relativePath, include)) { + dirMap[relativePath] = { subDir: subDir, stats: stats }; + itemMapped = true; + } } } - } + }); return itemMapped; } function matchGlobArray(path, globs) { - for (var i in globs) { - if (minimatch(path, globs[i])) { - return true; - } - } - return false; + return globs.some(function(elem) { + return minimatch(path, elem, {dot:true}); + }); } } @@ -384,7 +378,7 @@ function mergePathMaps(sourceMaps, targetMap, targetDir) { // Target stats will be filled in below for targets that exist. var pathMap = {}; sourceMaps.forEach(function (sourceMap) { - for (var sourceSubPath in sourceMap) { + Object.keys(sourceMap).forEach(function(sourceSubPath){ var sourceEntry = sourceMap[sourceSubPath]; pathMap[sourceSubPath] = { targetPath: path.join(targetDir, sourceSubPath), @@ -392,12 +386,12 @@ function mergePathMaps(sourceMaps, targetMap, targetDir) { sourcePath: path.join(sourceEntry.subDir, sourceSubPath), sourceStats: sourceEntry.stats }; - } + }); }); // Fill in target stats for targets that exist, and create entries // for targets that don't have any corresponding sources. - for (var subPath in targetMap) { + Object.keys(targetMap).forEach(function(subPath){ var entry = pathMap[subPath]; if (entry) { entry.targetStats = targetMap[subPath].stats; @@ -409,7 +403,7 @@ function mergePathMaps(sourceMaps, targetMap, targetDir) { sourceStats: null }; } - } + }); return pathMap; } diff --git a/node_modules/cordova-common/src/util/xml-helpers.js b/node_modules/cordova-common/src/util/xml-helpers.js index 4b630fa7..9a1e82dd 100644 --- a/node_modules/cordova-common/src/util/xml-helpers.js +++ b/node_modules/cordova-common/src/util/xml-helpers.js @@ -160,6 +160,23 @@ module.exports = { return true; }, + prunXMLRemove: function(doc, selector, nodes) { + var target = module.exports.resolveParent(doc, selector); + if (!target) return false; + + nodes.forEach(function (node) { + var attributes = node.attrib; + for (var attribute in attributes) { + if (target.attrib[attribute]) { + delete target.attrib[attribute]; + } + } + }); + + return true; + + }, + parseElementtreeSync: function (filename) { var contents = fs.readFileSync(filename, 'utf-8'); diff --git a/node_modules/glob/package.json b/node_modules/glob/package.json index e7d40047..2823a1c8 100644 --- a/node_modules/glob/package.json +++ b/node_modules/glob/package.json @@ -35,7 +35,8 @@ "type": "range" }, "_requiredBy": [ - "/cordova-common" + "/cordova-common", + "/istanbul" ], "_resolved": "http://registry.npmjs.org/glob/-/glob-5.0.15.tgz", "_shasum": "1bc936b9e02f4a603fcc222ecf7633d30b8b93b1", diff --git a/node_modules/inflight/inflight.js b/node_modules/inflight/inflight.js index 8bc96cbd..48202b3c 100644 --- a/node_modules/inflight/inflight.js +++ b/node_modules/inflight/inflight.js @@ -19,18 +19,28 @@ function makeres (key) { var cbs = reqs[key] var len = cbs.length var args = slice(arguments) - for (var i = 0; i < len; i++) { - cbs[i].apply(null, args) - } - if (cbs.length > len) { - // added more in the interim. - // de-zalgo, just in case, but don't call again. - cbs.splice(0, len) - process.nextTick(function () { - RES.apply(null, args) - }) - } else { - delete reqs[key] + + // XXX It's somewhat ambiguous whether a new callback added in this + // pass should be queued for later execution if something in the + // list of callbacks throws, or if it should just be discarded. + // However, it's such an edge case that it hardly matters, and either + // choice is likely as surprising as the other. + // As it happens, we do go ahead and schedule it for later execution. + try { + for (var i = 0; i < len; i++) { + cbs[i].apply(null, args) + } + } finally { + if (cbs.length > len) { + // added more in the interim. + // de-zalgo, just in case, but don't call again. + cbs.splice(0, len) + process.nextTick(function () { + RES.apply(null, args) + }) + } else { + delete reqs[key] + } } }) } diff --git a/node_modules/inflight/package.json b/node_modules/inflight/package.json index 5a67ac8f..2d302583 100644 --- a/node_modules/inflight/package.json +++ b/node_modules/inflight/package.json @@ -14,20 +14,20 @@ ] ], "_from": "inflight@>=1.0.4 <2.0.0", - "_id": "inflight@1.0.5", + "_id": "inflight@1.0.6", "_inCache": true, "_installable": true, "_location": "/inflight", - "_nodeVersion": "5.10.1", + "_nodeVersion": "6.5.0", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/inflight-1.0.5.tgz_1463529611443_0.00041943578980863094" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/inflight-1.0.6.tgz_1476330807696_0.10388551792129874" }, "_npmUser": { - "name": "zkat", - "email": "kat@sykosomatic.org" + "name": "isaacs", + "email": "i@izs.me" }, - "_npmVersion": "3.9.1", + "_npmVersion": "3.10.7", "_phantomChildren": {}, "_requested": { "raw": "inflight@^1.0.4", @@ -39,10 +39,11 @@ "type": "range" }, "_requiredBy": [ + "/cli/glob", "/glob" ], - "_resolved": "http://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz", - "_shasum": "db3204cd5a9de2e6cd890b85c6e2f66bcf4f620a", + "_resolved": "http://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "_shasum": "49bd6331d7d02d0c09bc910a1075ba8165b56df9", "_shrinkwrap": null, "_spec": "inflight@^1.0.4", "_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/glob", @@ -60,17 +61,17 @@ }, "description": "Add callbacks to requests in flight to avoid async duplication", "devDependencies": { - "tap": "^1.2.0" + "tap": "^7.1.2" }, "directories": {}, "dist": { - "shasum": "db3204cd5a9de2e6cd890b85c6e2f66bcf4f620a", - "tarball": "https://registry.npmjs.org/inflight/-/inflight-1.0.5.tgz" + "shasum": "49bd6331d7d02d0c09bc910a1075ba8165b56df9", + "tarball": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz" }, "files": [ "inflight.js" ], - "gitHead": "559e37b4f6327fca797fe8d7fe8ed6d9cae08821", + "gitHead": "a547881738c8f57b27795e584071d67cf6ac1a57", "homepage": "https://github.com/isaacs/inflight", "license": "ISC", "main": "inflight.js", @@ -100,7 +101,7 @@ "url": "git+https://github.com/npm/inflight.git" }, "scripts": { - "test": "tap test.js" + "test": "tap test.js --100" }, - "version": "1.0.5" + "version": "1.0.6" } diff --git a/node_modules/inherits/inherits.js b/node_modules/inherits/inherits.js index 29f5e24f..3b94763a 100644 --- a/node_modules/inherits/inherits.js +++ b/node_modules/inherits/inherits.js @@ -1 +1,7 @@ -module.exports = require('util').inherits +try { + var util = require('util'); + if (typeof util.inherits !== 'function') throw ''; + module.exports = util.inherits; +} catch (e) { + module.exports = require('./inherits_browser.js'); +} diff --git a/node_modules/inherits/package.json b/node_modules/inherits/package.json index 44dcb9a4..740569dd 100644 --- a/node_modules/inherits/package.json +++ b/node_modules/inherits/package.json @@ -14,15 +14,20 @@ ] ], "_from": "inherits@>=2.0.0 <3.0.0", - "_id": "inherits@2.0.1", + "_id": "inherits@2.0.3", "_inCache": true, "_installable": true, "_location": "/inherits", + "_nodeVersion": "6.5.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/inherits-2.0.3.tgz_1473295776489_0.08142363070510328" + }, "_npmUser": { "name": "isaacs", "email": "i@izs.me" }, - "_npmVersion": "1.3.8", + "_npmVersion": "3.10.7", "_phantomChildren": {}, "_requested": { "raw": "inherits@2", @@ -34,10 +39,13 @@ "type": "range" }, "_requiredBy": [ - "/glob" + "/cli/glob", + "/fileset/glob", + "/glob", + "/readable-stream" ], - "_resolved": "http://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "_shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", + "_resolved": "http://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "_shasum": "633c2c83e3da42a502f52466022480f4208261de", "_shrinkwrap": null, "_spec": "inherits@2", "_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/glob", @@ -47,12 +55,19 @@ }, "dependencies": {}, "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", - "devDependencies": {}, + "devDependencies": { + "tap": "^7.1.0" + }, "directories": {}, "dist": { - "shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", - "tarball": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz" + "shasum": "633c2c83e3da42a502f52466022480f4208261de", + "tarball": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" }, + "files": [ + "inherits.js", + "inherits_browser.js" + ], + "gitHead": "e05d0fb27c61a3ec687214f0476386b765364d5f", "homepage": "https://github.com/isaacs/inherits#readme", "keywords": [ "inheritance", @@ -82,5 +97,5 @@ "scripts": { "test": "node test" }, - "version": "2.0.1" + "version": "2.0.3" } diff --git a/node_modules/inherits/test.js b/node_modules/inherits/test.js deleted file mode 100644 index fc53012d..00000000 --- a/node_modules/inherits/test.js +++ /dev/null @@ -1,25 +0,0 @@ -var inherits = require('./inherits.js') -var assert = require('assert') - -function test(c) { - assert(c.constructor === Child) - assert(c.constructor.super_ === Parent) - assert(Object.getPrototypeOf(c) === Child.prototype) - assert(Object.getPrototypeOf(Object.getPrototypeOf(c)) === Parent.prototype) - assert(c instanceof Child) - assert(c instanceof Parent) -} - -function Child() { - Parent.call(this) - test(this) -} - -function Parent() {} - -inherits(Child, Parent) - -var c = new Child -test(c) - -console.log('ok') diff --git a/node_modules/minimatch/package.json b/node_modules/minimatch/package.json index a5dbca35..43a68539 100644 --- a/node_modules/minimatch/package.json +++ b/node_modules/minimatch/package.json @@ -39,8 +39,10 @@ "type": "range" }, "_requiredBy": [ + "/cli/glob", "/cordova-common", - "/glob" + "/glob", + "/jshint" ], "_resolved": "http://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", "_shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774", diff --git a/node_modules/nopt/package.json b/node_modules/nopt/package.json index e0e7cba6..4a994381 100644 --- a/node_modules/nopt/package.json +++ b/node_modules/nopt/package.json @@ -35,7 +35,8 @@ "type": "range" }, "_requiredBy": [ - "/" + "/", + "/istanbul" ], "_resolved": "http://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", "_shasum": "c6465dbf08abcd4db359317f79ac68a646b28ff9", diff --git a/node_modules/once/README.md b/node_modules/once/README.md index a2981ea0..1f1ffca9 100644 --- a/node_modules/once/README.md +++ b/node_modules/once/README.md @@ -49,3 +49,31 @@ function load (cb) { }) } ``` + +## `once.strict(func)` + +Throw an error if the function is called twice. + +Some functions are expected to be called only once. Using `once` for them would +potentially hide logical errors. + +In the example below, the `greet` function has to call the callback only once: + +```javascript +function greet (name, cb) { + // return is missing from the if statement + // when no name is passed, the callback is called twice + if (!name) cb('Hello anonymous') + cb('Hello ' + name) +} + +function log (msg) { + console.log(msg) +} + +// this will print 'Hello anonymous' but the logical error will be missed +greet(null, once(msg)) + +// once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time +greet(null, once.strict(msg)) +``` diff --git a/node_modules/once/once.js b/node_modules/once/once.js index 2e1e721b..23540673 100644 --- a/node_modules/once/once.js +++ b/node_modules/once/once.js @@ -1,5 +1,6 @@ var wrappy = require('wrappy') module.exports = wrappy(once) +module.exports.strict = wrappy(onceStrict) once.proto = once(function () { Object.defineProperty(Function.prototype, 'once', { @@ -8,6 +9,13 @@ once.proto = once(function () { }, configurable: true }) + + Object.defineProperty(Function.prototype, 'onceStrict', { + value: function () { + return onceStrict(this) + }, + configurable: true + }) }) function once (fn) { @@ -19,3 +27,16 @@ function once (fn) { f.called = false return f } + +function onceStrict (fn) { + var f = function () { + if (f.called) + throw new Error(f.onceError) + f.called = true + return f.value = fn.apply(this, arguments) + } + var name = fn.name || 'Function wrapped with `once`' + f.onceError = name + " shouldn't be called more than once" + f.called = false + return f +} diff --git a/node_modules/once/package.json b/node_modules/once/package.json index 18f3d69b..37547957 100644 --- a/node_modules/once/package.json +++ b/node_modules/once/package.json @@ -14,16 +14,20 @@ ] ], "_from": "once@>=1.3.0 <2.0.0", - "_id": "once@1.3.3", + "_id": "once@1.4.0", "_inCache": true, "_installable": true, "_location": "/once", - "_nodeVersion": "4.0.0", + "_nodeVersion": "6.5.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/once-1.4.0.tgz_1473196269128_0.537820661207661" + }, "_npmUser": { "name": "isaacs", "email": "i@izs.me" }, - "_npmVersion": "3.3.2", + "_npmVersion": "3.10.7", "_phantomChildren": {}, "_requested": { "raw": "once@^1.3.0", @@ -35,11 +39,13 @@ "type": "range" }, "_requiredBy": [ + "/cli/glob", "/glob", - "/inflight" + "/inflight", + "/istanbul" ], - "_resolved": "http://registry.npmjs.org/once/-/once-1.3.3.tgz", - "_shasum": "b2e261557ce4c314ec8304f3fa82663e4297ca20", + "_resolved": "http://registry.npmjs.org/once/-/once-1.4.0.tgz", + "_shasum": "583b1aa775961d4b113ac17d9c50baef9dd76bd1", "_shrinkwrap": null, "_spec": "once@^1.3.0", "_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/glob", @@ -56,19 +62,19 @@ }, "description": "Run a function exactly one time", "devDependencies": { - "tap": "^1.2.0" + "tap": "^7.0.1" }, "directories": { "test": "test" }, "dist": { - "shasum": "b2e261557ce4c314ec8304f3fa82663e4297ca20", - "tarball": "https://registry.npmjs.org/once/-/once-1.3.3.tgz" + "shasum": "583b1aa775961d4b113ac17d9c50baef9dd76bd1", + "tarball": "https://registry.npmjs.org/once/-/once-1.4.0.tgz" }, "files": [ "once.js" ], - "gitHead": "2ad558657e17fafd24803217ba854762842e4178", + "gitHead": "0e614d9f5a7e6f0305c625f6b581f6d80b33b8a6", "homepage": "https://github.com/isaacs/once#readme", "keywords": [ "once", @@ -94,5 +100,5 @@ "scripts": { "test": "tap test/*.js" }, - "version": "1.3.3" + "version": "1.4.0" } diff --git a/node_modules/os-homedir/package.json b/node_modules/os-homedir/package.json index d4a14644..8f7e04af 100644 --- a/node_modules/os-homedir/package.json +++ b/node_modules/os-homedir/package.json @@ -14,16 +14,20 @@ ] ], "_from": "os-homedir@>=1.0.0 <2.0.0", - "_id": "os-homedir@1.0.1", + "_id": "os-homedir@1.0.2", "_inCache": true, "_installable": true, "_location": "/os-homedir", - "_nodeVersion": "0.12.5", + "_nodeVersion": "6.6.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/os-homedir-1.0.2.tgz_1475211519628_0.7873868853785098" + }, "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, - "_npmVersion": "2.11.2", + "_npmVersion": "3.10.3", "_phantomChildren": {}, "_requested": { "raw": "os-homedir@^1.0.0", @@ -37,8 +41,8 @@ "_requiredBy": [ "/osenv" ], - "_resolved": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.1.tgz", - "_shasum": "0d62bdf44b916fd3bbdcf2cab191948fb094f007", + "_resolved": "http://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "_shasum": "ffbc4988336e0e833de0c168c7ef152121aa7fb3", "_shrinkwrap": null, "_spec": "os-homedir@^1.0.0", "_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/osenv", @@ -51,15 +55,16 @@ "url": "https://github.com/sindresorhus/os-homedir/issues" }, "dependencies": {}, - "description": "io.js 2.3.0 os.homedir() ponyfill", + "description": "Node.js 4 `os.homedir()` ponyfill", "devDependencies": { - "ava": "0.0.4", - "path-exists": "^1.0.0" + "ava": "*", + "path-exists": "^2.0.0", + "xo": "^0.16.0" }, "directories": {}, "dist": { - "shasum": "0d62bdf44b916fd3bbdcf2cab191948fb094f007", - "tarball": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.1.tgz" + "shasum": "ffbc4988336e0e833de0c168c7ef152121aa7fb3", + "tarball": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz" }, "engines": { "node": ">=0.10.0" @@ -67,10 +72,10 @@ "files": [ "index.js" ], - "gitHead": "13ff83fbd13ebe286a6092286b2c634ab4534c5f", - "homepage": "https://github.com/sindresorhus/os-homedir", + "gitHead": "b1b0ae70a5965fef7005ff6509a5dd1a78c95e36", + "homepage": "https://github.com/sindresorhus/os-homedir#readme", "keywords": [ - "built-in", + "builtin", "core", "ponyfill", "polyfill", @@ -99,7 +104,7 @@ "url": "git+https://github.com/sindresorhus/os-homedir.git" }, "scripts": { - "test": "node test.js" + "test": "xo && ava" }, - "version": "1.0.1" + "version": "1.0.2" } diff --git a/node_modules/os-homedir/readme.md b/node_modules/os-homedir/readme.md index 4851f104..856ae615 100644 --- a/node_modules/os-homedir/readme.md +++ b/node_modules/os-homedir/readme.md @@ -1,8 +1,6 @@ # os-homedir [![Build Status](https://travis-ci.org/sindresorhus/os-homedir.svg?branch=master)](https://travis-ci.org/sindresorhus/os-homedir) -> io.js 2.3.0 [`os.homedir()`](https://iojs.org/api/os.html#os_os_homedir) ponyfill - -> Ponyfill: A polyfill that doesn't overwrite the native method +> Node.js 4 [`os.homedir()`](https://nodejs.org/api/os.html#os_os_homedir) [ponyfill](https://ponyfill.com) ## Install @@ -15,10 +13,10 @@ $ npm install --save os-homedir ## Usage ```js -var osHomedir = require('os-homedir'); +const osHomedir = require('os-homedir'); console.log(osHomedir()); -//=> /Users/sindresorhus +//=> '/Users/sindresorhus' ``` @@ -30,4 +28,4 @@ console.log(osHomedir()); ## License -MIT © [Sindre Sorhus](http://sindresorhus.com) +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/os-tmpdir/index.js b/node_modules/os-tmpdir/index.js index 52d90bf2..2077b1ce 100644 --- a/node_modules/os-tmpdir/index.js +++ b/node_modules/os-tmpdir/index.js @@ -2,7 +2,7 @@ var isWindows = process.platform === 'win32'; var trailingSlashRe = isWindows ? /[^:]\\$/ : /.\/$/; -// https://github.com/nodejs/io.js/blob/3e7a14381497a3b73dda68d05b5130563cdab420/lib/os.js#L25-L43 +// https://github.com/nodejs/node/blob/3e7a14381497a3b73dda68d05b5130563cdab420/lib/os.js#L25-L43 module.exports = function () { var path; diff --git a/node_modules/os-tmpdir/package.json b/node_modules/os-tmpdir/package.json index 7ba6e21b..6b3203ba 100644 --- a/node_modules/os-tmpdir/package.json +++ b/node_modules/os-tmpdir/package.json @@ -14,16 +14,20 @@ ] ], "_from": "os-tmpdir@>=1.0.0 <2.0.0", - "_id": "os-tmpdir@1.0.1", + "_id": "os-tmpdir@1.0.2", "_inCache": true, "_installable": true, "_location": "/os-tmpdir", - "_nodeVersion": "0.12.3", + "_nodeVersion": "6.6.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/os-tmpdir-1.0.2.tgz_1475211274587_0.14931037812493742" + }, "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, - "_npmVersion": "2.9.1", + "_npmVersion": "3.10.3", "_phantomChildren": {}, "_requested": { "raw": "os-tmpdir@^1.0.0", @@ -37,8 +41,8 @@ "_requiredBy": [ "/osenv" ], - "_resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.1.tgz", - "_shasum": "e9b423a1edaf479882562e92ed71d7743a071b6e", + "_resolved": "http://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "_shasum": "bbe67406c79aa85c5cfec766fe5734555dfa1274", "_shrinkwrap": null, "_spec": "os-tmpdir@^1.0.0", "_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/osenv", @@ -53,12 +57,13 @@ "dependencies": {}, "description": "Node.js os.tmpdir() ponyfill", "devDependencies": { - "ava": "0.0.4" + "ava": "*", + "xo": "^0.16.0" }, "directories": {}, "dist": { - "shasum": "e9b423a1edaf479882562e92ed71d7743a071b6e", - "tarball": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.1.tgz" + "shasum": "bbe67406c79aa85c5cfec766fe5734555dfa1274", + "tarball": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz" }, "engines": { "node": ">=0.10.0" @@ -66,8 +71,8 @@ "files": [ "index.js" ], - "gitHead": "5c5d355f81378980db629d60128ad03e02b1c1e5", - "homepage": "https://github.com/sindresorhus/os-tmpdir", + "gitHead": "1abf9cf5611b4be7377060ea67054b45cbf6813c", + "homepage": "https://github.com/sindresorhus/os-tmpdir#readme", "keywords": [ "built-in", "core", @@ -99,7 +104,7 @@ "url": "git+https://github.com/sindresorhus/os-tmpdir.git" }, "scripts": { - "test": "node test.js" + "test": "xo && ava" }, - "version": "1.0.1" + "version": "1.0.2" } diff --git a/node_modules/os-tmpdir/readme.md b/node_modules/os-tmpdir/readme.md index 54d4c6ec..c09f7ed8 100644 --- a/node_modules/os-tmpdir/readme.md +++ b/node_modules/os-tmpdir/readme.md @@ -1,12 +1,8 @@ # os-tmpdir [![Build Status](https://travis-ci.org/sindresorhus/os-tmpdir.svg?branch=master)](https://travis-ci.org/sindresorhus/os-tmpdir) -> Node.js [`os.tmpdir()`](https://nodejs.org/api/os.html#os_os_tmpdir) ponyfill +> Node.js [`os.tmpdir()`](https://nodejs.org/api/os.html#os_os_tmpdir) [ponyfill](https://ponyfill.com) -> Ponyfill: A polyfill that doesn't overwrite the native method - -Use this instead of `require('os').tmpdir()` to get a consistent behaviour on different Node.js versions (even 0.8). - -*This is actually taken from io.js 2.0.2 as it contains some fixes that haven't bubbled up to Node.js yet.* +Use this instead of `require('os').tmpdir()` to get a consistent behavior on different Node.js versions (even 0.8). ## Install @@ -19,10 +15,10 @@ $ npm install --save os-tmpdir ## Usage ```js -var osTmpdir = require('os-tmpdir'); +const osTmpdir = require('os-tmpdir'); osTmpdir(); -//=> /var/folders/m3/5574nnhn0yj488ccryqr7tc80000gn/T +//=> '/var/folders/m3/5574nnhn0yj488ccryqr7tc80000gn/T' ``` @@ -33,4 +29,4 @@ See the [`os.tmpdir()` docs](https://nodejs.org/api/os.html#os_os_tmpdir). ## License -MIT © [Sindre Sorhus](http://sindresorhus.com) +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/path-is-absolute/index.js b/node_modules/path-is-absolute/index.js index 19f103f9..22aa6c35 100644 --- a/node_modules/path-is-absolute/index.js +++ b/node_modules/path-is-absolute/index.js @@ -2,18 +2,18 @@ function posix(path) { return path.charAt(0) === '/'; -}; +} function win32(path) { - // https://github.com/joyent/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 + // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; var result = splitDeviceRe.exec(path); var device = result[1] || ''; - var isUnc = !!device && device.charAt(1) !== ':'; + var isUnc = Boolean(device && device.charAt(1) !== ':'); // UNC paths are always absolute - return !!result[2] || isUnc; -}; + return Boolean(result[2] || isUnc); +} module.exports = process.platform === 'win32' ? win32 : posix; module.exports.posix = posix; diff --git a/node_modules/path-is-absolute/package.json b/node_modules/path-is-absolute/package.json index d296c78f..0225c39f 100644 --- a/node_modules/path-is-absolute/package.json +++ b/node_modules/path-is-absolute/package.json @@ -14,16 +14,20 @@ ] ], "_from": "path-is-absolute@>=1.0.0 <2.0.0", - "_id": "path-is-absolute@1.0.0", + "_id": "path-is-absolute@1.0.1", "_inCache": true, "_installable": true, "_location": "/path-is-absolute", - "_nodeVersion": "0.12.0", + "_nodeVersion": "6.6.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/path-is-absolute-1.0.1.tgz_1475210523565_0.9876507974695414" + }, "_npmUser": { "name": "sindresorhus", "email": "sindresorhus@gmail.com" }, - "_npmVersion": "2.5.1", + "_npmVersion": "3.10.3", "_phantomChildren": {}, "_requested": { "raw": "path-is-absolute@^1.0.0", @@ -35,10 +39,11 @@ "type": "range" }, "_requiredBy": [ + "/cli/glob", "/glob" ], - "_resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz", - "_shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912", + "_resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "_shasum": "174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f", "_shrinkwrap": null, "_spec": "path-is-absolute@^1.0.0", "_where": "/Users/steveng/repo/cordova/cordova-android/node_modules/glob", @@ -52,11 +57,13 @@ }, "dependencies": {}, "description": "Node.js 0.12 path.isAbsolute() ponyfill", - "devDependencies": {}, + "devDependencies": { + "xo": "^0.16.0" + }, "directories": {}, "dist": { - "shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912", - "tarball": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz" + "shasum": "174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f", + "tarball": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz" }, "engines": { "node": ">=0.10.0" @@ -64,8 +71,8 @@ "files": [ "index.js" ], - "gitHead": "7a76a0c9f2263192beedbe0a820e4d0baee5b7a1", - "homepage": "https://github.com/sindresorhus/path-is-absolute", + "gitHead": "edc91d348b21dac2ab65ea2fbec2868e2eff5eb6", + "homepage": "https://github.com/sindresorhus/path-is-absolute#readme", "keywords": [ "path", "paths", @@ -100,7 +107,7 @@ "url": "git+https://github.com/sindresorhus/path-is-absolute.git" }, "scripts": { - "test": "node test.js" + "test": "xo && node test.js" }, - "version": "1.0.0" + "version": "1.0.1" } diff --git a/node_modules/path-is-absolute/readme.md b/node_modules/path-is-absolute/readme.md index cdf94f43..8dbdf5fc 100644 --- a/node_modules/path-is-absolute/readme.md +++ b/node_modules/path-is-absolute/readme.md @@ -1,8 +1,6 @@ # path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute) -> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) ponyfill - -> Ponyfill: A polyfill that doesn't overwrite the native method +> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) [ponyfill](https://ponyfill.com) ## Install @@ -15,19 +13,29 @@ $ npm install --save path-is-absolute ## Usage ```js -var pathIsAbsolute = require('path-is-absolute'); +const pathIsAbsolute = require('path-is-absolute'); -// Linux +// Running on Linux pathIsAbsolute('/home/foo'); //=> true +pathIsAbsolute('C:/Users/foo'); +//=> false -// Windows -pathIsAbsolute('C:/Users/'); +// Running on Windows +pathIsAbsolute('C:/Users/foo'); //=> true +pathIsAbsolute('/home/foo'); +//=> false -// Any OS +// Running on any OS pathIsAbsolute.posix('/home/foo'); //=> true +pathIsAbsolute.posix('C:/Users/foo'); +//=> false +pathIsAbsolute.win32('C:/Users/foo'); +//=> true +pathIsAbsolute.win32('/home/foo'); +//=> false ``` @@ -39,13 +47,13 @@ See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isa ### pathIsAbsolute.posix(path) -The Posix specific version. +POSIX specific version. ### pathIsAbsolute.win32(path) -The Windows specific version. +Windows specific version. ## License -MIT © [Sindre Sorhus](http://sindresorhus.com) +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/node_modules/underscore/package.json b/node_modules/underscore/package.json index fb23b70e..095e1fa1 100644 --- a/node_modules/underscore/package.json +++ b/node_modules/underscore/package.json @@ -34,7 +34,8 @@ "type": "range" }, "_requiredBy": [ - "/cordova-common" + "/cordova-common", + "/jasmine-node" ], "_resolved": "http://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", "_shasum": "4f3fb53b106e6097fcf9cb4109f2a5e9bdfa5022", diff --git a/package.json b/package.json index 170d4c02..8fd5d8c4 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "author": "Apache Software Foundation", "license": "Apache-2.0", "dependencies": { - "cordova-common": "^1.4.0", + "cordova-common": "^1.5.0", "elementtree": "^0.1.6", "nopt": "^3.0.1", "properties-parser": "^0.2.3",