forked from github/cordova-android
Revert "Other minor dependencies updates in 7.1.x patch"
This reverts commit 5a5f544a4890ff65519329303e75a649e482df23. Rationale: base64-js update in 5a5f544 causes extra base64-js version to be installed under plist (node_modules/plist/node_modules/base64-js), which would need to be committed to satisfy the needs of the deprecated Node.js 4 version. The extra base64-js version in node_modules/plist/node_modules/base64-js was missed at the time 5a5f544 was committed. The base64-js update in 5a5f544 is now deemed as not wanted due to the extra base64-js version that would need to be committed. The other dependencies updates in 5a5f544 may be nice to have but not considered necessary for the patch release. Reverting now to unblock the upcoming 7.1.4 patch release. Note that neither 5a5f544 nor this revert will show up in the master branch.
This commit is contained in:
parent
b7643a3712
commit
84cb08b23e
10
node_modules/base64-js/README.md
generated
vendored
10
node_modules/base64-js/README.md
generated
vendored
@ -15,15 +15,13 @@ Sometimes encoding/decoding binary data in the browser is useful, and that is wh
|
|||||||
|
|
||||||
With [npm](https://npmjs.org) do:
|
With [npm](https://npmjs.org) do:
|
||||||
|
|
||||||
`npm install base64-js` and `var base64js = require('base64-js')`
|
`npm install base64-js`
|
||||||
|
|
||||||
For use in web browsers do:
|
|
||||||
|
|
||||||
`<script src="base64js.min.js"></script>`
|
|
||||||
|
|
||||||
## methods
|
## methods
|
||||||
|
|
||||||
`base64js` has three exposed functions, `byteLength`, `toByteArray` and `fromByteArray`, which both take a single argument.
|
`var base64 = require('base64-js')`
|
||||||
|
|
||||||
|
`base64` has three exposed functions, `byteLength`, `toByteArray` and `fromByteArray`, which both take a single argument.
|
||||||
|
|
||||||
* `byteLength` - Takes a base64 string and returns length of byte array
|
* `byteLength` - Takes a base64 string and returns length of byte array
|
||||||
* `toByteArray` - Takes a base64 string and returns a byte array
|
* `toByteArray` - Takes a base64 string and returns a byte array
|
||||||
|
2
node_modules/base64-js/base64js.min.js
generated
vendored
2
node_modules/base64-js/base64js.min.js
generated
vendored
@ -1 +1 @@
|
|||||||
(function(r){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=r()}else if(typeof define==="function"&&define.amd){define([],r)}else{var e;if(typeof window!=="undefined"){e=window}else if(typeof global!=="undefined"){e=global}else if(typeof self!=="undefined"){e=self}else{e=this}e.base64js=r()}})(function(){var r,e,n;return function(){function r(e,n,t){function o(f,i){if(!n[f]){if(!e[f]){var u="function"==typeof require&&require;if(!i&&u)return u(f,!0);if(a)return a(f,!0);var v=new Error("Cannot find module '"+f+"'");throw v.code="MODULE_NOT_FOUND",v}var d=n[f]={exports:{}};e[f][0].call(d.exports,function(r){var n=e[f][1][r];return o(n||r)},d,d.exports,r,e,n,t)}return n[f].exports}for(var a="function"==typeof require&&require,f=0;f<t.length;f++)o(t[f]);return o}return r}()({"/":[function(r,e,n){"use strict";n.byteLength=d;n.toByteArray=h;n.fromByteArray=p;var t=[];var o=[];var a=typeof Uint8Array!=="undefined"?Uint8Array:Array;var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i=0,u=f.length;i<u;++i){t[i]=f[i];o[f.charCodeAt(i)]=i}o["-".charCodeAt(0)]=62;o["_".charCodeAt(0)]=63;function v(r){var e=r.length;if(e%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}var n=r.indexOf("=");if(n===-1)n=e;var t=n===e?0:4-n%4;return[n,t]}function d(r){var e=v(r);var n=e[0];var t=e[1];return(n+t)*3/4-t}function c(r,e,n){return(e+n)*3/4-n}function h(r){var e;var n=v(r);var t=n[0];var f=n[1];var i=new a(c(r,t,f));var u=0;var d=f>0?t-4:t;for(var h=0;h<d;h+=4){e=o[r.charCodeAt(h)]<<18|o[r.charCodeAt(h+1)]<<12|o[r.charCodeAt(h+2)]<<6|o[r.charCodeAt(h+3)];i[u++]=e>>16&255;i[u++]=e>>8&255;i[u++]=e&255}if(f===2){e=o[r.charCodeAt(h)]<<2|o[r.charCodeAt(h+1)]>>4;i[u++]=e&255}if(f===1){e=o[r.charCodeAt(h)]<<10|o[r.charCodeAt(h+1)]<<4|o[r.charCodeAt(h+2)]>>2;i[u++]=e>>8&255;i[u++]=e&255}return i}function s(r){return t[r>>18&63]+t[r>>12&63]+t[r>>6&63]+t[r&63]}function l(r,e,n){var t;var o=[];for(var a=e;a<n;a+=3){t=(r[a]<<16&16711680)+(r[a+1]<<8&65280)+(r[a+2]&255);o.push(s(t))}return o.join("")}function p(r){var e;var n=r.length;var o=n%3;var a=[];var f=16383;for(var i=0,u=n-o;i<u;i+=f){a.push(l(r,i,i+f>u?u:i+f))}if(o===1){e=r[n-1];a.push(t[e>>2]+t[e<<4&63]+"==")}else if(o===2){e=(r[n-2]<<8)+r[n-1];a.push(t[e>>10]+t[e>>4&63]+t[e<<2&63]+"=")}return a.join("")}},{}]},{},[])("/")});
|
(function(r){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=r()}else if(typeof define==="function"&&define.amd){define([],r)}else{var e;if(typeof window!=="undefined"){e=window}else if(typeof global!=="undefined"){e=global}else if(typeof self!=="undefined"){e=self}else{e=this}e.base64js=r()}})(function(){var r,e,t;return function r(e,t,n){function o(i,a){if(!t[i]){if(!e[i]){var u=typeof require=="function"&&require;if(!a&&u)return u(i,!0);if(f)return f(i,!0);var d=new Error("Cannot find module '"+i+"'");throw d.code="MODULE_NOT_FOUND",d}var c=t[i]={exports:{}};e[i][0].call(c.exports,function(r){var t=e[i][1][r];return o(t?t:r)},c,c.exports,r,e,t,n)}return t[i].exports}var f=typeof require=="function"&&require;for(var i=0;i<n.length;i++)o(n[i]);return o}({"/":[function(r,e,t){"use strict";t.byteLength=c;t.toByteArray=v;t.fromByteArray=s;var n=[];var o=[];var f=typeof Uint8Array!=="undefined"?Uint8Array:Array;var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var a=0,u=i.length;a<u;++a){n[a]=i[a];o[i.charCodeAt(a)]=a}o["-".charCodeAt(0)]=62;o["_".charCodeAt(0)]=63;function d(r){var e=r.length;if(e%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}return r[e-2]==="="?2:r[e-1]==="="?1:0}function c(r){return r.length*3/4-d(r)}function v(r){var e,t,n,i,a,u;var c=r.length;a=d(r);u=new f(c*3/4-a);n=a>0?c-4:c;var v=0;for(e=0,t=0;e<n;e+=4,t+=3){i=o[r.charCodeAt(e)]<<18|o[r.charCodeAt(e+1)]<<12|o[r.charCodeAt(e+2)]<<6|o[r.charCodeAt(e+3)];u[v++]=i>>16&255;u[v++]=i>>8&255;u[v++]=i&255}if(a===2){i=o[r.charCodeAt(e)]<<2|o[r.charCodeAt(e+1)]>>4;u[v++]=i&255}else if(a===1){i=o[r.charCodeAt(e)]<<10|o[r.charCodeAt(e+1)]<<4|o[r.charCodeAt(e+2)]>>2;u[v++]=i>>8&255;u[v++]=i&255}return u}function l(r){return n[r>>18&63]+n[r>>12&63]+n[r>>6&63]+n[r&63]}function h(r,e,t){var n;var o=[];for(var f=e;f<t;f+=3){n=(r[f]<<16)+(r[f+1]<<8)+r[f+2];o.push(l(n))}return o.join("")}function s(r){var e;var t=r.length;var o=t%3;var f="";var i=[];var a=16383;for(var u=0,d=t-o;u<d;u+=a){i.push(h(r,u,u+a>d?d:u+a))}if(o===1){e=r[t-1];f+=n[e>>2];f+=n[e<<4&63];f+="=="}else if(o===2){e=(r[t-2]<<8)+r[t-1];f+=n[e>>10];f+=n[e>>4&63];f+=n[e<<2&63];f+="="}i.push(f);return i.join("")}},{}]},{},[])("/")});
|
||||||
|
121
node_modules/base64-js/index.js
generated
vendored
121
node_modules/base64-js/index.js
generated
vendored
@ -14,102 +14,68 @@ for (var i = 0, len = code.length; i < len; ++i) {
|
|||||||
revLookup[code.charCodeAt(i)] = i
|
revLookup[code.charCodeAt(i)] = i
|
||||||
}
|
}
|
||||||
|
|
||||||
// Support decoding URL-safe base64 strings, as Node.js does.
|
|
||||||
// See: https://en.wikipedia.org/wiki/Base64#URL_applications
|
|
||||||
revLookup['-'.charCodeAt(0)] = 62
|
revLookup['-'.charCodeAt(0)] = 62
|
||||||
revLookup['_'.charCodeAt(0)] = 63
|
revLookup['_'.charCodeAt(0)] = 63
|
||||||
|
|
||||||
function getLens (b64) {
|
function placeHoldersCount (b64) {
|
||||||
var len = b64.length
|
var len = b64.length
|
||||||
|
|
||||||
if (len % 4 > 0) {
|
if (len % 4 > 0) {
|
||||||
throw new Error('Invalid string. Length must be a multiple of 4')
|
throw new Error('Invalid string. Length must be a multiple of 4')
|
||||||
}
|
}
|
||||||
|
|
||||||
// Trim off extra bytes after placeholder bytes are found
|
// the number of equal signs (place holders)
|
||||||
// See: https://github.com/beatgammit/base64-js/issues/42
|
// if there are two placeholders, than the two characters before it
|
||||||
var validLen = b64.indexOf('=')
|
// represent one byte
|
||||||
if (validLen === -1) validLen = len
|
// if there is only one, then the three characters before it represent 2 bytes
|
||||||
|
// this is just a cheap hack to not do indexOf twice
|
||||||
var placeHoldersLen = validLen === len
|
return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0
|
||||||
? 0
|
|
||||||
: 4 - (validLen % 4)
|
|
||||||
|
|
||||||
return [validLen, placeHoldersLen]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// base64 is 4/3 + up to two characters of the original data
|
|
||||||
function byteLength (b64) {
|
function byteLength (b64) {
|
||||||
var lens = getLens(b64)
|
// base64 is 4/3 + up to two characters of the original data
|
||||||
var validLen = lens[0]
|
return b64.length * 3 / 4 - placeHoldersCount(b64)
|
||||||
var placeHoldersLen = lens[1]
|
|
||||||
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
|
|
||||||
}
|
|
||||||
|
|
||||||
function _byteLength (b64, validLen, placeHoldersLen) {
|
|
||||||
return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function toByteArray (b64) {
|
function toByteArray (b64) {
|
||||||
var tmp
|
var i, j, l, tmp, placeHolders, arr
|
||||||
var lens = getLens(b64)
|
var len = b64.length
|
||||||
var validLen = lens[0]
|
placeHolders = placeHoldersCount(b64)
|
||||||
var placeHoldersLen = lens[1]
|
|
||||||
|
|
||||||
var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))
|
arr = new Arr(len * 3 / 4 - placeHolders)
|
||||||
|
|
||||||
var curByte = 0
|
|
||||||
|
|
||||||
// if there are placeholders, only get up to the last complete 4 chars
|
// if there are placeholders, only get up to the last complete 4 chars
|
||||||
var len = placeHoldersLen > 0
|
l = placeHolders > 0 ? len - 4 : len
|
||||||
? validLen - 4
|
|
||||||
: validLen
|
|
||||||
|
|
||||||
for (var i = 0; i < len; i += 4) {
|
var L = 0
|
||||||
tmp =
|
|
||||||
(revLookup[b64.charCodeAt(i)] << 18) |
|
for (i = 0, j = 0; i < l; i += 4, j += 3) {
|
||||||
(revLookup[b64.charCodeAt(i + 1)] << 12) |
|
tmp = (revLookup[b64.charCodeAt(i)] << 18) | (revLookup[b64.charCodeAt(i + 1)] << 12) | (revLookup[b64.charCodeAt(i + 2)] << 6) | revLookup[b64.charCodeAt(i + 3)]
|
||||||
(revLookup[b64.charCodeAt(i + 2)] << 6) |
|
arr[L++] = (tmp >> 16) & 0xFF
|
||||||
revLookup[b64.charCodeAt(i + 3)]
|
arr[L++] = (tmp >> 8) & 0xFF
|
||||||
arr[curByte++] = (tmp >> 16) & 0xFF
|
arr[L++] = tmp & 0xFF
|
||||||
arr[curByte++] = (tmp >> 8) & 0xFF
|
|
||||||
arr[curByte++] = tmp & 0xFF
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (placeHoldersLen === 2) {
|
if (placeHolders === 2) {
|
||||||
tmp =
|
tmp = (revLookup[b64.charCodeAt(i)] << 2) | (revLookup[b64.charCodeAt(i + 1)] >> 4)
|
||||||
(revLookup[b64.charCodeAt(i)] << 2) |
|
arr[L++] = tmp & 0xFF
|
||||||
(revLookup[b64.charCodeAt(i + 1)] >> 4)
|
} else if (placeHolders === 1) {
|
||||||
arr[curByte++] = tmp & 0xFF
|
tmp = (revLookup[b64.charCodeAt(i)] << 10) | (revLookup[b64.charCodeAt(i + 1)] << 4) | (revLookup[b64.charCodeAt(i + 2)] >> 2)
|
||||||
}
|
arr[L++] = (tmp >> 8) & 0xFF
|
||||||
|
arr[L++] = tmp & 0xFF
|
||||||
if (placeHoldersLen === 1) {
|
|
||||||
tmp =
|
|
||||||
(revLookup[b64.charCodeAt(i)] << 10) |
|
|
||||||
(revLookup[b64.charCodeAt(i + 1)] << 4) |
|
|
||||||
(revLookup[b64.charCodeAt(i + 2)] >> 2)
|
|
||||||
arr[curByte++] = (tmp >> 8) & 0xFF
|
|
||||||
arr[curByte++] = tmp & 0xFF
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return arr
|
return arr
|
||||||
}
|
}
|
||||||
|
|
||||||
function tripletToBase64 (num) {
|
function tripletToBase64 (num) {
|
||||||
return lookup[num >> 18 & 0x3F] +
|
return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F]
|
||||||
lookup[num >> 12 & 0x3F] +
|
|
||||||
lookup[num >> 6 & 0x3F] +
|
|
||||||
lookup[num & 0x3F]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function encodeChunk (uint8, start, end) {
|
function encodeChunk (uint8, start, end) {
|
||||||
var tmp
|
var tmp
|
||||||
var output = []
|
var output = []
|
||||||
for (var i = start; i < end; i += 3) {
|
for (var i = start; i < end; i += 3) {
|
||||||
tmp =
|
tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
|
||||||
((uint8[i] << 16) & 0xFF0000) +
|
|
||||||
((uint8[i + 1] << 8) & 0xFF00) +
|
|
||||||
(uint8[i + 2] & 0xFF)
|
|
||||||
output.push(tripletToBase64(tmp))
|
output.push(tripletToBase64(tmp))
|
||||||
}
|
}
|
||||||
return output.join('')
|
return output.join('')
|
||||||
@ -119,33 +85,30 @@ function fromByteArray (uint8) {
|
|||||||
var tmp
|
var tmp
|
||||||
var len = uint8.length
|
var len = uint8.length
|
||||||
var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
|
var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes
|
||||||
|
var output = ''
|
||||||
var parts = []
|
var parts = []
|
||||||
var maxChunkLength = 16383 // must be multiple of 3
|
var maxChunkLength = 16383 // must be multiple of 3
|
||||||
|
|
||||||
// go through the array every three bytes, we'll deal with trailing stuff later
|
// go through the array every three bytes, we'll deal with trailing stuff later
|
||||||
for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
|
for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
|
||||||
parts.push(encodeChunk(
|
parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))
|
||||||
uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)
|
|
||||||
))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// pad the end with zeros, but make sure to not forget the extra bytes
|
// pad the end with zeros, but make sure to not forget the extra bytes
|
||||||
if (extraBytes === 1) {
|
if (extraBytes === 1) {
|
||||||
tmp = uint8[len - 1]
|
tmp = uint8[len - 1]
|
||||||
parts.push(
|
output += lookup[tmp >> 2]
|
||||||
lookup[tmp >> 2] +
|
output += lookup[(tmp << 4) & 0x3F]
|
||||||
lookup[(tmp << 4) & 0x3F] +
|
output += '=='
|
||||||
'=='
|
|
||||||
)
|
|
||||||
} else if (extraBytes === 2) {
|
} else if (extraBytes === 2) {
|
||||||
tmp = (uint8[len - 2] << 8) + uint8[len - 1]
|
tmp = (uint8[len - 2] << 8) + (uint8[len - 1])
|
||||||
parts.push(
|
output += lookup[tmp >> 10]
|
||||||
lookup[tmp >> 10] +
|
output += lookup[(tmp >> 4) & 0x3F]
|
||||||
lookup[(tmp >> 4) & 0x3F] +
|
output += lookup[(tmp << 2) & 0x3F]
|
||||||
lookup[(tmp << 2) & 0x3F] +
|
output += '='
|
||||||
'='
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parts.push(output)
|
||||||
|
|
||||||
return parts.join('')
|
return parts.join('')
|
||||||
}
|
}
|
||||||
|
33
node_modules/base64-js/package.json
generated
vendored
33
node_modules/base64-js/package.json
generated
vendored
@ -1,28 +1,27 @@
|
|||||||
{
|
{
|
||||||
"_from": "base64-js@1",
|
"_from": "base64-js@1.2.0",
|
||||||
"_id": "base64-js@1.3.0",
|
"_id": "base64-js@1.2.0",
|
||||||
"_inBundle": false,
|
"_inBundle": false,
|
||||||
"_integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==",
|
"_integrity": "sha1-o5mS1yNYSBGYK+XikLtqU9hnAPE=",
|
||||||
"_location": "/base64-js",
|
"_location": "/base64-js",
|
||||||
"_phantomChildren": {},
|
"_phantomChildren": {},
|
||||||
"_requested": {
|
"_requested": {
|
||||||
"type": "range",
|
"type": "version",
|
||||||
"registry": true,
|
"registry": true,
|
||||||
"raw": "base64-js@1",
|
"raw": "base64-js@1.2.0",
|
||||||
"name": "base64-js",
|
"name": "base64-js",
|
||||||
"escapedName": "base64-js",
|
"escapedName": "base64-js",
|
||||||
"rawSpec": "1",
|
"rawSpec": "1.2.0",
|
||||||
"saveSpec": null,
|
"saveSpec": null,
|
||||||
"fetchSpec": "1"
|
"fetchSpec": "1.2.0"
|
||||||
},
|
},
|
||||||
"_requiredBy": [
|
"_requiredBy": [
|
||||||
"#USER",
|
"/plist"
|
||||||
"/"
|
|
||||||
],
|
],
|
||||||
"_resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz",
|
"_resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.2.0.tgz",
|
||||||
"_shasum": "cab1e6118f051095e58b5281aea8c1cd22bfc0e3",
|
"_shasum": "a39992d723584811982be5e290bb6a53d86700f1",
|
||||||
"_spec": "base64-js@1",
|
"_spec": "base64-js@1.2.0",
|
||||||
"_where": "/Users/brodybits/Documents/cordova/cordova-android",
|
"_where": "/Users/brodybits/Documents/cordova/cordova-android/node_modules/plist",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "T. Jameson Little",
|
"name": "T. Jameson Little",
|
||||||
"email": "t.jameson.little@gmail.com"
|
"email": "t.jameson.little@gmail.com"
|
||||||
@ -34,11 +33,11 @@
|
|||||||
"deprecated": false,
|
"deprecated": false,
|
||||||
"description": "Base64 encoding/decoding in pure JS",
|
"description": "Base64 encoding/decoding in pure JS",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"benchmark": "^2.1.4",
|
"benchmark": "^2.1.0",
|
||||||
"browserify": "^14.0.0",
|
"browserify": "^13.0.0",
|
||||||
"standard": "*",
|
"standard": "*",
|
||||||
"tape": "4.x",
|
"tape": "4.x",
|
||||||
"uglify-js": "^2.8.29"
|
"uglify-js": "^2.6.2"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"test",
|
"test",
|
||||||
@ -62,5 +61,5 @@
|
|||||||
"test": "npm run lint && npm run unit",
|
"test": "npm run lint && npm run unit",
|
||||||
"unit": "tape test/*.js"
|
"unit": "tape test/*.js"
|
||||||
},
|
},
|
||||||
"version": "1.3.0"
|
"version": "1.2.0"
|
||||||
}
|
}
|
||||||
|
1
node_modules/base64-js/test/big-data.js
generated
vendored
1
node_modules/base64-js/test/big-data.js
generated
vendored
@ -10,7 +10,6 @@ test('convert big data to base64', function (t) {
|
|||||||
b64str = b64.fromByteArray(big)
|
b64str = b64.fromByteArray(big)
|
||||||
arr = b64.toByteArray(b64str)
|
arr = b64.toByteArray(b64str)
|
||||||
t.ok(equal(arr, big))
|
t.ok(equal(arr, big))
|
||||||
t.equal(b64.byteLength(b64str), arr.length)
|
|
||||||
t.end()
|
t.end()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
40
node_modules/base64-js/test/convert.js
generated
vendored
40
node_modules/base64-js/test/convert.js
generated
vendored
@ -29,46 +29,6 @@ test('convert to base64 and back', function (t) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
var data = [
|
|
||||||
[[0, 0, 0], 'AAAA'],
|
|
||||||
[[0, 0, 1], 'AAAB'],
|
|
||||||
[[0, 1, -1], 'AAH/'],
|
|
||||||
[[1, 1, 1], 'AQEB'],
|
|
||||||
[[0, -73, 23], 'ALcX']
|
|
||||||
]
|
|
||||||
|
|
||||||
test('convert known data to string', function (t) {
|
|
||||||
for (var i = 0; i < data.length; i++) {
|
|
||||||
var bytes = data[i][0]
|
|
||||||
var expected = data[i][1]
|
|
||||||
var actual = b64.fromByteArray(bytes)
|
|
||||||
t.equal(actual, expected, 'Ensure that ' + bytes + ' serialise to ' + expected)
|
|
||||||
}
|
|
||||||
t.end()
|
|
||||||
})
|
|
||||||
|
|
||||||
test('convert known data from string', function (t) {
|
|
||||||
for (var i = 0; i < data.length; i++) {
|
|
||||||
var expected = data[i][0]
|
|
||||||
var string = data[i][1]
|
|
||||||
var actual = b64.toByteArray(string)
|
|
||||||
t.ok(equal(actual, expected), 'Ensure that ' + string + ' deserialise to ' + expected)
|
|
||||||
var length = b64.byteLength(string)
|
|
||||||
t.equal(length, expected.length, 'Ensure that ' + string + ' has byte lentgh of ' + expected.length)
|
|
||||||
}
|
|
||||||
t.end()
|
|
||||||
})
|
|
||||||
|
|
||||||
function equal (a, b) {
|
|
||||||
var i
|
|
||||||
var length = a.length
|
|
||||||
if (length !== b.length) return false
|
|
||||||
for (i = 0; i < length; ++i) {
|
|
||||||
if ((a[i] & 0xFF) !== (b[i] & 0xFF)) return false
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
function map (arr, callback) {
|
function map (arr, callback) {
|
||||||
var res = []
|
var res = []
|
||||||
var kValue, mappedValue
|
var kValue, mappedValue
|
||||||
|
10
node_modules/base64-js/test/corrupt.js
generated
vendored
10
node_modules/base64-js/test/corrupt.js
generated
vendored
@ -1,10 +0,0 @@
|
|||||||
var test = require('tape')
|
|
||||||
var b64 = require('../')
|
|
||||||
|
|
||||||
test('padding bytes found inside base64 string', function (t) {
|
|
||||||
// See https://github.com/beatgammit/base64-js/issues/42
|
|
||||||
var str = 'SQ==QU0='
|
|
||||||
t.deepEqual(b64.toByteArray(str), new Uint8Array([73]))
|
|
||||||
t.equal(b64.byteLength(str), 1)
|
|
||||||
t.end()
|
|
||||||
})
|
|
10
node_modules/base64-js/test/url-safe.js
generated
vendored
10
node_modules/base64-js/test/url-safe.js
generated
vendored
@ -4,21 +4,15 @@ var b64 = require('../')
|
|||||||
test('decode url-safe style base64 strings', function (t) {
|
test('decode url-safe style base64 strings', function (t) {
|
||||||
var expected = [0xff, 0xff, 0xbe, 0xff, 0xef, 0xbf, 0xfb, 0xef, 0xff]
|
var expected = [0xff, 0xff, 0xbe, 0xff, 0xef, 0xbf, 0xfb, 0xef, 0xff]
|
||||||
|
|
||||||
var str = '//++/++/++//'
|
var actual = b64.toByteArray('//++/++/++//')
|
||||||
var actual = b64.toByteArray(str)
|
|
||||||
for (var i = 0; i < actual.length; i++) {
|
for (var i = 0; i < actual.length; i++) {
|
||||||
t.equal(actual[i], expected[i])
|
t.equal(actual[i], expected[i])
|
||||||
}
|
}
|
||||||
|
|
||||||
t.equal(b64.byteLength(str), actual.length)
|
actual = b64.toByteArray('__--_--_--__')
|
||||||
|
|
||||||
str = '__--_--_--__'
|
|
||||||
actual = b64.toByteArray(str)
|
|
||||||
for (i = 0; i < actual.length; i++) {
|
for (i = 0; i < actual.length; i++) {
|
||||||
t.equal(actual[i], expected[i])
|
t.equal(actual[i], expected[i])
|
||||||
}
|
}
|
||||||
|
|
||||||
t.equal(b64.byteLength(str), actual.length)
|
|
||||||
|
|
||||||
t.end()
|
t.end()
|
||||||
})
|
})
|
||||||
|
59
node_modules/big-integer/BigInteger.js
generated
vendored
59
node_modules/big-integer/BigInteger.js
generated
vendored
@ -785,44 +785,29 @@ var bigInt = (function (undefined) {
|
|||||||
if (n.isUnit()) return false;
|
if (n.isUnit()) return false;
|
||||||
if (n.equals(2) || n.equals(3) || n.equals(5)) return true;
|
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.isEven() || n.isDivisibleBy(3) || n.isDivisibleBy(5)) return false;
|
||||||
if (n.lesser(49)) return true;
|
if (n.lesser(25)) return true;
|
||||||
// we don't know if it's prime: let the other functions figure it out
|
// we don't know if it's prime: let the other functions figure it out
|
||||||
}
|
}
|
||||||
|
|
||||||
function millerRabinTest(n, a) {
|
BigInteger.prototype.isPrime = function () {
|
||||||
var nPrev = n.prev(),
|
|
||||||
b = nPrev,
|
|
||||||
r = 0,
|
|
||||||
d, t, i, x;
|
|
||||||
while (b.isEven()) b = b.divide(2), r++;
|
|
||||||
next : for (i = 0; i < a.length; i++) {
|
|
||||||
if (n.lesser(a[i])) continue;
|
|
||||||
x = bigInt(a[i]).modPow(b, n);
|
|
||||||
if (x.equals(Integer[1]) || x.equals(nPrev)) continue;
|
|
||||||
for (d = r - 1; d != 0; d--) {
|
|
||||||
x = x.square().mod(n);
|
|
||||||
if (x.isUnit()) return false;
|
|
||||||
if (x.equals(nPrev)) continue next;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set "strict" to true to force GRH-supported lower bound of 2*log(N)^2
|
|
||||||
BigInteger.prototype.isPrime = function (strict) {
|
|
||||||
var isPrime = isBasicPrime(this);
|
var isPrime = isBasicPrime(this);
|
||||||
if (isPrime !== undefined) return isPrime;
|
if (isPrime !== undefined) return isPrime;
|
||||||
var n = this.abs();
|
var n = this.abs(),
|
||||||
var bits = n.bitLength();
|
nPrev = n.prev();
|
||||||
if(bits <= 64)
|
var a = [2, 3, 5, 7, 11, 13, 17, 19],
|
||||||
return millerRabinTest(n, [2, 325, 9375, 28178, 450775, 9780504, 1795265022]);
|
b = nPrev,
|
||||||
var logN = Math.log(2) * bits;
|
d, t, i, x;
|
||||||
var t = Math.ceil((strict === true) ? (2 * Math.pow(logN, 2)) : logN);
|
while (b.isEven()) b = b.divide(2);
|
||||||
for (var a = [], i = 0; i < t; i++) {
|
for (i = 0; i < a.length; i++) {
|
||||||
a.push(bigInt(i + 2));
|
x = bigInt(a[i]).modPow(b, n);
|
||||||
|
if (x.equals(Integer[1]) || x.equals(nPrev)) continue;
|
||||||
|
for (t = true, d = b; t && d.lesser(nPrev); d = d.multiply(2)) {
|
||||||
|
x = x.square().mod(n);
|
||||||
|
if (x.equals(nPrev)) t = false;
|
||||||
|
}
|
||||||
|
if (t) return false;
|
||||||
}
|
}
|
||||||
return millerRabinTest(n, a);
|
return true;
|
||||||
};
|
};
|
||||||
SmallInteger.prototype.isPrime = BigInteger.prototype.isPrime;
|
SmallInteger.prototype.isPrime = BigInteger.prototype.isPrime;
|
||||||
|
|
||||||
@ -831,10 +816,12 @@ var bigInt = (function (undefined) {
|
|||||||
if (isPrime !== undefined) return isPrime;
|
if (isPrime !== undefined) return isPrime;
|
||||||
var n = this.abs();
|
var n = this.abs();
|
||||||
var t = iterations === undefined ? 5 : iterations;
|
var t = iterations === undefined ? 5 : iterations;
|
||||||
for (var a = [], i = 0; i < t; i++) {
|
// use the Fermat primality test
|
||||||
a.push(bigInt.randBetween(2, n.minus(2)));
|
for (var i = 0; i < t; i++) {
|
||||||
|
var a = bigInt.randBetween(2, n.minus(2));
|
||||||
|
if (!a.modPow(n.prev(), n).isUnit()) return false; // definitely composite
|
||||||
}
|
}
|
||||||
return millerRabinTest(n, a);
|
return true; // large chance of being prime
|
||||||
};
|
};
|
||||||
SmallInteger.prototype.isProbablePrime = BigInteger.prototype.isProbablePrime;
|
SmallInteger.prototype.isProbablePrime = BigInteger.prototype.isProbablePrime;
|
||||||
|
|
||||||
|
2
node_modules/big-integer/BigInteger.min.js
generated
vendored
2
node_modules/big-integer/BigInteger.min.js
generated
vendored
File diff suppressed because one or more lines are too long
10
node_modules/big-integer/README.md
generated
vendored
10
node_modules/big-integer/README.md
generated
vendored
@ -219,15 +219,15 @@ Returns `true` if the number is prime, `false` otherwise.
|
|||||||
|
|
||||||
Returns `true` if the number is very likely to be prime, `false` otherwise.
|
Returns `true` if the number is very likely to be prime, `false` otherwise.
|
||||||
Argument is optional and determines the amount of iterations of the test (default: `5`). The more iterations, the lower chance of getting a false positive.
|
Argument is optional and determines the amount of iterations of the test (default: `5`). The more iterations, the lower chance of getting a false positive.
|
||||||
This uses the [Miller Rabin test](https://en.wikipedia.org/wiki/Miller%E2%80%93Rabin_primality_test).
|
This uses the [Fermat primality test](https://en.wikipedia.org/wiki/Fermat_primality_test).
|
||||||
|
|
||||||
- `bigInt(5).isProbablePrime()` => `true`
|
- `bigInt(5).isProbablePrime()` => `true`
|
||||||
- `bigInt(49).isProbablePrime()` => `false`
|
- `bigInt(49).isProbablePrime()` => `false`
|
||||||
- `bigInt(1729).isProbablePrime()` => `false`
|
- `bigInt(1729).isProbablePrime(50)` => `false`
|
||||||
|
|
||||||
Note that this function is not deterministic, since it relies on random sampling of factors, so the result for some numbers is not always the same.
|
Note that this function is not deterministic, since it relies on random sampling of factors, so the result for some numbers is not always the same. [Carmichael numbers](https://en.wikipedia.org/wiki/Carmichael_number) are particularly prone to give unreliable results.
|
||||||
If the number is composite then the Miller–Rabin primality test declares the number probably prime with a probability at most `4` to the power `−iterations`.
|
|
||||||
If the number is prime, this function always returns `true`.
|
For example, `bigInt(1729).isProbablePrime()` returns `false` about 76% of the time and `true` about 24% of the time. The correct result is `false`.
|
||||||
|
|
||||||
#### `isUnit()`
|
#### `isUnit()`
|
||||||
|
|
||||||
|
24
node_modules/big-integer/package.json
generated
vendored
24
node_modules/big-integer/package.json
generated
vendored
@ -1,29 +1,27 @@
|
|||||||
{
|
{
|
||||||
"_from": "big-integer@1",
|
"_from": "big-integer@^1.6.7",
|
||||||
"_id": "big-integer@1.6.36",
|
"_id": "big-integer@1.6.32",
|
||||||
"_inBundle": false,
|
"_inBundle": false,
|
||||||
"_integrity": "sha512-t70bfa7HYEA1D9idDbmuv7YbsbVkQ+Hp+8KFSul4aE5e/i1bjCNIRYJZlA8Q8p0r9T8cF/RVvwUgRA//FydEyg==",
|
"_integrity": "sha512-ljKJdR3wk9thHfLj4DtrNiOSTxvGFaMjWrG4pW75juXC4j7+XuKJVFdg4kgFMYp85PVkO05dFMj2dk2xVsH4xw==",
|
||||||
"_location": "/big-integer",
|
"_location": "/big-integer",
|
||||||
"_phantomChildren": {},
|
"_phantomChildren": {},
|
||||||
"_requested": {
|
"_requested": {
|
||||||
"type": "range",
|
"type": "range",
|
||||||
"registry": true,
|
"registry": true,
|
||||||
"raw": "big-integer@1",
|
"raw": "big-integer@^1.6.7",
|
||||||
"name": "big-integer",
|
"name": "big-integer",
|
||||||
"escapedName": "big-integer",
|
"escapedName": "big-integer",
|
||||||
"rawSpec": "1",
|
"rawSpec": "^1.6.7",
|
||||||
"saveSpec": null,
|
"saveSpec": null,
|
||||||
"fetchSpec": "1"
|
"fetchSpec": "^1.6.7"
|
||||||
},
|
},
|
||||||
"_requiredBy": [
|
"_requiredBy": [
|
||||||
"#USER",
|
|
||||||
"/",
|
|
||||||
"/bplist-parser"
|
"/bplist-parser"
|
||||||
],
|
],
|
||||||
"_resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.36.tgz",
|
"_resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.32.tgz",
|
||||||
"_shasum": "78631076265d4ae3555c04f85e7d9d2f3a071a36",
|
"_shasum": "5867458b25ecd5bcb36b627c30bb501a13c07e89",
|
||||||
"_spec": "big-integer@1",
|
"_spec": "big-integer@^1.6.7",
|
||||||
"_where": "/Users/brodybits/Documents/cordova/cordova-android",
|
"_where": "/Users/brodybits/Documents/cordova/cordova-android/node_modules/bplist-parser",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Peter Olson",
|
"name": "Peter Olson",
|
||||||
"email": "peter.e.c.olson+npm@gmail.com"
|
"email": "peter.e.c.olson+npm@gmail.com"
|
||||||
@ -78,5 +76,5 @@
|
|||||||
"test": "tsc && karma start my.conf.js && node spec/tsDefinitions.js"
|
"test": "tsc && karma start my.conf.js && node spec/tsDefinitions.js"
|
||||||
},
|
},
|
||||||
"typings": "./BigInteger.d.ts",
|
"typings": "./BigInteger.d.ts",
|
||||||
"version": "1.6.36"
|
"version": "1.6.32"
|
||||||
}
|
}
|
||||||
|
17
node_modules/path-is-absolute/package.json
generated
vendored
17
node_modules/path-is-absolute/package.json
generated
vendored
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"_from": "path-is-absolute@1",
|
"_from": "path-is-absolute@^1.0.0",
|
||||||
"_id": "path-is-absolute@1.0.1",
|
"_id": "path-is-absolute@1.0.1",
|
||||||
"_inBundle": false,
|
"_inBundle": false,
|
||||||
"_integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
|
"_integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
|
||||||
@ -8,25 +8,24 @@
|
|||||||
"_requested": {
|
"_requested": {
|
||||||
"type": "range",
|
"type": "range",
|
||||||
"registry": true,
|
"registry": true,
|
||||||
"raw": "path-is-absolute@1",
|
"raw": "path-is-absolute@^1.0.0",
|
||||||
"name": "path-is-absolute",
|
"name": "path-is-absolute",
|
||||||
"escapedName": "path-is-absolute",
|
"escapedName": "path-is-absolute",
|
||||||
"rawSpec": "1",
|
"rawSpec": "^1.0.0",
|
||||||
"saveSpec": null,
|
"saveSpec": null,
|
||||||
"fetchSpec": "1"
|
"fetchSpec": "^1.0.0"
|
||||||
},
|
},
|
||||||
"_requiredBy": [
|
"_requiredBy": [
|
||||||
"#USER",
|
|
||||||
"/",
|
|
||||||
"/eslint/glob",
|
"/eslint/glob",
|
||||||
"/glob",
|
"/glob",
|
||||||
|
"/globby/glob",
|
||||||
"/jasmine/glob",
|
"/jasmine/glob",
|
||||||
"/rimraf/glob"
|
"/rimraf/glob"
|
||||||
],
|
],
|
||||||
"_resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
"_resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||||
"_shasum": "174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f",
|
"_shasum": "174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f",
|
||||||
"_spec": "path-is-absolute@1",
|
"_spec": "path-is-absolute@^1.0.0",
|
||||||
"_where": "/Users/brodybits/Documents/cordova/cordova-android",
|
"_where": "/Users/brodybits/Documents/cordova/cordova-android/node_modules/glob",
|
||||||
"author": {
|
"author": {
|
||||||
"name": "Sindre Sorhus",
|
"name": "Sindre Sorhus",
|
||||||
"email": "sindresorhus@gmail.com",
|
"email": "sindresorhus@gmail.com",
|
||||||
|
23
node_modules/semver/README.md
generated
vendored
23
node_modules/semver/README.md
generated
vendored
@ -29,6 +29,8 @@ As a command-line utility:
|
|||||||
```
|
```
|
||||||
$ semver -h
|
$ semver -h
|
||||||
|
|
||||||
|
SemVer 5.3.0
|
||||||
|
|
||||||
A JavaScript implementation of the http://semver.org/ specification
|
A JavaScript implementation of the http://semver.org/ specification
|
||||||
Copyright Isaac Z. Schlueter
|
Copyright Isaac Z. Schlueter
|
||||||
|
|
||||||
@ -52,9 +54,6 @@ Options:
|
|||||||
-l --loose
|
-l --loose
|
||||||
Interpret versions and ranges loosely
|
Interpret versions and ranges loosely
|
||||||
|
|
||||||
-p --include-prerelease
|
|
||||||
Always include prerelease versions in range matching
|
|
||||||
|
|
||||||
-c --coerce
|
-c --coerce
|
||||||
Coerce a string into SemVer if possible
|
Coerce a string into SemVer if possible
|
||||||
(does not imply --loose)
|
(does not imply --loose)
|
||||||
@ -275,7 +274,7 @@ logical-or ::= ( ' ' ) * '||' ( ' ' ) *
|
|||||||
range ::= hyphen | simple ( ' ' simple ) * | ''
|
range ::= hyphen | simple ( ' ' simple ) * | ''
|
||||||
hyphen ::= partial ' - ' partial
|
hyphen ::= partial ' - ' partial
|
||||||
simple ::= primitive | partial | tilde | caret
|
simple ::= primitive | partial | tilde | caret
|
||||||
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
|
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial
|
||||||
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
|
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
|
||||||
xr ::= 'x' | 'X' | '*' | nr
|
xr ::= 'x' | 'X' | '*' | nr
|
||||||
nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
|
nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
|
||||||
@ -290,19 +289,9 @@ part ::= nr | [-0-9A-Za-z]+
|
|||||||
|
|
||||||
## Functions
|
## Functions
|
||||||
|
|
||||||
All methods and classes take a final `options` object argument. All
|
All methods and classes take a final `loose` boolean argument that, if
|
||||||
options in this object are `false` by default. The options supported
|
true, will be more forgiving about not-quite-valid semver strings.
|
||||||
are:
|
The resulting output will always be 100% strict, of course.
|
||||||
|
|
||||||
- `loose` Be more forgiving about not-quite-valid semver strings.
|
|
||||||
(Any resulting output will always be 100% strict compliant, of
|
|
||||||
course.) For backwards compatibility reasons, if the `options`
|
|
||||||
argument is a boolean value instead of an object, it is interpreted
|
|
||||||
to be the `loose` param.
|
|
||||||
- `includePrerelease` Set to suppress the [default
|
|
||||||
behavior](https://github.com/npm/node-semver#prerelease-tags) of
|
|
||||||
excluding prerelease tagged versions from ranges unless they are
|
|
||||||
explicitly opted into.
|
|
||||||
|
|
||||||
Strict-mode Comparators and Ranges will be strict about the SemVer
|
Strict-mode Comparators and Ranges will be strict about the SemVer
|
||||||
strings that they parse.
|
strings that they parse.
|
||||||
|
18
node_modules/semver/bin/semver
generated
vendored
18
node_modules/semver/bin/semver
generated
vendored
@ -12,12 +12,10 @@ var argv = process.argv.slice(2)
|
|||||||
, inc = null
|
, inc = null
|
||||||
, version = require("../package.json").version
|
, version = require("../package.json").version
|
||||||
, loose = false
|
, loose = false
|
||||||
, includePrerelease = false
|
|
||||||
, coerce = false
|
, coerce = false
|
||||||
, identifier = undefined
|
, identifier = undefined
|
||||||
, semver = require("../semver")
|
, semver = require("../semver")
|
||||||
, reverse = false
|
, reverse = false
|
||||||
, options = {}
|
|
||||||
|
|
||||||
main()
|
main()
|
||||||
|
|
||||||
@ -37,9 +35,6 @@ function main () {
|
|||||||
case "-l": case "--loose":
|
case "-l": case "--loose":
|
||||||
loose = true
|
loose = true
|
||||||
break
|
break
|
||||||
case "-p": case "--include-prerelease":
|
|
||||||
includePrerelease = true
|
|
||||||
break
|
|
||||||
case "-v": case "--version":
|
case "-v": case "--version":
|
||||||
versions.push(argv.shift())
|
versions.push(argv.shift())
|
||||||
break
|
break
|
||||||
@ -71,8 +66,6 @@ function main () {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var options = { loose: loose, includePrerelease: includePrerelease }
|
|
||||||
|
|
||||||
versions = versions.map(function (v) {
|
versions = versions.map(function (v) {
|
||||||
return coerce ? (semver.coerce(v) || {version: v}).version : v
|
return coerce ? (semver.coerce(v) || {version: v}).version : v
|
||||||
}).filter(function (v) {
|
}).filter(function (v) {
|
||||||
@ -84,7 +77,7 @@ function main () {
|
|||||||
|
|
||||||
for (var i = 0, l = range.length; i < l ; i ++) {
|
for (var i = 0, l = range.length; i < l ; i ++) {
|
||||||
versions = versions.filter(function (v) {
|
versions = versions.filter(function (v) {
|
||||||
return semver.satisfies(v, range[i], options)
|
return semver.satisfies(v, range[i], loose)
|
||||||
})
|
})
|
||||||
if (!versions.length) return fail()
|
if (!versions.length) return fail()
|
||||||
}
|
}
|
||||||
@ -101,11 +94,11 @@ function fail () { process.exit(1) }
|
|||||||
function success () {
|
function success () {
|
||||||
var compare = reverse ? "rcompare" : "compare"
|
var compare = reverse ? "rcompare" : "compare"
|
||||||
versions.sort(function (a, b) {
|
versions.sort(function (a, b) {
|
||||||
return semver[compare](a, b, options)
|
return semver[compare](a, b, loose)
|
||||||
}).map(function (v) {
|
}).map(function (v) {
|
||||||
return semver.clean(v, options)
|
return semver.clean(v, loose)
|
||||||
}).map(function (v) {
|
}).map(function (v) {
|
||||||
return inc ? semver.inc(v, inc, options, identifier) : v
|
return inc ? semver.inc(v, inc, loose, identifier) : v
|
||||||
}).forEach(function (v,i,_) { console.log(v) })
|
}).forEach(function (v,i,_) { console.log(v) })
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,9 +128,6 @@ function help () {
|
|||||||
,"-l --loose"
|
,"-l --loose"
|
||||||
," Interpret versions and ranges loosely"
|
," Interpret versions and ranges loosely"
|
||||||
,""
|
,""
|
||||||
,"-p --include-prerelease"
|
|
||||||
," Always include prerelease versions in range matching"
|
|
||||||
,""
|
|
||||||
,"-c --coerce"
|
,"-c --coerce"
|
||||||
," Coerce a string into SemVer if possible"
|
," Coerce a string into SemVer if possible"
|
||||||
," (does not imply --loose)"
|
," (does not imply --loose)"
|
||||||
|
26
node_modules/semver/package.json
generated
vendored
26
node_modules/semver/package.json
generated
vendored
@ -1,30 +1,28 @@
|
|||||||
{
|
{
|
||||||
"_from": "semver@5",
|
"_from": "semver@^5.4.1",
|
||||||
"_id": "semver@5.6.0",
|
"_id": "semver@5.5.0",
|
||||||
"_inBundle": false,
|
"_inBundle": false,
|
||||||
"_integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==",
|
"_integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==",
|
||||||
"_location": "/semver",
|
"_location": "/semver",
|
||||||
"_phantomChildren": {},
|
"_phantomChildren": {},
|
||||||
"_requested": {
|
"_requested": {
|
||||||
"type": "range",
|
"type": "range",
|
||||||
"registry": true,
|
"registry": true,
|
||||||
"raw": "semver@5",
|
"raw": "semver@^5.4.1",
|
||||||
"name": "semver",
|
"name": "semver",
|
||||||
"escapedName": "semver",
|
"escapedName": "semver",
|
||||||
"rawSpec": "5",
|
"rawSpec": "^5.4.1",
|
||||||
"saveSpec": null,
|
"saveSpec": null,
|
||||||
"fetchSpec": "5"
|
"fetchSpec": "^5.4.1"
|
||||||
},
|
},
|
||||||
"_requiredBy": [
|
"_requiredBy": [
|
||||||
"#USER",
|
|
||||||
"/",
|
|
||||||
"/android-versions",
|
"/android-versions",
|
||||||
"/normalize-package-data"
|
"/normalize-package-data"
|
||||||
],
|
],
|
||||||
"_resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz",
|
"_resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz",
|
||||||
"_shasum": "7e74256fbaa49c75aa7c7a205cc22799cac80004",
|
"_shasum": "dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab",
|
||||||
"_spec": "semver@5",
|
"_spec": "semver@^5.4.1",
|
||||||
"_where": "/Users/brodybits/Documents/cordova/cordova-android",
|
"_where": "/Users/brodybits/Documents/cordova/cordova-android/node_modules/android-versions",
|
||||||
"bin": {
|
"bin": {
|
||||||
"semver": "./bin/semver"
|
"semver": "./bin/semver"
|
||||||
},
|
},
|
||||||
@ -35,7 +33,7 @@
|
|||||||
"deprecated": false,
|
"deprecated": false,
|
||||||
"description": "The semantic version parser used by npm.",
|
"description": "The semantic version parser used by npm.",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"tap": "^12.0.1"
|
"tap": "^10.7.0"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"bin",
|
"bin",
|
||||||
@ -53,5 +51,5 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "tap test/*.js --cov -J"
|
"test": "tap test/*.js --cov -J"
|
||||||
},
|
},
|
||||||
"version": "5.6.0"
|
"version": "5.5.0"
|
||||||
}
|
}
|
||||||
|
236
node_modules/semver/semver.js
generated
vendored
236
node_modules/semver/semver.js
generated
vendored
@ -245,10 +245,7 @@ for (var i = 0; i < R; i++) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exports.parse = parse;
|
exports.parse = parse;
|
||||||
function parse(version, options) {
|
function parse(version, loose) {
|
||||||
if (!options || typeof options !== 'object')
|
|
||||||
options = { loose: !!options, includePrerelease: false }
|
|
||||||
|
|
||||||
if (version instanceof SemVer)
|
if (version instanceof SemVer)
|
||||||
return version;
|
return version;
|
||||||
|
|
||||||
@ -258,37 +255,35 @@ function parse(version, options) {
|
|||||||
if (version.length > MAX_LENGTH)
|
if (version.length > MAX_LENGTH)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
var r = options.loose ? re[LOOSE] : re[FULL];
|
var r = loose ? re[LOOSE] : re[FULL];
|
||||||
if (!r.test(version))
|
if (!r.test(version))
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
return new SemVer(version, options);
|
return new SemVer(version, loose);
|
||||||
} catch (er) {
|
} catch (er) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.valid = valid;
|
exports.valid = valid;
|
||||||
function valid(version, options) {
|
function valid(version, loose) {
|
||||||
var v = parse(version, options);
|
var v = parse(version, loose);
|
||||||
return v ? v.version : null;
|
return v ? v.version : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
exports.clean = clean;
|
exports.clean = clean;
|
||||||
function clean(version, options) {
|
function clean(version, loose) {
|
||||||
var s = parse(version.trim().replace(/^[=v]+/, ''), options);
|
var s = parse(version.trim().replace(/^[=v]+/, ''), loose);
|
||||||
return s ? s.version : null;
|
return s ? s.version : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.SemVer = SemVer;
|
exports.SemVer = SemVer;
|
||||||
|
|
||||||
function SemVer(version, options) {
|
function SemVer(version, loose) {
|
||||||
if (!options || typeof options !== 'object')
|
|
||||||
options = { loose: !!options, includePrerelease: false }
|
|
||||||
if (version instanceof SemVer) {
|
if (version instanceof SemVer) {
|
||||||
if (version.loose === options.loose)
|
if (version.loose === loose)
|
||||||
return version;
|
return version;
|
||||||
else
|
else
|
||||||
version = version.version;
|
version = version.version;
|
||||||
@ -300,13 +295,11 @@ function SemVer(version, options) {
|
|||||||
throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
|
throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
|
||||||
|
|
||||||
if (!(this instanceof SemVer))
|
if (!(this instanceof SemVer))
|
||||||
return new SemVer(version, options);
|
return new SemVer(version, loose);
|
||||||
|
|
||||||
debug('SemVer', version, options);
|
debug('SemVer', version, loose);
|
||||||
this.options = options;
|
this.loose = loose;
|
||||||
this.loose = !!options.loose;
|
var m = version.trim().match(loose ? re[LOOSE] : re[FULL]);
|
||||||
|
|
||||||
var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL]);
|
|
||||||
|
|
||||||
if (!m)
|
if (!m)
|
||||||
throw new TypeError('Invalid Version: ' + version);
|
throw new TypeError('Invalid Version: ' + version);
|
||||||
@ -356,16 +349,16 @@ SemVer.prototype.toString = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
SemVer.prototype.compare = function(other) {
|
SemVer.prototype.compare = function(other) {
|
||||||
debug('SemVer.compare', this.version, this.options, other);
|
debug('SemVer.compare', this.version, this.loose, other);
|
||||||
if (!(other instanceof SemVer))
|
if (!(other instanceof SemVer))
|
||||||
other = new SemVer(other, this.options);
|
other = new SemVer(other, this.loose);
|
||||||
|
|
||||||
return this.compareMain(other) || this.comparePre(other);
|
return this.compareMain(other) || this.comparePre(other);
|
||||||
};
|
};
|
||||||
|
|
||||||
SemVer.prototype.compareMain = function(other) {
|
SemVer.prototype.compareMain = function(other) {
|
||||||
if (!(other instanceof SemVer))
|
if (!(other instanceof SemVer))
|
||||||
other = new SemVer(other, this.options);
|
other = new SemVer(other, this.loose);
|
||||||
|
|
||||||
return compareIdentifiers(this.major, other.major) ||
|
return compareIdentifiers(this.major, other.major) ||
|
||||||
compareIdentifiers(this.minor, other.minor) ||
|
compareIdentifiers(this.minor, other.minor) ||
|
||||||
@ -374,7 +367,7 @@ SemVer.prototype.compareMain = function(other) {
|
|||||||
|
|
||||||
SemVer.prototype.comparePre = function(other) {
|
SemVer.prototype.comparePre = function(other) {
|
||||||
if (!(other instanceof SemVer))
|
if (!(other instanceof SemVer))
|
||||||
other = new SemVer(other, this.options);
|
other = new SemVer(other, this.loose);
|
||||||
|
|
||||||
// NOT having a prerelease is > having one
|
// NOT having a prerelease is > having one
|
||||||
if (this.prerelease.length && !other.prerelease.length)
|
if (this.prerelease.length && !other.prerelease.length)
|
||||||
@ -665,23 +658,19 @@ function cmp(a, op, b, loose) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exports.Comparator = Comparator;
|
exports.Comparator = Comparator;
|
||||||
function Comparator(comp, options) {
|
function Comparator(comp, loose) {
|
||||||
if (!options || typeof options !== 'object')
|
|
||||||
options = { loose: !!options, includePrerelease: false }
|
|
||||||
|
|
||||||
if (comp instanceof Comparator) {
|
if (comp instanceof Comparator) {
|
||||||
if (comp.loose === !!options.loose)
|
if (comp.loose === loose)
|
||||||
return comp;
|
return comp;
|
||||||
else
|
else
|
||||||
comp = comp.value;
|
comp = comp.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(this instanceof Comparator))
|
if (!(this instanceof Comparator))
|
||||||
return new Comparator(comp, options);
|
return new Comparator(comp, loose);
|
||||||
|
|
||||||
debug('comparator', comp, options);
|
debug('comparator', comp, loose);
|
||||||
this.options = options;
|
this.loose = loose;
|
||||||
this.loose = !!options.loose;
|
|
||||||
this.parse(comp);
|
this.parse(comp);
|
||||||
|
|
||||||
if (this.semver === ANY)
|
if (this.semver === ANY)
|
||||||
@ -694,7 +683,7 @@ function Comparator(comp, options) {
|
|||||||
|
|
||||||
var ANY = {};
|
var ANY = {};
|
||||||
Comparator.prototype.parse = function(comp) {
|
Comparator.prototype.parse = function(comp) {
|
||||||
var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR];
|
var r = this.loose ? re[COMPARATORLOOSE] : re[COMPARATOR];
|
||||||
var m = comp.match(r);
|
var m = comp.match(r);
|
||||||
|
|
||||||
if (!m)
|
if (!m)
|
||||||
@ -708,7 +697,7 @@ Comparator.prototype.parse = function(comp) {
|
|||||||
if (!m[2])
|
if (!m[2])
|
||||||
this.semver = ANY;
|
this.semver = ANY;
|
||||||
else
|
else
|
||||||
this.semver = new SemVer(m[2], this.options.loose);
|
this.semver = new SemVer(m[2], this.loose);
|
||||||
};
|
};
|
||||||
|
|
||||||
Comparator.prototype.toString = function() {
|
Comparator.prototype.toString = function() {
|
||||||
@ -716,33 +705,30 @@ Comparator.prototype.toString = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Comparator.prototype.test = function(version) {
|
Comparator.prototype.test = function(version) {
|
||||||
debug('Comparator.test', version, this.options.loose);
|
debug('Comparator.test', version, this.loose);
|
||||||
|
|
||||||
if (this.semver === ANY)
|
if (this.semver === ANY)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (typeof version === 'string')
|
if (typeof version === 'string')
|
||||||
version = new SemVer(version, this.options);
|
version = new SemVer(version, this.loose);
|
||||||
|
|
||||||
return cmp(version, this.operator, this.semver, this.options);
|
return cmp(version, this.operator, this.semver, this.loose);
|
||||||
};
|
};
|
||||||
|
|
||||||
Comparator.prototype.intersects = function(comp, options) {
|
Comparator.prototype.intersects = function(comp, loose) {
|
||||||
if (!(comp instanceof Comparator)) {
|
if (!(comp instanceof Comparator)) {
|
||||||
throw new TypeError('a Comparator is required');
|
throw new TypeError('a Comparator is required');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!options || typeof options !== 'object')
|
|
||||||
options = { loose: !!options, includePrerelease: false }
|
|
||||||
|
|
||||||
var rangeTmp;
|
var rangeTmp;
|
||||||
|
|
||||||
if (this.operator === '') {
|
if (this.operator === '') {
|
||||||
rangeTmp = new Range(comp.value, options);
|
rangeTmp = new Range(comp.value, loose);
|
||||||
return satisfies(this.value, rangeTmp, options);
|
return satisfies(this.value, rangeTmp, loose);
|
||||||
} else if (comp.operator === '') {
|
} else if (comp.operator === '') {
|
||||||
rangeTmp = new Range(this.value, options);
|
rangeTmp = new Range(this.value, loose);
|
||||||
return satisfies(comp.semver, rangeTmp, options);
|
return satisfies(comp.semver, rangeTmp, loose);
|
||||||
}
|
}
|
||||||
|
|
||||||
var sameDirectionIncreasing =
|
var sameDirectionIncreasing =
|
||||||
@ -756,11 +742,11 @@ Comparator.prototype.intersects = function(comp, options) {
|
|||||||
(this.operator === '>=' || this.operator === '<=') &&
|
(this.operator === '>=' || this.operator === '<=') &&
|
||||||
(comp.operator === '>=' || comp.operator === '<=');
|
(comp.operator === '>=' || comp.operator === '<=');
|
||||||
var oppositeDirectionsLessThan =
|
var oppositeDirectionsLessThan =
|
||||||
cmp(this.semver, '<', comp.semver, options) &&
|
cmp(this.semver, '<', comp.semver, loose) &&
|
||||||
((this.operator === '>=' || this.operator === '>') &&
|
((this.operator === '>=' || this.operator === '>') &&
|
||||||
(comp.operator === '<=' || comp.operator === '<'));
|
(comp.operator === '<=' || comp.operator === '<'));
|
||||||
var oppositeDirectionsGreaterThan =
|
var oppositeDirectionsGreaterThan =
|
||||||
cmp(this.semver, '>', comp.semver, options) &&
|
cmp(this.semver, '>', comp.semver, loose) &&
|
||||||
((this.operator === '<=' || this.operator === '<') &&
|
((this.operator === '<=' || this.operator === '<') &&
|
||||||
(comp.operator === '>=' || comp.operator === '>'));
|
(comp.operator === '>=' || comp.operator === '>'));
|
||||||
|
|
||||||
@ -771,29 +757,23 @@ Comparator.prototype.intersects = function(comp, options) {
|
|||||||
|
|
||||||
|
|
||||||
exports.Range = Range;
|
exports.Range = Range;
|
||||||
function Range(range, options) {
|
function Range(range, loose) {
|
||||||
if (!options || typeof options !== 'object')
|
|
||||||
options = { loose: !!options, includePrerelease: false }
|
|
||||||
|
|
||||||
if (range instanceof Range) {
|
if (range instanceof Range) {
|
||||||
if (range.loose === !!options.loose &&
|
if (range.loose === loose) {
|
||||||
range.includePrerelease === !!options.includePrerelease) {
|
|
||||||
return range;
|
return range;
|
||||||
} else {
|
} else {
|
||||||
return new Range(range.raw, options);
|
return new Range(range.raw, loose);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (range instanceof Comparator) {
|
if (range instanceof Comparator) {
|
||||||
return new Range(range.value, options);
|
return new Range(range.value, loose);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(this instanceof Range))
|
if (!(this instanceof Range))
|
||||||
return new Range(range, options);
|
return new Range(range, loose);
|
||||||
|
|
||||||
this.options = options;
|
this.loose = loose;
|
||||||
this.loose = !!options.loose;
|
|
||||||
this.includePrerelease = !!options.includePrerelease
|
|
||||||
|
|
||||||
// First, split based on boolean or ||
|
// First, split based on boolean or ||
|
||||||
this.raw = range;
|
this.raw = range;
|
||||||
@ -823,8 +803,9 @@ Range.prototype.toString = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Range.prototype.parseRange = function(range) {
|
Range.prototype.parseRange = function(range) {
|
||||||
var loose = this.options.loose;
|
var loose = this.loose;
|
||||||
range = range.trim();
|
range = range.trim();
|
||||||
|
debug('range', range, loose);
|
||||||
// `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
|
// `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
|
||||||
var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE];
|
var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE];
|
||||||
range = range.replace(hr, hyphenReplace);
|
range = range.replace(hr, hyphenReplace);
|
||||||
@ -847,22 +828,22 @@ Range.prototype.parseRange = function(range) {
|
|||||||
|
|
||||||
var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR];
|
var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR];
|
||||||
var set = range.split(' ').map(function(comp) {
|
var set = range.split(' ').map(function(comp) {
|
||||||
return parseComparator(comp, this.options);
|
return parseComparator(comp, loose);
|
||||||
}, this).join(' ').split(/\s+/);
|
}).join(' ').split(/\s+/);
|
||||||
if (this.options.loose) {
|
if (this.loose) {
|
||||||
// in loose mode, throw out any that are not valid comparators
|
// in loose mode, throw out any that are not valid comparators
|
||||||
set = set.filter(function(comp) {
|
set = set.filter(function(comp) {
|
||||||
return !!comp.match(compRe);
|
return !!comp.match(compRe);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
set = set.map(function(comp) {
|
set = set.map(function(comp) {
|
||||||
return new Comparator(comp, this.options);
|
return new Comparator(comp, loose);
|
||||||
}, this);
|
});
|
||||||
|
|
||||||
return set;
|
return set;
|
||||||
};
|
};
|
||||||
|
|
||||||
Range.prototype.intersects = function(range, options) {
|
Range.prototype.intersects = function(range, loose) {
|
||||||
if (!(range instanceof Range)) {
|
if (!(range instanceof Range)) {
|
||||||
throw new TypeError('a Range is required');
|
throw new TypeError('a Range is required');
|
||||||
}
|
}
|
||||||
@ -871,7 +852,7 @@ Range.prototype.intersects = function(range, options) {
|
|||||||
return thisComparators.every(function(thisComparator) {
|
return thisComparators.every(function(thisComparator) {
|
||||||
return range.set.some(function(rangeComparators) {
|
return range.set.some(function(rangeComparators) {
|
||||||
return rangeComparators.every(function(rangeComparator) {
|
return rangeComparators.every(function(rangeComparator) {
|
||||||
return thisComparator.intersects(rangeComparator, options);
|
return thisComparator.intersects(rangeComparator, loose);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -880,8 +861,8 @@ Range.prototype.intersects = function(range, options) {
|
|||||||
|
|
||||||
// Mostly just for testing and legacy API reasons
|
// Mostly just for testing and legacy API reasons
|
||||||
exports.toComparators = toComparators;
|
exports.toComparators = toComparators;
|
||||||
function toComparators(range, options) {
|
function toComparators(range, loose) {
|
||||||
return new Range(range, options).set.map(function(comp) {
|
return new Range(range, loose).set.map(function(comp) {
|
||||||
return comp.map(function(c) {
|
return comp.map(function(c) {
|
||||||
return c.value;
|
return c.value;
|
||||||
}).join(' ').trim().split(' ');
|
}).join(' ').trim().split(' ');
|
||||||
@ -891,15 +872,15 @@ function toComparators(range, options) {
|
|||||||
// comprised of xranges, tildes, stars, and gtlt's at this point.
|
// comprised of xranges, tildes, stars, and gtlt's at this point.
|
||||||
// already replaced the hyphen ranges
|
// already replaced the hyphen ranges
|
||||||
// turn into a set of JUST comparators.
|
// turn into a set of JUST comparators.
|
||||||
function parseComparator(comp, options) {
|
function parseComparator(comp, loose) {
|
||||||
debug('comp', comp, options);
|
debug('comp', comp);
|
||||||
comp = replaceCarets(comp, options);
|
comp = replaceCarets(comp, loose);
|
||||||
debug('caret', comp);
|
debug('caret', comp);
|
||||||
comp = replaceTildes(comp, options);
|
comp = replaceTildes(comp, loose);
|
||||||
debug('tildes', comp);
|
debug('tildes', comp);
|
||||||
comp = replaceXRanges(comp, options);
|
comp = replaceXRanges(comp, loose);
|
||||||
debug('xrange', comp);
|
debug('xrange', comp);
|
||||||
comp = replaceStars(comp, options);
|
comp = replaceStars(comp, loose);
|
||||||
debug('stars', comp);
|
debug('stars', comp);
|
||||||
return comp;
|
return comp;
|
||||||
}
|
}
|
||||||
@ -914,16 +895,14 @@ function isX(id) {
|
|||||||
// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
|
// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
|
||||||
// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
|
// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
|
||||||
// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
|
// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
|
||||||
function replaceTildes(comp, options) {
|
function replaceTildes(comp, loose) {
|
||||||
return comp.trim().split(/\s+/).map(function(comp) {
|
return comp.trim().split(/\s+/).map(function(comp) {
|
||||||
return replaceTilde(comp, options);
|
return replaceTilde(comp, loose);
|
||||||
}).join(' ');
|
}).join(' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
function replaceTilde(comp, options) {
|
function replaceTilde(comp, loose) {
|
||||||
if (!options || typeof options !== 'object')
|
var r = loose ? re[TILDELOOSE] : re[TILDE];
|
||||||
options = { loose: !!options, includePrerelease: false }
|
|
||||||
var r = options.loose ? re[TILDELOOSE] : re[TILDE];
|
|
||||||
return comp.replace(r, function(_, M, m, p, pr) {
|
return comp.replace(r, function(_, M, m, p, pr) {
|
||||||
debug('tilde', comp, _, M, m, p, pr);
|
debug('tilde', comp, _, M, m, p, pr);
|
||||||
var ret;
|
var ret;
|
||||||
@ -957,17 +936,15 @@ function replaceTilde(comp, options) {
|
|||||||
// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
|
// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
|
||||||
// ^1.2.3 --> >=1.2.3 <2.0.0
|
// ^1.2.3 --> >=1.2.3 <2.0.0
|
||||||
// ^1.2.0 --> >=1.2.0 <2.0.0
|
// ^1.2.0 --> >=1.2.0 <2.0.0
|
||||||
function replaceCarets(comp, options) {
|
function replaceCarets(comp, loose) {
|
||||||
return comp.trim().split(/\s+/).map(function(comp) {
|
return comp.trim().split(/\s+/).map(function(comp) {
|
||||||
return replaceCaret(comp, options);
|
return replaceCaret(comp, loose);
|
||||||
}).join(' ');
|
}).join(' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
function replaceCaret(comp, options) {
|
function replaceCaret(comp, loose) {
|
||||||
debug('caret', comp, options);
|
debug('caret', comp, loose);
|
||||||
if (!options || typeof options !== 'object')
|
var r = loose ? re[CARETLOOSE] : re[CARET];
|
||||||
options = { loose: !!options, includePrerelease: false }
|
|
||||||
var r = options.loose ? re[CARETLOOSE] : re[CARET];
|
|
||||||
return comp.replace(r, function(_, M, m, p, pr) {
|
return comp.replace(r, function(_, M, m, p, pr) {
|
||||||
debug('caret', comp, _, M, m, p, pr);
|
debug('caret', comp, _, M, m, p, pr);
|
||||||
var ret;
|
var ret;
|
||||||
@ -1014,18 +991,16 @@ function replaceCaret(comp, options) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function replaceXRanges(comp, options) {
|
function replaceXRanges(comp, loose) {
|
||||||
debug('replaceXRanges', comp, options);
|
debug('replaceXRanges', comp, loose);
|
||||||
return comp.split(/\s+/).map(function(comp) {
|
return comp.split(/\s+/).map(function(comp) {
|
||||||
return replaceXRange(comp, options);
|
return replaceXRange(comp, loose);
|
||||||
}).join(' ');
|
}).join(' ');
|
||||||
}
|
}
|
||||||
|
|
||||||
function replaceXRange(comp, options) {
|
function replaceXRange(comp, loose) {
|
||||||
comp = comp.trim();
|
comp = comp.trim();
|
||||||
if (!options || typeof options !== 'object')
|
var r = loose ? re[XRANGELOOSE] : re[XRANGE];
|
||||||
options = { loose: !!options, includePrerelease: false }
|
|
||||||
var r = options.loose ? re[XRANGELOOSE] : re[XRANGE];
|
|
||||||
return comp.replace(r, function(ret, gtlt, M, m, p, pr) {
|
return comp.replace(r, function(ret, gtlt, M, m, p, pr) {
|
||||||
debug('xRange', comp, ret, gtlt, M, m, p, pr);
|
debug('xRange', comp, ret, gtlt, M, m, p, pr);
|
||||||
var xM = isX(M);
|
var xM = isX(M);
|
||||||
@ -1089,8 +1064,8 @@ function replaceXRange(comp, options) {
|
|||||||
|
|
||||||
// Because * is AND-ed with everything else in the comparator,
|
// Because * is AND-ed with everything else in the comparator,
|
||||||
// and '' means "any version", just remove the *s entirely.
|
// and '' means "any version", just remove the *s entirely.
|
||||||
function replaceStars(comp, options) {
|
function replaceStars(comp, loose) {
|
||||||
debug('replaceStars', comp, options);
|
debug('replaceStars', comp, loose);
|
||||||
// Looseness is ignored here. star is always as loose as it gets!
|
// Looseness is ignored here. star is always as loose as it gets!
|
||||||
return comp.trim().replace(re[STAR], '');
|
return comp.trim().replace(re[STAR], '');
|
||||||
}
|
}
|
||||||
@ -1134,25 +1109,22 @@ Range.prototype.test = function(version) {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (typeof version === 'string')
|
if (typeof version === 'string')
|
||||||
version = new SemVer(version, this.options);
|
version = new SemVer(version, this.loose);
|
||||||
|
|
||||||
for (var i = 0; i < this.set.length; i++) {
|
for (var i = 0; i < this.set.length; i++) {
|
||||||
if (testSet(this.set[i], version, this.options))
|
if (testSet(this.set[i], version))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
function testSet(set, version, options) {
|
function testSet(set, version) {
|
||||||
for (var i = 0; i < set.length; i++) {
|
for (var i = 0; i < set.length; i++) {
|
||||||
if (!set[i].test(version))
|
if (!set[i].test(version))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!options)
|
if (version.prerelease.length) {
|
||||||
options = {}
|
|
||||||
|
|
||||||
if (version.prerelease.length && !options.includePrerelease) {
|
|
||||||
// Find the set of versions that are allowed to have prereleases
|
// Find the set of versions that are allowed to have prereleases
|
||||||
// For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
|
// For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
|
||||||
// That should allow `1.2.3-pr.2` to pass.
|
// That should allow `1.2.3-pr.2` to pass.
|
||||||
@ -1180,9 +1152,9 @@ function testSet(set, version, options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exports.satisfies = satisfies;
|
exports.satisfies = satisfies;
|
||||||
function satisfies(version, range, options) {
|
function satisfies(version, range, loose) {
|
||||||
try {
|
try {
|
||||||
range = new Range(range, options);
|
range = new Range(range, loose);
|
||||||
} catch (er) {
|
} catch (er) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1190,19 +1162,19 @@ function satisfies(version, range, options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exports.maxSatisfying = maxSatisfying;
|
exports.maxSatisfying = maxSatisfying;
|
||||||
function maxSatisfying(versions, range, options) {
|
function maxSatisfying(versions, range, loose) {
|
||||||
var max = null;
|
var max = null;
|
||||||
var maxSV = null;
|
var maxSV = null;
|
||||||
try {
|
try {
|
||||||
var rangeObj = new Range(range, options);
|
var rangeObj = new Range(range, loose);
|
||||||
} catch (er) {
|
} catch (er) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
versions.forEach(function (v) {
|
versions.forEach(function (v) {
|
||||||
if (rangeObj.test(v)) { // satisfies(v, range, options)
|
if (rangeObj.test(v)) { // satisfies(v, range, loose)
|
||||||
if (!max || maxSV.compare(v) === -1) { // compare(max, v, true)
|
if (!max || maxSV.compare(v) === -1) { // compare(max, v, true)
|
||||||
max = v;
|
max = v;
|
||||||
maxSV = new SemVer(max, options);
|
maxSV = new SemVer(max, loose);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -1210,19 +1182,19 @@ function maxSatisfying(versions, range, options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exports.minSatisfying = minSatisfying;
|
exports.minSatisfying = minSatisfying;
|
||||||
function minSatisfying(versions, range, options) {
|
function minSatisfying(versions, range, loose) {
|
||||||
var min = null;
|
var min = null;
|
||||||
var minSV = null;
|
var minSV = null;
|
||||||
try {
|
try {
|
||||||
var rangeObj = new Range(range, options);
|
var rangeObj = new Range(range, loose);
|
||||||
} catch (er) {
|
} catch (er) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
versions.forEach(function (v) {
|
versions.forEach(function (v) {
|
||||||
if (rangeObj.test(v)) { // satisfies(v, range, options)
|
if (rangeObj.test(v)) { // satisfies(v, range, loose)
|
||||||
if (!min || minSV.compare(v) === 1) { // compare(min, v, true)
|
if (!min || minSV.compare(v) === 1) { // compare(min, v, true)
|
||||||
min = v;
|
min = v;
|
||||||
minSV = new SemVer(min, options);
|
minSV = new SemVer(min, loose);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -1230,11 +1202,11 @@ function minSatisfying(versions, range, options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exports.validRange = validRange;
|
exports.validRange = validRange;
|
||||||
function validRange(range, options) {
|
function validRange(range, loose) {
|
||||||
try {
|
try {
|
||||||
// Return '*' instead of '' so that truthiness works.
|
// Return '*' instead of '' so that truthiness works.
|
||||||
// This will throw if it's invalid anyway
|
// This will throw if it's invalid anyway
|
||||||
return new Range(range, options).range || '*';
|
return new Range(range, loose).range || '*';
|
||||||
} catch (er) {
|
} catch (er) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -1242,20 +1214,20 @@ function validRange(range, options) {
|
|||||||
|
|
||||||
// Determine if version is less than all the versions possible in the range
|
// Determine if version is less than all the versions possible in the range
|
||||||
exports.ltr = ltr;
|
exports.ltr = ltr;
|
||||||
function ltr(version, range, options) {
|
function ltr(version, range, loose) {
|
||||||
return outside(version, range, '<', options);
|
return outside(version, range, '<', loose);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine if version is greater than all the versions possible in the range.
|
// Determine if version is greater than all the versions possible in the range.
|
||||||
exports.gtr = gtr;
|
exports.gtr = gtr;
|
||||||
function gtr(version, range, options) {
|
function gtr(version, range, loose) {
|
||||||
return outside(version, range, '>', options);
|
return outside(version, range, '>', loose);
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.outside = outside;
|
exports.outside = outside;
|
||||||
function outside(version, range, hilo, options) {
|
function outside(version, range, hilo, loose) {
|
||||||
version = new SemVer(version, options);
|
version = new SemVer(version, loose);
|
||||||
range = new Range(range, options);
|
range = new Range(range, loose);
|
||||||
|
|
||||||
var gtfn, ltefn, ltfn, comp, ecomp;
|
var gtfn, ltefn, ltfn, comp, ecomp;
|
||||||
switch (hilo) {
|
switch (hilo) {
|
||||||
@ -1278,7 +1250,7 @@ function outside(version, range, hilo, options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If it satisifes the range it is not outside
|
// If it satisifes the range it is not outside
|
||||||
if (satisfies(version, range, options)) {
|
if (satisfies(version, range, loose)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1297,9 +1269,9 @@ function outside(version, range, hilo, options) {
|
|||||||
}
|
}
|
||||||
high = high || comparator;
|
high = high || comparator;
|
||||||
low = low || comparator;
|
low = low || comparator;
|
||||||
if (gtfn(comparator.semver, high.semver, options)) {
|
if (gtfn(comparator.semver, high.semver, loose)) {
|
||||||
high = comparator;
|
high = comparator;
|
||||||
} else if (ltfn(comparator.semver, low.semver, options)) {
|
} else if (ltfn(comparator.semver, low.semver, loose)) {
|
||||||
low = comparator;
|
low = comparator;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -1323,15 +1295,15 @@ function outside(version, range, hilo, options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exports.prerelease = prerelease;
|
exports.prerelease = prerelease;
|
||||||
function prerelease(version, options) {
|
function prerelease(version, loose) {
|
||||||
var parsed = parse(version, options);
|
var parsed = parse(version, loose);
|
||||||
return (parsed && parsed.prerelease.length) ? parsed.prerelease : null;
|
return (parsed && parsed.prerelease.length) ? parsed.prerelease : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.intersects = intersects;
|
exports.intersects = intersects;
|
||||||
function intersects(r1, r2, options) {
|
function intersects(r1, r2, loose) {
|
||||||
r1 = new Range(r1, options)
|
r1 = new Range(r1, loose)
|
||||||
r2 = new Range(r2, options)
|
r2 = new Range(r2, loose)
|
||||||
return r1.intersects(r2)
|
return r1.intersects(r2)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,8 +30,8 @@
|
|||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"android-versions": "1.4.0",
|
"android-versions": "1.4.0",
|
||||||
"base64-js": "1.3.0",
|
"base64-js": "1.2.0",
|
||||||
"big-integer": "1.6.36",
|
"big-integer": "1.6.32",
|
||||||
"cordova-common": "2.2.5",
|
"cordova-common": "2.2.5",
|
||||||
"elementtree": "0.1.6",
|
"elementtree": "0.1.6",
|
||||||
"glob": "5.0.15",
|
"glob": "5.0.15",
|
||||||
@ -41,7 +41,7 @@
|
|||||||
"properties-parser": "0.2.3",
|
"properties-parser": "0.2.3",
|
||||||
"q": "1.4.1",
|
"q": "1.4.1",
|
||||||
"sax": "0.3.5",
|
"sax": "0.3.5",
|
||||||
"semver": "5.6.0",
|
"semver": "5.5.0",
|
||||||
"shelljs": "0.5.3",
|
"shelljs": "0.5.3",
|
||||||
"xmlbuilder": "8.2.2"
|
"xmlbuilder": "8.2.2"
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user