UNPKG

cz-adapter-eslint

Version:

A commitizen adapter for the conventional-changelog eslint preset.

2 lines (1 loc) 14.8 kB
var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r=e(function(e,r){var n="Expected a function",o=1,i=2,a=1/0,u=9007199254740991,c="[object Arguments]",f="[object Array]",s="[object Boolean]",l="[object Date]",p="[object Error]",h="[object Function]",d="[object GeneratorFunction]",y="[object Map]",v="[object Number]",_="[object Object]",g="[object RegExp]",b="[object Set]",m="[object String]",w="[object Symbol]",j="[object ArrayBuffer]",A="[object DataView]",k=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,O=/^\w*$/,E=/^\./,x=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,S=/\\(\\)?/g,B=/^\[object .+?Constructor\]$/,$=/^(?:0|[1-9]\d*)$/,T={};T["[object Float32Array]"]=T["[object Float64Array]"]=T["[object Int8Array]"]=T["[object Int16Array]"]=T["[object Int32Array]"]=T["[object Uint8Array]"]=T["[object Uint8ClampedArray]"]=T["[object Uint16Array]"]=T["[object Uint32Array]"]=!0,T[c]=T[f]=T[j]=T[s]=T[A]=T[l]=T[p]=T[h]=T[y]=T[v]=T[_]=T[g]=T[b]=T[m]=T["[object WeakMap]"]=!1;var D="object"==typeof t&&t&&t.Object===Object&&t,I="object"==typeof self&&self&&self.Object===Object&&self,U=D||I||Function("return this")(),C=r&&!r.nodeType&&r,F=C&&e&&!e.nodeType&&e,N=F&&F.exports===C&&D.process,P=function(){try{return N&&N.binding("util")}catch(t){}}(),M=P&&P.isTypedArray;function R(t,e){for(var r=-1,n=t?t.length:0;++r<n;)if(e(t[r],r,t))return!0;return!1}function G(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function L(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}function W(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=t}),r}var z,H,K,V=Array.prototype,q=Function.prototype,J=Object.prototype,Q=U["__core-js_shared__"],X=(z=/[^.]+$/.exec(Q&&Q.keys&&Q.keys.IE_PROTO||""))?"Symbol(src)_1."+z:"",Y=q.toString,Z=J.hasOwnProperty,tt=J.toString,et=RegExp("^"+Y.call(Z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),rt=U.Symbol,nt=U.Uint8Array,ot=J.propertyIsEnumerable,it=V.splice,at=(H=Object.keys,K=Object,function(t){return H(K(t))}),ut=Ft(U,"DataView"),ct=Ft(U,"Map"),ft=Ft(U,"Promise"),st=Ft(U,"Set"),lt=Ft(U,"WeakMap"),pt=Ft(Object,"create"),ht=zt(ut),dt=zt(ct),yt=zt(ft),vt=zt(st),_t=zt(lt),gt=rt?rt.prototype:void 0,bt=gt?gt.valueOf:void 0,mt=gt?gt.toString:void 0;function wt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function jt(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function At(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function kt(t){var e=-1,r=t?t.length:0;for(this.__data__=new At;++e<r;)this.add(t[e])}function Ot(t){this.__data__=new jt(t)}function Et(t,e){for(var r=t.length;r--;)if(Kt(t[r][0],e))return r;return-1}wt.prototype.clear=function(){this.__data__=pt?pt(null):{}},wt.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},wt.prototype.get=function(t){var e=this.__data__;if(pt){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return Z.call(e,t)?e[t]:void 0},wt.prototype.has=function(t){var e=this.__data__;return pt?void 0!==e[t]:Z.call(e,t)},wt.prototype.set=function(t,e){return this.__data__[t]=pt&&void 0===e?"__lodash_hash_undefined__":e,this},jt.prototype.clear=function(){this.__data__=[]},jt.prototype.delete=function(t){var e=this.__data__,r=Et(e,t);return!(r<0||(r==e.length-1?e.pop():it.call(e,r,1),0))},jt.prototype.get=function(t){var e=this.__data__,r=Et(e,t);return r<0?void 0:e[r][1]},jt.prototype.has=function(t){return Et(this.__data__,t)>-1},jt.prototype.set=function(t,e){var r=this.__data__,n=Et(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},At.prototype.clear=function(){this.__data__={hash:new wt,map:new(ct||jt),string:new wt}},At.prototype.delete=function(t){return Ct(this,t).delete(t)},At.prototype.get=function(t){return Ct(this,t).get(t)},At.prototype.has=function(t){return Ct(this,t).has(t)},At.prototype.set=function(t,e){return Ct(this,t).set(t,e),this},kt.prototype.add=kt.prototype.push=function(t){return this.__data__.set(t,"__lodash_hash_undefined__"),this},kt.prototype.has=function(t){return this.__data__.has(t)},Ot.prototype.clear=function(){this.__data__=new jt},Ot.prototype.delete=function(t){return this.__data__.delete(t)},Ot.prototype.get=function(t){return this.__data__.get(t)},Ot.prototype.has=function(t){return this.__data__.has(t)},Ot.prototype.set=function(t,e){var r=this.__data__;if(r instanceof jt){var n=r.__data__;if(!ct||n.length<199)return n.push([t,e]),this;r=this.__data__=new At(n)}return r.set(t,e),this};var xt,St=(xt=function(t,e){return t&&Bt(t,e,re)},function(t,e){if(null==t)return t;if(!Jt(t))return xt(t,e);for(var r=t.length,n=-1,o=Object(t);++n<r&&!1!==e(o[n],n,o););return t}),Bt=function(t,e,r){for(var n=-1,o=Object(t),i=r(t),a=i.length;a--;){var u=i[++n];if(!1===e(o[u],u,o))break}return t};function $t(t,e){for(var r=0,n=(e=Mt(e,t)?[e]:It(e)).length;null!=t&&r<n;)t=t[Wt(e[r++])];return r&&r==n?t:void 0}function Tt(t,e){return null!=t&&e in Object(t)}function Dt(t,e,r,n,a){return t===e||(null==t||null==e||!Yt(t)&&!Zt(e)?t!=t&&e!=e:function(t,e,r,n,a,u){var h=qt(t),d=qt(e),k=f,O=f;h||(k=(k=Nt(t))==c?_:k),d||(O=(O=Nt(e))==c?_:O);var E=k==_&&!G(t),x=O==_&&!G(e),S=k==O;if(S&&!E)return u||(u=new Ot),h||ee(t)?Ut(t,e,r,n,a,u):function(t,e,r,n,a,u,c){switch(k){case A:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case j:return!(t.byteLength!=e.byteLength||!n(new nt(t),new nt(e)));case s:case l:case v:return Kt(+t,+e);case p:return t.name==e.name&&t.message==e.message;case g:case m:return t==e+"";case y:var f=L;case b:if(f||(f=W),t.size!=e.size&&!(u&i))return!1;var h=c.get(t);if(h)return h==e;u|=o,c.set(t,e);var d=Ut(f(t),f(e),n,a,u,c);return c.delete(t),d;case w:if(bt)return bt.call(t)==bt.call(e)}return!1}(t,e,0,r,n,a,u);if(!(a&i)){var B=E&&Z.call(t,"__wrapped__"),$=x&&Z.call(e,"__wrapped__");if(B||$){var T=B?t.value():t,D=$?e.value():e;return u||(u=new Ot),r(T,D,n,a,u)}}return!!S&&(u||(u=new Ot),function(t,e,r,n,o,a){var u=o&i,c=re(t),f=c.length;if(f!=re(e).length&&!u)return!1;for(var s=f;s--;){var l=c[s];if(!(u?l in e:Z.call(e,l)))return!1}var p=a.get(t);if(p&&a.get(e))return p==e;var h=!0;a.set(t,e),a.set(e,t);for(var d=u;++s<f;){var y=t[l=c[s]],v=e[l];if(n)var _=u?n(v,y,l,e,t,a):n(y,v,l,t,e,a);if(!(void 0===_?y===v||r(y,v,n,o,a):_)){h=!1;break}d||(d="constructor"==l)}if(h&&!d){var g=t.constructor,b=e.constructor;g!=b&&"constructor"in t&&"constructor"in e&&!("function"==typeof g&&g instanceof g&&"function"==typeof b&&b instanceof b)&&(h=!1)}return a.delete(t),a.delete(e),h}(t,e,r,n,a,u))}(t,e,Dt,r,n,a))}function It(t){return qt(t)?t:Lt(t)}function Ut(t,e,r,n,a,u){var c=a&i,f=t.length,s=e.length;if(f!=s&&!(c&&s>f))return!1;var l=u.get(t);if(l&&u.get(e))return l==e;var p=-1,h=!0,d=a&o?new kt:void 0;for(u.set(t,e),u.set(e,t);++p<f;){var y=t[p],v=e[p];if(n)var _=c?n(v,y,p,e,t,u):n(y,v,p,t,e,u);if(void 0!==_){if(_)continue;h=!1;break}if(d){if(!R(e,function(t,e){if(!d.has(e)&&(y===t||r(y,t,n,a,u)))return d.add(e)})){h=!1;break}}else if(y!==v&&!r(y,v,n,a,u)){h=!1;break}}return u.delete(t),u.delete(e),h}function Ct(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function Ft(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return function(t){return!(!Yt(t)||(e=t,X&&X in e))&&(Qt(t)||G(t)?et:B).test(zt(t));var e}(r)?r:void 0}var Nt=function(t){return tt.call(t)};function Pt(t,e){return!!(e=null==e?u:e)&&("number"==typeof t||$.test(t))&&t>-1&&t%1==0&&t<e}function Mt(t,e){if(qt(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!te(t))||O.test(t)||!k.test(t)||null!=e&&t in Object(e)}function Rt(t){return t==t&&!Yt(t)}function Gt(t,e){return function(r){return null!=r&&r[t]===e&&(void 0!==e||t in Object(r))}}(ut&&Nt(new ut(new ArrayBuffer(1)))!=A||ct&&Nt(new ct)!=y||ft&&"[object Promise]"!=Nt(ft.resolve())||st&&Nt(new st)!=b||lt&&"[object WeakMap]"!=Nt(new lt))&&(Nt=function(t){var e=tt.call(t),r=e==_?t.constructor:void 0,n=r?zt(r):void 0;if(n)switch(n){case ht:return A;case dt:return y;case yt:return"[object Promise]";case vt:return b;case _t:return"[object WeakMap]"}return e});var Lt=Ht(function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(te(t))return mt?mt.call(t):"";var e=t+"";return"0"==e&&1/t==-a?"-0":e}(e);var r=[];return E.test(t)&&r.push(""),t.replace(x,function(t,e,n,o){r.push(n?o.replace(S,"$1"):e||t)}),r});function Wt(t){if("string"==typeof t||te(t))return t;var e=t+"";return"0"==e&&1/t==-a?"-0":e}function zt(t){if(null!=t){try{return Y.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Ht(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError(n);var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=t.apply(this,n);return r.cache=i.set(o,a),a};return r.cache=new(Ht.Cache||At),r}function Kt(t,e){return t===e||t!=t&&e!=e}function Vt(t){return function(t){return Zt(t)&&Jt(t)}(t)&&Z.call(t,"callee")&&(!ot.call(t,"callee")||tt.call(t)==c)}Ht.Cache=At;var qt=Array.isArray;function Jt(t){return null!=t&&Xt(t.length)&&!Qt(t)}function Qt(t){var e=Yt(t)?tt.call(t):"";return e==h||e==d}function Xt(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=u}function Yt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Zt(t){return!!t&&"object"==typeof t}function te(t){return"symbol"==typeof t||Zt(t)&&tt.call(t)==w}var ee=M?function(t){return function(e){return t(e)}}(M):function(t){return Zt(t)&&Xt(t.length)&&!!T[tt.call(t)]};function re(t){return Jt(t)?function(t,e){var r=qt(t)||Vt(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],n=r.length,o=!!n;for(var i in t)!Z.call(t,i)||o&&("length"==i||Pt(i,n))||r.push(i);return r}(t):function(t){if((e=t)!==("function"==typeof(r=e&&e.constructor)&&r.prototype||J))return at(t);var e,r,n=[];for(var o in Object(t))Z.call(t,o)&&"constructor"!=o&&n.push(o);return n}(t)}function ne(t){return t}e.exports=function(t,e){return(qt(t)?function(t,e){for(var r=-1,n=t?t.length:0,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o}:function(t,e){var r=-1,n=Jt(t)?Array(t.length):[];return St(t,function(t,o,i){n[++r]=e(t,o,i)}),n})(t,"function"==typeof(r=e)?r:null==r?ne:"object"==typeof r?qt(r)?function(t,e){return Mt(t)&&Rt(e)?Gt(Wt(t),e):function(r){var n=function(t,e,r){var n=null==t?void 0:$t(t,e);return void 0===n?void 0:n}(r,t);return void 0===n&&n===e?function(t,e){return null!=t&&function(t,e,r){for(var n,o=-1,i=(e=Mt(e,t)?[e]:It(e)).length;++o<i;){var a=Wt(e[o]);if(!(n=null!=t&&r(t,a)))break;t=t[a]}return n||!!(i=t?t.length:0)&&Xt(i)&&Pt(a,i)&&(qt(t)||Vt(t))}(t,e,Tt)}(r,t):Dt(e,n,void 0,o|i)}}(r[0],r[1]):1==(a=function(t){for(var e=re(t),r=e.length;r--;){var n=e[r],o=t[n];e[r]=[n,o,Rt(o)]}return e}(n=r)).length&&a[0][2]?Gt(a[0][0],a[0][1]):function(t){return t===n||function(t,e,r,n){var a=r.length,u=a;if(null==t)return!u;for(t=Object(t);a--;){var c=r[a];if(c[2]?c[1]!==t[c[0]]:!(c[0]in t))return!1}for(;++a<u;){var f=(c=r[a])[0],s=t[f],l=c[1];if(c[2]){if(void 0===s&&!(f in t))return!1}else{var p=new Ot;if(!Dt(l,s,void 0,o|i,p))return!1}}return!0}(t,0,a)}:Mt(u=r)?(c=Wt(u),function(t){return null==t?void 0:t[c]}):function(t){return function(e){return $t(e,t)}}(u));var r,n,a,u,c}}),n=e(function(t,e){t.exports=function(t,e,r){if("string"!=typeof t)throw new Error("The string parameter must be a string.");if(t.length<1)throw new Error("The string parameter must be 1 character or longer.");if("number"!=typeof e)throw new Error("The length parameter must be a number.");if("string"!=typeof r&&r)throw new Error("The character parameter must be a string.");var n=-1;for(e-=t.length,r||0===r||(r=" ");++n<e;)t+=r;return t}}),o=function(t,e){if(null==t)return t;var r="string"==typeof(e=e||{}).indent?e.indent:" ",n=e.newline||"\n"+r,o="function"==typeof e.escape?e.escape:i,a=".{1,"+(e.width||50)+"}";!0!==e.cut&&(a+="([\\s​]+|$)|[^\\s​]+?([\\s​]+|$)");var u=new RegExp(a,"g"),c=r+(t.match(u)||[]).map(function(t){return"\n"===t.slice(-1)&&(t=t.slice(0,t.length-1)),o(t)}).join(n);return!0===e.trim&&(c=c.replace(/[ \t]*$/gm,"")),c};function i(t){return t}var a,u,c,f=(a={Fix:{description:"A bug fix",title:"Bug fixes"},Update:{description:"A backwards-compatible enhancement",title:"Updates"},Breaking:{description:"A backwards-incompatible enhancement",title:"Breaking changes"},Docs:{description:"Documentation change",title:"Docs"},Build:{description:"Build process update",title:"Build changes"},New:{description:"A new feature implementation",title:"New features"},Upgrade:{description:"Dependency upgrade",title:"Upgrades"},Chore:{description:"Other changes (e.g.: refactoring)",title:"Chores"}},u=function(t){if(!Array.isArray(t))throw new TypeError("expected an array");var e=t.length;if(0!==e){var r=t[0];"number"==typeof r&&(r=String(r));for(var n=r.length,o=0;++o<e;){var i=t[o];if(null!=i){"number"==typeof i&&(i=String(i));var a=i.length;"number"==typeof a&&a>n&&(n=a,r=i)}}return r}}(Object.keys(a)).length+1,c=r(a,function(t,e){return{name:n(e+":",u)+" "+t.description,value:e}}),{prompter:function(t,e){console.log("\nLine 1 will be cropped at 100 characters. All other lines will be wrapped after 100 characters.\n"),t.prompt([{type:"list",name:"type",message:"Select the type of change that you're committing:",choices:c},{type:"input",name:"subject",message:"Write a short, imperative tense description of the change:\n"},{type:"input",name:"body",message:"Provide a longer description of the change: (press enter to skip)\n"},{type:"confirm",name:"isBreaking",message:"Are there any breaking changes?",default:!1},{type:"input",name:"breaking",message:"Describe the breaking changes:\n",when:function(t){return t.isBreaking}},{type:"confirm",name:"isIssueAffected",message:"Does this change affect any open issues?",default:!1},{type:"input",name:"issues",message:'Add issue references (e.g. "fix #123", "re #123".):\n',when:function(t){return t.isIssueAffected}}]).then(function(t){var r={trim:!0,newline:"\n",indent:"",width:100},n=(t.type+": "+t.subject.trim()).slice(0,100),i=o(t.body,r),a=t.breaking?t.breaking.trim():"";a=a?"BREAKING CHANGE: "+a.replace(/^BREAKING CHANGE: /,""):"";var u,c=(u=[a=o(a,r),t.issues?o(t.issues,r):""],u.filter(function(t){return t})).join("\n\n");e(n+"\n\n"+i+"\n\n"+c)})}});module.exports=f;