mirror of
https://github.com/jiawanlong/Cesium-Examples.git
synced 2025-07-05 07:37:31 +00:00
8 lines
2.2 KiB
JavaScript
8 lines
2.2 KiB
JavaScript
/**
|
|
* Minified by jsDelivr using Terser v5.15.1.
|
|
* Original file: /npm/compare-versions@5.0.3/lib/umd/index.js
|
|
*
|
|
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
|
*/
|
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).compareVersions={})}(this,(function(e){"use strict";const t=(e,t)=>{const r=i(e),n=i(t),o=r.pop(),s=n.pop(),f=p(r,n);return 0!==f?f:o&&s?p(o.split("."),s.split(".")):o||s?o?-1:1:0},r=(e,r,n)=>{a(n);const i=t(e,r);return d[n].includes(i)},n=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,i=e=>{if("string"!=typeof e)throw new TypeError("Invalid argument expected string");const t=e.match(n);if(!t)throw new Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},o=e=>"*"===e||"x"===e||"X"===e,s=e=>{const t=parseInt(e,10);return isNaN(t)?e:t},f=(e,t)=>{if(o(e)||o(t))return 0;const[r,n]=((e,t)=>typeof e!=typeof t?[String(e),String(t)]:[e,t])(s(e),s(t));return r>n?1:r<n?-1:0},p=(e,t)=>{for(let r=0;r<Math.max(e.length,t.length);r++){const n=f(e[r]||"0",t[r]||"0");if(0!==n)return n}return 0},d={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1]},c=Object.keys(d),a=e=>{if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===c.indexOf(e))throw new Error(`Invalid operator, expected one of ${c.join("|")}`)};e.compare=r,e.compareVersions=t,e.satisfies=(e,t)=>{const n=t.match(/^([<>=~^]+)/),o=n?n[1]:"=";if("^"!==o&&"~"!==o)return r(e,t,o);const[s,f,d,,c]=i(e),[a,l,u,,x]=i(t),g=[s,f,d],y=[a,null!=l?l:"x",null!=u?u:"x"];if(x){if(!c)return!1;if(0!==p(g,y))return!1;if(-1===p(c.split("."),x.split(".")))return!1}const h=y.findIndex((e=>"0"!==e))+1,m="~"===o?2:h>1?h:1;return 0===p(g.slice(0,m),y.slice(0,m))&&-1!==p(g.slice(m),y.slice(m))},e.validate=e=>"string"==typeof e&&/^[v\d]/.test(e)&&n.test(e)}));
|
|
//# sourceMappingURL=/sm/ccf9972f73ddf0179f7515bd44750d66154bb9fc1d0d274e32b884aab84828c6.map
|