cargo-semver-checks/dist/index.js

21 lines
1.6 MiB
JavaScript
Raw Permalink Normal View History

(()=>{var __webpack_modules__={2544:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){if(i===undefined)i=r;Object.defineProperty(e,i,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,i){if(i===undefined)i=r;e[i]=t[r]});var s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))i(t,e,r);s(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.annotate=t.escapeProperty=t.escapeData=void 0;const n=a(r(2037));function toCommandValue(e){if(e===null||e===undefined){return""}else if(typeof e==="string"||e instanceof String){return e}return JSON.stringify(e)}function escapeData(e){return toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A")}t.escapeData=escapeData;function escapeProperty(e){return toCommandValue(e).replace(/%/g,"%25").replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/:/g,"%3A").replace(/,/g,"%2C")}t.escapeProperty=escapeProperty;const o="::";function render(e,t,r){let i=o+e;if(r&&Object.keys(r).length>0){i+=" ";let e=true;for(const[t,s]of Object.entries(r)){if(s){if(e){e=false}else{i+=","}i+=`${t}=${escapeProperty(s)}`}}}i+=`${o}${escapeData(t)}`;return i}function annotate(e){let t;switch(e.annotation_level){case"notice":case"warning":t="warning";break;case"failure":t="error";break}const r=render(t,e.message,{file:e.path,line:e.start_line,col:e.start_column});process.stdout.write(r+n.EOL)}t.annotate=annotate},6014:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){if(i===undefined)i=r;Object.defineProperty(e,i,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,i){if(i===undefined)i=r;e[i]=t[r]});var s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))i(t,e,r);s(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.CheckReporter=void 0;const n=a(r(3706));class CheckReporter{constructor(e,t){this.client=e;this.checkName=t;this.checkId=undefined}async startCheck(e){const{owner:t,repo:r}=n.context.repo;const i=await this.client.checks.create({owner:t,repo:r,name:this.checkName,head_sha:n.context.sha,status:e?e:"in_progress"});this.checkId=i.data.id;return this.checkId}async finishCheck(e,t){const{owner:r,repo:i}=n.context.repo;await this.client.checks.update({owner:r,repo:i,name:this.checkName,check_run_id:this.checkId,status:"completed",conclusion:e,completed_at:(new Date).toISOString(),output:t});return}async cancelCheck(){const{owner:e,repo:t}=n.context.repo;await this.client.checks.update({owner:e,repo:t,name:this.checkName,check_run_id:this.checkId,status:"completed",conclusion:"cancelled",completed_at:(new Date).toISOString(),output:{title:this.checkName,summary:"Unhandled error",text:"Check was cancelled due to unhandled error. Check the Action logs for details."}});return}}t.CheckReporter=CheckReporter},9438:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){if(i===undefined)i=r;Object.defineProperty(e,i,{enumerable:true,get:function(){return t[r]}})}:function(e,t,r,i){if(i===undefined)i=r;e[i]=t[r]});var s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var a=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))i(t,e,r);s(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.Cargo=t.resolveVersion=void 0;const n=a(r(7436));const o=a(r(2186));const p
2023-01-09 00:46:08 +01:00
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/function isObject(e){return Object.prototype.toString.call(e)==="[object Object]"}function isPlainObject(e){var t,r;if(isObject(e)===false)return false;t=e.constructor;if(t===undefined)return true;r=t.prototype;if(isObject(r)===false)return false;if(r.hasOwnProperty("isPrototypeOf")===false){return false}return true}t.isPlainObject=isPlainObject},7129:(e,t,r)=>{"use strict";const i=r(665);const s=Symbol("max");const a=Symbol("length");const n=Symbol("lengthCalculator");const o=Symbol("allowStale");const p=Symbol("maxAge");const l=Symbol("dispose");const c=Symbol("noDisposeOnSet");const d=Symbol("lruList");const u=Symbol("cache");const h=Symbol("updateAgeOnGet");const naiveLength=()=>1;class LRUCache{constructor(e){if(typeof e==="number")e={max:e};if(!e)e={};if(e.max&&(typeof e.max!=="number"||e.max<0))throw new TypeError("max must be a non-negative number");const t=this[s]=e.max||Infinity;const r=e.length||naiveLength;this[n]=typeof r!=="function"?naiveLength:r;this[o]=e.stale||false;if(e.maxAge&&typeof e.maxAge!=="number")throw new TypeError("maxAge must be a number");this[p]=e.maxAge||0;this[l]=e.dispose;this[c]=e.noDisposeOnSet||false;this[h]=e.updateAgeOnGet||false;this.reset()}set max(e){if(typeof e!=="number"||e<0)throw new TypeError("max must be a non-negative number");this[s]=e||Infinity;trim(this)}get max(){return this[s]}set allowStale(e){this[o]=!!e}get allowStale(){return this[o]}set maxAge(e){if(typeof e!=="number")throw new TypeError("maxAge must be a non-negative number");this[p]=e;trim(this)}get maxAge(){return this[p]}set lengthCalculator(e){if(typeof e!=="function")e=naiveLength;if(e!==this[n]){this[n]=e;this[a]=0;this[d].forEach((e=>{e.length=this[n](e.value,e.key);this[a]+=e.length}))}trim(this)}get lengthCalculator(){return this[n]}get length(){return this[a]}get itemCount(){return this[d].length}rforEach(e,t){t=t||this;for(let r=this[d].tail;r!==null;){const i=r.prev;forEachStep(this,e,r,t);r=i}}forEach(e,t){t=t||this;for(let r=this[d].head;r!==null;){const i=r.next;forEachStep(this,e,r,t);r=i}}keys(){return this[d].toArray().map((e=>e.key))}values(){return this[d].toArray().map((e=>e.value))}reset(){if(this[l]&&this[d]&&this[d].length){this[d].forEach((e=>this[l](e.key,e.value)))}this[u]=new Map;this[d]=new i;this[a]=0}dump(){return this[d].map((e=>isStale(this,e)?false:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[d]}set(e,t,r){r=r||this[p];if(r&&typeof r!=="number")throw new TypeError("maxAge must be a number");const i=r?Date.now():0;const o=this[n](t,e);if(this[u].has(e)){if(o>this[s]){del(this,this[u].get(e));return false}const n=this[u].get(e);const p=n.value;if(this[l]){if(!this[c])this[l](e,p.value)}p.now=i;p.maxAge=r;p.value=t;this[a]+=o-p.length;p.length=o;this.get(e);trim(this);return true}const h=new Entry(e,t,o,i,r);if(h.length>this[s]){if(this[l])this[l](e,t);return false}this[a]+=h.length;this[d].unshift(h);this[u].set(e,this[d].head);trim(this);return true}has(e){if(!this[u].has(e))return false;const t=this[u].get(e).value;return!isStale(this,t)}get(e){return get(this,e,true)}peek(e){return get(this,e,false)}pop(){const e=this[d].tail;if(!e)return null;del(this,e);return e.value}del(e){del(this,this[u].get(e))}load(e){this.reset();const t=Date.now();for(let r=e.length-1;r>=0;r--){const i=e[r];const s=i.e||0;if(s===0)this.set(i.k,i.v);else{const e=s-t;if(e>0){this.set(i.k,i.v,e)}}}}prune(){this[u].forEach(((e,t)=>get(this,t,false)))}}const get=(e,t,r)=>{const i=e[u].get(t);if(i){const t=i.value;if(isStale(e,t)){del(e,i);if(!e[o])return undefined}else{if(r){if(e[h])i.value.now=Date.now();e[d].unshiftNode(i)}}return t.value}};const isStale=(e,t)=>{if(!t||!t.maxAge&&!e[p])return false;const r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[p]&&r>e[p]};const trim=e=>{if(e[a]>e[s]){for(let t=e[d].tail;e[a]>e[s]&&t!==null;){const r=t.prev;del(e,t);t=r}}};const del=(e,t)=>{if(t){const r=t.value;if(e[l])e[l](r.key,r.value);e[a]-=r.length;e[u].delete(r.key);e[d].removeNode(t)}};class Entry{constructor(e,t,r,i,s){this.key=e;this.value=t;this.length
2023-01-09 00:46:08 +01:00
/*!
* mime-db
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015-2022 Douglas Christopher Wilson
* MIT Licensed
*/
e.exports=r(3765)},3583:(e,t,r)=>{"use strict";
2023-01-09 00:46:08 +01:00
/*!
* mime-types
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015 Douglas Christopher Wilson
* MIT Licensed
*/var i=r(7426);var s=r(1017).extname;var a=/^\s*([^;\s]*)(?:;|\s|$)/;var n=/^text\//i;t.charset=charset;t.charsets={lookup:charset};t.contentType=contentType;t.extension=extension;t.extensions=Object.create(null);t.lookup=lookup;t.types=Object.create(null);populateMaps(t.extensions,t.types);function charset(e){if(!e||typeof e!=="string"){return false}var t=a.exec(e);var r=t&&i[t[1].toLowerCase()];if(r&&r.charset){return r.charset}if(t&&n.test(t[1])){return"UTF-8"}return false}function contentType(e){if(!e||typeof e!=="string"){return false}var r=e.indexOf("/")===-1?t.lookup(e):e;if(!r){return false}if(r.indexOf("charset")===-1){var i=t.charset(r);if(i)r+="; charset="+i.toLowerCase()}return r}function extension(e){if(!e||typeof e!=="string"){return false}var r=a.exec(e);var i=r&&t.extensions[r[1].toLowerCase()];if(!i||!i.length){return false}return i[0]}function lookup(e){if(!e||typeof e!=="string"){return false}var r=s("x."+e).toLowerCase().substr(1);if(!r){return false}return t.types[r]||false}function populateMaps(e,t){var r=["nginx","apache",undefined,"iana"];Object.keys(i).forEach((function forEachMimeType(s){var a=i[s];var n=a.extensions;if(!n||!n.length){return}e[s]=n;for(var o=0;o<n.length;o++){var p=n[o];if(t[p]){var l=r.indexOf(i[t[p]].source);var c=r.indexOf(a.source);if(t[p]!=="application/octet-stream"&&(l>c||l===c&&t[p].substr(0,12)==="application/")){continue}}t[p]=s}}))}},3973:(e,t,r)=>{e.exports=minimatch;minimatch.Minimatch=Minimatch;var i=function(){try{return r(1017)}catch(e){}}()||{sep:"/"};minimatch.sep=i.sep;var s=minimatch.GLOBSTAR=Minimatch.GLOBSTAR={};var a=r(3717);var n={"!":{open:"(?:(?!(?:",close:"))[^/]*?)"},"?":{open:"(?:",close:")?"},"+":{open:"(?:",close:")+"},"*":{open:"(?:",close:")*"},"@":{open:"(?:",close:")"}};var o="[^/]";var p=o+"*?";var l="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";var c="(?:(?!(?:\\/|^)\\.).)*?";var d=charSet("().*{}+?[]^$\\!");function charSet(e){return e.split("").reduce((function(e,t){e[t]=true;return e}),{})}var u=/\/+/;minimatch.filter=filter;function filter(e,t){t=t||{};return function(r,i,s){return minimatch(r,e,t)}}function ext(e,t){t=t||{};var r={};Object.keys(e).forEach((function(t){r[t]=e[t]}));Object.keys(t).forEach((function(e){r[e]=t[e]}));return r}minimatch.defaults=function(e){if(!e||typeof e!=="object"||!Object.keys(e).length){return minimatch}var t=minimatch;var r=function minimatch(r,i,s){return t(r,i,ext(e,s))};r.Minimatch=function Minimatch(r,i){return new t.Minimatch(r,ext(e,i))};r.Minimatch.defaults=function defaults(r){return t.defaults(ext(e,r)).Minimatch};r.filter=function filter(r,i){return t.filter(r,ext(e,i))};r.defaults=function defaults(r){return t.defaults(ext(e,r))};r.makeRe=function makeRe(r,i){return t.makeRe(r,ext(e,i))};r.braceExpand=function braceExpand(r,i){return t.braceExpand(r,ext(e,i))};r.match=function(r,i,s){return t.match(r,i,ext(e,s))};return r};Minimatch.defaults=function(e){return minimatch.defaults(e).Minimatch};function minimatch(e,t,r){assertValidPattern(t);if(!r)r={};if(!r.nocomment&&t.charAt(0)==="#"){return false}return new Minimatch(t,r).match(e)}function Minimatch(e,t){if(!(this instanceof Minimatch)){return new Minimatch(e,t)}assertValidPattern(e);if(!t)t={};e=e.trim();if(!t.allowWindowsEscape&&i.sep!=="/"){e=e.split(i.sep).join("/")}this.options=t;this.set=[];this.pattern=e;this.regexp=null;this.negate=false;this.comment=false;this.empty=false;this.partial=!!t.partial;this.make()}Minimatch.prototype.debug=function(){};Minimatch.prototype.make=make;function make(){var e=this.pattern;var t=this.options;if(!t.nocomment&&e.charAt(0)==="#"){this.comment=true;return}if(!e){this.empty=true;return}this.parseNegate();var r=this.globSet=this.braceExpand();if(t.debug)this.debug=function debug(){console.error.apply(console,arguments)};this.debug(this.pattern,r);r=this.globParts=r.map((function(e){return e.split(u)}));this.debug(this.pattern,r);r=r.map((function(e,t,r){return e.map(this.parse,this)}),this);this.debug(this.pattern,r);r=r.filter((function(e){return e.indexOf(false)===-1}));this.debug(this.pattern,r);thi
2023-06-06 21:35:53 +02:00
/*! http://mths.be/fromcodepoint v0.1.0 by @mathias */if(!String.fromCodePoint){(function(){var e=String.fromCharCode;var t=Math.floor;var fromCodePoint=function(){var r=16384;var i=[];var s;var a;var n=-1;var o=arguments.length;if(!o){return""}var p="";while(++n<o){var l=Number(arguments[n]);if(!isFinite(l)||l<0||l>1114111||t(l)!==l){throw RangeError("Invalid code point: "+l)}if(l<=65535){i.push(l)}else{l-=65536;s=(l>>10)+55296;a=l%1024+56320;i.push(s,a)}if(n+1===o||i.length>r){p+=e.apply(null,i);i.length=0}}return p};if(Object.defineProperty){Object.defineProperty(String,"fromCodePoint",{value:fromCodePoint,configurable:true,writable:true})}else{String.fromCodePoint=fromCodePoint}})()}})(false?0:t)},5911:(e,t)=>{t=e.exports=SemVer;var r;if(typeof process==="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)){r=function(){var e=Array.prototype.slice.call(arguments,0);e.unshift("SEMVER");console.log.apply(console,e)}}else{r=function(){}}t.SEMVER_SPEC_VERSION="2.0.0";var i=256;var s=Number.MAX_SAFE_INTEGER||9007199254740991;var a=16;var n=t.re=[];var o=t.src=[];var p=t.tokens={};var l=0;function tok(e){p[e]=l++}tok("NUMERICIDENTIFIER");o[p.NUMERICIDENTIFIER]="0|[1-9]\\d*";tok("NUMERICIDENTIFIERLOOSE");o[p.NUMERICIDENTIFIERLOOSE]="[0-9]+";tok("NONNUMERICIDENTIFIER");o[p.NONNUMERICIDENTIFIER]="\\d*[a-zA-Z-][a-zA-Z0-9-]*";tok("MAINVERSION");o[p.MAINVERSION]="("+o[p.NUMERICIDENTIFIER]+")\\."+"("+o[p.NUMERICIDENTIFIER]+")\\."+"("+o[p.NUMERICIDENTIFIER]+")";tok("MAINVERSIONLOOSE");o[p.MAINVERSIONLOOSE]="("+o[p.NUMERICIDENTIFIERLOOSE]+")\\."+"("+o[p.NUMERICIDENTIFIERLOOSE]+")\\."+"("+o[p.NUMERICIDENTIFIERLOOSE]+")";tok("PRERELEASEIDENTIFIER");o[p.PRERELEASEIDENTIFIER]="(?:"+o[p.NUMERICIDENTIFIER]+"|"+o[p.NONNUMERICIDENTIFIER]+")";tok("PRERELEASEIDENTIFIERLOOSE");o[p.PRERELEASEIDENTIFIERLOOSE]="(?:"+o[p.NUMERICIDENTIFIERLOOSE]+"|"+o[p.NONNUMERICIDENTIFIER]+")";tok("PRERELEASE");o[p.PRERELEASE]="(?:-("+o[p.PRERELEASEIDENTIFIER]+"(?:\\."+o[p.PRERELEASEIDENTIFIER]+")*))";tok("PRERELEASELOOSE");o[p.PRERELEASELOOSE]="(?:-?("+o[p.PRERELEASEIDENTIFIERLOOSE]+"(?:\\."+o[p.PRERELEASEIDENTIFIERLOOSE]+")*))";tok("BUILDIDENTIFIER");o[p.BUILDIDENTIFIER]="[0-9A-Za-z-]+";tok("BUILD");o[p.BUILD]="(?:\\+("+o[p.BUILDIDENTIFIER]+"(?:\\."+o[p.BUILDIDENTIFIER]+")*))";tok("FULL");tok("FULLPLAIN");o[p.FULLPLAIN]="v?"+o[p.MAINVERSION]+o[p.PRERELEASE]+"?"+o[p.BUILD]+"?";o[p.FULL]="^"+o[p.FULLPLAIN]+"$";tok("LOOSEPLAIN");o[p.LOOSEPLAIN]="[v=\\s]*"+o[p.MAINVERSIONLOOSE]+o[p.PRERELEASELOOSE]+"?"+o[p.BUILD]+"?";tok("LOOSE");o[p.LOOSE]="^"+o[p.LOOSEPLAIN]+"$";tok("GTLT");o[p.GTLT]="((?:<|>)?=?)";tok("XRANGEIDENTIFIERLOOSE");o[p.XRANGEIDENTIFIERLOOSE]=o[p.NUMERICIDENTIFIERLOOSE]+"|x|X|\\*";tok("XRANGEIDENTIFIER");o[p.XRANGEIDENTIFIER]=o[p.NUMERICIDENTIFIER]+"|x|X|\\*";tok("XRANGEPLAIN");o[p.XRANGEPLAIN]="[v=\\s]*("+o[p.XRANGEIDENTIFIER]+")"+"(?:\\.("+o[p.XRANGEIDENTIFIER]+")"+"(?:\\.("+o[p.XRANGEIDENTIFIER]+")"+"(?:"+o[p.PRERELEASE]+")?"+o[p.BUILD]+"?"+")?)?";tok("XRANGEPLAINLOOSE");o[p.XRANGEPLAINLOOSE]="[v=\\s]*("+o[p.XRANGEIDENTIFIERLOOSE]+")"+"(?:\\.("+o[p.XRANGEIDENTIFIERLOOSE]+")"+"(?:\\.("+o[p.XRANGEIDENTIFIERLOOSE]+")"+"(?:"+o[p.PRERELEASELOOSE]+")?"+o[p.BUILD]+"?"+")?)?";tok("XRANGE");o[p.XRANGE]="^"+o[p.GTLT]+"\\s*"+o[p.XRANGEPLAIN]+"$";tok("XRANGELOOSE");o[p.XRANGELOOSE]="^"+o[p.GTLT]+"\\s*"+o[p.XRANGEPLAINLOOSE]+"$";tok("COERCE");o[p.COERCE]="(^|[^\\d])"+"(\\d{1,"+a+"})"+"(?:\\.(\\d{1,"+a+"}))?"+"(?:\\.(\\d{1,"+a+"}))?"+"(?:$|[^\\d])";tok("COERCERTL");n[p.COERCERTL]=new RegExp(o[p.COERCE],"g");tok("LONETILDE");o[p.LONETILDE]="(?:~>?)";tok("TILDETRIM");o[p.TILDETRIM]="(\\s*)"+o[p.LONETILDE]+"\\s+";n[p.TILDETRIM]=new RegExp(o[p.TILDETRIM],"g");var c="$1~";tok("TILDE");o[p.TILDE]="^"+o[p.LONETILDE]+o[p.XRANGEPLAIN]+"$";tok("TILDELOOSE");o[p.TILDELOOSE]="^"+o[p.LONETILDE]+o[p.XRANGEPLAINLOOSE]+"$";tok("LONECARET");o[p.LONECARET]="(?:\\^)";tok("CARETTRIM");o[p.CARETTRIM]="(\\s*)"+o[p.LONECARET]+"\\s+";n[p.CARETTRIM]=new RegExp(o[p.CARETTRIM],"g");var d="$1^";tok("CARET");o[p.CARET]="^"+o[p.LONECARET]+o[p.XRANGEPLAIN