Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@stoplight/path

Package Overview
Dependencies
Maintainers
14
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@stoplight/path - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

__tests__/basename.spec.d.ts

2

index.cjs.js

@@ -1,1 +0,1 @@

"use strict";function format(e){let r="";return e.absolute&&("file"===e.protocol?(e.drive&&(r+=e.drive),r+="/"):(r+=e.protocol+"://",e.origin&&(r+=e.origin+"/"))),""===(r+=e.path.join("/"))&&(r="."),r}function peg$subclass(e,r){function t(){this.constructor=e}t.prototype=r.prototype,e.prototype=new t}function peg$SyntaxError(e,r,t,n){this.message=e,this.expected=r,this.found=t,this.location=n,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,peg$SyntaxError)}function peg$parse(e,r){r=void 0!==r?r:{};var t,n,a,o,s={},u={Path:0},i=0,l=[function(e,r,t,n){return{protocol:e,origin:r,absolute:!0,...t,...n}},function(e,r,t){return{protocol:e,origin:r,absolute:!0,...t,path:[]}},"http://",m("http://",!0),function(e){return"http"},"https://",m("https://",!0),function(e){return"https"},"",function(){return null},function(e,r,t){return{protocol:e,origin:null,absolute:!0,...r,...t}},"file://",m("file://",!0),"file:",m("file:",!0),function(e){return"file"},function(e,r){return{protocol:"file",origin:null,absolute:!0,...e,...r}},function(){return{drive:null}},/^[A-Za-z]/,d([["A","Z"],["a","z"]],!1,!1),":",m(":",!1),function(e){return{drive:e.toLowerCase()+":"}},function(){return{drive:null}},function(e){return{protocol:null,origin:null,absolute:!1,drive:null,...e}},function(e){return{path:e}},function(e,r){return[e,...r]},function(e){return[e]},".",m(".",!1),"/",m("/",!1),"\\",m("\\",!1),/^[^\/\\]/,d(["/","\\"],!0,!1)],p=[$(";!./ &;&.) &;(.# &;-"),$("%;\"/F#;%/=$;*/4$;./+$8$: $$#\"! )($'#(#'#(\"'#&'#.F &%;\"/<#;%/3$;,/*$8#:!##\"! )(#'#(\"'#&'#"),$(";#.# &;$"),$('%3"""5\'7#/\' 8!:$!! )'),$("%3%\"\"5(7&/' 8!:'!! )"),$('%$;5/&#0#*;5&&&#/"!&,).. &% (/& 8!:)! )'),$("%;'/<#;)/3$;./*$8#:*##\"! )(#'#(\"'#&'#"),$('%3+""5\'7,.) &3-""5%7./\' 8!:/!! )'),$('%;)/2#;./)$8":0""! )("\'#&\'#'),$(";*.# &;+"),$("%;4/& 8!:1! )"),$('%42""5!73/@#24""6475/1$;4/($8#:6#!")(#\'#("\'#&\'#'),$("% (/& 8!:7! )"),$('%;0/1#;./($8":8"! )("\'#&\'#'),$("%;//' 8!:9!! )"),$("%;1/;#;4/2$;//)$8#::#\"\" )(#'#(\"'#&'#./ &%;1/' 8!:;!! )"),$(";2.# &;3"),$('%$;5/&#0#*;5&&&#/"!&,).# & ('),$('%2<""6<7=/,#;4/#$+")("\'#&\'#'),$(" ("),$('2>""6>7?.) &2@""6@7A'),$('4B""5!7C')],c=0,h=[{line:1,column:1}],f=0,g=[],b=0;if("startRule"in r){if(!(r.startRule in u))throw new Error("Can't start parsing from rule \""+r.startRule+'".');i=u[r.startRule]}function m(e,r){return{type:"literal",text:e,ignoreCase:r}}function d(e,r,t){return{type:"class",parts:e,inverted:r,ignoreCase:t}}function x(r){var t,n=h[r];if(n)return n;for(t=r-1;!h[t];)t--;for(n={line:(n=h[t]).line,column:n.column};t<r;)10===e.charCodeAt(t)?(n.line++,n.column=1):n.column++,t++;return h[r]=n,n}function v(e,r){var t=x(e),n=x(r);return{start:{offset:e,line:t.line,column:t.column},end:{offset:r,line:n.line,column:n.column}}}function k(e){c<f||(c>f&&(f=c,g=[]),g.push(e))}function $(e){var r,t=new Array(e.length);for(r=0;r<e.length;r++)t[r]=e.charCodeAt(r)-32;return t}if((t=function r(t){for(var n,a,o=p[t],u=0,i=[],h=o.length,f=[],g=[];;){for(;u<h;)switch(o[u]){case 0:g.push(l[o[u+1]]),u+=2;break;case 1:g.push(void 0),u++;break;case 2:g.push(null),u++;break;case 3:g.push(s),u++;break;case 4:g.push([]),u++;break;case 5:g.push(c),u++;break;case 6:g.pop(),u++;break;case 7:c=g.pop(),u++;break;case 8:g.length-=o[u+1],u+=2;break;case 9:g.splice(-2,1),u++;break;case 10:g[g.length-2].push(g.pop()),u++;break;case 11:g.push(g.splice(g.length-o[u+1],o[u+1])),u+=2;break;case 12:g.push(e.substring(g.pop(),c)),u++;break;case 13:f.push(h),i.push(u+3+o[u+1]+o[u+2]),g[g.length-1]?(h=u+3+o[u+1],u+=3):(h=u+3+o[u+1]+o[u+2],u+=3+o[u+1]);break;case 14:f.push(h),i.push(u+3+o[u+1]+o[u+2]),g[g.length-1]===s?(h=u+3+o[u+1],u+=3):(h=u+3+o[u+1]+o[u+2],u+=3+o[u+1]);break;case 15:f.push(h),i.push(u+3+o[u+1]+o[u+2]),g[g.length-1]!==s?(h=u+3+o[u+1],u+=3):(h=u+3+o[u+1]+o[u+2],u+=3+o[u+1]);break;case 16:g[g.length-1]!==s?(f.push(h),i.push(u),h=u+2+o[u+1],u+=2):u+=2+o[u+1];break;case 17:f.push(h),i.push(u+3+o[u+1]+o[u+2]),e.length>c?(h=u+3+o[u+1],u+=3):(h=u+3+o[u+1]+o[u+2],u+=3+o[u+1]);break;case 18:f.push(h),i.push(u+4+o[u+2]+o[u+3]),e.substr(c,l[o[u+1]].length)===l[o[u+1]]?(h=u+4+o[u+2],u+=4):(h=u+4+o[u+2]+o[u+3],u+=4+o[u+2]);break;case 19:f.push(h),i.push(u+4+o[u+2]+o[u+3]),e.substr(c,l[o[u+1]].length).toLowerCase()===l[o[u+1]]?(h=u+4+o[u+2],u+=4):(h=u+4+o[u+2]+o[u+3],u+=4+o[u+2]);break;case 20:f.push(h),i.push(u+4+o[u+2]+o[u+3]),l[o[u+1]].test(e.charAt(c))?(h=u+4+o[u+2],u+=4):(h=u+4+o[u+2]+o[u+3],u+=4+o[u+2]);break;case 21:g.push(e.substr(c,o[u+1])),c+=o[u+1],u+=2;break;case 22:g.push(l[o[u+1]]),c+=l[o[u+1]].length,u+=2;break;case 23:g.push(s),0===b&&k(l[o[u+1]]),u+=2;break;case 24:g[g.length-1-o[u+1]],u+=2;break;case 25:c,u++;break;case 26:for(n=o.slice(u+4,u+4+o[u+3]),a=0;a<o[u+3];a++)n[a]=g[g.length-1-n[a]];g.splice(g.length-o[u+2],o[u+2],l[o[u+1]].apply(null,n)),u+=4+o[u+3];break;case 27:g.push(r(o[u+1])),u+=2;break;case 28:b++,u++;break;case 29:b--,u++;break;default:throw new Error("Invalid opcode: "+o[u]+".")}if(!(f.length>0))break;h=f.pop(),u=i.pop()}return g[0]}(i))!==s&&c===e.length)return t;throw t!==s&&c<e.length&&k({type:"end"}),n=g,a=f<e.length?e.charAt(f):null,o=f<e.length?v(f,f+1):v(f,f),new peg$SyntaxError(peg$SyntaxError.buildMessage(n,a),n,a,o)}Object.defineProperty(exports,"__esModule",{value:!0}),peg$subclass(peg$SyntaxError,Error),peg$SyntaxError.buildMessage=function(e,r){var t={literal:function(e){return'"'+a(e.text)+'"'},class:function(e){var r,t="";for(r=0;r<e.parts.length;r++)t+=e.parts[r]instanceof Array?o(e.parts[r][0])+"-"+o(e.parts[r][1]):o(e.parts[r]);return"["+(e.inverted?"^":"")+t+"]"},any:function(e){return"any character"},end:function(e){return"end of input"},other:function(e){return e.description}};function n(e){return e.charCodeAt(0).toString(16).toUpperCase()}function a(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+n(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+n(e)})}function o(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+n(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+n(e)})}return"Expected "+function(e){var r,n,a,o=new Array(e.length);for(r=0;r<e.length;r++)o[r]=(a=e[r],t[a.type](a));if(o.sort(),o.length>0){for(r=1,n=1;r<o.length;r++)o[r-1]!==o[r]&&(o[n]=o[r],n++);o.length=n}switch(o.length){case 1:return o[0];case 2:return o[0]+" or "+o[1];default:return o.slice(0,-1).join(", ")+", or "+o[o.length-1]}}(e)+" but "+function(e){return e?'"'+a(e)+'"':"end of input"}(r)+" found."};var grammar={SyntaxError:peg$SyntaxError,parse:peg$parse},grammar_1=grammar.parse;function parse(e){return grammar_1(e,{})}function normalize(e){return format(normalizeParsed(parse(e)))}function normalizeParsed(e){let r=e.path;r=r.filter(e=>""!==e&&"."!==e);const t=[];for(const n of r)".."===n&&t.length&&".."!==t[t.length-1]?t.pop():".."===n&&e.absolute||t.push(n);return e.path=t,e}function parseBase(e){let r=e.lastIndexOf(".");".."===e&&(r=-1),"."===e&&(r=-1);let t=e,n="";return r>0&&(t=e.slice(0,r),n=e.slice(r)),{name:t,ext:n}}const basename=e=>{const r=normalizeParsed(parse(e)).path.pop();if(!r)return"";const{name:t}=parseBase(r);return t},dirname=e=>{const r=normalizeParsed(parse(e));return r.path.pop(),format(normalizeParsed(r))},extname=e=>{const r=normalizeParsed(parse(e)).path.pop();if(!r)return"";const{ext:t}=parseBase(r);return t};function isAbsolute(e){return parse(e).absolute}function isURL(e){const r=parse(e);return"http"===r.protocol||"https"===r.protocol}const join=(...e)=>{if(0===e.length)return".";const r=e.map(parse),t=Object.assign({},r[0]);for(let n=1;n<r.length;n++){const a=r[n];if(a.absolute)throw new Error('Cannot join an absolute path "'+e[n]+'" in the middle of other paths.');for(const e of a.path)t.path.push(e)}return format(normalizeParsed(t))};function relative(e,r){const t=normalizeParsed(parse(r));if(!t.absolute)return format(t);const n=normalizeParsed(parse(e));if(t.origin!==n.origin)return format(t);if(!n.absolute)return format(t);if(n.drive!==t.drive)return format(t);const a=Math.min(n.path.length,t.path.length);for(let e=0;e<a&&n.path[0]===t.path[0];e++)n.path.shift(),t.path.shift();return t.path.unshift(...n.path.fill("..")),format({origin:null,drive:null,absolute:!1,protocol:null,path:t.path})}function resolve(...e){if(0===e.length)return".";const r=normalizeParsed(parse(e[e.length-1]));return r.absolute?format(r):join(...e)}const sep="/",startsWithWindowsDrive=e=>{return null!==parse(e).drive};exports.basename=basename,exports.dirname=dirname,exports.extname=extname,exports.format=format,exports.isAbsolute=isAbsolute,exports.isURL=isURL,exports.join=join,exports.normalize=normalize,exports.parse=parse,exports.relative=relative,exports.resolve=resolve,exports.sep="/",exports.startsWithWindowsDrive=startsWithWindowsDrive,exports.toFSPath=normalize;
"use strict";function format(e){let r="";return e.absolute&&("file"===e.protocol?(e.drive&&(r+=e.drive),r+="/"):(r+=e.protocol+"://",e.origin&&(r+=e.origin+"/"))),""===(r+=e.path.join("/"))&&(r="."),r}function peg$subclass(e,r){function t(){this.constructor=e}t.prototype=r.prototype,e.prototype=new t}function peg$SyntaxError(e,r,t,n){this.message=e,this.expected=r,this.found=t,this.location=n,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,peg$SyntaxError)}function peg$parse(e,r){r=void 0!==r?r:{};var t,n,a,o,s={},u={Path:0},i=0,l=[function(e,r,t,n){return{protocol:e,origin:r,absolute:!0,...t,...n}},function(e,r,t){return{protocol:e,origin:r,absolute:!0,...t,path:[]}},"http://",m("http://",!0),function(e){return"http"},"https://",m("https://",!0),function(e){return"https"},"",function(){return null},function(e,r,t){return{protocol:e,origin:null,absolute:!0,...r,...t}},"file://",m("file://",!0),"file:",m("file:",!0),function(e){return"file"},function(e,r){return{protocol:"file",origin:null,absolute:!0,...e,...r}},function(){return{drive:null}},/^[A-Za-z]/,d([["A","Z"],["a","z"]],!1,!1),":",m(":",!1),function(e){return{drive:e.toLowerCase()+":"}},function(){return{drive:null}},function(e){return{protocol:null,origin:null,absolute:!1,drive:null,...e}},function(e){return{path:e}},function(e,r){return[e,...r]},function(e){return[e]},".",m(".",!1),"/",m("/",!1),"\\",m("\\",!1),/^[^\/\\]/,d(["/","\\"],!0,!1)],p=[k(";!./ &;&.) &;(.# &;-"),k("%;\"/F#;%/=$;*/4$;./+$8$: $$#\"! )($'#(#'#(\"'#&'#.F &%;\"/<#;%/3$;,/*$8#:!##\"! )(#'#(\"'#&'#"),k(";#.# &;$"),k('%3"""5\'7#/\' 8!:$!! )'),k("%3%\"\"5(7&/' 8!:'!! )"),k('%$;5/&#0#*;5&&&#/"!&,).. &% (/& 8!:)! )'),k("%;'/<#;)/3$;./*$8#:*##\"! )(#'#(\"'#&'#"),k('%3+""5\'7,.) &3-""5%7./\' 8!:/!! )'),k('%;)/2#;./)$8":0""! )("\'#&\'#'),k(";*.# &;+"),k("%;4/& 8!:1! )"),k('%42""5!73/@#24""6475/1$;4/($8#:6#!")(#\'#("\'#&\'#'),k("% (/& 8!:7! )"),k('%;0/1#;./($8":8"! )("\'#&\'#'),k("%;//' 8!:9!! )"),k("%;1/;#;4/2$;//)$8#::#\"\" )(#'#(\"'#&'#./ &%;1/' 8!:;!! )"),k(";2.# &;3"),k('%$;5/&#0#*;5&&&#/"!&,).# & ('),k('%2<""6<7=/,#;4/#$+")("\'#&\'#'),k(" ("),k('2>""6>7?.) &2@""6@7A'),k('4B""5!7C')],c=0,h=[{line:1,column:1}],f=0,g=[],b=0;if("startRule"in r){if(!(r.startRule in u))throw new Error("Can't start parsing from rule \""+r.startRule+'".');i=u[r.startRule]}function m(e,r){return{type:"literal",text:e,ignoreCase:r}}function d(e,r,t){return{type:"class",parts:e,inverted:r,ignoreCase:t}}function x(r){var t,n=h[r];if(n)return n;for(t=r-1;!h[t];)t--;for(n={line:(n=h[t]).line,column:n.column};t<r;)10===e.charCodeAt(t)?(n.line++,n.column=1):n.column++,t++;return h[r]=n,n}function $(e,r){var t=x(e),n=x(r);return{start:{offset:e,line:t.line,column:t.column},end:{offset:r,line:n.line,column:n.column}}}function v(e){c<f||(c>f&&(f=c,g=[]),g.push(e))}function k(e){var r,t=new Array(e.length);for(r=0;r<e.length;r++)t[r]=e.charCodeAt(r)-32;return t}if((t=function r(t){for(var n,a,o=p[t],u=0,i=[],h=o.length,f=[],g=[];;){for(;u<h;)switch(o[u]){case 0:g.push(l[o[u+1]]),u+=2;break;case 1:g.push(void 0),u++;break;case 2:g.push(null),u++;break;case 3:g.push(s),u++;break;case 4:g.push([]),u++;break;case 5:g.push(c),u++;break;case 6:g.pop(),u++;break;case 7:c=g.pop(),u++;break;case 8:g.length-=o[u+1],u+=2;break;case 9:g.splice(-2,1),u++;break;case 10:g[g.length-2].push(g.pop()),u++;break;case 11:g.push(g.splice(g.length-o[u+1],o[u+1])),u+=2;break;case 12:g.push(e.substring(g.pop(),c)),u++;break;case 13:f.push(h),i.push(u+3+o[u+1]+o[u+2]),g[g.length-1]?(h=u+3+o[u+1],u+=3):(h=u+3+o[u+1]+o[u+2],u+=3+o[u+1]);break;case 14:f.push(h),i.push(u+3+o[u+1]+o[u+2]),g[g.length-1]===s?(h=u+3+o[u+1],u+=3):(h=u+3+o[u+1]+o[u+2],u+=3+o[u+1]);break;case 15:f.push(h),i.push(u+3+o[u+1]+o[u+2]),g[g.length-1]!==s?(h=u+3+o[u+1],u+=3):(h=u+3+o[u+1]+o[u+2],u+=3+o[u+1]);break;case 16:g[g.length-1]!==s?(f.push(h),i.push(u),h=u+2+o[u+1],u+=2):u+=2+o[u+1];break;case 17:f.push(h),i.push(u+3+o[u+1]+o[u+2]),e.length>c?(h=u+3+o[u+1],u+=3):(h=u+3+o[u+1]+o[u+2],u+=3+o[u+1]);break;case 18:f.push(h),i.push(u+4+o[u+2]+o[u+3]),e.substr(c,l[o[u+1]].length)===l[o[u+1]]?(h=u+4+o[u+2],u+=4):(h=u+4+o[u+2]+o[u+3],u+=4+o[u+2]);break;case 19:f.push(h),i.push(u+4+o[u+2]+o[u+3]),e.substr(c,l[o[u+1]].length).toLowerCase()===l[o[u+1]]?(h=u+4+o[u+2],u+=4):(h=u+4+o[u+2]+o[u+3],u+=4+o[u+2]);break;case 20:f.push(h),i.push(u+4+o[u+2]+o[u+3]),l[o[u+1]].test(e.charAt(c))?(h=u+4+o[u+2],u+=4):(h=u+4+o[u+2]+o[u+3],u+=4+o[u+2]);break;case 21:g.push(e.substr(c,o[u+1])),c+=o[u+1],u+=2;break;case 22:g.push(l[o[u+1]]),c+=l[o[u+1]].length,u+=2;break;case 23:g.push(s),0===b&&v(l[o[u+1]]),u+=2;break;case 24:g[g.length-1-o[u+1]],u+=2;break;case 25:c,u++;break;case 26:for(n=o.slice(u+4,u+4+o[u+3]),a=0;a<o[u+3];a++)n[a]=g[g.length-1-n[a]];g.splice(g.length-o[u+2],o[u+2],l[o[u+1]].apply(null,n)),u+=4+o[u+3];break;case 27:g.push(r(o[u+1])),u+=2;break;case 28:b++,u++;break;case 29:b--,u++;break;default:throw new Error("Invalid opcode: "+o[u]+".")}if(!(f.length>0))break;h=f.pop(),u=i.pop()}return g[0]}(i))!==s&&c===e.length)return t;throw t!==s&&c<e.length&&v({type:"end"}),n=g,a=f<e.length?e.charAt(f):null,o=f<e.length?$(f,f+1):$(f,f),new peg$SyntaxError(peg$SyntaxError.buildMessage(n,a),n,a,o)}Object.defineProperty(exports,"__esModule",{value:!0}),peg$subclass(peg$SyntaxError,Error),peg$SyntaxError.buildMessage=function(e,r){var t={literal:function(e){return'"'+a(e.text)+'"'},class:function(e){var r,t="";for(r=0;r<e.parts.length;r++)t+=e.parts[r]instanceof Array?o(e.parts[r][0])+"-"+o(e.parts[r][1]):o(e.parts[r]);return"["+(e.inverted?"^":"")+t+"]"},any:function(e){return"any character"},end:function(e){return"end of input"},other:function(e){return e.description}};function n(e){return e.charCodeAt(0).toString(16).toUpperCase()}function a(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+n(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+n(e)})}function o(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(e){return"\\x0"+n(e)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(e){return"\\x"+n(e)})}return"Expected "+function(e){var r,n,a,o=new Array(e.length);for(r=0;r<e.length;r++)o[r]=(a=e[r],t[a.type](a));if(o.sort(),o.length>0){for(r=1,n=1;r<o.length;r++)o[r-1]!==o[r]&&(o[n]=o[r],n++);o.length=n}switch(o.length){case 1:return o[0];case 2:return o[0]+" or "+o[1];default:return o.slice(0,-1).join(", ")+", or "+o[o.length-1]}}(e)+" but "+function(e){return e?'"'+a(e)+'"':"end of input"}(r)+" found."};var grammar={SyntaxError:peg$SyntaxError,parse:peg$parse},grammar_1=grammar.parse;function parse(e){return grammar_1(e,{})}function normalize(e){return format(normalizeParsed(parse(e)))}function normalizeParsed(e){let r=e.path;r=r.filter(e=>""!==e&&"."!==e);const t=[];for(const n of r)".."===n&&t.length&&".."!==t[t.length-1]?t.pop():".."===n&&e.absolute||t.push(n);return e.path=t,e}function parseBase(e){let r=e.lastIndexOf(".");".."===e&&(r=-1),"."===e&&(r=-1);let t=e,n="";return r>0&&(t=e.slice(0,r),n=e.slice(r)),{name:t,ext:n}}const basename=e=>{const r=normalizeParsed(parse(e)).path.pop();if(!r)return"";const{name:t,ext:n}=parseBase(r);return`${t}${n}`},dirname=e=>{const r=normalizeParsed(parse(e));return r.path.pop(),format(normalizeParsed(r))},extname=e=>{const r=normalizeParsed(parse(e)).path.pop();if(!r)return"";const{ext:t}=parseBase(r);return t};function isAbsolute(e){return parse(e).absolute}function isURL(e){const r=parse(e);return"http"===r.protocol||"https"===r.protocol}const join=(...e)=>{if(0===e.length)return".";const r=e.map(parse),t=Object.assign({},r[0]);for(let n=1;n<r.length;n++){const a=r[n];if(a.absolute)throw new Error('Cannot join an absolute path "'+e[n]+'" in the middle of other paths.');for(const e of a.path)t.path.push(e)}return format(normalizeParsed(t))};function relative(e,r){const t=normalizeParsed(parse(r));if(!t.absolute)return format(t);const n=normalizeParsed(parse(e));if(t.origin!==n.origin)return format(t);if(!n.absolute)return format(t);if(n.drive!==t.drive)return format(t);const a=Math.min(n.path.length,t.path.length);for(let e=0;e<a&&n.path[0]===t.path[0];e++)n.path.shift(),t.path.shift();return t.path.unshift(...n.path.fill("..")),format({origin:null,drive:null,absolute:!1,protocol:null,path:t.path})}function resolve(...e){if(0===e.length)return".";const r=normalizeParsed(parse(e[e.length-1]));return r.absolute?format(r):join(...e)}const sep="/",startsWithWindowsDrive=e=>{return null!==parse(e).drive};exports.basename=basename,exports.dirname=dirname,exports.extname=extname,exports.format=format,exports.isAbsolute=isAbsolute,exports.isURL=isURL,exports.join=join,exports.normalize=normalize,exports.parse=parse,exports.relative=relative,exports.resolve=resolve,exports.sep="/",exports.startsWithWindowsDrive=startsWithWindowsDrive,exports.toFSPath=normalize;

