diff --git a/node_modules/abbrev/LICENSE b/node_modules/abbrev/LICENSE index 19129e31..9bcfa9d7 100644 --- a/node_modules/abbrev/LICENSE +++ b/node_modules/abbrev/LICENSE @@ -1,3 +1,8 @@ +This software is dual-licensed under the ISC and MIT licenses. +You may use this software under EITHER of the following licenses. + +---------- + The ISC License Copyright (c) Isaac Z. Schlueter and Contributors @@ -13,3 +18,29 @@ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +---------- + +Copyright Isaac Z. Schlueter and Contributors +All rights reserved. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. diff --git a/node_modules/abbrev/package.json b/node_modules/abbrev/package.json index 9fadf3ed..d5a9ebcd 100644 --- a/node_modules/abbrev/package.json +++ b/node_modules/abbrev/package.json @@ -14,19 +14,19 @@ ] ], "_from": "abbrev@>=1.0.0 <2.0.0", - "_id": "abbrev@1.1.0", + "_id": "abbrev@1.1.1", "_inCache": true, "_location": "/abbrev", - "_nodeVersion": "8.0.0-pre", + "_nodeVersion": "8.5.0", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/abbrev-1.1.0.tgz_1487054000015_0.9229173036292195" + "host": "s3://npm-registry-packages", + "tmp": "tmp/abbrev-1.1.1.tgz_1506566833068_0.05750026390887797" }, "_npmUser": { "name": "isaacs", "email": "i@izs.me" }, - "_npmVersion": "4.3.0", + "_npmVersion": "5.4.2", "_phantomChildren": {}, "_requested": { "raw": "abbrev@1", @@ -40,8 +40,8 @@ "_requiredBy": [ "/nopt" ], - "_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz", - "_shasum": "d0554c2256636e2f56e7c2e5ad183f859428d81f", + "_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "_shasum": "f8f2c887ad10bf67f634f005b6987fed3179aac8", "_shrinkwrap": null, "_spec": "abbrev@1", "_where": "/Users/jbowser/cordova/cordova-android/node_modules/nopt", @@ -59,17 +59,22 @@ }, "directories": {}, "dist": { - "shasum": "d0554c2256636e2f56e7c2e5ad183f859428d81f", - "tarball": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.0.tgz" + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "shasum": "f8f2c887ad10bf67f634f005b6987fed3179aac8", + "tarball": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz" }, "files": [ "abbrev.js" ], - "gitHead": "7136d4d95449dc44115d4f78b80ec907724f64e0", + "gitHead": "a9ee72ebc8fe3975f1b0c7aeb3a8f2a806a432eb", "homepage": "https://github.com/isaacs/abbrev-js#readme", "license": "ISC", "main": "abbrev.js", "maintainers": [ + { + "name": "gabra", + "email": "jerry+1@npmjs.com" + }, { "name": "isaacs", "email": "i@izs.me" @@ -88,5 +93,5 @@ "preversion": "npm test", "test": "tap test.js --100" }, - "version": "1.1.0" + "version": "1.1.1" } diff --git a/node_modules/android-versions/package.json b/node_modules/android-versions/package.json index e47f4248..564f2a5e 100644 --- a/node_modules/android-versions/package.json +++ b/node_modules/android-versions/package.json @@ -2,18 +2,18 @@ "_args": [ [ { - "raw": "android-versions@^1.2.0", + "raw": "android-versions@^1.2.1", "scope": null, "escapedName": "android-versions", "name": "android-versions", - "rawSpec": "^1.2.0", - "spec": ">=1.2.0 <2.0.0", + "rawSpec": "^1.2.1", + "spec": ">=1.2.1 <2.0.0", "type": "range" }, "/Users/jbowser/cordova/cordova-android" ] ], - "_from": "android-versions@>=1.2.0 <2.0.0", + "_from": "android-versions@>=1.2.1 <2.0.0", "_id": "android-versions@1.2.1", "_inCache": true, "_location": "/android-versions", @@ -29,12 +29,12 @@ "_npmVersion": "5.4.0", "_phantomChildren": {}, "_requested": { - "raw": "android-versions@^1.2.0", + "raw": "android-versions@^1.2.1", "scope": null, "escapedName": "android-versions", "name": "android-versions", - "rawSpec": "^1.2.0", - "spec": ">=1.2.0 <2.0.0", + "rawSpec": "^1.2.1", + "spec": ">=1.2.1 <2.0.0", "type": "range" }, "_requiredBy": [ @@ -43,7 +43,7 @@ "_resolved": "https://registry.npmjs.org/android-versions/-/android-versions-1.2.1.tgz", "_shasum": "3f50baf693e73a512c3c5403542291cead900063", "_shrinkwrap": null, - "_spec": "android-versions@^1.2.0", + "_spec": "android-versions@^1.2.1", "_where": "/Users/jbowser/cordova/cordova-android", "author": { "name": "dvoiss" diff --git a/node_modules/big-integer/BigInteger.d.ts b/node_modules/big-integer/BigInteger.d.ts index 3cd4c0e3..d70e401b 100644 --- a/node_modules/big-integer/BigInteger.d.ts +++ b/node_modules/big-integer/BigInteger.d.ts @@ -346,6 +346,11 @@ declare namespace bigInt { * Converts a bigInt to a string. */ toString(radix?: number): string; + + /** + * Converts a bigInt to a string. This method is called behind the scenes in JSON.stringify. + */ + toJSON(): string; /** * Converts a bigInt to a native Javascript number. This override allows you to use native diff --git a/node_modules/big-integer/BigInteger.js b/node_modules/big-integer/BigInteger.js index 8ba88436..9a65a5f4 100644 --- a/node_modules/big-integer/BigInteger.js +++ b/node_modules/big-integer/BigInteger.js @@ -873,7 +873,7 @@ var bigInt = (function (undefined) { }; var powersOfTwo = [1]; - while (powersOfTwo[powersOfTwo.length - 1] <= BASE) powersOfTwo.push(2 * powersOfTwo[powersOfTwo.length - 1]); + while (2 * powersOfTwo[powersOfTwo.length - 1] <= BASE) powersOfTwo.push(2 * powersOfTwo[powersOfTwo.length - 1]); var powers2Length = powersOfTwo.length, highestPower2 = powersOfTwo[powers2Length - 1]; function shift_isSmall(n) { @@ -920,31 +920,29 @@ var bigInt = (function (undefined) { var xSign = x.isNegative(), ySign = y.isNegative(); var xRem = xSign ? x.not() : x, yRem = ySign ? y.not() : y; - var xBits = [], yBits = []; - var xStop = false, yStop = false; - while (!xStop || !yStop) { - if (xRem.isZero()) { // virtual sign extension for simulating two's complement - xStop = true; - xBits.push(xSign ? 1 : 0); - } - else if (xSign) xBits.push(xRem.isEven() ? 1 : 0); // two's complement for negative numbers - else xBits.push(xRem.isEven() ? 0 : 1); - - if (yRem.isZero()) { - yStop = true; - yBits.push(ySign ? 1 : 0); - } - else if (ySign) yBits.push(yRem.isEven() ? 1 : 0); - else yBits.push(yRem.isEven() ? 0 : 1); - - xRem = xRem.over(2); - yRem = yRem.over(2); - } + var xDigit = 0, yDigit = 0; + var xDivMod = null, yDivMod = null; var result = []; - for (var i = 0; i < xBits.length; i++) result.push(fn(xBits[i], yBits[i])); - var sum = bigInt(result.pop()).negate().times(bigInt(2).pow(result.length)); - while (result.length) { - sum = sum.add(bigInt(result.pop()).times(bigInt(2).pow(result.length))); + while (!xRem.isZero() || !yRem.isZero()) { + xDivMod = divModAny(xRem, highestPower2); + xDigit = xDivMod[1].toJSNumber(); + if (xSign) { + xDigit = highestPower2 - 1 - xDigit; // two's complement for negative numbers + } + + yDivMod = divModAny(yRem, highestPower2); + yDigit = yDivMod[1].toJSNumber(); + if (ySign) { + yDigit = highestPower2 - 1 - yDigit; // two's complement for negative numbers + } + + xRem = xDivMod[0]; + yRem = yDivMod[0]; + result.push(fn(xDigit, yDigit)); + } + var sum = fn(xSign ? 1 : 0, ySign ? 1 : 0) !== 0 ? bigInt(-1) : bigInt(0); + for (var i = result.length - 1; i >= 0; i -= 1) { + sum = sum.multiply(highestPower2).add(bigInt(result[i])); } return sum; } @@ -1023,8 +1021,8 @@ var bigInt = (function (undefined) { a = parseValue(a); b = parseValue(b); var low = min(a, b), high = max(a, b); - var range = high.subtract(low); - if (range.isSmall) return low.add(Math.round(Math.random() * range)); + var range = high.subtract(low).add(1); + if (range.isSmall) return low.add(Math.floor(Math.random() * range)); var length = range.value.length - 1; var result = [], restricted = true; for (var i = length; i >= 0; i--) { diff --git a/node_modules/big-integer/BigInteger.min.js b/node_modules/big-integer/BigInteger.min.js index 99ea9fbe..a868e442 100644 --- a/node_modules/big-integer/BigInteger.min.js +++ b/node_modules/big-integer/BigInteger.min.js @@ -1 +1 @@ -var bigInt=function(undefined){"use strict";var BASE=1e7,LOG_BASE=7,MAX_INT=9007199254740992,MAX_INT_ARR=smallToArray(MAX_INT),LOG_MAX_INT=Math.log(MAX_INT);function Integer(v,radix){if(typeof v==="undefined")return Integer[0];if(typeof radix!=="undefined")return+radix===10?parseValue(v):parseBase(v,radix);return parseValue(v)}function BigInteger(value,sign){this.value=value;this.sign=sign;this.isSmall=false}BigInteger.prototype=Object.create(Integer.prototype);function SmallInteger(value){this.value=value;this.sign=value<0;this.isSmall=true}SmallInteger.prototype=Object.create(Integer.prototype);function isPrecise(n){return-MAX_INT0)return Math.floor(n);return Math.ceil(n)}function add(a,b){var l_a=a.length,l_b=b.length,r=new Array(l_a),carry=0,base=BASE,sum,i;for(i=0;i=base?1:0;r[i]=sum-carry*base}while(i0)r.push(carry);return r}function addAny(a,b){if(a.length>=b.length)return add(a,b);return add(b,a)}function addSmall(a,carry){var l=a.length,r=new Array(l),base=BASE,sum,i;for(i=0;i0){r[i++]=carry%base;carry=Math.floor(carry/base)}return r}BigInteger.prototype.add=function(v){var n=parseValue(v);if(this.sign!==n.sign){return this.subtract(n.negate())}var a=this.value,b=n.value;if(n.isSmall){return new BigInteger(addSmall(a,Math.abs(b)),this.sign)}return new BigInteger(addAny(a,b),this.sign)};BigInteger.prototype.plus=BigInteger.prototype.add;SmallInteger.prototype.add=function(v){var n=parseValue(v);var a=this.value;if(a<0!==n.sign){return this.subtract(n.negate())}var b=n.value;if(n.isSmall){if(isPrecise(a+b))return new SmallInteger(a+b);b=smallToArray(Math.abs(b))}return new BigInteger(addSmall(b,Math.abs(a)),a<0)};SmallInteger.prototype.plus=SmallInteger.prototype.add;function subtract(a,b){var a_l=a.length,b_l=b.length,r=new Array(a_l),borrow=0,base=BASE,i,difference;for(i=0;i=0){value=subtract(a,b)}else{value=subtract(b,a);sign=!sign}value=arrayToSmall(value);if(typeof value==="number"){if(sign)value=-value;return new SmallInteger(value)}return new BigInteger(value,sign)}function subtractSmall(a,b,sign){var l=a.length,r=new Array(l),carry=-b,base=BASE,i,difference;for(i=0;i=0)};SmallInteger.prototype.minus=SmallInteger.prototype.subtract;BigInteger.prototype.negate=function(){return new BigInteger(this.value,!this.sign)};SmallInteger.prototype.negate=function(){var sign=this.sign;var small=new SmallInteger(-this.value);small.sign=!sign;return small};BigInteger.prototype.abs=function(){return new BigInteger(this.value,false)};SmallInteger.prototype.abs=function(){return new SmallInteger(Math.abs(this.value))};function multiplyLong(a,b){var a_l=a.length,b_l=b.length,l=a_l+b_l,r=createArray(l),base=BASE,product,carry,i,a_i,b_j;for(i=0;i0){r[i++]=carry%base;carry=Math.floor(carry/base)}return r}function shiftLeft(x,n){var r=[];while(n-- >0)r.push(0);return r.concat(x)}function multiplyKaratsuba(x,y){var n=Math.max(x.length,y.length);if(n<=30)return multiplyLong(x,y);n=Math.ceil(n/2);var b=x.slice(n),a=x.slice(0,n),d=y.slice(n),c=y.slice(0,n);var ac=multiplyKaratsuba(a,c),bd=multiplyKaratsuba(b,d),abcd=multiplyKaratsuba(addAny(a,b),addAny(c,d));var product=addAny(addAny(ac,shiftLeft(subtract(subtract(abcd,ac),bd),n)),shiftLeft(bd,2*n));trim(product);return product}function useKaratsuba(l1,l2){return-.012*l1-.012*l2+15e-6*l1*l2>0}BigInteger.prototype.multiply=function(v){var n=parseValue(v),a=this.value,b=n.value,sign=this.sign!==n.sign,abs;if(n.isSmall){if(b===0)return Integer[0];if(b===1)return this;if(b===-1)return this.negate();abs=Math.abs(b);if(abs=0;shift--){quotientDigit=base-1;if(remainder[shift+b_l]!==divisorMostSignificantDigit){quotientDigit=Math.floor((remainder[shift+b_l]*base+remainder[shift+b_l-1])/divisorMostSignificantDigit)}carry=0;borrow=0;l=divisor.length;for(i=0;ib_l){highx=(highx+1)*base}guess=Math.ceil(highx/highy);do{check=multiplySmall(b,guess);if(compareAbs(check,part)<=0)break;guess--}while(guess);result.push(guess);part=subtract(part,check)}result.reverse();return[arrayToSmall(result),arrayToSmall(part)]}function divModSmall(value,lambda){var length=value.length,quotient=createArray(length),base=BASE,i,q,remainder,divisor;remainder=0;for(i=length-1;i>=0;--i){divisor=remainder*base+value[i];q=truncate(divisor/lambda);remainder=divisor-q*lambda;quotient[i]=q|0}return[quotient,remainder|0]}function divModAny(self,v){var value,n=parseValue(v);var a=self.value,b=n.value;var quotient;if(b===0)throw new Error("Cannot divide by zero");if(self.isSmall){if(n.isSmall){return[new SmallInteger(truncate(a/b)),new SmallInteger(a%b)]}return[Integer[0],self]}if(n.isSmall){if(b===1)return[self,Integer[0]];if(b==-1)return[self.negate(),Integer[0]];var abs=Math.abs(b);if(absb.length?1:-1}for(var i=a.length-1;i>=0;i--){if(a[i]!==b[i])return a[i]>b[i]?1:-1}return 0}BigInteger.prototype.compareAbs=function(v){var n=parseValue(v),a=this.value,b=n.value;if(n.isSmall)return 1;return compareAbs(a,b)};SmallInteger.prototype.compareAbs=function(v){var n=parseValue(v),a=Math.abs(this.value),b=n.value;if(n.isSmall){b=Math.abs(b);return a===b?0:a>b?1:-1}return-1};BigInteger.prototype.compare=function(v){if(v===Infinity){return-1}if(v===-Infinity){return 1}var n=parseValue(v),a=this.value,b=n.value;if(this.sign!==n.sign){return n.sign?1:-1}if(n.isSmall){return this.sign?-1:1}return compareAbs(a,b)*(this.sign?-1:1)};BigInteger.prototype.compareTo=BigInteger.prototype.compare;SmallInteger.prototype.compare=function(v){if(v===Infinity){return-1}if(v===-Infinity){return 1}var n=parseValue(v),a=this.value,b=n.value;if(n.isSmall){return a==b?0:a>b?1:-1}if(a<0!==n.sign){return a<0?-1:1}return a<0?1:-1};SmallInteger.prototype.compareTo=SmallInteger.prototype.compare;BigInteger.prototype.equals=function(v){return this.compare(v)===0};SmallInteger.prototype.eq=SmallInteger.prototype.equals=BigInteger.prototype.eq=BigInteger.prototype.equals;BigInteger.prototype.notEquals=function(v){return this.compare(v)!==0};SmallInteger.prototype.neq=SmallInteger.prototype.notEquals=BigInteger.prototype.neq=BigInteger.prototype.notEquals;BigInteger.prototype.greater=function(v){return this.compare(v)>0};SmallInteger.prototype.gt=SmallInteger.prototype.greater=BigInteger.prototype.gt=BigInteger.prototype.greater;BigInteger.prototype.lesser=function(v){return this.compare(v)<0};SmallInteger.prototype.lt=SmallInteger.prototype.lesser=BigInteger.prototype.lt=BigInteger.prototype.lesser;BigInteger.prototype.greaterOrEquals=function(v){return this.compare(v)>=0};SmallInteger.prototype.geq=SmallInteger.prototype.greaterOrEquals=BigInteger.prototype.geq=BigInteger.prototype.greaterOrEquals;BigInteger.prototype.lesserOrEquals=function(v){return this.compare(v)<=0};SmallInteger.prototype.leq=SmallInteger.prototype.lesserOrEquals=BigInteger.prototype.leq=BigInteger.prototype.lesserOrEquals;BigInteger.prototype.isEven=function(){return(this.value[0]&1)===0};SmallInteger.prototype.isEven=function(){return(this.value&1)===0};BigInteger.prototype.isOdd=function(){return(this.value[0]&1)===1};SmallInteger.prototype.isOdd=function(){return(this.value&1)===1};BigInteger.prototype.isPositive=function(){return!this.sign};SmallInteger.prototype.isPositive=function(){return this.value>0};BigInteger.prototype.isNegative=function(){return this.sign};SmallInteger.prototype.isNegative=function(){return this.value<0};BigInteger.prototype.isUnit=function(){return false};SmallInteger.prototype.isUnit=function(){return Math.abs(this.value)===1};BigInteger.prototype.isZero=function(){return false};SmallInteger.prototype.isZero=function(){return this.value===0};BigInteger.prototype.isDivisibleBy=function(v){var n=parseValue(v);var value=n.value;if(value===0)return false;if(value===1)return true;if(value===2)return this.isEven();return this.mod(n).equals(Integer[0])};SmallInteger.prototype.isDivisibleBy=BigInteger.prototype.isDivisibleBy;function isBasicPrime(v){var n=v.abs();if(n.isUnit())return false;if(n.equals(2)||n.equals(3)||n.equals(5))return true;if(n.isEven()||n.isDivisibleBy(3)||n.isDivisibleBy(5))return false;if(n.lesser(25))return true}BigInteger.prototype.isPrime=function(){var isPrime=isBasicPrime(this);if(isPrime!==undefined)return isPrime;var n=this.abs(),nPrev=n.prev();var a=[2,3,5,7,11,13,17,19],b=nPrev,d,t,i,x;while(b.isEven())b=b.divide(2);for(i=0;i-MAX_INT)return new SmallInteger(value-1);return new BigInteger(MAX_INT_ARR,true)};var powersOfTwo=[1];while(powersOfTwo[powersOfTwo.length-1]<=BASE)powersOfTwo.push(2*powersOfTwo[powersOfTwo.length-1]);var powers2Length=powersOfTwo.length,highestPower2=powersOfTwo[powers2Length-1];function shift_isSmall(n){return(typeof n==="number"||typeof n==="string")&&+Math.abs(n)<=BASE||n instanceof BigInteger&&n.value.length<=1}BigInteger.prototype.shiftLeft=function(n){if(!shift_isSmall(n)){throw new Error(String(n)+" is too large for shifting.")}n=+n;if(n<0)return this.shiftRight(-n);var result=this;while(n>=powers2Length){result=result.multiply(highestPower2);n-=powers2Length-1}return result.multiply(powersOfTwo[n])};SmallInteger.prototype.shiftLeft=BigInteger.prototype.shiftLeft;BigInteger.prototype.shiftRight=function(n){var remQuo;if(!shift_isSmall(n)){throw new Error(String(n)+" is too large for shifting.")}n=+n;if(n<0)return this.shiftLeft(-n);var result=this;while(n>=powers2Length){if(result.isZero())return result;remQuo=divModAny(result,highestPower2);result=remQuo[1].isNegative()?remQuo[0].prev():remQuo[0];n-=powers2Length-1}remQuo=divModAny(result,powersOfTwo[n]);return remQuo[1].isNegative()?remQuo[0].prev():remQuo[0]};SmallInteger.prototype.shiftRight=BigInteger.prototype.shiftRight;function bitwise(x,y,fn){y=parseValue(y);var xSign=x.isNegative(),ySign=y.isNegative();var xRem=xSign?x.not():x,yRem=ySign?y.not():y;var xBits=[],yBits=[];var xStop=false,yStop=false;while(!xStop||!yStop){if(xRem.isZero()){xStop=true;xBits.push(xSign?1:0)}else if(xSign)xBits.push(xRem.isEven()?1:0);else xBits.push(xRem.isEven()?0:1);if(yRem.isZero()){yStop=true;yBits.push(ySign?1:0)}else if(ySign)yBits.push(yRem.isEven()?1:0);else yBits.push(yRem.isEven()?0:1);xRem=xRem.over(2);yRem=yRem.over(2)}var result=[];for(var i=0;i=0;i--){var top=restricted?range.value[i]:BASE;var digit=truncate(Math.random()*top);result.unshift(digit);if(digit=absBase){if(c==="1"&&absBase===1)continue;throw new Error(c+" is not a valid digit in base "+base+".")}else if(c.charCodeAt(0)-87>=absBase){throw new Error(c+" is not a valid digit in base "+base+".")}}}if(2<=base&&base<=36){if(length<=LOG_MAX_INT/Math.log(base)){var result=parseInt(text,base);if(isNaN(result)){throw new Error(c+" is not a valid digit in base "+base+".")}return new SmallInteger(parseInt(text,base))}}base=parseValue(base);var digits=[];var isNegative=text[0]==="-";for(i=isNegative?1:0;i");digits.push(parseValue(text.slice(start+1,i)))}else throw new Error(c+" is not a valid character")}return parseBaseFromArray(digits,base,isNegative)};function parseBaseFromArray(digits,base,isNegative){var val=Integer[0],pow=Integer[1],i;for(i=digits.length-1;i>=0;i--){val=val.add(digits[i].times(pow));pow=pow.times(base)}return isNegative?val.negate():val}function stringify(digit){var v=digit.value;if(typeof v==="number")v=[v];if(v.length===1&&v[0]<=35){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(v[0])}return"<"+v+">"}function toBase(n,base){base=bigInt(base);if(base.isZero()){if(n.isZero())return"0";throw new Error("Cannot convert nonzero numbers to base 0.")}if(base.equals(-1)){if(n.isZero())return"0";if(n.isNegative())return new Array(1-n).join("10");return"1"+new Array(+n).join("01")}var minusSign="";if(n.isNegative()&&base.isPositive()){minusSign="-";n=n.abs()}if(base.equals(1)){if(n.isZero())return"0";return minusSign+new Array(+n+1).join(1)}var out=[];var left=n,divmod;while(left.isNegative()||left.compareAbs(base)>=0){divmod=left.divmod(base);left=divmod.quotient;var digit=divmod.remainder;if(digit.isNegative()){digit=base.minus(digit).abs();left=left.next()}out.push(stringify(digit))}out.push(stringify(left));return minusSign+out.reverse().join("")}BigInteger.prototype.toString=function(radix){if(radix===undefined)radix=10;if(radix!==10)return toBase(this,radix);var v=this.value,l=v.length,str=String(v[--l]),zeros="0000000",digit;while(--l>=0){digit=String(v[l]);str+=zeros.slice(digit.length)+digit}var sign=this.sign?"-":"";return sign+str};SmallInteger.prototype.toString=function(radix){if(radix===undefined)radix=10;if(radix!=10)return toBase(this,radix);return String(this.value)};BigInteger.prototype.toJSON=SmallInteger.prototype.toJSON=function(){return this.toString()};BigInteger.prototype.valueOf=function(){return+this.toString()};BigInteger.prototype.toJSNumber=BigInteger.prototype.valueOf;SmallInteger.prototype.valueOf=function(){return this.value};SmallInteger.prototype.toJSNumber=SmallInteger.prototype.valueOf;function parseStringValue(v){if(isPrecise(+v)){var x=+v;if(x===truncate(x))return new SmallInteger(x);throw"Invalid integer: "+v}var sign=v[0]==="-";if(sign)v=v.slice(1);var split=v.split(/e/i);if(split.length>2)throw new Error("Invalid integer: "+split.join("e"));if(split.length===2){var exp=split[1];if(exp[0]==="+")exp=exp.slice(1);exp=+exp;if(exp!==truncate(exp)||!isPrecise(exp))throw new Error("Invalid integer: "+exp+" is not a valid exponent.");var text=split[0];var decimalPlace=text.indexOf(".");if(decimalPlace>=0){exp-=text.length-decimalPlace-1;text=text.slice(0,decimalPlace)+text.slice(decimalPlace+1)}if(exp<0)throw new Error("Cannot include negative exponent part for integers");text+=new Array(exp+1).join("0");v=text}var isValid=/^([0-9][0-9]*)$/.test(v);if(!isValid)throw new Error("Invalid integer: "+v);var r=[],max=v.length,l=LOG_BASE,min=max-l;while(max>0){r.push(+v.slice(min,max));min-=l;if(min<0)min=0;max-=l}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.");return new SmallInteger(v)}return parseStringValue(v.toString())}function parseValue(v){if(typeof v==="number"){return parseNumberValue(v)}if(typeof v==="string"){return parseStringValue(v)}return v}for(var i=0;i<1e3;i++){Integer[i]=new SmallInteger(i);if(i>0)Integer[-i]=new SmallInteger(-i)}Integer.one=Integer[1];Integer.zero=Integer[0];Integer.minusOne=Integer[-1];Integer.max=max;Integer.min=min;Integer.gcd=gcd;Integer.lcm=lcm;Integer.isInstance=function(x){return x instanceof BigInteger||x instanceof SmallInteger};Integer.randBetween=randBetween;Integer.fromArray=function(digits,base,isNegative){return parseBaseFromArray(digits.map(parseValue),parseValue(base||10),isNegative)};return Integer}();if(typeof module!=="undefined"&&module.hasOwnProperty("exports")){module.exports=bigInt}if(typeof define==="function"&&define.amd){define("big-integer",[],function(){return bigInt})} \ No newline at end of file +var bigInt=function(undefined){"use strict";var BASE=1e7,LOG_BASE=7,MAX_INT=9007199254740992,MAX_INT_ARR=smallToArray(MAX_INT),LOG_MAX_INT=Math.log(MAX_INT);function Integer(v,radix){if(typeof v==="undefined")return Integer[0];if(typeof radix!=="undefined")return+radix===10?parseValue(v):parseBase(v,radix);return parseValue(v)}function BigInteger(value,sign){this.value=value;this.sign=sign;this.isSmall=false}BigInteger.prototype=Object.create(Integer.prototype);function SmallInteger(value){this.value=value;this.sign=value<0;this.isSmall=true}SmallInteger.prototype=Object.create(Integer.prototype);function isPrecise(n){return-MAX_INT0)return Math.floor(n);return Math.ceil(n)}function add(a,b){var l_a=a.length,l_b=b.length,r=new Array(l_a),carry=0,base=BASE,sum,i;for(i=0;i=base?1:0;r[i]=sum-carry*base}while(i0)r.push(carry);return r}function addAny(a,b){if(a.length>=b.length)return add(a,b);return add(b,a)}function addSmall(a,carry){var l=a.length,r=new Array(l),base=BASE,sum,i;for(i=0;i0){r[i++]=carry%base;carry=Math.floor(carry/base)}return r}BigInteger.prototype.add=function(v){var n=parseValue(v);if(this.sign!==n.sign){return this.subtract(n.negate())}var a=this.value,b=n.value;if(n.isSmall){return new BigInteger(addSmall(a,Math.abs(b)),this.sign)}return new BigInteger(addAny(a,b),this.sign)};BigInteger.prototype.plus=BigInteger.prototype.add;SmallInteger.prototype.add=function(v){var n=parseValue(v);var a=this.value;if(a<0!==n.sign){return this.subtract(n.negate())}var b=n.value;if(n.isSmall){if(isPrecise(a+b))return new SmallInteger(a+b);b=smallToArray(Math.abs(b))}return new BigInteger(addSmall(b,Math.abs(a)),a<0)};SmallInteger.prototype.plus=SmallInteger.prototype.add;function subtract(a,b){var a_l=a.length,b_l=b.length,r=new Array(a_l),borrow=0,base=BASE,i,difference;for(i=0;i=0){value=subtract(a,b)}else{value=subtract(b,a);sign=!sign}value=arrayToSmall(value);if(typeof value==="number"){if(sign)value=-value;return new SmallInteger(value)}return new BigInteger(value,sign)}function subtractSmall(a,b,sign){var l=a.length,r=new Array(l),carry=-b,base=BASE,i,difference;for(i=0;i=0)};SmallInteger.prototype.minus=SmallInteger.prototype.subtract;BigInteger.prototype.negate=function(){return new BigInteger(this.value,!this.sign)};SmallInteger.prototype.negate=function(){var sign=this.sign;var small=new SmallInteger(-this.value);small.sign=!sign;return small};BigInteger.prototype.abs=function(){return new BigInteger(this.value,false)};SmallInteger.prototype.abs=function(){return new SmallInteger(Math.abs(this.value))};function multiplyLong(a,b){var a_l=a.length,b_l=b.length,l=a_l+b_l,r=createArray(l),base=BASE,product,carry,i,a_i,b_j;for(i=0;i0){r[i++]=carry%base;carry=Math.floor(carry/base)}return r}function shiftLeft(x,n){var r=[];while(n-- >0)r.push(0);return r.concat(x)}function multiplyKaratsuba(x,y){var n=Math.max(x.length,y.length);if(n<=30)return multiplyLong(x,y);n=Math.ceil(n/2);var b=x.slice(n),a=x.slice(0,n),d=y.slice(n),c=y.slice(0,n);var ac=multiplyKaratsuba(a,c),bd=multiplyKaratsuba(b,d),abcd=multiplyKaratsuba(addAny(a,b),addAny(c,d));var product=addAny(addAny(ac,shiftLeft(subtract(subtract(abcd,ac),bd),n)),shiftLeft(bd,2*n));trim(product);return product}function useKaratsuba(l1,l2){return-.012*l1-.012*l2+15e-6*l1*l2>0}BigInteger.prototype.multiply=function(v){var n=parseValue(v),a=this.value,b=n.value,sign=this.sign!==n.sign,abs;if(n.isSmall){if(b===0)return Integer[0];if(b===1)return this;if(b===-1)return this.negate();abs=Math.abs(b);if(abs=0;shift--){quotientDigit=base-1;if(remainder[shift+b_l]!==divisorMostSignificantDigit){quotientDigit=Math.floor((remainder[shift+b_l]*base+remainder[shift+b_l-1])/divisorMostSignificantDigit)}carry=0;borrow=0;l=divisor.length;for(i=0;ib_l){highx=(highx+1)*base}guess=Math.ceil(highx/highy);do{check=multiplySmall(b,guess);if(compareAbs(check,part)<=0)break;guess--}while(guess);result.push(guess);part=subtract(part,check)}result.reverse();return[arrayToSmall(result),arrayToSmall(part)]}function divModSmall(value,lambda){var length=value.length,quotient=createArray(length),base=BASE,i,q,remainder,divisor;remainder=0;for(i=length-1;i>=0;--i){divisor=remainder*base+value[i];q=truncate(divisor/lambda);remainder=divisor-q*lambda;quotient[i]=q|0}return[quotient,remainder|0]}function divModAny(self,v){var value,n=parseValue(v);var a=self.value,b=n.value;var quotient;if(b===0)throw new Error("Cannot divide by zero");if(self.isSmall){if(n.isSmall){return[new SmallInteger(truncate(a/b)),new SmallInteger(a%b)]}return[Integer[0],self]}if(n.isSmall){if(b===1)return[self,Integer[0]];if(b==-1)return[self.negate(),Integer[0]];var abs=Math.abs(b);if(absb.length?1:-1}for(var i=a.length-1;i>=0;i--){if(a[i]!==b[i])return a[i]>b[i]?1:-1}return 0}BigInteger.prototype.compareAbs=function(v){var n=parseValue(v),a=this.value,b=n.value;if(n.isSmall)return 1;return compareAbs(a,b)};SmallInteger.prototype.compareAbs=function(v){var n=parseValue(v),a=Math.abs(this.value),b=n.value;if(n.isSmall){b=Math.abs(b);return a===b?0:a>b?1:-1}return-1};BigInteger.prototype.compare=function(v){if(v===Infinity){return-1}if(v===-Infinity){return 1}var n=parseValue(v),a=this.value,b=n.value;if(this.sign!==n.sign){return n.sign?1:-1}if(n.isSmall){return this.sign?-1:1}return compareAbs(a,b)*(this.sign?-1:1)};BigInteger.prototype.compareTo=BigInteger.prototype.compare;SmallInteger.prototype.compare=function(v){if(v===Infinity){return-1}if(v===-Infinity){return 1}var n=parseValue(v),a=this.value,b=n.value;if(n.isSmall){return a==b?0:a>b?1:-1}if(a<0!==n.sign){return a<0?-1:1}return a<0?1:-1};SmallInteger.prototype.compareTo=SmallInteger.prototype.compare;BigInteger.prototype.equals=function(v){return this.compare(v)===0};SmallInteger.prototype.eq=SmallInteger.prototype.equals=BigInteger.prototype.eq=BigInteger.prototype.equals;BigInteger.prototype.notEquals=function(v){return this.compare(v)!==0};SmallInteger.prototype.neq=SmallInteger.prototype.notEquals=BigInteger.prototype.neq=BigInteger.prototype.notEquals;BigInteger.prototype.greater=function(v){return this.compare(v)>0};SmallInteger.prototype.gt=SmallInteger.prototype.greater=BigInteger.prototype.gt=BigInteger.prototype.greater;BigInteger.prototype.lesser=function(v){return this.compare(v)<0};SmallInteger.prototype.lt=SmallInteger.prototype.lesser=BigInteger.prototype.lt=BigInteger.prototype.lesser;BigInteger.prototype.greaterOrEquals=function(v){return this.compare(v)>=0};SmallInteger.prototype.geq=SmallInteger.prototype.greaterOrEquals=BigInteger.prototype.geq=BigInteger.prototype.greaterOrEquals;BigInteger.prototype.lesserOrEquals=function(v){return this.compare(v)<=0};SmallInteger.prototype.leq=SmallInteger.prototype.lesserOrEquals=BigInteger.prototype.leq=BigInteger.prototype.lesserOrEquals;BigInteger.prototype.isEven=function(){return(this.value[0]&1)===0};SmallInteger.prototype.isEven=function(){return(this.value&1)===0};BigInteger.prototype.isOdd=function(){return(this.value[0]&1)===1};SmallInteger.prototype.isOdd=function(){return(this.value&1)===1};BigInteger.prototype.isPositive=function(){return!this.sign};SmallInteger.prototype.isPositive=function(){return this.value>0};BigInteger.prototype.isNegative=function(){return this.sign};SmallInteger.prototype.isNegative=function(){return this.value<0};BigInteger.prototype.isUnit=function(){return false};SmallInteger.prototype.isUnit=function(){return Math.abs(this.value)===1};BigInteger.prototype.isZero=function(){return false};SmallInteger.prototype.isZero=function(){return this.value===0};BigInteger.prototype.isDivisibleBy=function(v){var n=parseValue(v);var value=n.value;if(value===0)return false;if(value===1)return true;if(value===2)return this.isEven();return this.mod(n).equals(Integer[0])};SmallInteger.prototype.isDivisibleBy=BigInteger.prototype.isDivisibleBy;function isBasicPrime(v){var n=v.abs();if(n.isUnit())return false;if(n.equals(2)||n.equals(3)||n.equals(5))return true;if(n.isEven()||n.isDivisibleBy(3)||n.isDivisibleBy(5))return false;if(n.lesser(25))return true}BigInteger.prototype.isPrime=function(){var isPrime=isBasicPrime(this);if(isPrime!==undefined)return isPrime;var n=this.abs(),nPrev=n.prev();var a=[2,3,5,7,11,13,17,19],b=nPrev,d,t,i,x;while(b.isEven())b=b.divide(2);for(i=0;i-MAX_INT)return new SmallInteger(value-1);return new BigInteger(MAX_INT_ARR,true)};var powersOfTwo=[1];while(2*powersOfTwo[powersOfTwo.length-1]<=BASE)powersOfTwo.push(2*powersOfTwo[powersOfTwo.length-1]);var powers2Length=powersOfTwo.length,highestPower2=powersOfTwo[powers2Length-1];function shift_isSmall(n){return(typeof n==="number"||typeof n==="string")&&+Math.abs(n)<=BASE||n instanceof BigInteger&&n.value.length<=1}BigInteger.prototype.shiftLeft=function(n){if(!shift_isSmall(n)){throw new Error(String(n)+" is too large for shifting.")}n=+n;if(n<0)return this.shiftRight(-n);var result=this;while(n>=powers2Length){result=result.multiply(highestPower2);n-=powers2Length-1}return result.multiply(powersOfTwo[n])};SmallInteger.prototype.shiftLeft=BigInteger.prototype.shiftLeft;BigInteger.prototype.shiftRight=function(n){var remQuo;if(!shift_isSmall(n)){throw new Error(String(n)+" is too large for shifting.")}n=+n;if(n<0)return this.shiftLeft(-n);var result=this;while(n>=powers2Length){if(result.isZero())return result;remQuo=divModAny(result,highestPower2);result=remQuo[1].isNegative()?remQuo[0].prev():remQuo[0];n-=powers2Length-1}remQuo=divModAny(result,powersOfTwo[n]);return remQuo[1].isNegative()?remQuo[0].prev():remQuo[0]};SmallInteger.prototype.shiftRight=BigInteger.prototype.shiftRight;function bitwise(x,y,fn){y=parseValue(y);var xSign=x.isNegative(),ySign=y.isNegative();var xRem=xSign?x.not():x,yRem=ySign?y.not():y;var xDigit=0,yDigit=0;var xDivMod=null,yDivMod=null;var result=[];while(!xRem.isZero()||!yRem.isZero()){xDivMod=divModAny(xRem,highestPower2);xDigit=xDivMod[1].toJSNumber();if(xSign){xDigit=highestPower2-1-xDigit}yDivMod=divModAny(yRem,highestPower2);yDigit=yDivMod[1].toJSNumber();if(ySign){yDigit=highestPower2-1-yDigit}xRem=xDivMod[0];yRem=yDivMod[0];result.push(fn(xDigit,yDigit))}var sum=fn(xSign?1:0,ySign?1:0)!==0?bigInt(-1):bigInt(0);for(var i=result.length-1;i>=0;i-=1){sum=sum.multiply(highestPower2).add(bigInt(result[i]))}return sum}BigInteger.prototype.not=function(){return this.negate().prev()};SmallInteger.prototype.not=BigInteger.prototype.not;BigInteger.prototype.and=function(n){return bitwise(this,n,function(a,b){return a&b})};SmallInteger.prototype.and=BigInteger.prototype.and;BigInteger.prototype.or=function(n){return bitwise(this,n,function(a,b){return a|b})};SmallInteger.prototype.or=BigInteger.prototype.or;BigInteger.prototype.xor=function(n){return bitwise(this,n,function(a,b){return a^b})};SmallInteger.prototype.xor=BigInteger.prototype.xor;var LOBMASK_I=1<<30,LOBMASK_BI=(BASE&-BASE)*(BASE&-BASE)|LOBMASK_I;function roughLOB(n){var v=n.value,x=typeof v==="number"?v|LOBMASK_I:v[0]+v[1]*BASE|LOBMASK_BI;return x&-x}function max(a,b){a=parseValue(a);b=parseValue(b);return a.greater(b)?a:b}function min(a,b){a=parseValue(a);b=parseValue(b);return a.lesser(b)?a:b}function gcd(a,b){a=parseValue(a).abs();b=parseValue(b).abs();if(a.equals(b))return a;if(a.isZero())return b;if(b.isZero())return a;var c=Integer[1],d,t;while(a.isEven()&&b.isEven()){d=Math.min(roughLOB(a),roughLOB(b));a=a.divide(d);b=b.divide(d);c=c.multiply(d)}while(a.isEven()){a=a.divide(roughLOB(a))}do{while(b.isEven()){b=b.divide(roughLOB(b))}if(a.greater(b)){t=b;b=a;a=t}b=b.subtract(a)}while(!b.isZero());return c.isUnit()?a:a.multiply(c)}function lcm(a,b){a=parseValue(a).abs();b=parseValue(b).abs();return a.divide(gcd(a,b)).multiply(b)}function randBetween(a,b){a=parseValue(a);b=parseValue(b);var low=min(a,b),high=max(a,b);var range=high.subtract(low).add(1);if(range.isSmall)return low.add(Math.floor(Math.random()*range));var length=range.value.length-1;var result=[],restricted=true;for(var i=length;i>=0;i--){var top=restricted?range.value[i]:BASE;var digit=truncate(Math.random()*top);result.unshift(digit);if(digit=absBase){if(c==="1"&&absBase===1)continue;throw new Error(c+" is not a valid digit in base "+base+".")}else if(c.charCodeAt(0)-87>=absBase){throw new Error(c+" is not a valid digit in base "+base+".")}}}if(2<=base&&base<=36){if(length<=LOG_MAX_INT/Math.log(base)){var result=parseInt(text,base);if(isNaN(result)){throw new Error(c+" is not a valid digit in base "+base+".")}return new SmallInteger(parseInt(text,base))}}base=parseValue(base);var digits=[];var isNegative=text[0]==="-";for(i=isNegative?1:0;i");digits.push(parseValue(text.slice(start+1,i)))}else throw new Error(c+" is not a valid character")}return parseBaseFromArray(digits,base,isNegative)};function parseBaseFromArray(digits,base,isNegative){var val=Integer[0],pow=Integer[1],i;for(i=digits.length-1;i>=0;i--){val=val.add(digits[i].times(pow));pow=pow.times(base)}return isNegative?val.negate():val}function stringify(digit){var v=digit.value;if(typeof v==="number")v=[v];if(v.length===1&&v[0]<=35){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(v[0])}return"<"+v+">"}function toBase(n,base){base=bigInt(base);if(base.isZero()){if(n.isZero())return"0";throw new Error("Cannot convert nonzero numbers to base 0.")}if(base.equals(-1)){if(n.isZero())return"0";if(n.isNegative())return new Array(1-n).join("10");return"1"+new Array(+n).join("01")}var minusSign="";if(n.isNegative()&&base.isPositive()){minusSign="-";n=n.abs()}if(base.equals(1)){if(n.isZero())return"0";return minusSign+new Array(+n+1).join(1)}var out=[];var left=n,divmod;while(left.isNegative()||left.compareAbs(base)>=0){divmod=left.divmod(base);left=divmod.quotient;var digit=divmod.remainder;if(digit.isNegative()){digit=base.minus(digit).abs();left=left.next()}out.push(stringify(digit))}out.push(stringify(left));return minusSign+out.reverse().join("")}BigInteger.prototype.toString=function(radix){if(radix===undefined)radix=10;if(radix!==10)return toBase(this,radix);var v=this.value,l=v.length,str=String(v[--l]),zeros="0000000",digit;while(--l>=0){digit=String(v[l]);str+=zeros.slice(digit.length)+digit}var sign=this.sign?"-":"";return sign+str};SmallInteger.prototype.toString=function(radix){if(radix===undefined)radix=10;if(radix!=10)return toBase(this,radix);return String(this.value)};BigInteger.prototype.toJSON=SmallInteger.prototype.toJSON=function(){return this.toString()};BigInteger.prototype.valueOf=function(){return+this.toString()};BigInteger.prototype.toJSNumber=BigInteger.prototype.valueOf;SmallInteger.prototype.valueOf=function(){return this.value};SmallInteger.prototype.toJSNumber=SmallInteger.prototype.valueOf;function parseStringValue(v){if(isPrecise(+v)){var x=+v;if(x===truncate(x))return new SmallInteger(x);throw"Invalid integer: "+v}var sign=v[0]==="-";if(sign)v=v.slice(1);var split=v.split(/e/i);if(split.length>2)throw new Error("Invalid integer: "+split.join("e"));if(split.length===2){var exp=split[1];if(exp[0]==="+")exp=exp.slice(1);exp=+exp;if(exp!==truncate(exp)||!isPrecise(exp))throw new Error("Invalid integer: "+exp+" is not a valid exponent.");var text=split[0];var decimalPlace=text.indexOf(".");if(decimalPlace>=0){exp-=text.length-decimalPlace-1;text=text.slice(0,decimalPlace)+text.slice(decimalPlace+1)}if(exp<0)throw new Error("Cannot include negative exponent part for integers");text+=new Array(exp+1).join("0");v=text}var isValid=/^([0-9][0-9]*)$/.test(v);if(!isValid)throw new Error("Invalid integer: "+v);var r=[],max=v.length,l=LOG_BASE,min=max-l;while(max>0){r.push(+v.slice(min,max));min-=l;if(min<0)min=0;max-=l}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.");return new SmallInteger(v)}return parseStringValue(v.toString())}function parseValue(v){if(typeof v==="number"){return parseNumberValue(v)}if(typeof v==="string"){return parseStringValue(v)}return v}for(var i=0;i<1e3;i++){Integer[i]=new SmallInteger(i);if(i>0)Integer[-i]=new SmallInteger(-i)}Integer.one=Integer[1];Integer.zero=Integer[0];Integer.minusOne=Integer[-1];Integer.max=max;Integer.min=min;Integer.gcd=gcd;Integer.lcm=lcm;Integer.isInstance=function(x){return x instanceof BigInteger||x instanceof SmallInteger};Integer.randBetween=randBetween;Integer.fromArray=function(digits,base,isNegative){return parseBaseFromArray(digits.map(parseValue),parseValue(base||10),isNegative)};return Integer}();if(typeof module!=="undefined"&&module.hasOwnProperty("exports")){module.exports=bigInt}if(typeof define==="function"&&define.amd){define("big-integer",[],function(){return bigInt})} \ No newline at end of file diff --git a/node_modules/big-integer/package.json b/node_modules/big-integer/package.json index ef26cbe0..bfe5744b 100644 --- a/node_modules/big-integer/package.json +++ b/node_modules/big-integer/package.json @@ -14,13 +14,13 @@ ] ], "_from": "big-integer@>=1.6.7 <2.0.0", - "_id": "big-integer@1.6.25", + "_id": "big-integer@1.6.26", "_inCache": true, "_location": "/big-integer", "_nodeVersion": "6.10.3", "_npmOperationalInternal": { "host": "s3://npm-registry-packages", - "tmp": "tmp/big-integer-1.6.25.tgz_1504748727289_0.9231066561769694" + "tmp": "tmp/big-integer-1.6.26.tgz_1510889021794_0.842821853235364" }, "_npmUser": { "name": "peterolson", @@ -40,8 +40,8 @@ "_requiredBy": [ "/bplist-parser" ], - "_resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.25.tgz", - "_shasum": "1de45a9f57542ac20121c682f8d642220a34e823", + "_resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.26.tgz", + "_shasum": "3af1672fa62daf2d5ecafacf6e5aa0d25e02c1c8", "_shrinkwrap": null, "_spec": "big-integer@^1.6.7", "_where": "/Users/jbowser/cordova/cordova-android/node_modules/bplist-parser", @@ -72,13 +72,13 @@ }, "directories": {}, "dist": { - "shasum": "1de45a9f57542ac20121c682f8d642220a34e823", - "tarball": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.25.tgz" + "shasum": "3af1672fa62daf2d5ecafacf6e5aa0d25e02c1c8", + "tarball": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.26.tgz" }, "engines": { "node": ">=0.6" }, - "gitHead": "a0c10d68aae8f5df56a67b3e3eb353b428abf170", + "gitHead": "b1c6e0e95eca0a0d19ebbb9cc81ec492448a9e8a", "homepage": "https://github.com/peterolson/BigInteger.js#readme", "keywords": [ "math", @@ -111,5 +111,5 @@ "test": "tsc && node_modules/.bin/karma start my.conf.js && node spec/tsDefinitions.js" }, "typings": "./BigInteger.d.ts", - "version": "1.6.25" + "version": "1.6.26" } diff --git a/node_modules/cordova-common/.travis.yml b/node_modules/cordova-common/.travis.yml index 459273a6..4592c3ee 100644 --- a/node_modules/cordova-common/.travis.yml +++ b/node_modules/cordova-common/.travis.yml @@ -5,6 +5,7 @@ git: node_js: - "4" - "6" + - "8" install: - npm install - npm install -g codecov diff --git a/node_modules/cordova-common/RELEASENOTES.md b/node_modules/cordova-common/RELEASENOTES.md index 5dc4460b..faf75247 100644 --- a/node_modules/cordova-common/RELEASENOTES.md +++ b/node_modules/cordova-common/RELEASENOTES.md @@ -20,6 +20,14 @@ --> # Cordova-common Release Notes +### 2.2.0 (Nov 22, 2017) +* [CB-13471](https://issues.apache.org/jira/browse/CB-13471) File Provider fix belongs in cordova-common +* [CB-11244](https://issues.apache.org/jira/browse/CB-11244) Spot fix for upcoming `cordova-android@7` changes. https://github.com/apache/cordova-android/pull/389 + +### 2.1.1 (Oct 04, 2017) +* [CB-13145](https://issues.apache.org/jira/browse/CB-13145) added `getFrameworks` to unit tests +* [CB-13145](https://issues.apache.org/jira/browse/CB-13145) added variable replacing to framework tag + ### 2.1.0 (August 30, 2017) * [CB-13145](https://issues.apache.org/jira/browse/CB-13145) added variable replacing to `framework` tag * [CB-13211](https://issues.apache.org/jira/browse/CB-13211) Add `allows-arbitrary-loads-for-media` attribute parsing for `getAccesses` diff --git a/node_modules/cordova-common/appveyor.yml b/node_modules/cordova-common/appveyor.yml index 94714f2b..ffe51941 100644 --- a/node_modules/cordova-common/appveyor.yml +++ b/node_modules/cordova-common/appveyor.yml @@ -5,6 +5,7 @@ environment: matrix: - nodejs_version: "4" - nodejs_version: "6" + - nodejs_version: "8" install: - ps: Install-Product node $env:nodejs_version diff --git a/node_modules/cordova-common/package.json b/node_modules/cordova-common/package.json index 3ac0c10b..43b55486 100644 --- a/node_modules/cordova-common/package.json +++ b/node_modules/cordova-common/package.json @@ -2,48 +2,48 @@ "_args": [ [ { - "raw": "cordova-common@^2.1.0", + "raw": "cordova-common@^2.2.0", "scope": null, "escapedName": "cordova-common", "name": "cordova-common", - "rawSpec": "^2.1.0", - "spec": ">=2.1.0 <3.0.0", + "rawSpec": "^2.2.0", + "spec": ">=2.2.0 <3.0.0", "type": "range" }, "/Users/jbowser/cordova/cordova-android" ] ], - "_from": "cordova-common@>=2.1.0 <3.0.0", - "_id": "cordova-common@2.1.0", + "_from": "cordova-common@>=2.2.0 <3.0.0", + "_id": "cordova-common@2.2.0", "_inCache": true, "_location": "/cordova-common", "_nodeVersion": "6.6.0", "_npmOperationalInternal": { "host": "s3://npm-registry-packages", - "tmp": "tmp/cordova-common-2.1.0.tgz_1504306462859_0.04064799007028341" + "tmp": "tmp/cordova-common-2.2.0.tgz_1511807085778_0.6969101736322045" }, "_npmUser": { - "name": "audreyso", - "email": "audreyeso@gmail.com" + "name": "stevegill", + "email": "stevengill97@gmail.com" }, "_npmVersion": "4.6.1", "_phantomChildren": {}, "_requested": { - "raw": "cordova-common@^2.1.0", + "raw": "cordova-common@^2.2.0", "scope": null, "escapedName": "cordova-common", "name": "cordova-common", - "rawSpec": "^2.1.0", - "spec": ">=2.1.0 <3.0.0", + "rawSpec": "^2.2.0", + "spec": ">=2.2.0 <3.0.0", "type": "range" }, "_requiredBy": [ "/" ], - "_resolved": "https://registry.npmjs.org/cordova-common/-/cordova-common-2.1.0.tgz", - "_shasum": "bb357ee1b9825031ed9db3c56b592efe973d1640", + "_resolved": "https://registry.npmjs.org/cordova-common/-/cordova-common-2.2.0.tgz", + "_shasum": "0d00f5bcd2bc6c7d06b1ddc0328aea3fe38bcf07", "_shrinkwrap": null, - "_spec": "cordova-common@^2.1.0", + "_spec": "cordova-common@^2.2.0", "_where": "/Users/jbowser/cordova/cordova-android", "author": { "name": "Apache Software Foundation" @@ -84,8 +84,8 @@ }, "directories": {}, "dist": { - "shasum": "bb357ee1b9825031ed9db3c56b592efe973d1640", - "tarball": "https://registry.npmjs.org/cordova-common/-/cordova-common-2.1.0.tgz" + "shasum": "0d00f5bcd2bc6c7d06b1ddc0328aea3fe38bcf07", + "tarball": "https://registry.npmjs.org/cordova-common/-/cordova-common-2.2.0.tgz" }, "engines": { "node": ">=4.0.0" @@ -144,5 +144,5 @@ "jasmine": "jasmine JASMINE_CONFIG_PATH=spec/support/jasmine.json", "test": "npm run eslint && npm run jasmine" }, - "version": "2.1.0" + "version": "2.2.0" } diff --git a/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js b/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js index a4a73314..ec4a28ae 100644 --- a/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js +++ b/node_modules/cordova-common/src/ConfigChanges/ConfigFile.js @@ -184,16 +184,34 @@ function resolveConfigFilePath (project_dir, platform, file) { return filepath; } - // special-case config.xml target that is just "config.xml". This should be resolved to the real location of the file. - // TODO: move the logic that contains the locations of config.xml from cordova CLI into plugman. + // XXX this checks for android studio projects + // only if none of the options above are satisfied does this get called + // TODO: Move this out of cordova-common and into the platforms somehow + if (platform === 'android' && !fs.existsSync(filepath)) { + if (file === 'AndroidManifest.xml') { + filepath = path.join(project_dir, 'app', 'src', 'main', 'AndroidManifest.xml'); + } else if (file.endsWith('config.xml')) { + filepath = path.join(project_dir, 'app', 'src', 'main', 'res', 'xml', 'config.xml'); + } else if (file.endsWith('strings.xml')) { + // Plugins really shouldn't mess with strings.xml, since it's able to be localized + filepath = path.join(project_dir, 'app', 'src', 'main', 'res', 'values', 'strings.xml'); + } else if (file.match(/res\/xml/)) { + // Catch-all for all other stored XML configuration in legacy plugins + var config_file = path.basename(file); + filepath = path.join(project_dir, 'app', 'src', 'main', 'res', 'xml', config_file); + } + return filepath; + } + + // special-case config.xml target that is just "config.xml" for other platforms. This should + // be resolved to the real location of the file. + // TODO: Move this out of cordova-common into platforms if (file === 'config.xml') { if (platform === 'ubuntu') { filepath = path.join(project_dir, 'config.xml'); } else if (platform === 'ios') { - var iospath = getIOSProjectname(project_dir); + var iospath = module.exports.getIOSProjectname(project_dir); filepath = path.join(project_dir, iospath, 'config.xml'); - } else if (platform === 'android') { - filepath = path.join(project_dir, 'res', 'xml', 'config.xml'); } else { matches = modules.glob.sync(path.join(project_dir, '**', 'config.xml')); if (matches.length) filepath = matches[0]; @@ -201,12 +219,6 @@ 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; } @@ -240,3 +252,6 @@ function isBinaryPlist (filename) { } module.exports = ConfigFile; +module.exports.isBinaryPlist = isBinaryPlist; +module.exports.getIOSProjectname = getIOSProjectname; +module.exports.resolveConfigFilePath = resolveConfigFilePath; diff --git a/node_modules/cordova-common/src/PluginInfo/PluginInfo.js b/node_modules/cordova-common/src/PluginInfo/PluginInfo.js index 4d77cbc7..7e9754d2 100644 --- a/node_modules/cordova-common/src/PluginInfo/PluginInfo.js +++ b/node_modules/cordova-common/src/PluginInfo/PluginInfo.js @@ -312,6 +312,11 @@ function PluginInfo (dirname) { var src = el.attrib.src; if (options) { var vars = options.cli_variables || {}; + + if (Object.keys(vars).length === 0) { + // get variable defaults from plugin.xml for removal + vars = self.getPreferences(platform); + } var regExp; // Iterate over plugin variables. // Replace them in framework src if they exist diff --git a/node_modules/q/CHANGES.md b/node_modules/q/CHANGES.md index 2d845a31..766fcdc2 100644 --- a/node_modules/q/CHANGES.md +++ b/node_modules/q/CHANGES.md @@ -1,3 +1,11 @@ + +## 1.5.1 + + - Q.any now annotates its error message to clarify that Q.any was involved and + includes only the last error emitted. (Ivan Etchart) + - Avoid domain.dispose during tests in preparation for Node.js 9. (Anna + Henningsen) + ## 1.5.0 - Q.any gives an error message from the last rejected promise diff --git a/node_modules/q/package.json b/node_modules/q/package.json index 92536516..4110a749 100644 --- a/node_modules/q/package.json +++ b/node_modules/q/package.json @@ -14,19 +14,19 @@ ] ], "_from": "q@>=1.4.1 <2.0.0", - "_id": "q@1.5.0", + "_id": "q@1.5.1", "_inCache": true, "_location": "/q", - "_nodeVersion": "6.9.5", + "_nodeVersion": "0.10.32", "_npmOperationalInternal": { - "host": "packages-18-east.internal.npmjs.com", - "tmp": "tmp/q-1.5.0.tgz_1490148893963_0.4695124195422977" + "host": "s3://npm-registry-packages", + "tmp": "tmp/q-1.5.1.tgz_1508435736930_0.7891315249726176" }, "_npmUser": { "name": "kriskowal", "email": "kris.kowal@cixar.com" }, - "_npmVersion": "3.10.10", + "_npmVersion": "2.14.2", "_phantomChildren": {}, "_requested": { "raw": "q@^1.4.1", @@ -41,8 +41,8 @@ "/", "/cordova-common" ], - "_resolved": "https://registry.npmjs.org/q/-/q-1.5.0.tgz", - "_shasum": "dd01bac9d06d30e6f219aecb8253ee9ebdc308f1", + "_resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", + "_shasum": "7e32f75b41381291d04611f1bf14109ac00651d7", "_shrinkwrap": null, "_spec": "q@^1.4.1", "_where": "/Users/jbowser/cordova/cordova-android", @@ -88,8 +88,8 @@ "test": "./spec" }, "dist": { - "shasum": "dd01bac9d06d30e6f219aecb8253ee9ebdc308f1", - "tarball": "https://registry.npmjs.org/q/-/q-1.5.0.tgz" + "shasum": "7e32f75b41381291d04611f1bf14109ac00651d7", + "tarball": "https://registry.npmjs.org/q/-/q-1.5.1.tgz" }, "engines": { "node": ">=0.6.0", @@ -100,7 +100,7 @@ "q.js", "queue.js" ], - "gitHead": "4fecabe07ff9f3683a3d4548e7f81c2aba693326", + "gitHead": "c2f5a6f35456389a806acca50bfd929cbe30c4cb", "homepage": "https://github.com/kriskowal/q", "keywords": [ "q", @@ -151,5 +151,5 @@ "test": "npm ls -s && jasmine-node spec && promises-aplus-tests spec/aplus-adapter && npm run -s lint", "test-browser": "opener spec/q-spec.html" }, - "version": "1.5.0" + "version": "1.5.1" } diff --git a/node_modules/q/q.js b/node_modules/q/q.js index 14dc24a6..6e467958 100644 --- a/node_modules/q/q.js +++ b/node_modules/q/q.js @@ -1645,9 +1645,12 @@ function any(promises) { function onRejected(err) { pendingCount--; if (pendingCount === 0) { - err.message = ("Q can't get fulfillment value from any promise, all " + - "promises were rejected. Last error message: " + err.message); - deferred.reject(err); + var rejection = err || new Error("" + err); + + rejection.message = ("Q can't get fulfillment value from any promise, all " + + "promises were rejected. Last error message: " + rejection.message); + + deferred.reject(rejection); } } function onProgress(progress) {