@noego/forge 0.0.3 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +0,0 @@
1
- {"version":3,"file":"page.svelte-C4chAYK2.js","sources":["../node_modules/path-to-regex/index.js","../src/parser/path.ts","../src/client/page.svelte.ts"],"sourcesContent":["module.exports = Regex;\n\nif (typeof window !== 'undefined') {\n\twindow.pathToRegex = Regex;\n}\n\nconst escapeRe = /([$.+*?=!:[\\]{}(|)/\\\\])/g;\n\n/**\n * defaultParam - simplistic polyfill for default function parament\n * @param {any} [obj]\n * @param {any} defaultValue\n * @return {any}\n */\nfunction defaultParam(obj, defaultValue) {\n\treturn typeof obj !== 'undefined' ? obj : defaultValue;\n}\n\n/**\n * Класс Regex [description].\n * @constructor\n * @param {Object} options [description].\n */\nfunction Regex(path, options) {\n\tthis.init(path, options);\n\treturn this;\n}\n\nRegex.prototype.init = function (\n\tpath = \"/\",\n\toptions = {}\n) {\n\tthis.options = {\n\t\tcase: typeof options.case === \"boolean\" ? options.case : true,\n\t\tseparators: typeof options.separators === \"string\" ? options.separators : \"/\",\n\t\tfromStart: typeof options.fromStart === \"boolean\" ? options.fromStart : true,\n\t\ttoEnd: typeof options.toEnd === \"boolean\" ? options.toEnd : true\n\t};\n\tthis.options.separator = \"[\" + this.escape(this.options.separators) + \"]\";\n\n\tif (path instanceof RegExp) {\n\t\tthis.restructureRegExp(path);\n\t} else if (typeof path === \"string\") {\n\t\tthis.restructurePath(path);\n\t}\n};\n\n/**\n * Метод преобразует строку с шаблоном пути, включающим в себя строковое представление регулярных выражений\n * и указадели на идентификаторы ключей в стиле Express.js в регулярное выражение\n * @param {string} path Строка содержащая шаблон пути. Может содержать в себе регулярные выражения и объявление ключей типа :id. Поведение имитирует аналогичный функционал библиотеки Express.js v.5.x\n */\nRegex.prototype.restructureRegExp = function (regexp) {\n\tregexp = defaultParam(regexp, /.*/);\n\tthis.keys = [];\n\tthis.path = undefined;\n\tthis.regstr = (\"\" + regexp);\n\tthis.regstr = this.regstr.substr(1, this.regstr.length - 2);\n\tthis.regexp = new RegExp(\n\t\tthis.regstr,\n\t\tthis.options.case ? \"\" : \"i\"\n\t);\n\n}\n\n/**\n * Метод преобразует строку с шаблоном пути, включающим в себя строковое представление регулярных выражений\n * и указадели на идентификаторы ключей в стиле Express.js в регулярное выражение\n * @param {string} path Строка содержащая шаблон пути. Может содержать в себе регулярные выражения и объявление ключей типа :id. Поведение имитирует аналогичный функционал библиотеки Express.js v.5.x\n */\nRegex.prototype.restructurePath = function (path) {\n\tpath = defaultParam(path, '/');\n\tthis.keys = [];\n\tthis.path = path;\n\tthis.regstr = \"\";\n\n\tconst separator = this.options.separator;\n\tconst notseparator = \"[^\" + this.escape(this.options.separators) + \"]\";\n\n\tlet offset = 0;\n\tlet count = 0;\n\t// 11. REGEXP toEnd[true]: /^[\\/]?foo\\/(.*?)[\\/]?$/\n\t// 11. REGEXP toEnd[false]: /^[\\/]?foo\\/(.*?)([\\/]|[\\/]?$)/i\n\n\tpath = path.replace(new RegExp(\"^\" + separator + \"*(.*?)\" + separator + \"*$\"), \"$1\");\n\t//path += this.options.separators[0];\n\n\tpath.replace(/:([a-z]\\w*)(\\((.*?)\\))?([\\?\\*\\+])?/gi, (str, key, a, pat, quant, index, string) => {\n\t\t// console.log(\"-----------------------------\");\n\t\t// console.log(\"str:\", str);\n\t\t// console.log(\"key:\", key);\n\t\t// console.log(\"a:\", a);\n\t\t// console.log(\"pat:\", pat);\n\t\t// console.log(\"quant:\", quant);\n\t\t// console.log(\"index:\", index);\n\t\t// console.log(\"string:\", string);\n\t\tcount++;\n\n\n\n\t\tconst isMultiple = (quant === \"*\" || quant === \"+\") ? true : false;\n\t\tconst isExtrude = /^(\\[[^\\[\\]]+\\]|\\([^\\(\\)]+\\)|\\.|\\\\.)[\\+\\*]$/.test(pat) ? true : false;\n\n\t\tlet isRequired = (quant !== \"*\" && quant !== \"?\") ? true : false;\n\t\tif (!quant && pat && /^(\\[[^\\[\\]]+\\]|\\([^\\(\\)]+\\)|\\.|\\\\.)[\\*\\?]?$/.test(pat)) isRequired = false;\n\n\t\tconst quantifier = quant ? quant : \"\";\n\t\t// console.log(\"isMultiple\", isMultiple);\n\t\t// console.log(\"isRequired\", isRequired);\n\n\t\t// const startChar = path.charAt(index-1);\n\t\tconst isStarted = (!index) ? true : this.separator(path.charAt(index - 1));\n\t\tconst isStoped = (index + str.length >= path.length) ? true : this.separator(path.charAt(index + str.length));\n\t\tconst isToken = isStarted && isStoped;\n\n\t\tif (index > offset) {\n\t\t\tconst text = path.substring(offset, index);\n\t\t\tconst regstr = this.escape(text);\n\t\t\tthis.regstr += regstr;\n\t\t}\n\n\t\tif (isToken && index) {\n\t\t\tif (!isMultiple || !isRequired) {\n\t\t\t\tif (pat && !isExtrude) {\n\t\t\t\t\tthis.regstr += \"?\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//console.log(\"isStarted\", isStarted);\n\t\t//console.log(\"isStoped\", isStoped);\n\t\t//console.log(\"isToken\", isToken);\n\t\t//console.log(\"this.regstr 1:\", this.regstr);\n\n\t\tconst pattern = (pat ? pat : notseparator + \"+\");\n\n\t\tconst regstr =\n\t\t\tisMultiple ?\n\t\t\t\tisToken ?\n\t\t\t\t\tisExtrude ?\n\t\t\t\t\t\t\"((?:\" + separator + \"?\" + pattern + \")\" + quantifier + \")\" :\n\t\t\t\t\t\t\"((?:\" + separator + \"\" + pattern + \")\" + quantifier + \")\" :\n\t\t\t\t\t\"((?:\" + notseparator + \"*\" + pattern + \")\" + quantifier + \")\" :\n\t\t\t\tisToken ?\n\t\t\t\t\tisExtrude ?\n\t\t\t\t\t\t\"(\" + pattern + \"?)\" + quantifier :\n\t\t\t\t\t\t\"(\" + pattern + \")\" + quantifier :\n\t\t\t\t\t\"(\" + pattern + \")\" + quantifier;\n\n\t\tthis.regstr += regstr;\n\n\t\tconst data = {\n\t\t\tkey: key,\n\t\t\tmultiple: isMultiple,\n\t\t\trequired: isRequired,\n\t\t\tindex: count,\n\t\t\tpattern: pattern\n\t\t};\n\t\tif (isMultiple)\n\t\t\tdata.regexp = new RegExp(pattern, this.options.case ? \"g\" : \"gi\");\n\n\t\tthis.keys.push(data);\n\n\t\toffset = index + str.length;\n\t\treturn str;\n\t});\n\n\tif (offset < path.length - 1) {\n\t\tconst text = path.substring(offset);\n\t\tconst regstr = this.escape(text);\n\t\tthis.regstr += regstr;\n\t}\n\n\tthis.regexp = new RegExp(\n\t\t(this.options.fromStart ? \"^\" : \"\") +\n\t\tseparator + \"?\" +\n\t\tthis.regstr +\n\t\t(this.options.toEnd\n\t\t\t?\n\t\t\tseparator + \"?\" + \"$\"\n\t\t\t:\n\t\t\t\"(\" + separator + \"|\" + separator + \"?\" + \"$\" + \")\"\n\t\t),\n\t\tthis.options.case ? \"\" : \"i\"\n\t);\n}\n\n\n\n/**\n * Метод экранирует все спец символы указанные в глобальной для модуля, переменной escapeRe\n * @param {string} text Любая строка\n * @return {string} Строка text, в которой все символы указанные в переменной escapeRe заэкранированы\n */\nRegex.prototype.escape = function (text) {\n\treturn text.replace(escapeRe, s => {\n\t\treturn \"\\\\\" + s\n\t});\n}\n\n/**\n * Метод проверяет является ли char одним из разделителей указанных в this.options.separators\n * @param {string} char Cтрока содержащая в себе проверяемый символ (длинна строки должна быть равна 1)\n * @return {boolean} Если проверяемый символ является одним из символов указанных в this.options.separators то true иначе false\n */\nRegex.prototype.separator = function (char) {\n\treturn !!(this.options.separators.indexOf(char) + 1);\n}\n\n\n\nRegex.prototype.match = function (path) {\n\t// console.log(\"match 01\");\n\n\tif (typeof path !== \"string\") return;\n\n\tconst reseparator = this.options.separator;\n\tconst separator = this.options.separators[0];\n\tpath = path.replace(new RegExp(\"^\" + reseparator + \"*(.*?)\" + reseparator + \"*$\"), separator + \"$1\" + separator);\n\n\t// console.log(\"match 02\");\n\tconst result = path.match(this.regexp);\n\t// console.log(\"match 03\");\n\n\tif (!result) return;\n\n\t// console.log(\"match 04\");\n\tconst data = {};\n\n\t// console.log(\"match 05\");\n\tthis.keys.forEach(item => {\n\t\t// console.log(\"match foreach 01\");\n\t\tlet isMultiple = false;\n\n\t\tif (data[item.key])\n\t\t\tisMultiple = true;\n\n\n\t\tif (data[item.key] && !Array.isArray(data[item.key])) {\n\t\t\tisMultiple = true;\n\t\t\tdata[item.key] = [data[item.key]];\n\t\t}\n\n\t\tif (item.multiple && !data[item.key]) {\n\t\t\tisMultiple = true;\n\t\t\tdata[item.key] = [];\n\t\t}\n\n\t\tlet value = result[item.index] ? result[item.index] : undefined;\n\n\t\tif (!isMultiple && !item.multiple) {\n\t\t\tdata[item.key] = value;\n\t\t\treturn;\n\t\t}\n\n\t\tif (isMultiple && !item.multiple && result[item.index]) {\n\t\t\tdata[item.key].push(value);\n\t\t\treturn;\n\t\t}\n\n\t\tif (result[item.index])\n\t\t\tresult[item.index].replace(item.regexp, str => {\n\t\t\t\tif (str) data[item.key].push(\n\t\t\t\t\tstr.replace(new RegExp(reseparator + \"*$\"), \"\")\n\t\t\t\t);\n\t\t\t});\n\n\t});\n\t// console.log(\"match 06\");\n\treturn data;\n};\n","import type {IRoute} from \"./IRoute\"\n\n/**\n * Convert OpenAPI‐style `{name[:pattern][modifier]}` into\n * path-to-regexp’s `:name(pattern)?*+` syntax, while\n * allowing literal `{` or `}` inside the regex.\n */\nexport function convertBraces(path: string): string {\n let out = '';\n let i = 0;\n\n while (i < path.length) {\n if (path[i] === '{') {\n // start of a parameter spec\n let start = i;\n i++;\n // find the matching closing '}' that balances this one\n let depth = 1;\n while (i < path.length && depth > 0) {\n if (path[i] === '\\\\') {\n // skip escaped chars\n i += 2;\n } else {\n if (path[i] === '{') depth++;\n else if (path[i] === '}') depth--;\n i++;\n }\n }\n if (depth !== 0) {\n throw new Error(`Unmatched '{' in path: ${path}`);\n }\n const segment = path.slice(start + 1, i - 1);\n // A segment is one of the following forms:\n // 1. \"name\" – simple param, no pattern, no modifier\n // 2. \"name+\" / \"name*\" / \"name?\" – param with modifier only\n // 3. \"name:regex\" – explicit pattern (may itself contain +, *, ?)\n // In the third case we must **not** interpret a trailing +, * or ? as a\n // modifier because it belongs to the user-supplied regex. The original\n // implementation used a single regexp with an optional modifier group,\n // which incorrectly split patterns such as `.*` or `.+` into two parts\n // (`.` as the pattern and `*` or `+` as the modifier). Instead we now\n // split on the first ':'; if a pattern is present we treat the rest of\n // the segment verbatim.\n\n const colonIdx = segment.indexOf(':');\n let name: string;\n let pattern: string | undefined;\n let modifier: string | undefined;\n\n if (colonIdx === -1) {\n // Forms 1 & 2 – no explicit pattern, so a trailing modifier is allowed.\n const m = segment.match(/^([^?*+]+)([?*+])?$/);\n if (!m) {\n throw new Error(`Invalid parameter segment: {${segment}}`);\n }\n [, name, modifier] = m as RegExpMatchArray & [string, string, string?];\n } else {\n // Form 3 – everything after the first ':' is the pattern.\n name = segment.slice(0, colonIdx);\n pattern = segment.slice(colonIdx + 1);\n // No modifier allowed when an explicit pattern is used.\n }\n\n out += `:${name}`;\n if (pattern) out += `(${pattern})`;\n if (modifier) out += modifier;\n } else {\n // ordinary char, copy (also handles escaped chars)\n out += path[i++];\n }\n }\n\n return out;\n}\n\n\nexport function parsePathConfig(path:string,method:string,path_config:any):IRoute {\n const layout = path_config['x-layout']\n const view = path_config['x-view']\n const summary = path_config.summary\n const query = path_config.query\n const body = path_config.body\n const parameters = path_config.parameters\n const responses = path_config.responses\n\n return {\n summary,\n path: convertBraces(path),\n method,\n layout,\n view,\n responses,\n parameters,\n query,\n body\n }\n}\n","import type { IPage } from \"../routing/page\";\nimport path_to_regex from \"path-to-regex\"\nimport {convertBraces} from \"../parser/path\";\n\n\n\nexport let page = $state({\n url: '',\n pathname:'',\n params: {},\n query:{},\n} as IPage);\n\n\nif(typeof window !== 'undefined') {\n page.url = window.location.href\n page.pathname = window.location.pathname\n Object.assign(page.query,Object.fromEntries(new URLSearchParams(window.location.search)))\n page.params = {}\n}\n\n\nconst patterns:Record<string,any> = {}\nexport function shadowUrl(pattern:string, url: string){\n if(!patterns[pattern]) {\n patterns[pattern] = new path_to_regex(convertBraces(pattern))\n }\n const match = patterns[pattern].match(url)\n if(match) {\n return match\n }else{\n return {}\n }\n}\n"],"names":["pathToRegex","Regex","escapeRe","defaultParam","obj","defaultValue","path","options","regexp","separator","notseparator","offset","count","str","key","a","pat","quant","index","string","isMultiple","isExtrude","isRequired","quantifier","isStarted","isStoped","isToken","text","regstr","pattern","data","s","char","reseparator","result","item","value","convertBraces","out","i","start","depth","segment","colonIdx","name","modifier","m","page","patterns","shadowUrl","url","path_to_regex","match"],"mappings":";;;;;;;SAAAA,IAAiBC,GAEb,OAAO,SAAW,QACrB,OAAO,cAAcA;AAGtB,QAAMC,IAAW;AAQjB,WAASC,EAAaC,GAAKC,GAAc;AACxC,WAAO,OAAOD,IAAQ,MAAcA,IAAMC;AAAA,EAC3C;AAOA,WAASJ,EAAMK,GAAMC,GAAS;AAC7B,gBAAK,KAAKD,GAAMC,CAAO,GAChB;AAAA,EACR;AAEA,SAAAN,EAAM,UAAU,OAAO,SACtBK,IAAO,KACPC,IAAU,CAAA,GACT;AACD,SAAK,UAAU;AAAA,MACd,MAAM,OAAOA,EAAQ,QAAS,YAAYA,EAAQ,OAAO;AAAA,MACzD,YAAY,OAAOA,EAAQ,cAAe,WAAWA,EAAQ,aAAa;AAAA,MAC1E,WAAW,OAAOA,EAAQ,aAAc,YAAYA,EAAQ,YAAY;AAAA,MACxE,OAAO,OAAOA,EAAQ,SAAU,YAAYA,EAAQ,QAAQ;AAAA,IAC5D,GACD,KAAK,QAAQ,YAAY,MAAM,KAAK,OAAO,KAAK,QAAQ,UAAU,IAAI,KAElED,aAAgB,SACnB,KAAK,kBAAkBA,CAAI,IACjB,OAAOA,KAAS,YAC1B,KAAK,gBAAgBA,CAAI;AAAA,EAE1B,GAODL,EAAM,UAAU,oBAAoB,SAAUO,GAAQ;AACrD,IAAAA,IAASL,EAAaK,GAAQ,IAAI,GAClC,KAAK,O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BAAgB,OAAO,SAAS,MAAM,CAAA,CAAA,GACtFA,EAAK;MAIHC;AACU,SAAAC,EAAUpB,GAAgBqB,GAAY;EAC9CF,EAASnB,CAAO,MAChBmB,EAASnB,CAAO,IAAA,IAAQsB,EAAcd,EAAcR,CAAO,CAAA;AAEzD,QAAAuB,IAAQJ,EAASnB,CAAO,EAAE,MAAMqB,CAAG;AACtC,SAAAE;AAKP;","x_google_ignoreList":[0]}
@@ -1,2 +0,0 @@
1
- "use strict";const T=require("svelte/internal/client");function A(o){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const s in o)if(s!=="default"){const e=Object.getOwnPropertyDescriptor(o,s);Object.defineProperty(a,s,e.get?e:{enumerable:!0,get:()=>o[s]})}}return a.default=o,Object.freeze(a)}const M=A(T);function U(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var k,b;function D(){if(b)return k;b=1,k=s,typeof window<"u"&&(window.pathToRegex=s);const o=/([$.+*?=!:[\]{}(|)/\\])/g;function a(e,t){return typeof e<"u"?e:t}function s(e,t){return this.init(e,t),this}return s.prototype.init=function(e="/",t={}){this.options={case:typeof t.case=="boolean"?t.case:!0,separators:typeof t.separators=="string"?t.separators:"/",fromStart:typeof t.fromStart=="boolean"?t.fromStart:!0,toEnd:typeof t.toEnd=="boolean"?t.toEnd:!0},this.options.separator="["+this.escape(this.options.separators)+"]",e instanceof RegExp?this.restructureRegExp(e):typeof e=="string"&&this.restructurePath(e)},s.prototype.restructureRegExp=function(e){e=a(e,/.*/),this.keys=[],this.path=void 0,this.regstr=""+e,this.regstr=this.regstr.substr(1,this.regstr.length-2),this.regexp=new RegExp(this.regstr,this.options.case?"":"i")},s.prototype.restructurePath=function(e){e=a(e,"/"),this.keys=[],this.path=e,this.regstr="";const t=this.options.separator,f="[^"+this.escape(this.options.separators)+"]";let i=0,n=0;if(e=e.replace(new RegExp("^"+t+"*(.*?)"+t+"*$"),"$1"),e.replace(/:([a-z]\w*)(\((.*?)\))?([\?\*\+])?/gi,(r,c,g,u,h,l,B)=>{n++;const w=h==="*"||h==="+",x=!!/^(\[[^\[\]]+\]|\([^\(\)]+\)|\.|\\.)[\+\*]$/.test(u);let E=h!=="*"&&h!=="?";!h&&u&&/^(\[[^\[\]]+\]|\([^\(\)]+\)|\.|\\.)[\*\?]?$/.test(u)&&(E=!1);const d=h||"",P=l?this.separator(e.charAt(l-1)):!0,S=l+r.length>=e.length?!0:this.separator(e.charAt(l+r.length)),R=P&&S;if(l>i){const j=e.substring(i,l),v=this.escape(j);this.regstr+=v}R&&l&&(!w||!E)&&u&&!x&&(this.regstr+="?");const p=u||f+"+",_=w?R?x?"((?:"+t+"?"+p+")"+d+")":"((?:"+t+p+")"+d+")":"((?:"+f+"*"+p+")"+d+")":R&&x?"("+p+"?)"+d:"("+p+")"+d;this.regstr+=_;const m={key:c,multiple:w,required:E,index:n,pattern:p};return w&&(m.regexp=new RegExp(p,this.options.case?"g":"gi")),this.keys.push(m),i=l+r.length,r}),i<e.length-1){const r=e.substring(i),c=this.escape(r);this.regstr+=c}this.regexp=new RegExp((this.options.fromStart?"^":"")+t+"?"+this.regstr+(this.options.toEnd?t+"?$":"("+t+"|"+t+"?$)"),this.options.case?"":"i")},s.prototype.escape=function(e){return e.replace(o,t=>"\\"+t)},s.prototype.separator=function(e){return!!(this.options.separators.indexOf(e)+1)},s.prototype.match=function(e){if(typeof e!="string")return;const t=this.options.separator,f=this.options.separators[0];e=e.replace(new RegExp("^"+t+"*(.*?)"+t+"*$"),f+"$1"+f);const i=e.match(this.regexp);if(!i)return;const n={};return this.keys.forEach(r=>{let c=!1;n[r.key]&&(c=!0),n[r.key]&&!Array.isArray(n[r.key])&&(c=!0,n[r.key]=[n[r.key]]),r.multiple&&!n[r.key]&&(c=!0,n[r.key]=[]);let g=i[r.index]?i[r.index]:void 0;if(!c&&!r.multiple){n[r.key]=g;return}if(c&&!r.multiple&&i[r.index]){n[r.key].push(g);return}i[r.index]&&i[r.index].replace(r.regexp,u=>{u&&n[r.key].push(u.replace(new RegExp(t+"*$"),""))})}),n},k}var q=D();const O=U(q);function z(o){let a="",s=0;for(;s<o.length;)if(o[s]==="{"){let e=s;s++;let t=1;for(;s<o.length&&t>0;)o[s]==="\\"?s+=2:(o[s]==="{"?t++:o[s]==="}"&&t--,s++);if(t!==0)throw new Error(`Unmatched '{' in path: ${o}`);const f=o.slice(e+1,s-1),i=f.indexOf(":");let n,r,c;if(i===-1){const g=f.match(/^([^?*+]+)([?*+])?$/);if(!g)throw new Error(`Invalid parameter segment: {${f}}`);[,n,c]=g}else n=f.slice(0,i),r=f.slice(i+1);a+=`:${n}`,r&&(a+=`(${r})`),c&&(a+=c)}else a+=o[s++];return a}let y=M.proxy({url:"",pathname:"",params:{},query:{}});typeof window<"u"&&(y.url=window.location.href,y.pathname=window.location.pathname,Object.assign(y.query,Object.fromEntries(new URLSearchParams(window.location.search))),y.params={});const $={};function I(o,a){$[o]||($[o]=new O(z(o)));const s=$[o].match(a);return s||{}}exports.page=y;exports.path_to_regex=O;exports.shadowUrl=I;
2
- //# sourceMappingURL=page.svelte-Dvj7306U.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"page.svelte-Dvj7306U.cjs","sources":["../node_modules/path-to-regex/index.js","../src/parser/path.ts","../src/client/page.svelte.ts"],"sourcesContent":["module.exports = Regex;\n\nif (typeof window !== 'undefined') {\n\twindow.pathToRegex = Regex;\n}\n\nconst escapeRe = /([$.+*?=!:[\\]{}(|)/\\\\])/g;\n\n/**\n * defaultParam - simplistic polyfill for default function parament\n * @param {any} [obj]\n * @param {any} defaultValue\n * @return {any}\n */\nfunction defaultParam(obj, defaultValue) {\n\treturn typeof obj !== 'undefined' ? obj : defaultValue;\n}\n\n/**\n * Класс Regex [description].\n * @constructor\n * @param {Object} options [description].\n */\nfunction Regex(path, options) {\n\tthis.init(path, options);\n\treturn this;\n}\n\nRegex.prototype.init = function (\n\tpath = \"/\",\n\toptions = {}\n) {\n\tthis.options = {\n\t\tcase: typeof options.case === \"boolean\" ? options.case : true,\n\t\tseparators: typeof options.separators === \"string\" ? options.separators : \"/\",\n\t\tfromStart: typeof options.fromStart === \"boolean\" ? options.fromStart : true,\n\t\ttoEnd: typeof options.toEnd === \"boolean\" ? options.toEnd : true\n\t};\n\tthis.options.separator = \"[\" + this.escape(this.options.separators) + \"]\";\n\n\tif (path instanceof RegExp) {\n\t\tthis.restructureRegExp(path);\n\t} else if (typeof path === \"string\") {\n\t\tthis.restructurePath(path);\n\t}\n};\n\n/**\n * Метод преобразует строку с шаблоном пути, включающим в себя строковое представление регулярных выражений\n * и указадели на идентификаторы ключей в стиле Express.js в регулярное выражение\n * @param {string} path Строка содержащая шаблон пути. Может содержать в себе регулярные выражения и объявление ключей типа :id. Поведение имитирует аналогичный функционал библиотеки Express.js v.5.x\n */\nRegex.prototype.restructureRegExp = function (regexp) {\n\tregexp = defaultParam(regexp, /.*/);\n\tthis.keys = [];\n\tthis.path = undefined;\n\tthis.regstr = (\"\" + regexp);\n\tthis.regstr = this.regstr.substr(1, this.regstr.length - 2);\n\tthis.regexp = new RegExp(\n\t\tthis.regstr,\n\t\tthis.options.case ? \"\" : \"i\"\n\t);\n\n}\n\n/**\n * Метод преобразует строку с шаблоном пути, включающим в себя строковое представление регулярных выражений\n * и указадели на идентификаторы ключей в стиле Express.js в регулярное выражение\n * @param {string} path Строка содержащая шаблон пути. Может содержать в себе регулярные выражения и объявление ключей типа :id. Поведение имитирует аналогичный функционал библиотеки Express.js v.5.x\n */\nRegex.prototype.restructurePath = function (path) {\n\tpath = defaultParam(path, '/');\n\tthis.keys = [];\n\tthis.path = path;\n\tthis.regstr = \"\";\n\n\tconst separator = this.options.separator;\n\tconst notseparator = \"[^\" + this.escape(this.options.separators) + \"]\";\n\n\tlet offset = 0;\n\tlet count = 0;\n\t// 11. REGEXP toEnd[true]: /^[\\/]?foo\\/(.*?)[\\/]?$/\n\t// 11. REGEXP toEnd[false]: /^[\\/]?foo\\/(.*?)([\\/]|[\\/]?$)/i\n\n\tpath = path.replace(new RegExp(\"^\" + separator + \"*(.*?)\" + separator + \"*$\"), \"$1\");\n\t//path += this.options.separators[0];\n\n\tpath.replace(/:([a-z]\\w*)(\\((.*?)\\))?([\\?\\*\\+])?/gi, (str, key, a, pat, quant, index, string) => {\n\t\t// console.log(\"-----------------------------\");\n\t\t// console.log(\"str:\", str);\n\t\t// console.log(\"key:\", key);\n\t\t// console.log(\"a:\", a);\n\t\t// console.log(\"pat:\", pat);\n\t\t// console.log(\"quant:\", quant);\n\t\t// console.log(\"index:\", index);\n\t\t// console.log(\"string:\", string);\n\t\tcount++;\n\n\n\n\t\tconst isMultiple = (quant === \"*\" || quant === \"+\") ? true : false;\n\t\tconst isExtrude = /^(\\[[^\\[\\]]+\\]|\\([^\\(\\)]+\\)|\\.|\\\\.)[\\+\\*]$/.test(pat) ? true : false;\n\n\t\tlet isRequired = (quant !== \"*\" && quant !== \"?\") ? true : false;\n\t\tif (!quant && pat && /^(\\[[^\\[\\]]+\\]|\\([^\\(\\)]+\\)|\\.|\\\\.)[\\*\\?]?$/.test(pat)) isRequired = false;\n\n\t\tconst quantifier = quant ? quant : \"\";\n\t\t// console.log(\"isMultiple\", isMultiple);\n\t\t// console.log(\"isRequired\", isRequired);\n\n\t\t// const startChar = path.charAt(index-1);\n\t\tconst isStarted = (!index) ? true : this.separator(path.charAt(index - 1));\n\t\tconst isStoped = (index + str.length >= path.length) ? true : this.separator(path.charAt(index + str.length));\n\t\tconst isToken = isStarted && isStoped;\n\n\t\tif (index > offset) {\n\t\t\tconst text = path.substring(offset, index);\n\t\t\tconst regstr = this.escape(text);\n\t\t\tthis.regstr += regstr;\n\t\t}\n\n\t\tif (isToken && index) {\n\t\t\tif (!isMultiple || !isRequired) {\n\t\t\t\tif (pat && !isExtrude) {\n\t\t\t\t\tthis.regstr += \"?\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//console.log(\"isStarted\", isStarted);\n\t\t//console.log(\"isStoped\", isStoped);\n\t\t//console.log(\"isToken\", isToken);\n\t\t//console.log(\"this.regstr 1:\", this.regstr);\n\n\t\tconst pattern = (pat ? pat : notseparator + \"+\");\n\n\t\tconst regstr =\n\t\t\tisMultiple ?\n\t\t\t\tisToken ?\n\t\t\t\t\tisExtrude ?\n\t\t\t\t\t\t\"((?:\" + separator + \"?\" + pattern + \")\" + quantifier + \")\" :\n\t\t\t\t\t\t\"((?:\" + separator + \"\" + pattern + \")\" + quantifier + \")\" :\n\t\t\t\t\t\"((?:\" + notseparator + \"*\" + pattern + \")\" + quantifier + \")\" :\n\t\t\t\tisToken ?\n\t\t\t\t\tisExtrude ?\n\t\t\t\t\t\t\"(\" + pattern + \"?)\" + quantifier :\n\t\t\t\t\t\t\"(\" + pattern + \")\" + quantifier :\n\t\t\t\t\t\"(\" + pattern + \")\" + quantifier;\n\n\t\tthis.regstr += regstr;\n\n\t\tconst data = {\n\t\t\tkey: key,\n\t\t\tmultiple: isMultiple,\n\t\t\trequired: isRequired,\n\t\t\tindex: count,\n\t\t\tpattern: pattern\n\t\t};\n\t\tif (isMultiple)\n\t\t\tdata.regexp = new RegExp(pattern, this.options.case ? \"g\" : \"gi\");\n\n\t\tthis.keys.push(data);\n\n\t\toffset = index + str.length;\n\t\treturn str;\n\t});\n\n\tif (offset < path.length - 1) {\n\t\tconst text = path.substring(offset);\n\t\tconst regstr = this.escape(text);\n\t\tthis.regstr += regstr;\n\t}\n\n\tthis.regexp = new RegExp(\n\t\t(this.options.fromStart ? \"^\" : \"\") +\n\t\tseparator + \"?\" +\n\t\tthis.regstr +\n\t\t(this.options.toEnd\n\t\t\t?\n\t\t\tseparator + \"?\" + \"$\"\n\t\t\t:\n\t\t\t\"(\" + separator + \"|\" + separator + \"?\" + \"$\" + \")\"\n\t\t),\n\t\tthis.options.case ? \"\" : \"i\"\n\t);\n}\n\n\n\n/**\n * Метод экранирует все спец символы указанные в глобальной для модуля, переменной escapeRe\n * @param {string} text Любая строка\n * @return {string} Строка text, в которой все символы указанные в переменной escapeRe заэкранированы\n */\nRegex.prototype.escape = function (text) {\n\treturn text.replace(escapeRe, s => {\n\t\treturn \"\\\\\" + s\n\t});\n}\n\n/**\n * Метод проверяет является ли char одним из разделителей указанных в this.options.separators\n * @param {string} char Cтрока содержащая в себе проверяемый символ (длинна строки должна быть равна 1)\n * @return {boolean} Если проверяемый символ является одним из символов указанных в this.options.separators то true иначе false\n */\nRegex.prototype.separator = function (char) {\n\treturn !!(this.options.separators.indexOf(char) + 1);\n}\n\n\n\nRegex.prototype.match = function (path) {\n\t// console.log(\"match 01\");\n\n\tif (typeof path !== \"string\") return;\n\n\tconst reseparator = this.options.separator;\n\tconst separator = this.options.separators[0];\n\tpath = path.replace(new RegExp(\"^\" + reseparator + \"*(.*?)\" + reseparator + \"*$\"), separator + \"$1\" + separator);\n\n\t// console.log(\"match 02\");\n\tconst result = path.match(this.regexp);\n\t// console.log(\"match 03\");\n\n\tif (!result) return;\n\n\t// console.log(\"match 04\");\n\tconst data = {};\n\n\t// console.log(\"match 05\");\n\tthis.keys.forEach(item => {\n\t\t// console.log(\"match foreach 01\");\n\t\tlet isMultiple = false;\n\n\t\tif (data[item.key])\n\t\t\tisMultiple = true;\n\n\n\t\tif (data[item.key] && !Array.isArray(data[item.key])) {\n\t\t\tisMultiple = true;\n\t\t\tdata[item.key] = [data[item.key]];\n\t\t}\n\n\t\tif (item.multiple && !data[item.key]) {\n\t\t\tisMultiple = true;\n\t\t\tdata[item.key] = [];\n\t\t}\n\n\t\tlet value = result[item.index] ? result[item.index] : undefined;\n\n\t\tif (!isMultiple && !item.multiple) {\n\t\t\tdata[item.key] = value;\n\t\t\treturn;\n\t\t}\n\n\t\tif (isMultiple && !item.multiple && result[item.index]) {\n\t\t\tdata[item.key].push(value);\n\t\t\treturn;\n\t\t}\n\n\t\tif (result[item.index])\n\t\t\tresult[item.index].replace(item.regexp, str => {\n\t\t\t\tif (str) data[item.key].push(\n\t\t\t\t\tstr.replace(new RegExp(reseparator + \"*$\"), \"\")\n\t\t\t\t);\n\t\t\t});\n\n\t});\n\t// console.log(\"match 06\");\n\treturn data;\n};\n","import type {IRoute} from \"./IRoute\"\n\n/**\n * Convert OpenAPI‐style `{name[:pattern][modifier]}` into\n * path-to-regexp’s `:name(pattern)?*+` syntax, while\n * allowing literal `{` or `}` inside the regex.\n */\nexport function convertBraces(path: string): string {\n let out = '';\n let i = 0;\n\n while (i < path.length) {\n if (path[i] === '{') {\n // start of a parameter spec\n let start = i;\n i++;\n // find the matching closing '}' that balances this one\n let depth = 1;\n while (i < path.length && depth > 0) {\n if (path[i] === '\\\\') {\n // skip escaped chars\n i += 2;\n } else {\n if (path[i] === '{') depth++;\n else if (path[i] === '}') depth--;\n i++;\n }\n }\n if (depth !== 0) {\n throw new Error(`Unmatched '{' in path: ${path}`);\n }\n const segment = path.slice(start + 1, i - 1);\n // A segment is one of the following forms:\n // 1. \"name\" – simple param, no pattern, no modifier\n // 2. \"name+\" / \"name*\" / \"name?\" – param with modifier only\n // 3. \"name:regex\" – explicit pattern (may itself contain +, *, ?)\n // In the third case we must **not** interpret a trailing +, * or ? as a\n // modifier because it belongs to the user-supplied regex. The original\n // implementation used a single regexp with an optional modifier group,\n // which incorrectly split patterns such as `.*` or `.+` into two parts\n // (`.` as the pattern and `*` or `+` as the modifier). Instead we now\n // split on the first ':'; if a pattern is present we treat the rest of\n // the segment verbatim.\n\n const colonIdx = segment.indexOf(':');\n let name: string;\n let pattern: string | undefined;\n let modifier: string | undefined;\n\n if (colonIdx === -1) {\n // Forms 1 & 2 – no explicit pattern, so a trailing modifier is allowed.\n const m = segment.match(/^([^?*+]+)([?*+])?$/);\n if (!m) {\n throw new Error(`Invalid parameter segment: {${segment}}`);\n }\n [, name, modifier] = m as RegExpMatchArray & [string, string, string?];\n } else {\n // Form 3 – everything after the first ':' is the pattern.\n name = segment.slice(0, colonIdx);\n pattern = segment.slice(colonIdx + 1);\n // No modifier allowed when an explicit pattern is used.\n }\n\n out += `:${name}`;\n if (pattern) out += `(${pattern})`;\n if (modifier) out += modifier;\n } else {\n // ordinary char, copy (also handles escaped chars)\n out += path[i++];\n }\n }\n\n return out;\n}\n\n\nexport function parsePathConfig(path:string,method:string,path_config:any):IRoute {\n const layout = path_config['x-layout']\n const view = path_config['x-view']\n const summary = path_config.summary\n const query = path_config.query\n const body = path_config.body\n const parameters = path_config.parameters\n const responses = path_config.responses\n\n return {\n summary,\n path: convertBraces(path),\n method,\n layout,\n view,\n responses,\n parameters,\n query,\n body\n }\n}\n","import type { IPage } from \"../routing/page\";\nimport path_to_regex from \"path-to-regex\"\nimport {convertBraces} from \"../parser/path\";\n\n\n\nexport let page = $state({\n url: '',\n pathname:'',\n params: {},\n query:{},\n} as IPage);\n\n\nif(typeof window !== 'undefined') {\n page.url = window.location.href\n page.pathname = window.location.pathname\n Object.assign(page.query,Object.fromEntries(new URLSearchParams(window.location.search)))\n page.params = {}\n}\n\n\nconst patterns:Record<string,any> = {}\nexport function shadowUrl(pattern:string, url: string){\n if(!patterns[pattern]) {\n patterns[pattern] = new path_to_regex(convertBraces(pattern))\n }\n const match = patterns[pattern].match(url)\n if(match) {\n return match\n }else{\n return {}\n }\n}\n"],"names":["pathToRegex","Regex","escapeRe","defaultParam","obj","defaultValue","path","options","regexp","separator","notseparator","offset","count","str","key","a","pat","quant","index","string","isMultiple","isExtrude","isRequired","quantifier","isStarted","isStoped","isToken","text","regstr","pattern","data","s","char","reseparator","result","item","value","convertBraces","out","i","start","depth","segment","colonIdx","name","modifier","m","page","patterns","shadowUrl","url","path_to_regex","match"],"mappings":"4dAAAA,EAAiBC,EAEb,OAAO,OAAW,MACrB,OAAO,YAAcA,GAGtB,MAAMC,EAAW,2BAQjB,SAASC,EAAaC,EAAKC,EAAc,CACxC,OAAO,OAAOD,EAAQ,IAAcA,EAAMC,CAC3C,CAOA,SAASJ,EAAMK,EAAMC,EAAS,CAC7B,YAAK,KAAKD,EAAMC,CAAO,EAChB,IACR,CAEA,OAAA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O,KAC5BgB,IAAiBP,GAAAO,EAAA,MAGrBP,GAAOhC,EAAKiC,GAAG,EAIZ,OAAAD,CACT,KCnEWS,WACP,IAAK,GACL,SAAS,GACT,UACA,kBAIM,OAAW,MACZA,EAAA,IAAM,OAAO,SAAS,KACtBA,EAAA,SAAW,OAAO,SAAS,SACzB,OAAA,OAAOA,EAAK,MAAM,OAAO,gBAAgB,gBAAgB,OAAO,SAAS,MAAM,CAAA,CAAA,EACtFA,EAAK,iBAIHC,KACU,SAAAC,EAAUpB,EAAgBqB,EAAY,CAC9CF,EAASnB,CAAO,IAChBmB,EAASnB,CAAO,EAAA,IAAQsB,EAAcd,EAAcR,CAAO,CAAA,GAEzD,MAAAuB,EAAQJ,EAASnB,CAAO,EAAE,MAAMqB,CAAG,EACtC,OAAAE,KAKP","x_google_ignoreList":[0]}
@@ -1,68 +0,0 @@
1
- "use strict";
2
- function convertBraces(path) {
3
- let out = "";
4
- let i = 0;
5
- while (i < path.length) {
6
- if (path[i] === "{") {
7
- let start = i;
8
- i++;
9
- let depth = 1;
10
- while (i < path.length && depth > 0) {
11
- if (path[i] === "\\") {
12
- i += 2;
13
- } else {
14
- if (path[i] === "{") depth++;
15
- else if (path[i] === "}") depth--;
16
- i++;
17
- }
18
- }
19
- if (depth !== 0) {
20
- throw new Error(`Unmatched '{' in path: ${path}`);
21
- }
22
- const segment = path.slice(start + 1, i - 1);
23
- const colonIdx = segment.indexOf(":");
24
- let name;
25
- let pattern;
26
- let modifier;
27
- if (colonIdx === -1) {
28
- const m = segment.match(/^([^?*+]+)([?*+])?$/);
29
- if (!m) {
30
- throw new Error(`Invalid parameter segment: {${segment}}`);
31
- }
32
- [, name, modifier] = m;
33
- } else {
34
- name = segment.slice(0, colonIdx);
35
- pattern = segment.slice(colonIdx + 1);
36
- }
37
- out += `:${name}`;
38
- if (pattern) out += `(${pattern})`;
39
- if (modifier) out += modifier;
40
- } else {
41
- out += path[i++];
42
- }
43
- }
44
- return out;
45
- }
46
- function parsePathConfig(path, method, path_config) {
47
- const layout = path_config["x-layout"];
48
- const view = path_config["x-view"];
49
- const summary = path_config.summary;
50
- const query = path_config.query;
51
- const body = path_config.body;
52
- const parameters = path_config.parameters;
53
- const responses = path_config.responses;
54
- return {
55
- summary,
56
- path: convertBraces(path),
57
- method,
58
- layout,
59
- view,
60
- responses,
61
- parameters,
62
- query,
63
- body
64
- };
65
- }
66
- exports.convertBraces = convertBraces;
67
- exports.parsePathConfig = parsePathConfig;
68
- //# sourceMappingURL=path-CyGuWUeq.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"path-CyGuWUeq.cjs","sources":["../src/parser/path.ts"],"sourcesContent":["import type {IRoute} from \"./IRoute\"\n\n/**\n * Convert OpenAPI‐style `{name[:pattern][modifier]}` into\n * path-to-regexp’s `:name(pattern)?*+` syntax, while\n * allowing literal `{` or `}` inside the regex.\n */\nexport function convertBraces(path: string): string {\n let out = '';\n let i = 0;\n\n while (i < path.length) {\n if (path[i] === '{') {\n // start of a parameter spec\n let start = i;\n i++;\n // find the matching closing '}' that balances this one\n let depth = 1;\n while (i < path.length && depth > 0) {\n if (path[i] === '\\\\') {\n // skip escaped chars\n i += 2;\n } else {\n if (path[i] === '{') depth++;\n else if (path[i] === '}') depth--;\n i++;\n }\n }\n if (depth !== 0) {\n throw new Error(`Unmatched '{' in path: ${path}`);\n }\n const segment = path.slice(start + 1, i - 1);\n // A segment is one of the following forms:\n // 1. \"name\" – simple param, no pattern, no modifier\n // 2. \"name+\" / \"name*\" / \"name?\" – param with modifier only\n // 3. \"name:regex\" – explicit pattern (may itself contain +, *, ?)\n // In the third case we must **not** interpret a trailing +, * or ? as a\n // modifier because it belongs to the user-supplied regex. The original\n // implementation used a single regexp with an optional modifier group,\n // which incorrectly split patterns such as `.*` or `.+` into two parts\n // (`.` as the pattern and `*` or `+` as the modifier). Instead we now\n // split on the first ':'; if a pattern is present we treat the rest of\n // the segment verbatim.\n\n const colonIdx = segment.indexOf(':');\n let name: string;\n let pattern: string | undefined;\n let modifier: string | undefined;\n\n if (colonIdx === -1) {\n // Forms 1 & 2 – no explicit pattern, so a trailing modifier is allowed.\n const m = segment.match(/^([^?*+]+)([?*+])?$/);\n if (!m) {\n throw new Error(`Invalid parameter segment: {${segment}}`);\n }\n [, name, modifier] = m as RegExpMatchArray & [string, string, string?];\n } else {\n // Form 3 – everything after the first ':' is the pattern.\n name = segment.slice(0, colonIdx);\n pattern = segment.slice(colonIdx + 1);\n // No modifier allowed when an explicit pattern is used.\n }\n\n out += `:${name}`;\n if (pattern) out += `(${pattern})`;\n if (modifier) out += modifier;\n } else {\n // ordinary char, copy (also handles escaped chars)\n out += path[i++];\n }\n }\n\n return out;\n}\n\n\nexport function parsePathConfig(path:string,method:string,path_config:any):IRoute {\n const layout = path_config['x-layout']\n const view = path_config['x-view']\n const summary = path_config.summary\n const query = path_config.query\n const body = path_config.body\n const parameters = path_config.parameters\n const responses = path_config.responses\n\n return {\n summary,\n path: convertBraces(path),\n method,\n layout,\n view,\n responses,\n parameters,\n query,\n body\n }\n}\n"],"names":[],"mappings":";AAOO,SAAS,cAAc,MAAsB;AAClD,MAAI,MAAM;AACV,MAAI,IAAI;AAED,SAAA,IAAI,KAAK,QAAQ;AAClB,QAAA,KAAK,CAAC,MAAM,KAAK;AAEnB,UAAI,QAAQ;AACZ;AAEA,UAAI,QAAQ;AACZ,aAAO,IAAI,KAAK,UAAU,QAAQ,GAAG;AAC/B,YAAA,KAAK,CAAC,MAAM,MAAM;AAEf,eAAA;AAAA,QAAA,OACA;AACD,cAAA,KAAK,CAAC,MAAM,IAAK;AAAA,mBACZ,KAAK,CAAC,MAAM,IAAK;AAC1B;AAAA,QAAA;AAAA,MACF;AAEF,UAAI,UAAU,GAAG;AACf,cAAM,IAAI,MAAM,0BAA0B,IAAI,EAAE;AAAA,MAAA;AAElD,YAAM,UAAU,KAAK,MAAM,QAAQ,GAAG,IAAI,CAAC;AAarC,YAAA,WAAW,QAAQ,QAAQ,GAAG;AAChC,UAAA;AACA,UAAA;AACA,UAAA;AAEJ,UAAI,aAAa,IAAI;AAEb,cAAA,IAAI,QAAQ,MAAM,qBAAqB;AAC7C,YAAI,CAAC,GAAG;AACN,gBAAM,IAAI,MAAM,+BAA+B,OAAO,GAAG;AAAA,QAAA;AAE1D,WAAE,MAAM,QAAQ,IAAI;AAAA,MAAA,OAChB;AAEK,eAAA,QAAQ,MAAM,GAAG,QAAQ;AACzB,kBAAA,QAAQ,MAAM,WAAW,CAAC;AAAA,MAAA;AAItC,aAAO,IAAI,IAAI;AACX,UAAA,QAAiB,QAAA,IAAI,OAAO;AAChC,UAAI,SAAiB,QAAA;AAAA,IAAA,OAChB;AAEL,aAAO,KAAK,GAAG;AAAA,IAAA;AAAA,EACjB;AAGK,SAAA;AACT;AAGgB,SAAA,gBAAgB,MAAY,QAAc,aAAwB;AACxE,QAAA,SAAS,YAAY,UAAU;AAC/B,QAAA,OAAO,YAAY,QAAQ;AACjC,QAAM,UAAU,YAAY;AAC5B,QAAM,QAAQ,YAAY;AAC1B,QAAM,OAAO,YAAY;AACzB,QAAM,aAAa,YAAY;AAC/B,QAAM,YAAY,YAAY;AAEvB,SAAA;AAAA,IACH;AAAA,IACA,MAAM,cAAc,IAAI;AAAA,IACxB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACJ;AACJ;;;"}
@@ -1,69 +0,0 @@
1
- function convertBraces(path) {
2
- let out = "";
3
- let i = 0;
4
- while (i < path.length) {
5
- if (path[i] === "{") {
6
- let start = i;
7
- i++;
8
- let depth = 1;
9
- while (i < path.length && depth > 0) {
10
- if (path[i] === "\\") {
11
- i += 2;
12
- } else {
13
- if (path[i] === "{") depth++;
14
- else if (path[i] === "}") depth--;
15
- i++;
16
- }
17
- }
18
- if (depth !== 0) {
19
- throw new Error(`Unmatched '{' in path: ${path}`);
20
- }
21
- const segment = path.slice(start + 1, i - 1);
22
- const colonIdx = segment.indexOf(":");
23
- let name;
24
- let pattern;
25
- let modifier;
26
- if (colonIdx === -1) {
27
- const m = segment.match(/^([^?*+]+)([?*+])?$/);
28
- if (!m) {
29
- throw new Error(`Invalid parameter segment: {${segment}}`);
30
- }
31
- [, name, modifier] = m;
32
- } else {
33
- name = segment.slice(0, colonIdx);
34
- pattern = segment.slice(colonIdx + 1);
35
- }
36
- out += `:${name}`;
37
- if (pattern) out += `(${pattern})`;
38
- if (modifier) out += modifier;
39
- } else {
40
- out += path[i++];
41
- }
42
- }
43
- return out;
44
- }
45
- function parsePathConfig(path, method, path_config) {
46
- const layout = path_config["x-layout"];
47
- const view = path_config["x-view"];
48
- const summary = path_config.summary;
49
- const query = path_config.query;
50
- const body = path_config.body;
51
- const parameters = path_config.parameters;
52
- const responses = path_config.responses;
53
- return {
54
- summary,
55
- path: convertBraces(path),
56
- method,
57
- layout,
58
- view,
59
- responses,
60
- parameters,
61
- query,
62
- body
63
- };
64
- }
65
- export {
66
- convertBraces as c,
67
- parsePathConfig as p
68
- };
69
- //# sourceMappingURL=path-ODk1FhWY.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"path-ODk1FhWY.js","sources":["../src/parser/path.ts"],"sourcesContent":["import type {IRoute} from \"./IRoute\"\n\n/**\n * Convert OpenAPI‐style `{name[:pattern][modifier]}` into\n * path-to-regexp’s `:name(pattern)?*+` syntax, while\n * allowing literal `{` or `}` inside the regex.\n */\nexport function convertBraces(path: string): string {\n let out = '';\n let i = 0;\n\n while (i < path.length) {\n if (path[i] === '{') {\n // start of a parameter spec\n let start = i;\n i++;\n // find the matching closing '}' that balances this one\n let depth = 1;\n while (i < path.length && depth > 0) {\n if (path[i] === '\\\\') {\n // skip escaped chars\n i += 2;\n } else {\n if (path[i] === '{') depth++;\n else if (path[i] === '}') depth--;\n i++;\n }\n }\n if (depth !== 0) {\n throw new Error(`Unmatched '{' in path: ${path}`);\n }\n const segment = path.slice(start + 1, i - 1);\n // A segment is one of the following forms:\n // 1. \"name\" – simple param, no pattern, no modifier\n // 2. \"name+\" / \"name*\" / \"name?\" – param with modifier only\n // 3. \"name:regex\" – explicit pattern (may itself contain +, *, ?)\n // In the third case we must **not** interpret a trailing +, * or ? as a\n // modifier because it belongs to the user-supplied regex. The original\n // implementation used a single regexp with an optional modifier group,\n // which incorrectly split patterns such as `.*` or `.+` into two parts\n // (`.` as the pattern and `*` or `+` as the modifier). Instead we now\n // split on the first ':'; if a pattern is present we treat the rest of\n // the segment verbatim.\n\n const colonIdx = segment.indexOf(':');\n let name: string;\n let pattern: string | undefined;\n let modifier: string | undefined;\n\n if (colonIdx === -1) {\n // Forms 1 & 2 – no explicit pattern, so a trailing modifier is allowed.\n const m = segment.match(/^([^?*+]+)([?*+])?$/);\n if (!m) {\n throw new Error(`Invalid parameter segment: {${segment}}`);\n }\n [, name, modifier] = m as RegExpMatchArray & [string, string, string?];\n } else {\n // Form 3 – everything after the first ':' is the pattern.\n name = segment.slice(0, colonIdx);\n pattern = segment.slice(colonIdx + 1);\n // No modifier allowed when an explicit pattern is used.\n }\n\n out += `:${name}`;\n if (pattern) out += `(${pattern})`;\n if (modifier) out += modifier;\n } else {\n // ordinary char, copy (also handles escaped chars)\n out += path[i++];\n }\n }\n\n return out;\n}\n\n\nexport function parsePathConfig(path:string,method:string,path_config:any):IRoute {\n const layout = path_config['x-layout']\n const view = path_config['x-view']\n const summary = path_config.summary\n const query = path_config.query\n const body = path_config.body\n const parameters = path_config.parameters\n const responses = path_config.responses\n\n return {\n summary,\n path: convertBraces(path),\n method,\n layout,\n view,\n responses,\n parameters,\n query,\n body\n }\n}\n"],"names":[],"mappings":"AAOO,SAAS,cAAc,MAAsB;AAClD,MAAI,MAAM;AACV,MAAI,IAAI;AAED,SAAA,IAAI,KAAK,QAAQ;AAClB,QAAA,KAAK,CAAC,MAAM,KAAK;AAEnB,UAAI,QAAQ;AACZ;AAEA,UAAI,QAAQ;AACZ,aAAO,IAAI,KAAK,UAAU,QAAQ,GAAG;AAC/B,YAAA,KAAK,CAAC,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