/usr/lib/javascript/semver/semver.min.js is in libjs-semver 2.1.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 | (function(e){function W(e,n){var r=n?t[y]:t[v];return r.test(e)?new $(e,n):null}function X(e,t){var n=W(e,t);return n?n.version:null}function V(e,t){var n=W(e,t);return n?n.version:null}function $(e,n){if(e instanceof $){if(e.loose===n)return e;e=e.version}if(!(this instanceof $))return new $(e,n);this.loose=n;var r=e.trim().match(n?t[y]:t[v]);if(!r)throw new TypeError("Invalid Version: "+e);this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],r[4]?this.prerelease=r[4].split(".").map(function(e){return/^[0-9]+$/.test(e)?+e:e}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}function J(e,t,n){try{return(new $(e,n)).inc(t).version}catch(r){return null}}function Q(e,t){var n=K.test(e),r=K.test(t);return n&&r&&(e=+e,t=+t),n&&!r?-1:r&&!n?1:e<t?-1:e>t?1:0}function G(e,t){return Q(t,e)}function Y(e,t,n){return(new $(e,n)).compare(t)}function Z(e,t){return Y(e,t,!0)}function et(e,t,n){return Y(t,e,n)}function tt(t,n){return t.sort(function(t,r){return e.compare(t,r,n)})}function nt(t,n){return t.sort(function(t,r){return e.rcompare(t,r,n)})}function rt(e,t,n){return Y(e,t,n)>0}function it(e,t,n){return Y(e,t,n)<0}function st(e,t,n){return Y(e,t,n)===0}function ot(e,t,n){return Y(e,t,n)!==0}function ut(e,t,n){return Y(e,t,n)>=0}function at(e,t,n){return Y(e,t,n)<=0}function ft(e,t,n,r){var i;switch(t){case"===":i=e===n;break;case"!==":i=e!==n;break;case"":case"=":case"==":i=st(e,n,r);break;case"!=":i=ot(e,n,r);break;case">":i=rt(e,n,r);break;case">=":i=ut(e,n,r);break;case"<":i=it(e,n,r);break;case"<=":i=at(e,n,r);break;default:throw new TypeError("Invalid operator: "+t)}return i}function lt(e,t){if(e instanceof lt){if(e.loose===t)return e;e=e.value}if(!(this instanceof lt))return new lt(e,t);this.loose=t,this.parse(e),this.semver===ct?this.value="":this.value=this.operator+this.semver.version}function ht(e,t){if(e instanceof ht&&e.loose===t)return e;if(!(this instanceof ht))return new ht(e,t);this.loose=t,this.raw=e,this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length});if(!this.set.length)throw new TypeError("Invalid SemVer Range: "+e);this.format()}function pt(e,t){return(new ht(e,t)).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})}function dt(e,t){return e=yt(e,t),e=mt(e,t),e=wt(e,t),e=St(e,t),e}function vt(e){return!e||e.toLowerCase()==="x"||e==="*"}function mt(e,t){return e.trim().split(/\s+/).map(function(e){return gt(e,t)}).join(" ")}function gt(e,n){var r=n?t[O]:t[A];return e.replace(r,function(e,t,n,r,i){var s;return vt(t)?s="":vt(n)?s=">="+t+".0.0-0 <"+(+t+1)+".0.0-0":vt(r)?s=">="+t+"."+n+".0-0 <"+t+"."+(+n+1)+".0-0":i?(i.charAt(0)!=="-"&&(i="-"+i),s=">="+t+"."+n+"."+r+i+" <"+t+"."+(+n+1)+".0-0"):s=">="+t+"."+n+"."+r+"-0"+" <"+t+"."+(+n+1)+".0-0",s})}function yt(e,t){return e.trim().split(/\s+/).map(function(e){return bt(e,t)}).join(" ")}function bt(e,n){var r=n?t[H]:t[P];return e.replace(r,function(e,t,n,r,i){var s;return vt(t)?s="":vt(n)?s=">="+t+".0.0-0 <"+(+t+1)+".0.0-0":vt(r)?t==="0"?s=">="+t+"."+n+".0-0 <"+t+"."+(+n+1)+".0-0":s=">="+t+"."+n+".0-0 <"+(+t+1)+".0.0-0":i?(i.charAt(0)!=="-"&&(i="-"+i),t==="0"?n==="0"?s="="+t+"."+n+"."+r+i:s=">="+t+"."+n+"."+r+i+" <"+t+"."+(+n+1)+".0-0":s=">="+t+"."+n+"."+r+i+" <"+(+t+1)+".0.0-0"):t==="0"?n==="0"?s="="+t+"."+n+"."+r:s=">="+t+"."+n+"."+r+"-0"+" <"+t+"."+(+n+1)+".0-0":s=">="+t+"."+n+"."+r+"-0"+" <"+(+t+1)+".0.0-0",s})}function wt(e,t){return e.split(/\s+/).map(function(e){return Et(e,t)}).join(" ")}function Et(e,n){e=e.trim();var r=n?t[N]:t[T];return e.replace(r,function(e,t,n,r,i,s){var o=vt(n),u=o||vt(r),a=u||vt(i),f=a;return t==="="&&f&&(t=""),t&&f?(o&&(n=0),u&&(r=0),a&&(i=0),t===">"&&(t=">=",o||(u?(n=+n+1,r=0,i=0):a&&(r=+r+1,i=0))),e=t+n+"."+r+"."+i+"-0"):o?e="*":u?e=">="+n+".0.0-0 <"+(+n+1)+".0.0-0":a&&(e=">="+n+"."+r+".0-0 <"+n+"."+(+r+1)+".0-0"),e})}function St(e,n){return e.trim().replace(t[U],"")}function xt(e,t,n,r,i,s,o,u,a,f,l,c,h){return vt(n)?t="":vt(r)?t=">="+n+".0.0-0":vt(i)?t=">="+n+"."+r+".0-0":t=">="+t,vt(a)?u="":vt(f)?u="<"+(+a+1)+".0.0-0":vt(l)?u="<"+a+"."+(+f+1)+".0-0":c?u="<="+a+"."+f+"."+l+"-"+c:u="<="+u,(t+" "+u).trim()}function Tt(e,t){for(var n=0;n<e.length;n++)if(!e[n].test(t))return!1;return!0}function Nt(e,t,n){try{t=new ht(t,n)}catch(r){return!1}return t.test(e)}function Ct(e,t,n){return e.filter(function(e){return Nt(e,t,n)}).sort(function(e,t){return et(e,t,n)})[0]||null}function kt(e,t){try{return(new ht(e,t)).range||"*"}catch(n){return null}}typeof module=="object"&&module.exports===e&&(e=module.exports=$),e.SEMVER_SPEC_VERSION="2.0.0";var t=e.re=[],n=e.src=[],r=0,i=r++;n[i]="0|[1-9]\\d*";var s=r++;n[s]="[0-9]+";var o=r++;n[o]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";var u=r++;n[u]="("+n[i]+")\\."+"("+n[i]+")\\."+"("+n[i]+")";var a=r++;n[a]="("+n[s]+")\\."+"("+n[s]+")\\."+"("+n[s]+")";var f=r++;n[f]="(?:"+n[i]+"|"+n[o]+")";var l=r++;n[l]="(?:"+n[s]+"|"+n[o]+")";var c=r++;n[c]="(?:-("+n[f]+"(?:\\."+n[f]+")*))";var h=r++;n[h]="(?:-?("+n[l]+"(?:\\."+n[l]+")*))";var p=r++;n[p]="[0-9A-Za-z-]+";var d=r++;n[d]="(?:\\+("+n[p]+"(?:\\."+n[p]+")*))";var v=r++,m="v?"+n[u]+n[c]+"?"+n[d]+"?";n[v]="^"+m+"$";var g="[v=\\s]*"+n[a]+n[h]+"?"+n[d]+"?",y=r++;n[y]="^"+g+"$";var b=r++;n[b]="((?:<|>)?=?)";var w=r++;n[w]=n[s]+"|x|X|\\*";var E=r++;n[E]=n[i]+"|x|X|\\*";var S=r++;n[S]="[v=\\s]*("+n[E]+")"+"(?:\\.("+n[E]+")"+"(?:\\.("+n[E]+")"+"(?:("+n[c]+")"+")?)?)?";var x=r++;n[x]="[v=\\s]*("+n[w]+")"+"(?:\\.("+n[w]+")"+"(?:\\.("+n[w]+")"+"(?:("+n[h]+")"+")?)?)?";var T=r++;n[T]="^"+n[b]+"\\s*"+n[S]+"$";var N=r++;n[N]="^"+n[b]+"\\s*"+n[x]+"$";var C=r++;n[C]="(?:~>?)";var k=r++;n[k]="(\\s*)"+n[C]+"\\s+",t[k]=new RegExp(n[k],"g");var L="$1~",A=r++;n[A]="^"+n[C]+n[S]+"$";var O=r++;n[O]="^"+n[C]+n[x]+"$";var M=r++;n[M]="(?:\\^)";var _=r++;n[_]="(\\s*)"+n[M]+"\\s+",t[_]=new RegExp(n[_],"g");var D="$1^",P=r++;n[P]="^"+n[M]+n[S]+"$";var H=r++;n[H]="^"+n[M]+n[x]+"$";var B=r++;n[B]="^"+n[b]+"\\s*("+g+")$|^$";var j=r++;n[j]="^"+n[b]+"\\s*("+m+")$|^$";var F=r++;n[F]="(\\s*)"+n[b]+"\\s*("+g+"|"+n[S]+")",t[F]=new RegExp(n[F],"g");var I="$1$2$3",q=r++;n[q]="^\\s*("+n[S]+")"+"\\s+-\\s+"+"("+n[S]+")"+"\\s*$";var R=r++;n[R]="^\\s*("+n[x]+")"+"\\s+-\\s+"+"("+n[x]+")"+"\\s*$";var U=r++;n[U]="(<|>)?=?\\s*\\*";for(var z=0;z<r;z++)t[z]||(t[z]=new RegExp(n[z]));e.parse=W,e.valid=X,e.clean=V,e.SemVer=$,$.prototype.format=function(){return this.version=this.major+"."+this.minor+"."+this.patch,this.prerelease.length&&(this.version+="-"+this.prerelease.join(".")),this.version},$.prototype.inspect=function(){return'<SemVer "'+this+'">'},$.prototype.toString=function(){return this.version},$.prototype.compare=function(e){return e instanceof $||(e=new $(e,this.loose)),this.compareMain(e)||this.comparePre(e)},$.prototype.compareMain=function(e){return e instanceof $||(e=new $(e,this.loose)),Q(this.major,e.major)||Q(this.minor,e.minor)||Q(this.patch,e.patch)},$.prototype.comparePre=function(e){e instanceof $||(e=new $(e,this.loose));if(this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.lenth&&!e.prerelease.length)return 0;var t=0;do{var n=this.prerelease[t],r=e.prerelease[t];if(n===undefined&&r===undefined)return 0;if(r===undefined)return 1;if(n===undefined)return-1;if(n===r)continue;return Q(n,r)}while(++t)},$.prototype.inc=function(e){switch(e){case"major":this.major++,this.minor=-1;case"minor":this.minor++,this.patch=-1;case"patch":this.patch++,this.prerelease=[];break;case"prerelease":if(this.prerelease.length===0)this.prerelease=[0];else{var t=this.prerelease.length;while(--t>=0)typeof this.prerelease[t]=="number"&&(this.prerelease[t]++,t=-2);t===-1&&this.prerelease.push(0)}break;default:throw new Error("invalid increment argument: "+e)}return this.format(),this},e.inc=J,e.compareIdentifiers=Q;var K=/^[0-9]+$/;e.rcompareIdentifiers=G,e.compare=Y,e.compareLoose=Z,e.rcompare=et,e.sort=tt,e.rsort=nt,e.gt=rt,e.lt=it,e.eq=st,e.neq=ot,e.gte=ut,e.lte=at,e.cmp=ft,e.Comparator=lt;var ct={};lt.prototype.parse=function(e){var n=this.loose?t[B]:t[j],r=e.match(n);if(!r)throw new TypeError("Invalid comparator: "+e);this.operator=r[1],r[2]?(this.semver=new $(r[2],this.loose),this.operator==="<"&&!this.semver.prerelease.length&&(this.semver.prerelease=["0"],this.semver.format())):this.semver=ct},lt.prototype.inspect=function(){return'<SemVer Comparator "'+this+'">'},lt.prototype.toString=function(){return this.value},lt.prototype.test=function(e){return this.semver===ct?!0:ft(e,this.operator,this.semver,this.loose)},e.Range=ht,ht.prototype.inspect=function(){return'<SemVer Range "'+this.range+'">'},ht.prototype.format=function(){return this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim(),this.range},ht.prototype.toString=function(){return this.range},ht.prototype.parseRange=function(e){var n=this.loose;e=e.trim();var r=n?t[R]:t[q];e=e.replace(r,xt),e=e.replace(t[F],I),e=e.replace(t[k],L),e=e.replace(t[_],D),e=e.split(/\s+/).join(" ");var i=n?t[B]:t[j],s=e.split(" ").map(function(e){return dt(e,n)}).join(" ").split(/\s+/);return this.loose&&(s=s.filter(function(e){return!!e.match(i)})),s=s.map(function(e){return new lt(e,n)}),s},e.toComparators=pt,ht.prototype.test=function(e){if(!e)return!1;for(var t=0;t<this.set.length;t++)if(Tt(this.set[t],e))return!0;return!1},e.satisfies=Nt,e.maxSatisfying=Ct,e.validRange=kt,typeof define=="function"&&define.amd&&define(e)})(typeof exports=="object"?exports:typeof define=="function"&&define.amd?{}:semver={});
|