rsnext/packages/next/compiled/semver/index.js

1 line
23 KiB
JavaScript
Raw Normal View History

module.exports=function(e,t){"use strict";var s={};function __webpack_require__(t){if(s[t]){return s[t].exports}var r=s[t]={i:t,l:false,exports:{}};e[t].call(r.exports,r,r.exports,__webpack_require__);r.l=true;return r.exports}__webpack_require__.ab=__dirname+"/";function startup(){return __webpack_require__(747)}return startup()}({28:function(e,t,s){const r=s(686);const n=s(872);e.exports=((e,t,s)=>{const o=[];let i=null;let c=null;const a=e.sort((e,t)=>n(e,t,s));for(const e of a){const n=r(e,t,s);if(n){c=e;if(!i)i=e}else{if(c){o.push([i,c])}c=null;i=null}}if(i)o.push([i,null]);const l=[];for(const[e,t]of o){if(e===t)l.push(e);else if(!t&&e===a[0])l.push("*");else if(!t)l.push(`>=${e}`);else if(e===a[0])l.push(`<=${t}`);else l.push(`${e} - ${t}`)}const f=l.join(" || ");const u=typeof t.raw==="string"?t.raw:String(t);return f.length<u.length?f:t})},41:function(e,t,s){const r=s(218);const{ANY:n}=s(44);const o=s(686);const i=s(872);const c=(e,t,s)=>{e=new r(e,s);t=new r(t,s);let n=false;e:for(const r of e.set){for(const e of t.set){const t=a(r,e,s);n=n||t!==null;if(t)continue e}if(n)return false}return true};const a=(e,t,s)=>{if(e.length===1&&e[0].semver===n)return t.length===1&&t[0].semver===n;const r=new Set;let c,a;for(const t of e){if(t.operator===">"||t.operator===">=")c=l(c,t,s);else if(t.operator==="<"||t.operator==="<=")a=f(a,t,s);else r.add(t.semver)}if(r.size>1)return null;let u;if(c&&a){u=i(c.semver,a.semver,s);if(u>0)return null;else if(u===0&&(c.operator!==">="||a.operator!=="<="))return null}for(const e of r){if(c&&!o(e,String(c),s))return null;if(a&&!o(e,String(a),s))return null;for(const r of t){if(!o(e,String(r),s))return false}return true}let E,h;let $,I;for(const e of t){I=I||e.operator===">"||e.operator===">=";$=$||e.operator==="<"||e.operator==="<=";if(c){if(e.operator===">"||e.operator===">="){E=l(c,e,s);if(E===e)return false}else if(c.operator===">="&&!o(c.semver,String(e),s))return false}if(a){if(e.operator==="<"||e.operator==="<="){h=f(a,e,s);if(h===e)return false}else if(a.operator==="<="&&!o(a.semver,String(e),s))return false}if(!e.operator&&(a||c)&&u!==0)return false}if(c&&$&&!a&&u!==0)return false;if(a&&I&&!c&&u!==0)return false;return true};const l=(e,t,s)=>{if(!e)return t;const r=i(e.semver,t.semver,s);return r>0?e:r<0?t:t.operator===">"&&e.operator===">="?t:e};const f=(e,t,s)=>{if(!e)return t;const r=i(e.semver,t.semver,s);return r<0?e:r>0?t:t.operator==="<"&&e.operator==="<="?t:e};e.exports=c},44:function(e,t,s){const r=Symbol("SemVer ANY");class Comparator{static get ANY(){return r}constructor(e,t){if(!t||typeof t!=="object"){t={loose:!!t,includePrerelease:false}}if(e instanceof Comparator){if(e.loose===!!t.loose){return e}else{e=e.value}}c("comparator",e,t);this.options=t;this.loose=!!t.loose;this.parse(e);if(this.semver===r){this.value=""}else{this.value=this.operator+this.semver.version}c("comp",this)}parse(e){const t=this.options.loose?n[o.COMPARATORLOOSE]:n[o.COMPARATOR];const s=e.match(t);if(!s){throw new TypeError(`Invalid comparator: ${e}`)}this.operator=s[1]!==undefined?s[1]:"";if(this.operator==="="){this.operator=""}if(!s[2]){this.semver=r}else{this.semver=new a(s[2],this.options.loose)}}toString(){return this.value}test(e){c("Comparator.test",e,this.options.loose);if(this.semver===r||e===r){return true}if(typeof e==="string"){try{e=new a(e,this.options)}catch(e){return false}}return i(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof Comparator)){throw new TypeError("a Comparator is required")}if(!t||typeof t!=="object"){t={loose:!!t,includePrerelease:false}}if(this.operator===""){if(this.value===""){return true}return new l(e.value,t).test(this.value)}else if(e.operator===""){if(e.value===""){return true}return new l(this.value,t).test(e.semver)}const s=(this.operator===">="||this.operator===">")&&(e.operator===">="||e.operator===">");const r=(this.operator==="<="||this.operator==="<")&&(e.operator==="<="||e.operator==="<");const n=this.semver.version===e.semver.version;const o=(this.operator===">="||this.operator==="<=")&&(e.operator===">="||e.opera