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

49 lines
339 KiB
JavaScript
Raw Normal View History

2020-02-15 10:00:56 +05:30
!function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,function(t){return e[t]}.bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=53)}([function(e,t,r){"use strict";e.exports=function(e){return i.test("number"==typeof e?n(e):e.charAt(0))};var n=String.fromCharCode,i=/\s/},function(e,t){e.exports=require("stream")},function(e,t,r){"use strict";
/*!
* repeat-string <https://github.com/jonschlinkert/repeat-string>
*
* Copyright (c) 2014-2015, Jon Schlinkert.
* Licensed under the MIT License.
*/var n,i="";e.exports=function(e,t){if("string"!=typeof e)throw new TypeError("expected a string");if(1===t)return e;if(2===t)return e+e;var r=e.length*t;if(n!==e||void 0===n)n=e,i="";else if(i.length>=r)return i.substr(0,r);for(;r>i.length&&t>1;)1&t&&(i+=e),t>>=1,e+=e;return i=(i+=e).substr(0,r)}},function(e,t){e.exports=function(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var i in n)r.call(n,i)&&(e[i]=n[i])}return e};var r=Object.prototype.hasOwnProperty},function(e,t){e.exports=require("zlib")},function(e,t,r){"use strict";r.r(t),r.d(t,"Deprecation",(function(){return n}));class n extends Error{constructor(e){super(e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="Deprecation"}}},function(e,t,r){"use strict";e.exports=function(e){var t="string"==typeof e?e.charCodeAt(0):e;return t>=48&&t<=57}},function(e,t){(t=e.exports=function(e){return e.replace(/^\s*|\s*$/g,"")}).left=function(e){return e.replace(/^\s*/,"")},t.right=function(e){return e.replace(/\s*$/,"")}},function(e,t){e.exports=require("url")},function(e,t){e.exports=require("path")},function(e,t,r){var n=r(63);function i(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function o(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)},r=e.name||"Function wrapped with `once`";return t.onceError=r+" shouldn't be called more than once",t.called=!1,t}e.exports=n(i),e.exports.strict=n(o),i.proto=i((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return i(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return o(this)},configurable:!0})}))},function(e,t){e.exports=function(e){if(r[e])return;console.warn(`DEPRECATED (@octokit/rest): ${e}`),r[e]=1};const r={}},function(e,t){e.exports=function(e){e=e.link||e.headers.link||"";const t={};return e.replace(/<([^>]*)>;\s*rel="([\w]*)"/g,(e,r,n)=>{t[n]=r}),t}},function(e,t){e.exports=require("http")},function(e,t){e.exports=require("os")},function(e,t,r){"use strict";function n(){return navigator.userAgent}r.r(t),r.d(t,"getUserAgent",(function(){return n}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(5);const o=((n=r(10))&&"object"==typeof n&&"default"in n?n.default:n)(e=>console.warn(e));class s extends Error{constructor(e,t,r){super(e),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="HttpError",this.status=t,Object.defineProperty(this,"code",{get:()=>(o(new i.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`.")),t)}),this.headers=r.headers||{};const n=Object.assign({},r.request);r.request.headers.authorization&&(n.headers=Object.assign({},r.request.headers,{authorization:r.request.headers.authorization.replace(/ .*$/," [REDACTED]")})),n.url=n.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]"),this.request=n}}t.RequestError=s},function(e,t,r){e.exports=function(e,t,r,a){n(`octokit.get${r.charAt(0).toUpperCase()+r.slice(1)}Page() You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`);const u=i(t)[r];if(!u){const e=new o(`No ${r} page found`,404);return Promise.reject(e)}const p={url:u,headers:s(t,a)};return e.request(p)};const n=r(11),i=r(12),o=r(99);function s(e,t){const r=e.headers&&e.headers["x-github-media-type"];return!r||t&&t.accept?t:((t=t||{}).accept="application/vnd."+r.replace("; param=",".").replace("; format=","+"),t)}},function(e,t,r){"use strict";var n=r(35),i=r(140),o=r(6),s=r(36),a=r(37),u=r(141);e.exports=function(e,t){var r,o,s={};t||(t={});for(o in d)r=t[o],s[o]=null==r?d[o]:r;(s.position.indent||s.position.start)&&(s.indent=s.position.indent||[],s.position=s.position.start);return function(e,t){var r,o,s,d,F,z,I,N,$,H,M,V,J,W,K,Y,Z,Q,X,ee=t.additional,te=t.nonTerminated,re=t.text,ne=t.reference,ie=t.warning,oe=t.textCo
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
e.exports=function(e){return null!=e&&null!=e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}},function(e,t,r){"use strict";var n=r(120);function i(){}e.exports=s,i.prototype=Error.prototype,s.prototype=new i;var o=s.prototype;function s(e,t,r){var i,o,s;"string"==typeof t&&(r=t,t=null),i=function(e){var t,r=[null,null];"string"==typeof e&&(-1===(t=e.indexOf(":"))?r[1]=e:(r[0]=e.slice(0,t),r[1]=e.slice(t+1)));return r}(r),o=n(t)||"1:1",s={start:{line:null,column:null},end:{line:null,column:null}},t&&t.position&&(t=t.position),t&&(t.start?(s=t,t=t.start):s.start=t),e.stack&&(this.stack=e.stack,e=e.message),this.message=e,this.name=o,this.reason=e,this.line=t?t.line:null,this.column=t?t.column:null,this.location=s,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(e,t,r){"use strict";var n={}.hasOwnProperty;function i(e){return e&&"object"==typeof e||(e={}),s(e.line)+":"+s(e.column)}function o(e){return e&&"object"==typeof e||(e={}),i(e.start)+"-"+i(e.end)}function s(e){return e&&"number"==typeof e?e:1}e.exports=function(e){if(!e||"object"!=typeof e)return"";if(n.call(e,"position")||n.call(e,"type"))return o(e.position);if(n.call(e,"start")||n.call(e,"end"))return o(e);if(n.call(e,"line")||n.call(e,"column"))return i(e);return""}},function(e,t,r){"use strict";var n=r(9),i=r(122),o=r(123);e.exports=p;var s={}.hasOwnProperty,a=p.prototype,u=["history","path","basename","stem","extname","dirname"];function p(e){var t,r,n;if(e){if("string"==typeof e||o(e))e={contents:e};else if("message"in e&&"messages"in e)return e}else e={};if(!(this instanceof p))return new p(e);for(this.data={},this.messages=[],this.history=[],this.cwd=process.cwd(),r=-1,n=u.length;++r<n;)t=u[r],s.call(e,t)&&(this[t]=e[t]);for(t in e)-1===u.indexOf(t)&&(this[t]=e[t])}function c(e,t){if(-1!==e.indexOf(n.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+n.sep+"`")}function l(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function d(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}a.toString=function(e){var t=this.contents||"";return o(t)?t.toString(e):String(t)},Object.defineProperty(a,"path",{get:function(){return this.history[this.history.length-1]},set:function(e){l(e,"path"),e!==this.path&&this.history.push(e)}}),Object.defineProperty(a,"dirname",{get:function(){return"string"==typeof this.path?n.dirname(this.path):void 0},set:function(e){d(this.path,"dirname"),this.path=n.join(e||"",this.basename)}}),Object.defineProperty(a,"basename",{get:function(){return"string"==typeof this.path?n.basename(this.path):void 0},set:function(e){l(e,"basename"),c(e,"basename"),this.path=n.join(this.dirname||"",e)}}),Object.defineProperty(a,"extname",{get:function(){return"string"==typeof this.path?n.extname(this.path):void 0},set:function(e){var t=e||"";if(c(t,"extname"),d(this.path,"extname"),t){if("."!==t.charAt(0))throw new Error("`extname` must start with `.`");if(-1!==t.indexOf(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=i(this.path,t)}}),Object.defineProperty(a,"stem",{get:function(){return"string"==typeof this.path?n.basename(this.path,this.extname):void 0},set:function(e){l(e,"stem"),c(e,"stem"),this.path=n.join(this.dirname||"",e+(this.extname||""))}})},function(e,t,r){"use strict";var n=r(9);e.exports=function(e,t){if("string"!=typeof e)return e;if(0===e.length)return e;var r=n.basename(e,n.extname(e))+t;return n.join(n.dirname(e),r)}},function(e,t){
/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/
e.exports=function(e){return null!=e&&null!=e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}},function(e,t,r){"use strict";var n=r(20),i=r(9),o=r(21);t.read=function(e,t){var r=o(e);return r.contents=n.readFileSync(i.resolve(r.cwd,r.path),t),r},t.write=function(e,t){var r=o(e);n.writeFileSync(i.resolve(r.cwd,r.path),r.contents||"",t)}},function(e,t,r){"use strict";var n=r(20),i=r(9),o=r(21);t.read=function(e,t,r){var s=o(e);r||"function"!=typeof t||(r=t,t=null);if(!r)return new Promise(a);function a(e,r){var o;try{o=i.resolve(s.cwd,s.path)}catch(e){return r(e)}n.readFile(o,t,(function(t,n){t?r(t):(s.contents=n,e(s))}))}a((function(e){r(null,e)}),r)},t.write=function(e,t,r){var s=o(e);r||"function"!=typeof t||(r=t,t=void 0);if(!r)return new Promise(a);function a(e,r){var o;try{o=i.resolve(s.cwd,s.path)}catch(e){return r(e)}n.writeFile(o,s.contents||"",t,(function(t){t?r(t):e()}))}a((function(e){r(null,e)}),r)}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const o=i(r(127)),s=i(r(133)),a=i(r(185));function u({version:e,releaseDate:t}){return function(r,n){const i=function(e){const t=e.children.filter(e=>"heading"===e.type&&2===e.depth);t.shift();let r=t.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(e,t,r){const n=e.children.find(e=>"heading"===e.type&&2===e.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}`,s=[{type:"linkReference",identifier:t,label:t,referenceType:"shortcut",position:i.position,children:[{type:"text",value:t}]},{type:"text",value:o}];n.children=s}(r,e,t),function(e){const t=e.children,r=t.findIndex(e=>"heading"===e.type&&2===e.depth),n=t.slice(0,r),i=t.slice(r);e.children=[...n,{type:"heading",depth:2,position:{},children:[{type:"linkReference",identifier:"unreleased",label:"Unreleased",referenceType:"shortcut",children:[{type:"text",value:"Unreleased"}]}]},...i]}(r),function(e,t,r){const n=e.children,i=n.findIndex(e=>"definition"===e.type);if(-1===i)throw new Error("Invalid changelog format, unable to find definitions section");const o=n.slice(0,i),s=n.slice(i),a=s.shift(),u=a.url.replace(r,t),p=a.url.replace("HEAD",t);e.children=[...o,{type:"definition",identifier:"unreleased",url:u,label:"Unreleased"},{type:"definition",identifier:t,url:p,label:t},...s]}(r,e,i),r}}t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){return yield o.default().use(s.default).use(u,{version:t,releaseDate:r}).use(a.default).process(e)}))}},function(e,t,r){"use strict";var n=r(128),i=r(129),o=r(32),s=r(130),a=r(132);e.exports=function e(){var t=[],r=s(),f={},b=!1,v=-1;return q.data=function(e,t){if("string"==typeof e)return 2===arguments.length?(m("data",b),f[e]=t,q):p.call(f,e)&&f[e]||null;if(e)return m("data",b),f=e,q;return f},q.freeze=w,q.attachers=t,q.use=function(e){var r;if(m("use",b),null==e);else if("function"==typeof e)p.apply(null,arguments);else{if("object"!=typeof e)throw new Error("Expected usable value, not `"+e+"`");"length"in e?s(e):i(e)}r&&(f.settings=n(f.settings||{},r));return q;function i(e){s(e.plugins),e.settings&&(r=n(r||{},e.settings))}function o(e){if("function"==typeof e)p(e);
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
function n(e){return!0==(null!=(t=e)&&"object"==typeof t&&!1===Array.isArray(t))&&"[object Object]"===Object.prototype.toString.call(e);
/*!
* isobject <https://github.com/jonschlinkert/isobject>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
var t}function i(e){var t,r;return!1!==n(e)&&("function"==typeof(t=e.constructor)&&(!1!==n(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf")))}r.r(t),r.d(t,"default",(function(){return i}))},function(e,t,r){"use strict";
/*!
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
function n(e){return!0==(null!=(t=e)&&"object"==typeof t&&!1===Array.isArray(t))&&"[object Object]"===Object.prototype.toString.call(e);
/*!
* isobject <https://github.com/jonschlinkert/isobject>
*
* Copyright (c) 2014-2017, Jon Schlinkert.
* Released under the MIT License.
*/
var t}function i(e){var t,r;return!1!==n(e)&&("function"==typeof(t=e.constructor)&&(!1!==n(r=t.prototype)&&!1!==r.hasOwnProperty("isPrototypeOf")))}r.r(t),r.d(t,"default",(function(){return i}))}]);