forked from phcode-dev/staging.phcode.dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsemver.browser.js
More file actions
1 lines (1 loc) · 14.9 KB
/
Copy pathsemver.browser.js
File metadata and controls
1 lines (1 loc) · 14.9 KB
1
define(function(){return function(r){function e(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return r[n].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var t={};return e.m=r,e.c=t,e.i=function(r){return r},e.d=function(r,t,n){e.o(r,t)||Object.defineProperty(r,t,{configurable:!1,enumerable:!0,get:n})},e.n=function(r){var t=r&&r.__esModule?function(){return r.default}:function(){return r};return e.d(t,"a",t),t},e.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)},e.p="",e(e.s=1)}([function(r,e){function t(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}function i(r){if(p===setTimeout)return setTimeout(r,0);if((p===t||!p)&&setTimeout)return p=setTimeout,setTimeout(r,0);try{return p(r,0)}catch(e){try{return p.call(null,r,0)}catch(e){return p.call(this,r,0)}}}function o(r){if(h===clearTimeout)return clearTimeout(r);if((h===n||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(r);try{return h(r)}catch(e){try{return h.call(null,r)}catch(e){return h.call(this,r)}}}function s(){m&&f&&(m=!1,f.length?v=f.concat(v):g=-1,v.length&&a())}function a(){if(!m){var r=i(s);m=!0;for(var e=v.length;e;){for(f=v,v=[];++g<e;)f&&f[g].run();g=-1,e=v.length}f=null,m=!1,o(r)}}function u(r,e){this.fun=r,this.array=e}function c(){}var p,h,l=r.exports={};!function(){try{p="function"==typeof setTimeout?setTimeout:t}catch(r){p=t}try{h="function"==typeof clearTimeout?clearTimeout:n}catch(r){h=n}}();var f,v=[],m=!1,g=-1;l.nextTick=function(r){var e=new Array(arguments.length-1);if(arguments.length>1)for(var t=1;t<arguments.length;t++)e[t-1]=arguments[t];v.push(new u(r,e)),1!==v.length||m||i(a)},u.prototype.run=function(){this.fun.apply(null,this.array)},l.title="browser",l.browser=!0,l.env={},l.argv=[],l.version="",l.versions={},l.on=c,l.addListener=c,l.once=c,l.off=c,l.removeListener=c,l.removeAllListeners=c,l.emit=c,l.prependListener=c,l.prependOnceListener=c,l.listeners=function(r){return[]},l.binding=function(r){throw new Error("process.binding is not supported")},l.cwd=function(){return"/"},l.chdir=function(r){throw new Error("process.chdir is not supported")},l.umask=function(){return 0}},function(r,e,t){(function(t){function n(r,e){if(r instanceof s)return r;if("string"!=typeof r)return null;if(r.length>J)return null;if(!(e?Q[vr]:Q[hr]).test(r))return null;try{return new s(r,e)}catch(r){return null}}function i(r,e){var t=n(r,e);return t?t.version:null}function o(r,e){var t=n(r.trim().replace(/^[=v]+/,""),e);return t?t.version:null}function s(r,e){if(r instanceof s){if(r.loose===e)return r;r=r.version}else if("string"!=typeof r)throw new TypeError("Invalid Version: "+r);if(r.length>J)throw new TypeError("version is longer than "+J+" characters");if(!(this instanceof s))return new s(r,e);H("SemVer",r,e),this.loose=e;var t=r.trim().match(e?Q[vr]:Q[hr]);if(!t)throw new TypeError("Invalid Version: "+r);if(this.raw=r,this.major=+t[1],this.minor=+t[2],this.patch=+t[3],this.major>K||this.major<0)throw new TypeError("Invalid major version");if(this.minor>K||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>K||this.patch<0)throw new TypeError("Invalid patch version");t[4]?this.prerelease=t[4].split(".").map(function(r){if(/^[0-9]+$/.test(r)){var e=+r;if(e>=0&&e<K)return e}return r}):this.prerelease=[],this.build=t[5]?t[5].split("."):[],this.format()}function a(r,e,t,n){"string"==typeof t&&(n=t,t=void 0);try{return new s(r,t).inc(e,n).version}catch(r){return null}}function u(r,e){if(j(r,e))return null;var t=n(r),i=n(e);if(t.prerelease.length||i.prerelease.length){for(var o in t)if(("major"===o||"minor"===o||"patch"===o)&&t[o]!==i[o])return"pre"+o;return"prerelease"}for(var o in t)if(("major"===o||"minor"===o||"patch"===o)&&t[o]!==i[o])return o}function c(r,e){var t=Xr.test(r),n=Xr.test(e);return t&&n&&(r=+r,e=+e),t&&!n?-1:n&&!t?1:r<e?-1:r>e?1:0}function p(r,e){return c(e,r)}function h(r,e){return new s(r,e).major}function l(r,e){return new s(r,e).minor}function f(r,e){return new s(r,e).patch}function v(r,e,t){return new s(r,t).compare(e)}function m(r,e){return v(r,e,!0)}function g(r,e,t){return v(e,r,t)}function w(r,t){return r.sort(function(r,n){return e.compare(r,n,t)})}function y(r,t){return r.sort(function(r,n){return e.rcompare(r,n,t)})}function d(r,e,t){return v(r,e,t)>0}function b(r,e,t){return v(r,e,t)<0}function j(r,e,t){return 0===v(r,e,t)}function E(r,e,t){return 0!==v(r,e,t)}function T(r,e,t){return v(r,e,t)>=0}function $(r,e,t){return v(r,e,t)<=0}function k(r,e,t,n){var i;switch(e){case"===":"object"==typeof r&&(r=r.version),"object"==typeof t&&(t=t.version),i=r===t;break;case"!==":"object"==typeof r&&(r=r.version),"object"==typeof t&&(t=t.version),i=r!==t;break;case"":case"=":case"==":i=j(r,t,n);break;case"!=":i=E(r,t,n);break;case">":i=d(r,t,n);break;case">=":i=T(r,t,n);break;case"<":i=b(r,t,n);break;case"<=":i=$(r,t,n);break;default:throw new TypeError("Invalid operator: "+e)}return i}function x(r,e){if(r instanceof x){if(r.loose===e)return r;r=r.value}if(!(this instanceof x))return new x(r,e);H("comparator",r,e),this.loose=e,this.parse(r),this.semver===zr?this.value="":this.value=this.operator+this.semver.version,H("comp",this)}function R(r,e){if(r instanceof R&&r.loose===e)return r;if(!(this instanceof R))return new R(r,e);if(this.loose=e,this.raw=r,this.set=r.split(/\s*\|\|\s*/).map(function(r){return this.parseRange(r.trim())},this).filter(function(r){return r.length}),!this.set.length)throw new TypeError("Invalid SemVer Range: "+r);this.format()}function S(r,e){return new R(r,e).set.map(function(r){return r.map(function(r){return r.value}).join(" ").trim().split(" ")})}function I(r,e){return H("comp",r),r=L(r,e),H("caret",r),r=V(r,e),H("tildes",r),r=N(r,e),H("xrange",r),r=C(r,e),H("stars",r),r}function A(r){return!r||"x"===r.toLowerCase()||"*"===r}function V(r,e){return r.trim().split(/\s+/).map(function(r){return _(r,e)}).join(" ")}function _(r,e){var t=e?Q[xr]:Q[kr];return r.replace(t,function(e,t,n,i,o){var s;return H("tilde",r,e,t,n,i,o),A(t)?s="":A(n)?s=">="+t+".0.0 <"+(+t+1)+".0.0":A(i)?s=">="+t+"."+n+".0 <"+t+"."+(+n+1)+".0":o?(H("replaceTilde pr",o),"-"!==o.charAt(0)&&(o="-"+o),s=">="+t+"."+n+"."+i+o+" <"+t+"."+(+n+1)+".0"):s=">="+t+"."+n+"."+i+" <"+t+"."+(+n+1)+".0",H("tilde return",s),s})}function L(r,e){return r.trim().split(/\s+/).map(function(r){return M(r,e)}).join(" ")}function M(r,e){H("caret",r,e);var t=e?Q[Vr]:Q[Ar];return r.replace(t,function(e,t,n,i,o){var s;return H("caret",r,e,t,n,i,o),A(t)?s="":A(n)?s=">="+t+".0.0 <"+(+t+1)+".0.0":A(i)?s="0"===t?">="+t+"."+n+".0 <"+t+"."+(+n+1)+".0":">="+t+"."+n+".0 <"+(+t+1)+".0.0":o?(H("replaceCaret pr",o),"-"!==o.charAt(0)&&(o="-"+o),s="0"===t?"0"===n?">="+t+"."+n+"."+i+o+" <"+t+"."+n+"."+(+i+1):">="+t+"."+n+"."+i+o+" <"+t+"."+(+n+1)+".0":">="+t+"."+n+"."+i+o+" <"+(+t+1)+".0.0"):(H("no pr"),s="0"===t?"0"===n?">="+t+"."+n+"."+i+" <"+t+"."+n+"."+(+i+1):">="+t+"."+n+"."+i+" <"+t+"."+(+n+1)+".0":">="+t+"."+n+"."+i+" <"+(+t+1)+".0.0"),H("caret return",s),s})}function N(r,e){return H("replaceXRanges",r,e),r.split(/\s+/).map(function(r){return O(r,e)}).join(" ")}function O(r,e){r=r.trim();var t=e?Q[jr]:Q[br];return r.replace(t,function(e,t,n,i,o,s){H("xRange",r,e,t,n,i,o,s);var a=A(n),u=a||A(i),c=u||A(o),p=c;return"="===t&&c&&(t=""),a?e=">"===t||"<"===t?"<0.0.0":"*":t&&c?(u&&(i=0),c&&(o=0),">"===t?(t=">=",u?(n=+n+1,i=0,o=0):c&&(i=+i+1,o=0)):"<="===t&&(t="<",u?n=+n+1:i=+i+1),e=t+n+"."+i+"."+o):u?e=">="+n+".0.0 <"+(+n+1)+".0.0":c&&(e=">="+n+"."+i+".0 <"+n+"."+(+i+1)+".0"),H("xRange return",e),e})}function C(r,e){return H("replaceStars",r,e),r.trim().replace(Q[Pr],"")}function P(r,e,t,n,i,o,s,a,u,c,p,h,l){return((e=A(t)?"":A(n)?">="+t+".0.0":A(i)?">="+t+"."+n+".0":">="+e)+" "+(a=A(u)?"":A(c)?"<"+(+u+1)+".0.0":A(p)?"<"+u+"."+(+c+1)+".0":h?"<="+u+"."+c+"."+p+"-"+h:"<="+a)).trim()}function D(r,e){for(var t=0;t<r.length;t++)if(!r[t].test(e))return!1;if(e.prerelease.length){for(var t=0;t<r.length;t++)if(H(r[t].semver),r[t].semver!==zr&&r[t].semver.prerelease.length>0){var n=r[t].semver;if(n.major===e.major&&n.minor===e.minor&&n.patch===e.patch)return!0}return!1}return!0}function X(r,e,t){try{e=new R(e,t)}catch(r){return!1}return e.test(r)}function z(r,e,t){return r.filter(function(r){return X(r,e,t)}).sort(function(r,e){return g(r,e,t)})[0]||null}function G(r,e,t){return r.filter(function(r){return X(r,e,t)}).sort(function(r,e){return v(r,e,t)})[0]||null}function Z(r,e){try{return new R(r,e).range||"*"}catch(r){return null}}function q(r,e,t){return U(r,e,"<",t)}function B(r,e,t){return U(r,e,">",t)}function U(r,e,t,n){var i,o,a,u,c;switch(r=new s(r,n),e=new R(e,n),t){case">":i=d,o=$,a=b,u=">",c=">=";break;case"<":i=b,o=T,a=d,u="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(X(r,e,n))return!1;for(var p=0;p<e.set.length;++p){var h=e.set[p],l=null,f=null;if(h.forEach(function(r){r.semver===zr&&(r=new x(">=0.0.0")),l=l||r,f=f||r,i(r.semver,l.semver,n)?l=r:a(r.semver,f.semver,n)&&(f=r)}),l.operator===u||l.operator===c)return!1;if((!f.operator||f.operator===u)&&o(r,f.semver))return!1;if(f.operator===c&&a(r,f.semver))return!1}return!0}function F(r,e){var t=n(r,e);return t&&t.prerelease.length?t.prerelease:null}var H;e=r.exports=s,H="object"==typeof t&&t.env&&t.env.NODE_DEBUG&&/\bsemver\b/i.test(t.env.NODE_DEBUG)?function(){var r=Array.prototype.slice.call(arguments,0);r.unshift("SEMVER"),console.log.apply(console,r)}:function(){},e.SEMVER_SPEC_VERSION="2.0.0";var J=256,K=Number.MAX_SAFE_INTEGER||9007199254740991,Q=e.re=[],W=e.src=[],Y=0,rr=Y++;W[rr]="0|[1-9]\\d*";var er=Y++;W[er]="[0-9]+";var tr=Y++;W[tr]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var nr=Y++;W[nr]="("+W[rr]+")\\.("+W[rr]+")\\.("+W[rr]+")";var ir=Y++;W[ir]="("+W[er]+")\\.("+W[er]+")\\.("+W[er]+")";var or=Y++;W[or]="(?:"+W[rr]+"|"+W[tr]+")";var sr=Y++;W[sr]="(?:"+W[er]+"|"+W[tr]+")";var ar=Y++;W[ar]="(?:-("+W[or]+"(?:\\."+W[or]+")*))";var ur=Y++;W[ur]="(?:-?("+W[sr]+"(?:\\."+W[sr]+")*))";var cr=Y++;W[cr]="[0-9A-Za-z-]+";var pr=Y++;W[pr]="(?:\\+("+W[cr]+"(?:\\."+W[cr]+")*))";var hr=Y++,lr="v?"+W[nr]+W[ar]+"?"+W[pr]+"?";W[hr]="^"+lr+"$";var fr="[v=\\s]*"+W[ir]+W[ur]+"?"+W[pr]+"?",vr=Y++;W[vr]="^"+fr+"$";var mr=Y++;W[mr]="((?:<|>)?=?)";var gr=Y++;W[gr]=W[er]+"|x|X|\\*";var wr=Y++;W[wr]=W[rr]+"|x|X|\\*";var yr=Y++;W[yr]="[v=\\s]*("+W[wr]+")(?:\\.("+W[wr]+")(?:\\.("+W[wr]+")(?:"+W[ar]+")?"+W[pr]+"?)?)?";var dr=Y++;W[dr]="[v=\\s]*("+W[gr]+")(?:\\.("+W[gr]+")(?:\\.("+W[gr]+")(?:"+W[ur]+")?"+W[pr]+"?)?)?";var br=Y++;W[br]="^"+W[mr]+"\\s*"+W[yr]+"$";var jr=Y++;W[jr]="^"+W[mr]+"\\s*"+W[dr]+"$";var Er=Y++;W[Er]="(?:~>?)";var Tr=Y++;W[Tr]="(\\s*)"+W[Er]+"\\s+",Q[Tr]=new RegExp(W[Tr],"g");var $r="$1~",kr=Y++;W[kr]="^"+W[Er]+W[yr]+"$";var xr=Y++;W[xr]="^"+W[Er]+W[dr]+"$";var Rr=Y++;W[Rr]="(?:\\^)";var Sr=Y++;W[Sr]="(\\s*)"+W[Rr]+"\\s+",Q[Sr]=new RegExp(W[Sr],"g");var Ir="$1^",Ar=Y++;W[Ar]="^"+W[Rr]+W[yr]+"$";var Vr=Y++;W[Vr]="^"+W[Rr]+W[dr]+"$";var _r=Y++;W[_r]="^"+W[mr]+"\\s*("+fr+")$|^$";var Lr=Y++;W[Lr]="^"+W[mr]+"\\s*("+lr+")$|^$";var Mr=Y++;W[Mr]="(\\s*)"+W[mr]+"\\s*("+fr+"|"+W[yr]+")",Q[Mr]=new RegExp(W[Mr],"g");var Nr="$1$2$3",Or=Y++;W[Or]="^\\s*("+W[yr]+")\\s+-\\s+("+W[yr]+")\\s*$";var Cr=Y++;W[Cr]="^\\s*("+W[dr]+")\\s+-\\s+("+W[dr]+")\\s*$";var Pr=Y++;W[Pr]="(<|>)?=?\\s*\\*";for(var Dr=0;Dr<Y;Dr++)H(Dr,W[Dr]),Q[Dr]||(Q[Dr]=new RegExp(W[Dr]));e.parse=n,e.valid=i,e.clean=o,e.SemVer=s,s.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},s.prototype.toString=function(){return this.version},s.prototype.compare=function(r){return H("SemVer.compare",this.version,this.loose,r),r instanceof s||(r=new s(r,this.loose)),this.compareMain(r)||this.comparePre(r)},s.prototype.compareMain=function(r){return r instanceof s||(r=new s(r,this.loose)),c(this.major,r.major)||c(this.minor,r.minor)||c(this.patch,r.patch)},s.prototype.comparePre=function(r){if(r instanceof s||(r=new s(r,this.loose)),this.prerelease.length&&!r.prerelease.length)return-1;if(!this.prerelease.length&&r.prerelease.length)return 1;if(!this.prerelease.length&&!r.prerelease.length)return 0;var e=0;do{var t=this.prerelease[e],n=r.prerelease[e];if(H("prerelease compare",e,t,n),void 0===t&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===t)return-1;if(t!==n)return c(t,n)}while(++e)},s.prototype.inc=function(r,e){switch(r){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",e);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",e);break;case"prepatch":this.prerelease.length=0,this.inc("patch",e),this.inc("pre",e);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",e),this.inc("pre",e);break;case"major":0===this.minor&&0===this.patch&&0!==this.prerelease.length||this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":0===this.patch&&0!==this.prerelease.length||this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":if(0===this.prerelease.length)this.prerelease=[0];else{for(var t=this.prerelease.length;--t>=0;)"number"==typeof this.prerelease[t]&&(this.prerelease[t]++,t=-2);-1===t&&this.prerelease.push(0)}e&&(this.prerelease[0]===e?isNaN(this.prerelease[1])&&(this.prerelease=[e,0]):this.prerelease=[e,0]);break;default:throw new Error("invalid increment argument: "+r)}return this.format(),this.raw=this.version,this},e.inc=a,e.diff=u,e.compareIdentifiers=c;var Xr=/^[0-9]+$/;e.rcompareIdentifiers=p,e.major=h,e.minor=l,e.patch=f,e.compare=v,e.compareLoose=m,e.rcompare=g,e.sort=w,e.rsort=y,e.gt=d,e.lt=b,e.eq=j,e.neq=E,e.gte=T,e.lte=$,e.cmp=k,e.Comparator=x;var zr={};x.prototype.parse=function(r){var e=this.loose?Q[_r]:Q[Lr],t=r.match(e);if(!t)throw new TypeError("Invalid comparator: "+r);this.operator=t[1],"="===this.operator&&(this.operator=""),t[2]?this.semver=new s(t[2],this.loose):this.semver=zr},x.prototype.toString=function(){return this.value},x.prototype.test=function(r){return H("Comparator.test",r,this.loose),this.semver===zr||("string"==typeof r&&(r=new s(r,this.loose)),k(r,this.operator,this.semver,this.loose))},e.Range=R,R.prototype.format=function(){return this.range=this.set.map(function(r){return r.join(" ").trim()}).join("||").trim(),this.range},R.prototype.toString=function(){return this.range},R.prototype.parseRange=function(r){var e=this.loose;r=r.trim(),H("range",r,e);var t=e?Q[Cr]:Q[Or];r=r.replace(t,P),H("hyphen replace",r),r=r.replace(Q[Mr],Nr),H("comparator trim",r,Q[Mr]),r=(r=(r=r.replace(Q[Tr],$r)).replace(Q[Sr],Ir)).split(/\s+/).join(" ");var n=e?Q[_r]:Q[Lr],i=r.split(" ").map(function(r){return I(r,e)}).join(" ").split(/\s+/);return this.loose&&(i=i.filter(function(r){return!!r.match(n)})),i.map(function(r){return new x(r,e)})},e.toComparators=S,R.prototype.test=function(r){if(!r)return!1;"string"==typeof r&&(r=new s(r,this.loose));for(var e=0;e<this.set.length;e++)if(D(this.set[e],r))return!0;return!1},e.satisfies=X,e.maxSatisfying=z,e.minSatisfying=G,e.validRange=Z,e.ltr=q,e.gtr=B,e.outside=U,e.prerelease=F}).call(e,t(0))}])});