feat: Add semantic versioning compatibility (#47)

* feat: Use regex groups

* feat: Add semver input

* deps: Add semver v7.3.7

* deps(Dev): Add @types/semver v7.3.9

* feat: Add prerelease output

* chore: Update action directory

* feat: Log prerelease value

* ci(GitHub): Update release workflow

* docs: Update README.md

* feat: Add ability to detect previous version based on semver comparison

* ci(GitHub): fix test workflow
This commit is contained in:
Ardalan Amini authored and GitHub committed 2022-04-29 00:06:26 +04:30
1 parent de993f2bea
commit bd78d66436
16 files changed
+226 -53

No files matched your search

+2 -2
View File
@@ -1,8 +1,8 @@
require('./sourcemap-register.js');(()=>{var __webpack_modules__={7412:function(e,t,a){"use strict";var s=this&&this.__awaiter||function(e,t,a,s){function adopt(e){return e instanceof a?e:new a((function(t){t(e)}))}return new(a||(a=Promise))((function(a,r){function fulfilled(e){try{step(s.next(e))}catch(e){r(e)}}function rejected(e){try{step(s["throw"](e))}catch(e){r(e)}}function step(e){e.done?a(e.value):adopt(e.value).then(fulfilled,rejected)}step((s=s.apply(e,t||[])).next())}))};var r=this&&this.__asyncValues||function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],a;return t?t.call(e):(e=typeof __values==="function"?__values(e):e[Symbol.iterator](),a={},verb("next"),verb("throw"),verb("return"),a[Symbol.asyncIterator]=function(){return this},a);function verb(t){a[t]=e[t]&&function(a){return new Promise((function(s,r){a=e[t](a),settle(s,r,a.done,a.value)}))}}function settle(e,t,a,s){Promise.resolve(s).then((function(t){e({value:t,done:a})}),t)}};var i=this&&this.__rest||function(e,t){var a={};for(var s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0)a[s]=e[s];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var r=0,s=Object.getOwnPropertySymbols(e);r<s.length;r++){if(t.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(e,s[r]))a[s[r]]=e[s[r]]}return a};Object.defineProperty(t,"__esModule",{value:true});t.generate=void 0;const n=a(1912);function generate(e){var t,a;var o,p,d;return s(this,void 0,void 0,(function*(){const{octokit:s,owner:l,repo:m,sha:c,tagRef:u,inputs:h}=e;const{commitTypes:g,defaultCommitType:v}=h;const y=`https://github.com/${l}/${m}`;const b={};try{e:for(var w=r(s.paginate.iterator(s.rest.repos.listCommits,{per_page:100,owner:l,repo:m,sha:c})),_;_=yield w.next(),!_.done;){const{data:e}=_.value;for(let t of e){const{sha:e}=t,a=i(t,["sha"]);if(e===u)break e;const s=a.commit.message.split("\n")[0];let[,r,l,m,c]=n.COMMIT_REGEX.exec(s)||[];if(!m)continue;c=trim(c);if(c==="ignore")continue;r=trim(r);r=(o=g[r])!==null&&o!==void 0?o:v;l=l?trim(l):"";m=trim(m).replace(n.PR_REGEX,((e,t)=>`[${e}](${y}/pull/${t})`));b[r]=(p=b[r])!==null&&p!==void 0?p:{};b[r][l]=(d=b[r][l])!==null&&d!==void 0?d:[];const h=b[r][l].findIndex((e=>e.title===m));if(h===-1)b[r][l].push({title:m,commits:[e]});else b[r][l][h].commits.push(e)}}}catch(e){t={error:e}}finally{try{if(_&&!_.done&&(a=w.return))yield a.call(w)}finally{if(t)throw t.error}}const E=unique([...Object.values(g),v]);return E.reduce(((e,t)=>{const a=b[t];if(a==null)return e;e.push(`### ${t}`,"");const s=Object.keys(a).sort();for(const t of s){const s=a[t];const r=t.length===0;if(!r)e.push(`* **${t}:**`);const i=r?"":" ";for(const{title:t,commits:a}of s){e.push(`${i}* ${t} (${a.map((e=>`[${e.slice(0,8)}](${y}/commit/${e})`)).join(",")})`)}}e.push("");return e}),[]).join("\n")}))}t.generate=generate;function trim(e){if(e==null)return e;return e.trim().replace(/ {2,}/g," ")}function unique(e){return[...new Set(e)]}},1912:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.PR_REGEX=t.COMMIT_REGEX=void 0;t.COMMIT_REGEX=/^([^)]*)(?:\(([^)]*?)\)|):(.*?)(?:\[([^\]]+?)\]|)\s*$/;t.PR_REGEX=/#([1-9]\d*)/g},7331:function(e,t,a){"use strict";var s=this&&this.__awaiter||function(e,t,a,s){function adopt(e){return e instanceof a?e:new a((function(t){t(e)}))}return new(a||(a=Promise))((function(a,r){function fulfilled(e){try{step(s.next(e))}catch(e){r(e)}}function rejected(e){try{step(s["throw"](e))}catch(e){r(e)}}function step(e){e.done?a(e.value):adopt(e.value).then(fulfilled,rejected)}step((s=s.apply(e,t||[])).next())}))};var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getInputs=t.getToken=void 0;const i=a(2186);const n=r(a(918));const o=r(a(4083));function getToken(){return(0,i.getInput)("github-token",{required:true})}t.getToken=getToken;function getInputs(){return s(this,void 0,void 0,(function*(){const e=o.default.parse((0,i.getInput)("commit-types",{required:true}));const t=(0,i.getInput)("default-commit-type",{required:true});return n.default.object().keys({commitTypes:n.default.object().pattern(n.default.string(),n.default.string()).required(),defaultCommitType:n.default.string().required()}).validateAsync({commitTypes:e,defaultCommitType:t})}))}t.getInputs=getInputs},9283:function(e,t,a){"use strict";var s=this&&this.__awaiter||function(e,t,a,s){function adopt(e){return e instanceof a?e:new a((function(t){t(e)}))}return new(a||(a=Promise))((function(a,r){function fulfilled(e){try{step(s.next(e))}catch(e){r(e)}}function rejected(e){try{step(s["throw"](e))}catch(e){r(e)}}function step(e){e.done?a(e.value):adopt(e.value).then(fulfilled,rejected)}step((s=s.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:true});const r=a(2186);const i=a(5438);const n=a(7412);const o=a(7331);function run(){return s(this,void 0,void 0,(fuLine truncated
require('./sourcemap-register.js');(()=>{var __webpack_modules__={7412:(e,t,s)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.generate=void 0;const a=s(1912);async function generate(e){const{octokit:t,owner:s,repo:r,sha:i,tagRef:n,inputs:o}=e;const{commitTypes:p,defaultCommitType:l}=o;const d=`https://github.com/${s}/${r}`;const c={};e:for await(const{data:e}of t.paginate.iterator(t.rest.repos.listCommits,{per_page:100,owner:s,repo:r,sha:i})){for(const{sha:t,...s}of e){if(t===n)break e;const e=s.commit.message.split("\n")[0];let{type:r,category:i,title:o,flag:m}=a.COMMIT_REGEX.exec(e)?.groups??{};if(!o)continue;m=trim(m);if(m==="ignore")continue;r=trim(r);r=p[r]??l;i=i?trim(i):"";o=trim(o).replace(a.PR_REGEX,((e,t)=>`[${e}](${d}/pull/${t})`));c[r]=c[r]??{};c[r][i]=c[r][i]??[];const u=c[r][i].findIndex((e=>e.title===o));if(u===-1)c[r][i].push({title:o,commits:[t]});else c[r][i][u].commits.push(t)}}const m=unique([...Object.values(p),l]);return m.reduce(((e,t)=>{const s=c[t];if(s==null)return e;e.push(`### ${t}`,"");const a=Object.keys(s).sort();for(const t of a){const a=s[t];const r=t.length===0;if(!r)e.push(`* **${t}:**`);const i=r?"":" ";for(const{title:t,commits:s}of a){e.push(`${i}* ${t} (${s.map((e=>`[${e.slice(0,8)}](${d}/commit/${e})`)).join(",")})`)}}e.push("");return e}),[]).join("\n")}t.generate=generate;function trim(e){if(e==null)return e;return e.trim().replace(/ {2,}/g," ")}function unique(e){return[...new Set(e)]}},1912:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.PR_REGEX=t.COMMIT_REGEX=void 0;t.COMMIT_REGEX=/^(?<type>[^)]*)(?:\((?<category>[^)]*?)\)|):(?<title>.*?)(?:\[(?<flag>[^\]]+?)\]|)\s*$/;t.PR_REGEX=/#([1-9]\d*)/g},7331:function(e,t,s){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getInputs=t.getToken=void 0;const r=s(2186);const i=a(s(918));const n=a(s(4083));function getToken(){return(0,r.getInput)("github-token",{required:true})}t.getToken=getToken;async function getInputs(){const e=n.default.parse((0,r.getInput)("commit-types",{required:true}));const t=(0,r.getInput)("default-commit-type",{required:true});const s=(0,r.getBooleanInput)("semver",{required:true});return i.default.object().keys({commitTypes:i.default.object().pattern(i.default.string(),i.default.string()).required(),defaultCommitType:i.default.string().required(),semver:i.default.boolean().required()}).validateAsync({commitTypes:e,defaultCommitType:t,semver:s})}t.getInputs=getInputs},9283:function(e,t,s){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});const r=s(2186);const i=s(5438);const n=a(s(1383));const o=s(9297);const p=s(7412);const l=s(7331);async function run(){const e=await(0,l.getInputs)();const t=(0,i.getOctokit)((0,l.getToken)());const{repo:{owner:s,repo:a},sha:d,ref:c}=i.context;let m=null;if(e.semver){m=n.default.parse(c,{includePrerelease:true});if(m==null)return(0,r.setFailed)(`Expected a semver compatible ref, got "${c}" instead.`)}let u=false;if(m!=null)u=m.prerelease.length>0;const h=await(0,o.getTagSha)({octokit:t,owner:s,repo:a,sha:d,semver:m,prerelease:u});const g=await(0,p.generate)({octokit:t,owner:s,repo:a,sha:d,tagRef:h,inputs:e});(0,r.info)(g);(0,r.setOutput)("changelog",g);(0,r.info)(`prerelease: ${u}`);(0,r.setOutput)("prerelease",u)}run().catch(r.setFailed)},9297:function(e,t,s){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.getTagSha=void 0;const r=a(s(1383));async function getTagSha(e){const{octokit:t,owner:s,repo:a,sha:i,semver:n,prerelease:o}=e;for await(const{data:e}of t.paginate.iterator(t.rest.repos.listTags,{per_page:100,owner:s,repo:a})){for(const{name:t,commit:{sha:s}}of e){if(i===s)continue;if(n==null)return s;const e=r.default.parse(t,{includePrerelease:true});if(e==null||n.compare(e)<=0)continue;if(e.prerelease.length>0&&!o)continue;return s}}return undefined}t.getTagSha=getTagSha},7351:function(e,t,s){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,s,a){if(a===undefined)a=s;Object.defineProperty(e,a,{enumerable:true,get:function(){return t[s]}})}:function(e,t,s,a){if(a===undefined)a=s;e[a]=t[s]});var r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var s in e)if(s!=="default"&&Object.hasOwnProperty.call(e,s))a(t,e,s);r(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.issue=t.issueCommand=void 0;const n=i(s(2037));const o=s(5278);function issueCommand(e,t,s){const a=new Command(e,t,s);process.stdout.write(a.toString()+n.EOL)}t.issueCommand=issueCommand;function issue(e,t=""){issueCoLine truncated
/*!
* 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,a;if(isObject(e)===false)return false;t=e.constructor;if(t===undefined)return true;a=t.prototype;if(isObject(a)===false)return false;if(a.hasOwnProperty("isPrototypeOf")===false){return false}return true}t.isPlainObject=isPlainObject},6014:(e,t,a)=>{"use strict";const s=a(5578);const r=a(2448);const i={annotations:Symbol("annotations")};t.error=function(e){if(!this._original||typeof this._original!=="object"){return this.details[0].message}const t=e?"":"";const a=e?"":"";const n=e?"":"";const o=s(this._original);for(let e=this.details.length-1;e>=0;--e){const t=e+1;const a=this.details[e];const s=a.path;let n=o;for(let e=0;;++e){const o=s[e];if(r.isSchema(n)){n=n.clone()}if(e+1<s.length&&typeof n[o]!=="string"){n=n[o]}else{const e=n[i.annotations]||{errors:{},missing:{}};n[i.annotations]=e;const s=o||a.context.key;if(n[o]!==undefined){e.errors[s]=e.errors[s]||[];e.errors[s].push(t)}else{e.missing[s]=t}break}}}const p={key:/_\$key\$_([, \d]+)_\$end\$_"/g,missing:/"_\$miss\$_([^|]+)\|(\d+)_\$end\$_": "__missing__"/g,arrayIndex:/\s*"_\$idx\$_([, \d]+)_\$end\$_",?\n(.*)/g,specials:/"\[(NaN|Symbol.*|-?Infinity|function.*|\(.*)]"/g};let d=i.safeStringify(o,2).replace(p.key,((e,a)=>`" ${t}[${a}]${n}`)).replace(p.missing,((e,s,r)=>`${a}"${s}"${n}${t} [${r}]: -- missing --${n}`)).replace(p.arrayIndex,((e,a,s)=>`\n${s} ${t}[${a}]${n}`)).replace(p.specials,((e,t)=>t));d=`${d}\n${t}`;for(let e=0;e<this.details.length;++e){const t=e+1;d=`${d}\n[${t}] ${this.details[e].message}`}d=d+n;return d};i.safeStringify=function(e,t){return JSON.stringify(e,i.serializer(),t)};i.serializer=function(){const e=[];const t=[];const cycleReplacer=(a,s)=>{if(t[0]===s){return"[Circular ~]"}return"[Circular ~."+e.slice(0,t.indexOf(s)).join(".")+"]"};return function(a,s){if(t.length>0){const r=t.indexOf(this);if(~r){t.length=r+1;e.length=r+1;e[r]=a}else{t.push(this);e.push(a)}if(~t.indexOf(s)){s=cycleReplacer.call(this,a,s)}}else{t.push(s)}if(s){const e=s[i.annotations];if(e){if(Array.isArray(s)){const t=[];for(let a=0;a<s.length;++a){if(e.errors[a]){t.push(`_$idx$_${e.errors[a].sort().join(", ")}_$end$_`)}t.push(s[a])}s=t}else{for(const t in e.errors){s[`${t}_$key$_${e.errors[t].sort().join(", ")}_$end$_`]=s[t];s[t]=undefined}for(const t in e.missing){s[`_$miss$_${t}|${e.missing[t]}_$end$_`]="__missing__"}}return s}}if(s===Infinity||s===-Infinity||Number.isNaN(s)||typeof s==="function"||typeof s==="symbol"){return"["+s.toString()+"]"}return s}}},5184:(e,t,a)=>{"use strict";const s=a(2718);const r=a(5578);const i=a(5801);const n=a(445);const o=a(3355);const p=a(2448);const d=a(3038);const l=a(9490);const m=a(6680);const c=a(7997);const u=a(6103);const h=a(1290);const g=a(3838);const v=a(3171);const y=a(1804);const b=a(1944);const w={};w.Base=class{constructor(e){this.type=e;this.$_root=null;this._definition={};this._reset()}_reset(){this._ids=new h.Ids;this._preferences=null;this._refs=new g.Manager;this._cache=null;this._valids=null;this._invalids=null;this._flags={};this._rules=[];this._singleRules=new Map;this.$_terms={};this.$_temp={ruleset:null,whens:{}}}describe(){s(typeof c.describe==="function","Manifest functionality disabled");return c.describe(this)}allow(...e){p.verifyFlat(e,"allow");return this._values(e,"_valids")}alter(e){s(e&&typeof e==="object"&&!Array.isArray(e),"Invalid targets argument");s(!this._inRuleset(),"Cannot set alterations inside a ruleset");const t=this.clone();t.$_terms.alterations=t.$_terms.alterations||[];for(const a in e){const r=e[a];s(typeof r==="function","Alteration adjuster for",a,"must be a function");t.$_terms.alterations.push({target:a,adjuster:r})}t.$_temp.ruleset=false;return t}artifact(e){s(e!==undefined,"Artifact cannot be undefined");s(!this._cache,"Cannot set an artifact with a rule cache");return this.$_setFlag("artifact",e)}cast(e){s(e===false||typeof e==="string","Invalid to value");s(e===false||this._definition.cast[e],"Type",this.type,"does not support casting to",e);return this.$_setFlag("cast",e===false?undefined:e)}default(e,t){return this._default("default",e,t)}description(e){s(e&&typeof e==="string","Description must be a non-empty string");return this.$_setFlag("description",e)}empty(e){const t=this.clone();if(e!==undefined){e=t.$_compile(e,{override:false})}return t.$_setFlag("empty",e,{clone:false})}error(e){s(e,"Missing error");s(e instanceof Error||typeof e==="function","Must provide a valid Error object or a function");return this.$_setFlag("error",e)}example(e,t={}){s(e!==undefined,"Missing example");p.assertOptions(t,["override"]);return this._inner("examples",e,{single:true,override:t.override})}external(e,t){if(typeof e==="object"){s(!t,"Cannot combine options with description");t=e.description;e=e.method}s(typeof e==="function","Method must be a function");s(t===undefined||t&&typeof t==="string","Description must be a non-empty string");returLine truncated
*/function isObject(e){return Object.prototype.toString.call(e)==="[object Object]"}function isPlainObject(e){var t,s;if(isObject(e)===false)return false;t=e.constructor;if(t===undefined)return true;s=t.prototype;if(isObject(s)===false)return false;if(s.hasOwnProperty("isPrototypeOf")===false){return false}return true}t.isPlainObject=isPlainObject},6014:(e,t,s)=>{"use strict";const a=s(5578);const r=s(2448);const i={annotations:Symbol("annotations")};t.error=function(e){if(!this._original||typeof this._original!=="object"){return this.details[0].message}const t=e?"":"";const s=e?"":"";const n=e?"":"";const o=a(this._original);for(let e=this.details.length-1;e>=0;--e){const t=e+1;const s=this.details[e];const a=s.path;let n=o;for(let e=0;;++e){const o=a[e];if(r.isSchema(n)){n=n.clone()}if(e+1<a.length&&typeof n[o]!=="string"){n=n[o]}else{const e=n[i.annotations]||{errors:{},missing:{}};n[i.annotations]=e;const a=o||s.context.key;if(n[o]!==undefined){e.errors[a]=e.errors[a]||[];e.errors[a].push(t)}else{e.missing[a]=t}break}}}const p={key:/_\$key\$_([, \d]+)_\$end\$_"/g,missing:/"_\$miss\$_([^|]+)\|(\d+)_\$end\$_": "__missing__"/g,arrayIndex:/\s*"_\$idx\$_([, \d]+)_\$end\$_",?\n(.*)/g,specials:/"\[(NaN|Symbol.*|-?Infinity|function.*|\(.*)]"/g};let l=i.safeStringify(o,2).replace(p.key,((e,s)=>`" ${t}[${s}]${n}`)).replace(p.missing,((e,a,r)=>`${s}"${a}"${n}${t} [${r}]: -- missing --${n}`)).replace(p.arrayIndex,((e,s,a)=>`\n${a} ${t}[${s}]${n}`)).replace(p.specials,((e,t)=>t));l=`${l}\n${t}`;for(let e=0;e<this.details.length;++e){const t=e+1;l=`${l}\n[${t}] ${this.details[e].message}`}l=l+n;return l};i.safeStringify=function(e,t){return JSON.stringify(e,i.serializer(),t)};i.serializer=function(){const e=[];const t=[];const cycleReplacer=(s,a)=>{if(t[0]===a){return"[Circular ~]"}return"[Circular ~."+e.slice(0,t.indexOf(a)).join(".")+"]"};return function(s,a){if(t.length>0){const r=t.indexOf(this);if(~r){t.length=r+1;e.length=r+1;e[r]=s}else{t.push(this);e.push(s)}if(~t.indexOf(a)){a=cycleReplacer.call(this,s,a)}}else{t.push(a)}if(a){const e=a[i.annotations];if(e){if(Array.isArray(a)){const t=[];for(let s=0;s<a.length;++s){if(e.errors[s]){t.push(`_$idx$_${e.errors[s].sort().join(", ")}_$end$_`)}t.push(a[s])}a=t}else{for(const t in e.errors){a[`${t}_$key$_${e.errors[t].sort().join(", ")}_$end$_`]=a[t];a[t]=undefined}for(const t in e.missing){a[`_$miss$_${t}|${e.missing[t]}_$end$_`]="__missing__"}}return a}}if(a===Infinity||a===-Infinity||Number.isNaN(a)||typeof a==="function"||typeof a==="symbol"){return"["+a.toString()+"]"}return a}}},5184:(e,t,s)=>{"use strict";const a=s(2718);const r=s(5578);const i=s(5801);const n=s(445);const o=s(3355);const p=s(2448);const l=s(3038);const d=s(9490);const c=s(6680);const m=s(7997);const u=s(6103);const h=s(1290);const g=s(3838);const v=s(3171);const y=s(1804);const w=s(1944);const b={};b.Base=class{constructor(e){this.type=e;this.$_root=null;this._definition={};this._reset()}_reset(){this._ids=new h.Ids;this._preferences=null;this._refs=new g.Manager;this._cache=null;this._valids=null;this._invalids=null;this._flags={};this._rules=[];this._singleRules=new Map;this.$_terms={};this.$_temp={ruleset:null,whens:{}}}describe(){a(typeof m.describe==="function","Manifest functionality disabled");return m.describe(this)}allow(...e){p.verifyFlat(e,"allow");return this._values(e,"_valids")}alter(e){a(e&&typeof e==="object"&&!Array.isArray(e),"Invalid targets argument");a(!this._inRuleset(),"Cannot set alterations inside a ruleset");const t=this.clone();t.$_terms.alterations=t.$_terms.alterations||[];for(const s in e){const r=e[s];a(typeof r==="function","Alteration adjuster for",s,"must be a function");t.$_terms.alterations.push({target:s,adjuster:r})}t.$_temp.ruleset=false;return t}artifact(e){a(e!==undefined,"Artifact cannot be undefined");a(!this._cache,"Cannot set an artifact with a rule cache");return this.$_setFlag("artifact",e)}cast(e){a(e===false||typeof e==="string","Invalid to value");a(e===false||this._definition.cast[e],"Type",this.type,"does not support casting to",e);return this.$_setFlag("cast",e===false?undefined:e)}default(e,t){return this._default("default",e,t)}description(e){a(e&&typeof e==="string","Description must be a non-empty string");return this.$_setFlag("description",e)}empty(e){const t=this.clone();if(e!==undefined){e=t.$_compile(e,{override:false})}return t.$_setFlag("empty",e,{clone:false})}error(e){a(e,"Missing error");a(e instanceof Error||typeof e==="function","Must provide a valid Error object or a function");return this.$_setFlag("error",e)}example(e,t={}){a(e!==undefined,"Missing example");p.assertOptions(t,["override"]);return this._inner("examples",e,{single:true,override:t.override})}external(e,t){if(typeof e==="object"){a(!t,"Cannot combine options with description");t=e.description;e=e.method}a(typeof e==="function","Method must be a function");a(t===undefined||t&&typeof t==="string","Description must be a non-empty string");returLine truncated
//# sourceMappingURL=index.js.map