Skip to content

Instantly share code, notes, and snippets.

@bundle-js
Created October 31, 2023 18:52

Revisions

  1. bundle-js created this gist Oct 31, 2023.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    Hey 👋, this is a gist which stores the final bundle results of the bundlejs api, learn more on the website https://bundlejs.com. This is the result of https://deno.bundlejs.com/?q=vfile-message.
    1 change: 1 addition & 0 deletions index.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    function c(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?l(t.position):"start"in t||"end"in t?l(t):"line"in t||"column"in t?p(t):""}function p(t){return y(t&&t.line)+":"+y(t&&t.column)}function l(t){return p(t&&t.start)+"-"+p(t&&t.end)}function y(t){return t&&typeof t=="number"?t:1}var i=class extends Error{constructor(o,n,s){super(),typeof n=="string"&&(s=n,n=void 0);let u="",e={},r=!1;if(n&&("line"in n&&"column"in n?e={place:n}:"start"in n&&"end"in n?e={place:n}:"type"in n?e={ancestors:[n],place:n.position}:e={...n}),typeof o=="string"?u=o:!e.cause&&o&&(r=!0,u=o.message,e.cause=o),!e.ruleId&&!e.source&&typeof s=="string"){let f=s.indexOf(":");f===-1?e.ruleId=s:(e.source=s.slice(0,f),e.ruleId=s.slice(f+1))}if(!e.place&&e.ancestors&&e.ancestors){let f=e.ancestors[e.ancestors.length-1];f&&(e.place=f.position)}let d=e.place&&"start"in e.place?e.place.start:e.place;this.ancestors=e.ancestors||void 0,this.cause=e.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file,this.message=u,this.line=d?d.line:void 0,this.name=c(e.place)||"1:1",this.place=e.place||void 0,this.reason=this.message,this.ruleId=e.ruleId||void 0,this.source=e.source||void 0,this.stack=r&&e.cause&&typeof e.cause.stack=="string"?e.cause.stack:"",this.actual,this.expected,this.note,this.url}};i.prototype.file="";i.prototype.name="";i.prototype.reason="";i.prototype.message="";i.prototype.stack="";i.prototype.column=void 0;i.prototype.line=void 0;i.prototype.ancestors=void 0;i.prototype.cause=void 0;i.prototype.fatal=void 0;i.prototype.place=void 0;i.prototype.ruleId=void 0;i.prototype.source=void 0;export{i as VFileMessage};