UNPKG

cz-adapter-eslint

Version:

A commitizen adapter for the conventional-changelog eslint preset.

3 lines (2 loc) 15.3 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.czAdapterEslint=e()}(this,function(){var t=function(t){if(!Array.isArray(t))throw new TypeError("expected an array");var e=t.length;if(0!==e){var n=t[0];"number"==typeof n&&(n=String(n));for(var r=n.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>r&&(r=a,n=i)}}return n}},e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(t,e){return t(e={exports:{}},e.exports),e.exports}var r,o,i,a=n(function(t,n){var r=200,o="Expected a function",i="__lodash_hash_undefined__",a=1,u=2,c=1/0,f=9007199254740991,s="[object Arguments]",l="[object Array]",p="[object Boolean]",h="[object Date]",d="[object Error]",y="[object Function]",v="[object GeneratorFunction]",g="[object Map]",_="[object Number]",b="[object Object]",m="[object RegExp]",w="[object Set]",j="[object String]",A="[object Symbol]",k="[object ArrayBuffer]",O="[object DataView]",E=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,x=/^\w*$/,S=/^\./,B=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,$=/\\(\\)?/g,T=/^\[object .+?Constructor\]$/,D=/^(?:0|[1-9]\d*)$/,I={};I["[object Float32Array]"]=I["[object Float64Array]"]=I["[object Int8Array]"]=I["[object Int16Array]"]=I["[object Int32Array]"]=I["[object Uint8Array]"]=I["[object Uint8ClampedArray]"]=I["[object Uint16Array]"]=I["[object Uint32Array]"]=!0,I[s]=I[l]=I[k]=I[p]=I[O]=I[h]=I[d]=I[y]=I[g]=I[_]=I[b]=I[m]=I[w]=I[j]=I["[object WeakMap]"]=!1;var U="object"==typeof e&&e&&e.Object===Object&&e,F="object"==typeof self&&self&&self.Object===Object&&self,N=U||F||Function("return this")(),P=n&&!n.nodeType&&n,C=P&&t&&!t.nodeType&&t,M=C&&C.exports===P&&U.process,R=function(){try{return M&&M.binding("util")}catch(t){}}(),W=R&&R.isTypedArray;function z(t,e){for(var n=-1,r=t?t.length:0,o=Array(r);++n<r;)o[n]=e(t[n],n,t);return o}function G(t,e){for(var n=-1,r=t?t.length:0;++n<r;)if(e(t[n],n,t))return!0;return!1}function L(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function H(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function K(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}var V,q,J,Q=Array.prototype,X=Function.prototype,Y=Object.prototype,Z=N["__core-js_shared__"],tt=(V=/[^.]+$/.exec(Z&&Z.keys&&Z.keys.IE_PROTO||""))?"Symbol(src)_1."+V:"",et=X.toString,nt=Y.hasOwnProperty,rt=Y.toString,ot=RegExp("^"+et.call(nt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),it=N.Symbol,at=N.Uint8Array,ut=Y.propertyIsEnumerable,ct=Q.splice,ft=(q=Object.keys,J=Object,function(t){return q(J(t))}),st=Ht(N,"DataView"),lt=Ht(N,"Map"),pt=Ht(N,"Promise"),ht=Ht(N,"Set"),dt=Ht(N,"WeakMap"),yt=Ht(Object,"create"),vt=Zt(st),gt=Zt(lt),_t=Zt(pt),bt=Zt(ht),mt=Zt(dt),wt=it?it.prototype:void 0,jt=wt?wt.valueOf:void 0,At=wt?wt.toString:void 0;function kt(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Ot(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function Et(t){var e=-1,n=t?t.length:0;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function xt(t){var e=-1,n=t?t.length:0;for(this.__data__=new Et;++e<n;)this.add(t[e])}function St(t){this.__data__=new Ot(t)}function Bt(t,e){var n=re(t)||ne(t)?function(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}(t.length,String):[],r=n.length,o=!!r;for(var i in t)!e&&!nt.call(t,i)||o&&("length"==i||Vt(i,r))||n.push(i);return n}function $t(t,e){for(var n=t.length;n--;)if(ee(t[n][0],e))return n;return-1}kt.prototype.clear=function(){this.__data__=yt?yt(null):{}},kt.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},kt.prototype.get=function(t){var e=this.__data__;if(yt){var n=e[t];return n===i?void 0:n}return nt.call(e,t)?e[t]:void 0},kt.prototype.has=function(t){var e=this.__data__;return yt?void 0!==e[t]:nt.call(e,t)},kt.prototype.set=function(t,e){return this.__data__[t]=yt&&void 0===e?i:e,this},Ot.prototype.clear=function(){this.__data__=[]},Ot.prototype.delete=function(t){var e=this.__data__,n=$t(e,t);return!(n<0||(n==e.length-1?e.pop():ct.call(e,n,1),0))},Ot.prototype.get=function(t){var e=this.__data__,n=$t(e,t);return n<0?void 0:e[n][1]},Ot.prototype.has=function(t){return $t(this.__data__,t)>-1},Ot.prototype.set=function(t,e){var n=this.__data__,r=$t(n,t);return r<0?n.push([t,e]):n[r][1]=e,this},Et.prototype.clear=function(){this.__data__={hash:new kt,map:new(lt||Ot),string:new kt}},Et.prototype.delete=function(t){return Lt(this,t).delete(t)},Et.prototype.get=function(t){return Lt(this,t).get(t)},Et.prototype.has=function(t){return Lt(this,t).has(t)},Et.prototype.set=function(t,e){return Lt(this,t).set(t,e),this},xt.prototype.add=xt.prototype.push=function(t){return this.__data__.set(t,i),this},xt.prototype.has=function(t){return this.__data__.has(t)},St.prototype.clear=function(){this.__data__=new Ot},St.prototype.delete=function(t){return this.__data__.delete(t)},St.prototype.get=function(t){return this.__data__.get(t)},St.prototype.has=function(t){return this.__data__.has(t)},St.prototype.set=function(t,e){var n=this.__data__;if(n instanceof Ot){var o=n.__data__;if(!lt||o.length<r-1)return o.push([t,e]),this;n=this.__data__=new Et(o)}return n.set(t,e),this};var Tt,Dt,It=(Tt=function(t,e){return t&&Ut(t,e,le)},function(t,e){if(null==t)return t;if(!oe(t))return Tt(t,e);for(var n=t.length,r=Dt?n:-1,o=Object(t);(Dt?r--:++r<n)&&!1!==e(o[r],r,o););return t}),Ut=function(t){return function(e,n,r){for(var o=-1,i=Object(e),a=r(e),u=a.length;u--;){var c=a[t?u:++o];if(!1===n(i[c],c,i))break}return e}}();function Ft(t,e){for(var n=0,r=(e=qt(e,t)?[e]:zt(e)).length;null!=t&&n<r;)t=t[Yt(e[n++])];return n&&n==r?t:void 0}function Nt(t,e){return null!=t&&e in Object(t)}function Pt(t,e,n,r,o){return t===e||(null==t||null==e||!ue(t)&&!ce(e)?t!=t&&e!=e:function(t,e,n,r,o,i){var c=re(t),f=re(e),y=l,v=l;c||(y=(y=Kt(t))==s?b:y);f||(v=(v=Kt(e))==s?b:v);var E=y==b&&!L(t),x=v==b&&!L(e),S=y==v;if(S&&!E)return i||(i=new St),c||se(t)?Gt(t,e,n,r,o,i):function(t,e,n,r,o,i,c){switch(n){case O:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case k:return!(t.byteLength!=e.byteLength||!r(new at(t),new at(e)));case p:case h:case _:return ee(+t,+e);case d:return t.name==e.name&&t.message==e.message;case m:case j:return t==e+"";case g:var f=H;case w:var s=i&u;if(f||(f=K),t.size!=e.size&&!s)return!1;var l=c.get(t);if(l)return l==e;i|=a,c.set(t,e);var y=Gt(f(t),f(e),r,o,i,c);return c.delete(t),y;case A:if(jt)return jt.call(t)==jt.call(e)}return!1}(t,e,y,n,r,o,i);if(!(o&u)){var B=E&&nt.call(t,"__wrapped__"),$=x&&nt.call(e,"__wrapped__");if(B||$){var T=B?t.value():t,D=$?e.value():e;return i||(i=new St),n(T,D,r,o,i)}}if(!S)return!1;return i||(i=new St),function(t,e,n,r,o,i){var a=o&u,c=le(t),f=c.length,s=le(e);if(f!=s.length&&!a)return!1;for(var l=f;l--;){var p=c[l];if(!(a?p in e:nt.call(e,p)))return!1}var h=i.get(t);if(h&&i.get(e))return h==e;var d=!0;i.set(t,e),i.set(e,t);for(var y=a;++l<f;){var v=t[p=c[l]],g=e[p];if(r)var _=a?r(g,v,p,e,t,i):r(v,g,p,t,e,i);if(!(void 0===_?v===g||n(v,g,r,o,i):_)){d=!1;break}y||(y="constructor"==p)}if(d&&!y){var b=t.constructor,m=e.constructor;b!=m&&"constructor"in t&&"constructor"in e&&!("function"==typeof b&&b instanceof b&&"function"==typeof m&&m instanceof m)&&(d=!1)}return i.delete(t),i.delete(e),d}(t,e,n,r,o,i)}(t,e,Pt,n,r,o))}function Ct(t){return!(!ue(t)||tt&&tt in t)&&(ie(t)||L(t)?ot:T).test(Zt(t))}function Mt(t){return"function"==typeof t?t:null==t?pe:"object"==typeof t?re(t)?function(t,e){if(qt(t)&&Jt(e))return Qt(Yt(t),e);return function(n){var r=function(t,e,n){var r=null==t?void 0:Ft(t,e);return void 0===r?n:r}(n,t);return void 0===r&&r===e?function(t,e){return null!=t&&function(t,e,n){var r,o=-1,i=(e=qt(e,t)?[e]:zt(e)).length;for(;++o<i;){var a=Yt(e[o]);if(!(r=null!=t&&n(t,a)))break;t=t[a]}if(r)return r;return!!(i=t?t.length:0)&&ae(i)&&Vt(a,i)&&(re(t)||ne(t))}(t,e,Nt)}(n,t):Pt(e,r,void 0,a|u)}}(t[0],t[1]):function(t){var e=function(t){var e=le(t),n=e.length;for(;n--;){var r=e[n],o=t[r];e[n]=[r,o,Jt(o)]}return e}(t);if(1==e.length&&e[0][2])return Qt(e[0][0],e[0][1]);return function(n){return n===t||function(t,e,n,r){var o=n.length,i=o,c=!r;if(null==t)return!i;for(t=Object(t);o--;){var f=n[o];if(c&&f[2]?f[1]!==t[f[0]]:!(f[0]in t))return!1}for(;++o<i;){var s=(f=n[o])[0],l=t[s],p=f[1];if(c&&f[2]){if(void 0===l&&!(s in t))return!1}else{var h=new St;if(r)var d=r(l,p,s,t,e,h);if(!(void 0===d?Pt(p,l,r,a|u,h):d))return!1}}return!0}(n,t,e)}}(t):qt(e=t)?(n=Yt(e),function(t){return null==t?void 0:t[n]}):function(t){return function(e){return Ft(e,t)}}(e);var e,n}function Rt(t){if((e=t)!==("function"==typeof(n=e&&e.constructor)&&n.prototype||Y))return ft(t);var e,n,r=[];for(var o in Object(t))nt.call(t,o)&&"constructor"!=o&&r.push(o);return r}function Wt(t,e){var n=-1,r=oe(t)?Array(t.length):[];return It(t,function(t,o,i){r[++n]=e(t,o,i)}),r}function zt(t){return re(t)?t:Xt(t)}function Gt(t,e,n,r,o,i){var c=o&u,f=t.length,s=e.length;if(f!=s&&!(c&&s>f))return!1;var l=i.get(t);if(l&&i.get(e))return l==e;var p=-1,h=!0,d=o&a?new xt:void 0;for(i.set(t,e),i.set(e,t);++p<f;){var y=t[p],v=e[p];if(r)var g=c?r(v,y,p,e,t,i):r(y,v,p,t,e,i);if(void 0!==g){if(g)continue;h=!1;break}if(d){if(!G(e,function(t,e){if(!d.has(e)&&(y===t||n(y,t,r,o,i)))return d.add(e)})){h=!1;break}}else if(y!==v&&!n(y,v,r,o,i)){h=!1;break}}return i.delete(t),i.delete(e),h}function Lt(t,e){var n,r,o=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof e?"string":"hash"]:o.map}function Ht(t,e){var n=function(t,e){return null==t?void 0:t[e]}(t,e);return Ct(n)?n:void 0}var Kt=function(t){return rt.call(t)};function Vt(t,e){return!!(e=null==e?f:e)&&("number"==typeof t||D.test(t))&&t>-1&&t%1==0&&t<e}function qt(t,e){if(re(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!fe(t))||(x.test(t)||!E.test(t)||null!=e&&t in Object(e))}function Jt(t){return t==t&&!ue(t)}function Qt(t,e){return function(n){return null!=n&&(n[t]===e&&(void 0!==e||t in Object(n)))}}(st&&Kt(new st(new ArrayBuffer(1)))!=O||lt&&Kt(new lt)!=g||pt&&"[object Promise]"!=Kt(pt.resolve())||ht&&Kt(new ht)!=w||dt&&"[object WeakMap]"!=Kt(new dt))&&(Kt=function(t){var e=rt.call(t),n=e==b?t.constructor:void 0,r=n?Zt(n):void 0;if(r)switch(r){case vt:return O;case gt:return g;case _t:return"[object Promise]";case bt:return w;case mt:return"[object WeakMap]"}return e});var Xt=te(function(t){var e;t=null==(e=t)?"":function(t){if("string"==typeof t)return t;if(fe(t))return At?At.call(t):"";var e=t+"";return"0"==e&&1/t==-c?"-0":e}(e);var n=[];return S.test(t)&&n.push(""),t.replace(B,function(t,e,r,o){n.push(r?o.replace($,"$1"):e||t)}),n});function Yt(t){if("string"==typeof t||fe(t))return t;var e=t+"";return"0"==e&&1/t==-c?"-0":e}function Zt(t){if(null!=t){try{return et.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function te(t,e){if("function"!=typeof t||e&&"function"!=typeof e)throw new TypeError(o);var n=function(){var r=arguments,o=e?e.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=t.apply(this,r);return n.cache=i.set(o,a),a};return n.cache=new(te.Cache||Et),n}function ee(t,e){return t===e||t!=t&&e!=e}function ne(t){return function(t){return ce(t)&&oe(t)}(t)&&nt.call(t,"callee")&&(!ut.call(t,"callee")||rt.call(t)==s)}te.Cache=Et;var re=Array.isArray;function oe(t){return null!=t&&ae(t.length)&&!ie(t)}function ie(t){var e=ue(t)?rt.call(t):"";return e==y||e==v}function ae(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=f}function ue(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function ce(t){return!!t&&"object"==typeof t}function fe(t){return"symbol"==typeof t||ce(t)&&rt.call(t)==A}var se=W?function(t){return function(e){return t(e)}}(W):function(t){return ce(t)&&ae(t.length)&&!!I[rt.call(t)]};function le(t){return oe(t)?Bt(t):Rt(t)}function pe(t){return t}t.exports=function(t,e){return(re(t)?z:Wt)(t,Mt(e))}}),u=n(function(t,e){t.exports=function(t,e,n){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 n&&n)throw new Error("The character parameter must be a string.");var r=-1;for(e-=t.length,n||0===n||(n=" ");++r<e;)t+=n;return t}}),c=function(t,e){if(e=e||{},null==t)return t;var n="string"==typeof e.indent?e.indent:" ",r=e.newline||"\n"+n,o="function"==typeof e.escape?e.escape:f,i=".{1,"+(e.width||50)+"}";!0!==e.cut&&(i+="([\\s​]+|$)|[^\\s​]+?([\\s​]+|$)");var a=new RegExp(i,"g"),u=n+(t.match(a)||[]).map(function(t){return"\n"===t.slice(-1)&&(t=t.slice(0,t.length-1)),o(t)}).join(r);return!0===e.trim&&(u=u.replace(/[ \t]*$/gm,"")),u};function f(t){return t}return r={types:{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"}}}.types,o=t(Object.keys(r)).length+1,i=a(r,function(t,e){return{name:u(e+":",o)+" "+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:i},{type:"input",name:"scope",message:"What is the scope of this change (e.g. component or file name)? (press enter to skip)\n"},{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 n={trim:!0,newline:"\n",indent:"",width:100},r=t.scope.trim();r=r?"("+t.scope.trim()+")":"";var o=(t.type+r+": "+t.subject.trim()).slice(0,100),i=c(t.body,n),a=t.breaking?t.breaking.trim():"";a=a?"BREAKING CHANGE: "+a.replace(/^BREAKING CHANGE: /,""):"",a=c(a,n);var u,f=t.issues?c(t.issues,n):"",s=(u=[a,f],u.filter(function(t){return t})).join("\n\n");e(o+"\n\n"+i+"\n\n"+s)})}}}); //# sourceMappingURL=cz-adapter-eslint.umd.js.map