@@ -1,1 +0,1 @@

function t(t){let e="";return t.absolute&&("file"===t.protocol?(t.drive&&(e+=t.drive),e+="/"):(e+=t.protocol+"://",t.origin&&(e+=t.origin+"/"))),""===(e+=t.path.join("/"))&&(e="."),e}function e(t,n,r,o){this.message=t,this.expected=n,this.found=r,this.location=o,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}!function(t,e){function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n}(e,Error),e.buildMessage=function(t,e){var n={literal:function(t){return'"'+o(t.text)+'"'},class:function(t){var e,n="";for(e=0;e<t.parts.length;e++)n+=t.parts[e]instanceof Array?u(t.parts[e][0])+"-"+u(t.parts[e][1]):u(t.parts[e]);return"["+(t.inverted?"^":"")+n+"]"},any:function(t){return"any character"},end:function(t){return"end of input"},other:function(t){return t.description}};function r(t){return t.charCodeAt(0).toString(16).toUpperCase()}function o(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(t){return"\\x0"+r(t)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(t){return"\\x"+r(t)})}function u(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(t){return"\\x0"+r(t)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(t){return"\\x"+r(t)})}return"Expected "+function(t){var e,r,o,u=new Array(t.length);for(e=0;e<t.length;e++)u[e]=(o=t[e],n[o.type](o));if(u.sort(),u.length>0){for(e=1,r=1;e<u.length;e++)u[e-1]!==u[e]&&(u[r]=u[e],r++);u.length=r}switch(u.length){case 1:return u[0];case 2:return u[0]+" or "+u[1];default:return u.slice(0,-1).join(", ")+", or "+u[u.length-1]}}(t)+" but "+function(t){return t?'"'+o(t)+'"':"end of input"}(e)+" found."};var n=function(t,n){n=void 0!==n?n:{};var r,o,u,a,c={},l={Path:0},s=0,i=[function(t,e,n,r){return{protocol:t,origin:e,absolute:!0,...n,...r}},function(t,e,n){return{protocol:t,origin:e,absolute:!0,...n,path:[]}},"http://",k("http://",!0),function(t){return"http"},"https://",k("https://",!0),function(t){return"https"},"",function(){return null},function(t,e,n){return{protocol:t,origin:null,absolute:!0,...e,...n}},"file://",k("file://",!0),"file:",k("file:",!0),function(t){return"file"},function(t,e){return{protocol:"file",origin:null,absolute:!0,...t,...e}},function(){return{drive:null}},/^[A-Za-z]/,x([["A","Z"],["a","z"]],!1,!1),":",k(":",!1),function(t){return{drive:t.toLowerCase()+":"}},function(){return{drive:null}},function(t){return{protocol:null,origin:null,absolute:!1,drive:null,...t}},function(t){return{path:t}},function(t,e){return[t,...e]},function(t){return[t]},".",k(".",!1),"/",k("/",!1),"\\",k("\\",!1),/^[^\/\\]/,x(["/","\\"],!0,!1)],p=[w(";!./ &;&.) &;(.# &;-"),w("%;\"/F#;%/=$;*/4$;./+$8$: $$#\"! )($'#(#'#(\"'#&'#.F &%;\"/<#;%/3$;,/*$8#:!##\"! )(#'#(\"'#&'#"),w(";#.# &;$"),w('%3"""5\'7#/\' 8!:$!! )'),w("%3%\"\"5(7&/' 8!:'!! )"),w('%$;5/&#0#*;5&&&#/"!&,).. &% (/& 8!:)! )'),w("%;'/<#;)/3$;./*$8#:*##\"! )(#'#(\"'#&'#"),w('%3+""5\'7,.) &3-""5%7./\' 8!:/!! )'),w('%;)/2#;./)$8":0""! )("\'#&\'#'),w(";*.# &;+"),w("%;4/& 8!:1! )"),w('%42""5!73/@#24""6475/1$;4/($8#:6#!")(#\'#("\'#&\'#'),w("% (/& 8!:7! )"),w('%;0/1#;./($8":8"! )("\'#&\'#'),w("%;//' 8!:9!! )"),w("%;1/;#;4/2$;//)$8#::#\"\" )(#'#(\"'#&'#./ &%;1/' 8!:;!! )"),w(";2.# &;3"),w('%$;5/&#0#*;5&&&#/"!&,).# & ('),w('%2<""6<7=/,#;4/#$+")("\'#&\'#'),w(" ("),w('2>""6>7?.) &2@""6@7A'),w('4B""5!7C')],h=0,f=[{line:1,column:1}],g=0,b=[],d=0;if("startRule"in n){if(!(n.startRule in l))throw new Error("Can't start parsing from rule \""+n.startRule+'".');s=l[n.startRule]}function k(t,e){return{type:"literal",text:t,ignoreCase:e}}function x(t,e,n){return{type:"class",parts:t,inverted:e,ignoreCase:n}}function v(e){var n,r=f[e];if(r)return r;for(n=e-1;!f[n];)n--;for(r={line:(r=f[n]).line,column:r.column};n<e;)10===t.charCodeAt(n)?(r.line++,r.column=1):r.column++,n++;return f[e]=r,r}function $(t,e){var n=v(t),r=v(e);return{start:{offset:t,line:n.line,column:n.column},end:{offset:e,line:r.line,column:r.column}}}function m(t){h<g||(h>g&&(g=h,b=[]),b.push(t))}function w(t){var e,n=new Array(t.length);for(e=0;e<t.length;e++)n[e]=t.charCodeAt(e)-32;return n}if((r=function e(n){for(var r,o,u=p[n],a=0,l=[],s=u.length,f=[],g=[];;){for(;a<s;)switch(u[a]){case 0:g.push(i[u[a+1]]),a+=2;break;case 1:g.push(void 0),a++;break;case 2:g.push(null),a++;break;case 3:g.push(c),a++;break;case 4:g.push([]),a++;break;case 5:g.push(h),a++;break;case 6:g.pop(),a++;break;case 7:h=g.pop(),a++;break;case 8:g.length-=u[a+1],a+=2;break;case 9:g.splice(-2,1),a++;break;case 10:g[g.length-2].push(g.pop()),a++;break;case 11:g.push(g.splice(g.length-u[a+1],u[a+1])),a+=2;break;case 12:g.push(t.substring(g.pop(),h)),a++;break;case 13:f.push(s),l.push(a+3+u[a+1]+u[a+2]),g[g.length-1]?(s=a+3+u[a+1],a+=3):(s=a+3+u[a+1]+u[a+2],a+=3+u[a+1]);break;case 14:f.push(s),l.push(a+3+u[a+1]+u[a+2]),g[g.length-1]===c?(s=a+3+u[a+1],a+=3):(s=a+3+u[a+1]+u[a+2],a+=3+u[a+1]);break;case 15:f.push(s),l.push(a+3+u[a+1]+u[a+2]),g[g.length-1]!==c?(s=a+3+u[a+1],a+=3):(s=a+3+u[a+1]+u[a+2],a+=3+u[a+1]);break;case 16:g[g.length-1]!==c?(f.push(s),l.push(a),s=a+2+u[a+1],a+=2):a+=2+u[a+1];break;case 17:f.push(s),l.push(a+3+u[a+1]+u[a+2]),t.length>h?(s=a+3+u[a+1],a+=3):(s=a+3+u[a+1]+u[a+2],a+=3+u[a+1]);break;case 18:f.push(s),l.push(a+4+u[a+2]+u[a+3]),t.substr(h,i[u[a+1]].length)===i[u[a+1]]?(s=a+4+u[a+2],a+=4):(s=a+4+u[a+2]+u[a+3],a+=4+u[a+2]);break;case 19:f.push(s),l.push(a+4+u[a+2]+u[a+3]),t.substr(h,i[u[a+1]].length).toLowerCase()===i[u[a+1]]?(s=a+4+u[a+2],a+=4):(s=a+4+u[a+2]+u[a+3],a+=4+u[a+2]);break;case 20:f.push(s),l.push(a+4+u[a+2]+u[a+3]),i[u[a+1]].test(t.charAt(h))?(s=a+4+u[a+2],a+=4):(s=a+4+u[a+2]+u[a+3],a+=4+u[a+2]);break;case 21:g.push(t.substr(h,u[a+1])),h+=u[a+1],a+=2;break;case 22:g.push(i[u[a+1]]),h+=i[u[a+1]].length,a+=2;break;case 23:g.push(c),0===d&&m(i[u[a+1]]),a+=2;break;case 24:g[g.length-1-u[a+1]],a+=2;break;case 25:a++;break;case 26:for(r=u.slice(a+4,a+4+u[a+3]),o=0;o<u[a+3];o++)r[o]=g[g.length-1-r[o]];g.splice(g.length-u[a+2],u[a+2],i[u[a+1]].apply(null,r)),a+=4+u[a+3];break;case 27:g.push(e(u[a+1])),a+=2;break;case 28:d++,a++;break;case 29:d--,a++;break;default:throw new Error("Invalid opcode: "+u[a]+".")}if(!(f.length>0))break;s=f.pop(),a=l.pop()}return g[0]}(s))!==c&&h===t.length)return r;throw r!==c&&h<t.length&&m({type:"end"}),o=b,u=g<t.length?t.charAt(g):null,a=g<t.length?$(g,g+1):$(g,g),new e(e.buildMessage(o,u),o,u,a)};function r(t){return n(t,{})}function o(e){return t(u(r(e)))}function u(t){let e=t.path;e=e.filter(t=>""!==t&&"."!==t);const n=[];for(const r of e)".."===r&&n.length&&".."!==n[n.length-1]?n.pop():".."===r&&t.absolute||n.push(r);return t.path=n,t}function a(t){let e=t.lastIndexOf(".");".."===t&&(e=-1),"."===t&&(e=-1);let n=t,r="";return e>0&&(n=t.slice(0,e),r=t.slice(e)),{name:n,ext:r}}const c=t=>{const e=u(r(t)).path.pop();if(!e)return"";const{name:n}=a(e);return n},l=e=>{const n=u(r(e));return n.path.pop(),t(u(n))},s=t=>{const e=u(r(t)).path.pop();if(!e)return"";const{ext:n}=a(e);return n};function i(t){return r(t).absolute}function p(t){const e=r(t);return"http"===e.protocol||"https"===e.protocol}const h=(...e)=>{if(0===e.length)return".";const n=e.map(r),o=Object.assign({},n[0]);for(let t=1;t<n.length;t++){const r=n[t];if(r.absolute)throw new Error('Cannot join an absolute path "'+e[t]+'" in the middle of other paths.');for(const t of r.path)o.path.push(t)}return t(u(o))};function f(e,n){const o=u(r(n));if(!o.absolute)return t(o);const a=u(r(e));if(o.origin!==a.origin)return t(o);if(!a.absolute)return t(o);if(a.drive!==o.drive)return t(o);const c=Math.min(a.path.length,o.path.length);for(let t=0;t<c&&a.path[0]===o.path[0];t++)a.path.shift(),o.path.shift();return o.path.unshift(...a.path.fill("..")),t({origin:null,drive:null,absolute:!1,protocol:null,path:o.path})}function g(...e){if(0===e.length)return".";const n=u(r(e[e.length-1]));return n.absolute?t(n):h(...e)}const b="/",d=t=>{return null!==r(t).drive};export{c as basename,l as dirname,s as extname,t as format,i as isAbsolute,p as isURL,h as join,o as normalize,r as parse,f as relative,g as resolve,b as sep,d as startsWithWindowsDrive,o as toFSPath};
function t(t){let e="";return t.absolute&&("file"===t.protocol?(t.drive&&(e+=t.drive),e+="/"):(e+=t.protocol+"://",t.origin&&(e+=t.origin+"/"))),""===(e+=t.path.join("/"))&&(e="."),e}function e(t,n,r,o){this.message=t,this.expected=n,this.found=r,this.location=o,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}!function(t,e){function n(){this.constructor=t}n.prototype=e.prototype,t.prototype=new n}(e,Error),e.buildMessage=function(t,e){var n={literal:function(t){return'"'+o(t.text)+'"'},class:function(t){var e,n="";for(e=0;e<t.parts.length;e++)n+=t.parts[e]instanceof Array?u(t.parts[e][0])+"-"+u(t.parts[e][1]):u(t.parts[e]);return"["+(t.inverted?"^":"")+n+"]"},any:function(t){return"any character"},end:function(t){return"end of input"},other:function(t){return t.description}};function r(t){return t.charCodeAt(0).toString(16).toUpperCase()}function o(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(t){return"\\x0"+r(t)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(t){return"\\x"+r(t)})}function u(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(t){return"\\x0"+r(t)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(t){return"\\x"+r(t)})}return"Expected "+function(t){var e,r,o,u=new Array(t.length);for(e=0;e<t.length;e++)u[e]=(o=t[e],n[o.type](o));if(u.sort(),u.length>0){for(e=1,r=1;e<u.length;e++)u[e-1]!==u[e]&&(u[r]=u[e],r++);u.length=r}switch(u.length){case 1:return u[0];case 2:return u[0]+" or "+u[1];default:return u.slice(0,-1).join(", ")+", or "+u[u.length-1]}}(t)+" but "+function(t){return t?'"'+o(t)+'"':"end of input"}(e)+" found."};var n=function(t,n){n=void 0!==n?n:{};var r,o,u,a,c={},l={Path:0},s=0,i=[function(t,e,n,r){return{protocol:t,origin:e,absolute:!0,...n,...r}},function(t,e,n){return{protocol:t,origin:e,absolute:!0,...n,path:[]}},"http://",k("http://",!0),function(t){return"http"},"https://",k("https://",!0),function(t){return"https"},"",function(){return null},function(t,e,n){return{protocol:t,origin:null,absolute:!0,...e,...n}},"file://",k("file://",!0),"file:",k("file:",!0),function(t){return"file"},function(t,e){return{protocol:"file",origin:null,absolute:!0,...t,...e}},function(){return{drive:null}},/^[A-Za-z]/,x([["A","Z"],["a","z"]],!1,!1),":",k(":",!1),function(t){return{drive:t.toLowerCase()+":"}},function(){return{drive:null}},function(t){return{protocol:null,origin:null,absolute:!1,drive:null,...t}},function(t){return{path:t}},function(t,e){return[t,...e]},function(t){return[t]},".",k(".",!1),"/",k("/",!1),"\\",k("\\",!1),/^[^\/\\]/,x(["/","\\"],!0,!1)],p=[w(";!./ &;&.) &;(.# &;-"),w("%;\"/F#;%/=$;*/4$;./+$8$: $$#\"! )($'#(#'#(\"'#&'#.F &%;\"/<#;%/3$;,/*$8#:!##\"! )(#'#(\"'#&'#"),w(";#.# &;$"),w('%3"""5\'7#/\' 8!:$!! )'),w("%3%\"\"5(7&/' 8!:'!! )"),w('%$;5/&#0#*;5&&&#/"!&,).. &% (/& 8!:)! )'),w("%;'/<#;)/3$;./*$8#:*##\"! )(#'#(\"'#&'#"),w('%3+""5\'7,.) &3-""5%7./\' 8!:/!! )'),w('%;)/2#;./)$8":0""! )("\'#&\'#'),w(";*.# &;+"),w("%;4/& 8!:1! )"),w('%42""5!73/@#24""6475/1$;4/($8#:6#!")(#\'#("\'#&\'#'),w("% (/& 8!:7! )"),w('%;0/1#;./($8":8"! )("\'#&\'#'),w("%;//' 8!:9!! )"),w("%;1/;#;4/2$;//)$8#::#\"\" )(#'#(\"'#&'#./ &%;1/' 8!:;!! )"),w(";2.# &;3"),w('%$;5/&#0#*;5&&&#/"!&,).# & ('),w('%2<""6<7=/,#;4/#$+")("\'#&\'#'),w(" ("),w('2>""6>7?.) &2@""6@7A'),w('4B""5!7C')],h=0,f=[{line:1,column:1}],g=0,b=[],d=0;if("startRule"in n){if(!(n.startRule in l))throw new Error("Can't start parsing from rule \""+n.startRule+'".');s=l[n.startRule]}function k(t,e){return{type:"literal",text:t,ignoreCase:e}}function x(t,e,n){return{type:"class",parts:t,inverted:e,ignoreCase:n}}function v(e){var n,r=f[e];if(r)return r;for(n=e-1;!f[n];)n--;for(r={line:(r=f[n]).line,column:r.column};n<e;)10===t.charCodeAt(n)?(r.line++,r.column=1):r.column++,n++;return f[e]=r,r}function $(t,e){var n=v(t),r=v(e);return{start:{offset:t,line:n.line,column:n.column},end:{offset:e,line:r.line,column:r.column}}}function m(t){h<g||(h>g&&(g=h,b=[]),b.push(t))}function w(t){var e,n=new Array(t.length);for(e=0;e<t.length;e++)n[e]=t.charCodeAt(e)-32;return n}if((r=function e(n){for(var r,o,u=p[n],a=0,l=[],s=u.length,f=[],g=[];;){for(;a<s;)switch(u[a]){case 0:g.push(i[u[a+1]]),a+=2;break;case 1:g.push(void 0),a++;break;case 2:g.push(null),a++;break;case 3:g.push(c),a++;break;case 4:g.push([]),a++;break;case 5:g.push(h),a++;break;case 6:g.pop(),a++;break;case 7:h=g.pop(),a++;break;case 8:g.length-=u[a+1],a+=2;break;case 9:g.splice(-2,1),a++;break;case 10:g[g.length-2].push(g.pop()),a++;break;case 11:g.push(g.splice(g.length-u[a+1],u[a+1])),a+=2;break;case 12:g.push(t.substring(g.pop(),h)),a++;break;case 13:f.push(s),l.push(a+3+u[a+1]+u[a+2]),g[g.length-1]?(s=a+3+u[a+1],a+=3):(s=a+3+u[a+1]+u[a+2],a+=3+u[a+1]);break;case 14:f.push(s),l.push(a+3+u[a+1]+u[a+2]),g[g.length-1]===c?(s=a+3+u[a+1],a+=3):(s=a+3+u[a+1]+u[a+2],a+=3+u[a+1]);break;case 15:f.push(s),l.push(a+3+u[a+1]+u[a+2]),g[g.length-1]!==c?(s=a+3+u[a+1],a+=3):(s=a+3+u[a+1]+u[a+2],a+=3+u[a+1]);break;case 16:g[g.length-1]!==c?(f.push(s),l.push(a),s=a+2+u[a+1],a+=2):a+=2+u[a+1];break;case 17:f.push(s),l.push(a+3+u[a+1]+u[a+2]),t.length>h?(s=a+3+u[a+1],a+=3):(s=a+3+u[a+1]+u[a+2],a+=3+u[a+1]);break;case 18:f.push(s),l.push(a+4+u[a+2]+u[a+3]),t.substr(h,i[u[a+1]].length)===i[u[a+1]]?(s=a+4+u[a+2],a+=4):(s=a+4+u[a+2]+u[a+3],a+=4+u[a+2]);break;case 19:f.push(s),l.push(a+4+u[a+2]+u[a+3]),t.substr(h,i[u[a+1]].length).toLowerCase()===i[u[a+1]]?(s=a+4+u[a+2],a+=4):(s=a+4+u[a+2]+u[a+3],a+=4+u[a+2]);break;case 20:f.push(s),l.push(a+4+u[a+2]+u[a+3]),i[u[a+1]].test(t.charAt(h))?(s=a+4+u[a+2],a+=4):(s=a+4+u[a+2]+u[a+3],a+=4+u[a+2]);break;case 21:g.push(t.substr(h,u[a+1])),h+=u[a+1],a+=2;break;case 22:g.push(i[u[a+1]]),h+=i[u[a+1]].length,a+=2;break;case 23:g.push(c),0===d&&m(i[u[a+1]]),a+=2;break;case 24:g[g.length-1-u[a+1]],a+=2;break;case 25:a++;break;case 26:for(r=u.slice(a+4,a+4+u[a+3]),o=0;o<u[a+3];o++)r[o]=g[g.length-1-r[o]];g.splice(g.length-u[a+2],u[a+2],i[u[a+1]].apply(null,r)),a+=4+u[a+3];break;case 27:g.push(e(u[a+1])),a+=2;break;case 28:d++,a++;break;case 29:d--,a++;break;default:throw new Error("Invalid opcode: "+u[a]+".")}if(!(f.length>0))break;s=f.pop(),a=l.pop()}return g[0]}(s))!==c&&h===t.length)return r;throw r!==c&&h<t.length&&m({type:"end"}),o=b,u=g<t.length?t.charAt(g):null,a=g<t.length?$(g,g+1):$(g,g),new e(e.buildMessage(o,u),o,u,a)};function r(t){return n(t,{})}function o(e){return t(u(r(e)))}function u(t){let e=t.path;e=e.filter(t=>""!==t&&"."!==t);const n=[];for(const r of e)".."===r&&n.length&&".."!==n[n.length-1]?n.pop():".."===r&&t.absolute||n.push(r);return t.path=n,t}function a(t){let e=t.lastIndexOf(".");".."===t&&(e=-1),"."===t&&(e=-1);let n=t,r="";return e>0&&(n=t.slice(0,e),r=t.slice(e)),{name:n,ext:r}}const c=t=>{const e=u(r(t)).path.pop();if(!e)return"";const{name:n,ext:o}=a(e);return`${n}${o}`},l=e=>{const n=u(r(e));return n.path.pop(),t(u(n))},s=t=>{const e=u(r(t)).path.pop();if(!e)return"";const{ext:n}=a(e);return n};function i(t){return r(t).absolute}function p(t){const e=r(t);return"http"===e.protocol||"https"===e.protocol}const h=(...e)=>{if(0===e.length)return".";const n=e.map(r),o=Object.assign({},n[0]);for(let t=1;t<n.length;t++){const r=n[t];if(r.absolute)throw new Error('Cannot join an absolute path "'+e[t]+'" in the middle of other paths.');for(const t of r.path)o.path.push(t)}return t(u(o))};function f(e,n){const o=u(r(n));if(!o.absolute)return t(o);const a=u(r(e));if(o.origin!==a.origin)return t(o);if(!a.absolute)return t(o);if(a.drive!==o.drive)return t(o);const c=Math.min(a.path.length,o.path.length);for(let t=0;t<c&&a.path[0]===o.path[0];t++)a.path.shift(),o.path.shift();return o.path.unshift(...a.path.fill("..")),t({origin:null,drive:null,absolute:!1,protocol:null,path:o.path})}function g(...e){if(0===e.length)return".";const n=u(r(e[e.length-1]));return n.absolute?t(n):h(...e)}const b="/",d=t=>{return null!==r(t).drive};export{c as basename,l as dirname,s as extname,t as format,i as isAbsolute,p as isURL,h as join,o as normalize,r as parse,f as relative,g as resolve,b as sep,d as startsWithWindowsDrive,o as toFSPath};
{
"name": "@stoplight/path",
"version": "1.0.1",
"version": "1.0.2",
"description": "",

@@ -5,0 +5,0 @@ "keywords": [],

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc