keep-a-changelog-new-release/dist/index.js

21 lines
110 KiB
JavaScript
Raw Normal View History

2020-02-15 11:19:02 +05:30
!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=36)}([function(t,e,r){"use strict";t.exports=function(t){return i.test("number"==typeof t?n(t):t.charAt(0))};var n=String.fromCharCode,i=/\s/},function(t,e,r){"use strict";
2020-02-15 10:00:56 +05:30
/*!
* repeat-string <https://github.com/jonschlinkert/repeat-string>
*
* Copyright (c) 2014-2015, Jon Schlinkert.
* Licensed under the MIT License.
2020-02-15 11:19:02 +05:30
*/var n,i="";t.exports=function(t,e){if("string"!=typeof t)throw new TypeError("expected a string");if(1===e)return t;if(2===e)return t+t;var r=t.length*e;if(n!==t||void 0===n)n=t,i="";else if(i.length>=r)return i.substr(0,r);for(;r>i.length&&e>1;)1&e&&(i+=t),e>>=1,t+=t;return i=(i+=t).substr(0,r)}},function(t,e){t.exports=function(){for(var t={},e=0;e<arguments.length;e++){var n=arguments[e];for(var i in n)r.call(n,i)&&(t[i]=n[i])}return t};var r=Object.prototype.hasOwnProperty},function(t,e,r){"use strict";t.exports=function(t){var e="string"==typeof t?t.charCodeAt(0):t;return e>=48&&e<=57}},function(t,e){(e=t.exports=function(t){return t.replace(/^\s*|\s*$/g,"")}).left=function(t){return t.replace(/^\s*/,"")},e.right=function(t){return t.replace(/\s*$/,"")}},function(t,e){t.exports=require("path")},function(t,e,r){"use strict";var n=r(18),i=r(63),o=r(3),a=r(19),s=r(20),c=r(64);t.exports=function(t,e){var r,o,a={};e||(e={});for(o in p)r=e[o],a[o]=null==r?p[o]:r;(a.position.indent||a.position.start)&&(a.indent=a.position.indent||[],a.position=a.position.start);return function(t,e){var r,o,a,p,z,_,V,H,G,F,M,$,Z,J,Y,K,Q,X,W,tt=e.additional,et=e.nonTerminated,rt=e.text,nt=e.reference,it=e.warning,ot=e.textContext,at=e.referenceContext,st=e.warningContext,ct=e.position,ut=e.indent||[],lt=t.length,ft=0,pt=-1,ht=ct.column||1,dt=ct.line||1,gt="",mt=[];"string"==typeof tt&&(tt=tt.charCodeAt(0));K=bt(),H=it?function(t,e){var r=bt();r.column+=e,r.offset+=e,it.call(st,U[t],r,t)}:f,ft--,lt++;for(;++ft<lt;)if(z===d&&(ht=ut[pt]||1),(z=t.charCodeAt(ft))===v){if((V=t.charCodeAt(ft+1))===h||V===d||V===g||V===m||V===v||V===y||V!=V||tt&&V===tt){gt+=l(z),ht++;continue}for($=Z=ft+1,W=Z,V===w?(W=++$,(V=t.charCodeAt(W))===A||V===k?(J=O,W=++$):J=L):J=E,r="",M="",p="",Y=T[J],W--;++W<lt&&(V=t.charCodeAt(W),Y(V));)p+=l(V),J===E&&u.call(n,p)&&(r=p,M=n[p]);(a=t.charCodeAt(W)===b)&&(W++,(o=J===E&&c(p))&&(r=p,M=o)),X=1+W-Z,(a||et)&&(p?J===E?(a&&!M?H(j,1):(r!==p&&(W=$+r.length,X=1+W-$,a=!1),a||(G=r?C:I,e.attribute?(V=t.charCodeAt(W))===x?(H(G,X),M=null):s(V)?M=null:H(G,X):H(G,X))),_=M):(a||H(D,X),_=parseInt(p,S[J]),(vt=_)>=55296&&vt<=57343||vt>1114111?(H(P,X),_=l(q)):_ in i?(H(R,X),_=i[_]):(F="",B(_)&&H(R,X),_>65535&&(F+=l((_-=65536)>>>10|55296),_=56320|1023&_),_=F+l(_))):J!==E&&H(N,X)),_?(yt(),K=bt(),ft=W-1,ht+=W-Z+1,mt.push(_),(Q=bt()).offset++,nt&&nt.call(at,_,{start:K,end:Q},t.slice(Z-1,W)),K=Q):(p=t.slice(Z-1,W),gt+=p,ht+=p.length,ft=W-1)}else 10===z&&(dt++,pt++,ht=0),z==z?(gt+=l(z),ht++):yt();var vt;return mt.join("");function bt(){return{line:dt,column:ht,offset:ft+(ct.offset||0)}}function yt(){gt&&(mt.push(gt),rt&&rt.call(ot,gt,{start:K,end:bt()}),gt="")}}(t,a)};var u={}.hasOwnProperty,l=String.fromCharCode,f=Function.prototype,p={warning:null,reference:null,text:null,warningContext:null,referenceContext:null,textContext:null,position:{},additional:null,attribute:!1,nonTerminated:!0},h=9,d=10,g=12,m=32,v=38,b=59,y=60,x=61,w=35,A=88,k=120,q=65533,E="named",O="hexadecimal",L="decimal",S={};S[O]=16,S[L]=10;var T={};T[E]=s,T[L]=o,T[O]=a;var C=1,D=2,I=3,N=4,j=5,R=6,P=7,U={};function B(t){return t>=1&&t<=8||11===t||t>=13&&t<=31||t>=127&&t<=159||t>=64976&&t<=65007||65535==(65535&t)||65534==(65535&t)}U[C]="Named character references must be terminated by a semicolon",U[D]="Numeric character references must be terminated by a semicolon",U[I]="Named character references cannot be empty",U[N]="Numeric character references cannot be empty",U[j]="Named character references must be known",U[R]="Numeric character references cannot be disallowed",U[P]="Numeric character references cannot be outside the permissible Unicode range"},function(t,e,r){"use strict";var n=r(40),i=r(14);t.exports=function(t){("string"==typeof t||n(t))&&(t={path:String(t)});return i(t)}},function(t,e,r){"use strict";t.exports=function(t,e,r,n){var i,o,a=t.length,s=-1;for(;++s<a;)if(i=t[s],(void 0===(o=i[1]||{}).pedantic||o.pedantic===r.options.pedantic)&&(void 0===o.commonmark||o.commonmark===r.options.commonmark)&&e[i[0]].apply(r,n))return!0;return!1}},function(t,e,r){"use strict";v
2020-02-15 10:00:56 +05:30
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
2020-02-15 11:19:02 +05:30
t.exports=function(t){return null!=t&&null!=t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}},function(t,e,r){"use strict";var n=r(42);function i(){}t.exports=a,i.prototype=Error.prototype,a.prototype=new i;var o=a.prototype;function a(t,e,r){var i,o,a;"string"==typeof e&&(r=e,e=null),i=function(t){var e,r=[null,null];"string"==typeof t&&(-1===(e=t.indexOf(":"))?r[1]=t:(r[0]=t.slice(0,e),r[1]=t.slice(e+1)));return r}(r),o=n(e)||"1:1",a={start:{line:null,column:null},end:{line:null,column:null}},e&&e.position&&(e=e.position),e&&(e.start?(a=e,e=e.start):a.start=e),t.stack&&(this.stack=t.stack,t=t.message),this.message=t,this.name=o,this.reason=t,this.line=e?e.line:null,this.column=e?e.column:null,this.location=a,this.source=i[0],this.ruleId=i[1]}o.file="",o.name="",o.reason="",o.message="",o.stack="",o.fatal=null,o.column=null,o.line=null},function(t,e,r){"use strict";var n={}.hasOwnProperty;function i(t){return t&&"object"==typeof t||(t={}),a(t.line)+":"+a(t.column)}function o(t){return t&&"object"==typeof t||(t={}),i(t.start)+"-"+i(t.end)}function a(t){return t&&"number"==typeof t?t:1}t.exports=function(t){if(!t||"object"!=typeof t)return"";if(n.call(t,"position")||n.call(t,"type"))return o(t.position);if(n.call(t,"start")||n.call(t,"end"))return o(t);if(n.call(t,"line")||n.call(t,"column"))return i(t);return""}},function(t,e,r){"use strict";var n=r(5),i=r(44),o=r(45);t.exports=u;var a={}.hasOwnProperty,s=u.prototype,c=["history","path","basename","stem","extname","dirname"];function u(t){var e,r,n;if(t){if("string"==typeof t||o(t))t={contents:t};else if("message"in t&&"messages"in t)return t}else t={};if(!(this instanceof u))return new u(t);for(this.data={},this.messages=[],this.history=[],this.cwd=process.cwd(),r=-1,n=c.length;++r<n;)e=c[r],a.call(t,e)&&(this[e]=t[e]);for(e in t)-1===c.indexOf(e)&&(this[e]=t[e])}function l(t,e){if(-1!==t.indexOf(n.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+n.sep+"`")}function f(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function p(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}s.toString=function(t){var e=this.contents||"";return o(e)?e.toString(t):String(e)},Object.defineProperty(s,"path",{get:function(){return this.history[this.history.length-1]},set:function(t){f(t,"path"),t!==this.path&&this.history.push(t)}}),Object.defineProperty(s,"dirname",{get:function(){return"string"==typeof this.path?n.dirname(this.path):void 0},set:function(t){p(this.path,"dirname"),this.path=n.join(t||"",this.basename)}}),Object.defineProperty(s,"basename",{get:function(){return"string"==typeof this.path?n.basename(this.path):void 0},set:function(t){f(t,"basename"),l(t,"basename"),this.path=n.join(this.dirname||"",t)}}),Object.defineProperty(s,"extname",{get:function(){return"string"==typeof this.path?n.extname(this.path):void 0},set:function(t){var e=t||"";if(l(e,"extname"),p(this.path,"extname"),e){if("."!==e.charAt(0))throw new Error("`extname` must start with `.`");if(-1!==e.indexOf(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=i(this.path,e)}}),Object.defineProperty(s,"stem",{get:function(){return"string"==typeof this.path?n.basename(this.path,this.extname):void 0},set:function(t){f(t,"stem"),l(t,"stem"),this.path=n.join(this.dirname||"",t+(this.extname||""))}})},function(t,e,r){"use strict";var n=r(5);t.exports=function(t,e){if("string"!=typeof t)return t;if(0===t.length)return t;var r=n.basename(t,n.extname(t))+e;return n.join(n.dirname(t),r)}},function(t,e){
2020-02-15 10:00:56 +05:30
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
2020-02-15 11:19:02 +05:30
t.exports=function(t){return null!=t&&null!=t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}},function(t,e,r){"use strict";var n=r(15),i=r(5),o=r(7);e.read=function(t,e){var r=o(t);return r.contents=n.readFileSync(i.resolve(r.cwd,r.path),e),r},e.write=function(t,e){var r=o(t);n.writeFileSync(i.resolve(r.cwd,r.path),r.contents||"",e)}},function(t,e,r){"use strict";var n=r(15),i=r(5),o=r(7);e.read=function(t,e,r){var a=o(t);r||"function"!=typeof e||(r=e,e=null);if(!r)return new Promise(s);function s(t,r){var o;try{o=i.resolve(a.cwd,a.path)}catch(t){return r(t)}n.readFile(o,e,(function(e,n){e?r(e):(a.contents=n,t(a))}))}s((function(t){r(null,t)}),r)},e.write=function(t,e,r){var a=o(t);r||"function"!=typeof e||(r=e,e=void 0);if(!r)return new Promise(s);function s(t,r){var o;try{o=i.resolve(a.cwd,a.path)}catch(t){return r(t)}n.writeFile(o,a.contents||"",e,(function(e){e?r(e):t()}))}s((function(t){r(null,t)}),r)}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});const o=i(r(49)),a=i(r(55)),s=i(r(108));function c({version:t,releaseDate:e}){return function(r,n){const i=function(t){const e=t.children.filter(t=>"heading"===t.type&&2===t.depth);e.shift();let r=e.shift();if(!r)throw new Error("Could not determine the release prior to this one!");const n=r.children[0];if(!n||"linkReference"!==n.type)throw new Error("Invalid changelog format, previous version is not a link reference");const i=n.children[0];if(!i)throw new Error("Invalid changelog format, link reference does not have a text");return i.value}(r);return function(t,e,r){const n=t.children.find(t=>"heading"===t.type&&2===t.depth);if(!n)throw new Error("Invalid changelog format, could not find Unreleased section");const i=n.children.shift();if(!i||n.children.length>0||"linkReference"!==i.type)throw new Error("Invalid changelog format, Unreleased section should only be a link reference");const o=` - ${r}`,a=[{type:"linkReference",identifier:e,label:e,referenceType:"shortcut",position:i.position,children:[{type:"text",value:e}]},{type:"text",value:o}];n.children=a}(r,t,e),function(t){const e=t.children,r=e.findIndex(t=>"heading"===t.type&&2===t.depth),n=e.slice(0,r),i=e.slice(r);t.children=[...n,{type:"heading",depth:2,position:{},children:[{type:"linkReference",identifier:"unreleased",label:"Unreleased",referenceType:"shortcut",children:[{type:"text",value:"Unreleased"}]}]},...i]}(r),function(t,e,r){const n=t.children,i=n.findIndex(t=>"definition"===t.type);if(-1===i)throw new Error("Invalid changelog format, unable to find definitions section");const o=n.slice(0,i),a=n.slice(i),s=a.shift(),c=s.url.replace(r,e),u=s.url.replace("HEAD",e);t.children=[...o,{type:"definition",identifier:"unreleased",url:c,label:"Unreleased"},{type:"definition",identifier:e,url:u,label:e},...a]}(r,t,i),r}}e.default=function(t,e,r){return n(this,void 0,void 0,(function*(){return yield o.default().use(a.default).use(c,{version:e,releaseDate:r}).use(s.default).process(t)}))}},function(t,e,r){"use strict";var n=r(50),i=r(51),o=r(14),a=r(52),s=r(54);t.exports=function t(){var e=[],r=a(),v={},b=!1,y=-1;return x.data=function(t,e){if("string"==typeof t)return 2===arguments.length?(d("data",b),v[t]=e,x):u.call(v,t)&&v[t]||null;if(t)return d("data",b),v=t,x;return v},x.freeze=w,x.attachers=e,x.use=function(t){var r;if(d("use",b),null==t);else if("function"==typeof t)u.apply(null,arguments);else{if("object"!=typeof t)throw new Error("Expected usable value, not `"+t+"`");"length"in t?a(t):i(t)}r&&(v.settings=n(v.settings||{},r));return x;function i(t){a(t.plugins),t.settings&&(r=n(r||{},t.settings))}function o(t){if("function"==typeof t)u(t);else{if(