diff --git a/dist-back/testes/TipagemRotas.test.js b/dist-back/testes/TipagemRotas.test.js new file mode 100644 index 0000000..49b4bbb --- /dev/null +++ b/dist-back/testes/TipagemRotas.test.js @@ -0,0 +1,22 @@ +"use strict"; +var import_vitest = require("vitest"); +var import_tipagemRotas = require("../tipagemRotas"); +(0, import_vitest.describe)("TipagemRotas", () => { + (0, import_vitest.it)("deve montar _partesCaminho a partir de string ou array, normalizando barras", () => { + const r1 = new import_tipagemRotas.TipagemRotas({ caminho: "aplicacao/func" }); + (0, import_vitest.expect)(r1.caminho).toBe("/aplicacao/func"); + const r2 = new import_tipagemRotas.TipagemRotas({ + caminho: ["aplicacao", "func"] + }); + (0, import_vitest.expect)(r2.caminho).toBe("/aplicacao/func"); + const r3 = new import_tipagemRotas.TipagemRotas({ caminho: "/a//b///c/" }); + (0, import_vitest.expect)(r3.caminho).toBe("/a/b/c"); + }); + (0, import_vitest.it)("Valores de entrada com mesmo valor dos valores de sa\xEDda", () => { + const r1 = new import_tipagemRotas.TipagemRotas({ caminho: "aplicacao/func" }); + const objetoEntrada = { idade: 21, nome: "Jo\xE3o" }; + const rota = r1.endereco(objetoEntrada); + const parametros = r1.parametros(rota); + (0, import_vitest.expect)(parametros.nome).toBe(objetoEntrada.nome); + }); +}); diff --git a/dist-back/tipagemRotas.js b/dist-back/tipagemRotas.js index 86c60f5..b9a2cf5 100644 --- a/dist-back/tipagemRotas.js +++ b/dist-back/tipagemRotas.js @@ -89,8 +89,8 @@ class TipagemRotas { ** console.log(mCaminho.parametros()) ** {q:"query"} */ - get parametros() { - const url = new URL( + parametros(urlEntrada) { + const url = urlEntrada ? new URL(urlEntrada) : new URL( typeof window !== "undefined" ? window.location.href : "http://localhost" ); const query = url.searchParams; diff --git a/dist-front/index.d.mts b/dist-front/index.d.mts index 226dbda..e41126e 100644 --- a/dist-front/index.d.mts +++ b/dist-front/index.d.mts @@ -198,7 +198,7 @@ declare class TipagemRotas; + parametros(urlEntrada?: string): Partial; } /** diff --git a/dist-front/index.mjs b/dist-front/index.mjs index 6ac7c3d..4b4efcb 100644 --- a/dist-front/index.mjs +++ b/dist-front/index.mjs @@ -1 +1 @@ -var f="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),X=e=>`eli-${Array.from({length:e||8}).map(()=>f[(999*Math.random()|0)%f.length]).join("")}`;var c={};globalThis.cacheMemoria_cache=c;var x=(e,o,t)=>{let i=typeof e=="string"?e:typeof e=="number"?String(e):encodeURIComponent(JSON.stringify(e)),n=t&&new Date().getTime()+t*1e3;o!==void 0&&(c[i]={valor:o,validade:n});let r=c[i];if(!(r?.validade&&r.validadec,oe=x,te=e=>o=>x(e,o);var re="00000000-0000-0000-0000-000000000000",k=(a=>(a.codigo="codigo",a.excluido="excluido",a.data_hora_criacao="data_hora_criacao",a.data_hora_atualizacao="data_hora_atualizacao",a.codigo_usuario_criacao="codigo_usuario_criacao",a.codigo_usuario_atualizacao="codigo_usuario_atualizacao",a.versao="versao",a))(k||{}),T=(o=>(o.token="token",o))(T||{}),S=(t=>(t.Usuario="usuario",t.Fornecedor="fornecedor",t))(S||{});var z=(t=>(t["="]="=",t["!="]="!=",t[">"]=">",t[">="]=">=",t["<"]="<",t["<="]="<=",t.like="like",t.in="in",t))(z||{});import m from"dayjs";import"dayjs/locale/pt-br";import N from"dayjs/plugin/duration";import $ from"dayjs/plugin/isSameOrAfter";import M from"dayjs/plugin/isSameOrBefore";import P from"dayjs/plugin/minMax";import E from"dayjs/plugin/relativeTime";import U from"dayjs/plugin/timezone";import A from"dayjs/plugin/utc";import I from"dayjs/plugin/weekOfYear";m.extend(A);m.extend(U);m.extend(I);m.extend(M);m.extend($);m.extend(P);m.extend(E);m.extend(N);m.locale("pt-br");var be="https://carro-de-boi-idz-one.b-cdn.net";var q=[{ext:"gif",tipo:"imagem",mime:"image/gif"},{ext:"jpg",tipo:"imagem",mime:"image/jpeg"},{ext:"jpeg",tipo:"imagem",mime:"image/jpeg"},{ext:"png",tipo:"imagem",mime:"image/png"},{ext:"bmp",tipo:"imagem",mime:"image/bmp"},{ext:"webp",tipo:"imagem",mime:"image/webp"},{ext:"tiff",tipo:"imagem",mime:"image/tiff"},{ext:"svg",tipo:"imagem",mime:"image/svg+xml"},{ext:"ico",tipo:"imagem",mime:"image/x-icon"},{ext:"pdf",tipo:"documento",mime:"application/pdf"},{ext:"doc",tipo:"documento",mime:"application/msword"},{ext:"docx",tipo:"documento",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:"xls",tipo:"documento",mime:"application/vnd.ms-excel"},{ext:"xlsx",tipo:"documento",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:"ppt",tipo:"documento",mime:"application/vnd.ms-powerpoint"},{ext:"pptx",tipo:"documento",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:"txt",tipo:"documento",mime:"text/plain"},{ext:"odt",tipo:"documento",mime:"application/vnd.oasis.opendocument.text"},{ext:"ods",tipo:"documento",mime:"application/vnd.oasis.opendocument.spreadsheet"},{ext:"rtf",tipo:"documento",mime:"application/rtf"},{ext:"csv",tipo:"documento",mime:"text/csv"},{ext:"mp4",tipo:"v\xEDdeo",mime:"video/mp4"},{ext:"avi",tipo:"v\xEDdeo",mime:"video/x-msvideo"},{ext:"mkv",tipo:"v\xEDdeo",mime:"video/x-matroska"},{ext:"mov",tipo:"v\xEDdeo",mime:"video/quicktime"},{ext:"wmv",tipo:"v\xEDdeo",mime:"video/x-ms-wmv"},{ext:"flv",tipo:"v\xEDdeo",mime:"video/x-flv"},{ext:"webm",tipo:"v\xEDdeo",mime:"video/webm"},{ext:"3gp",tipo:"v\xEDdeo",mime:"video/3gpp"},{ext:"mpeg",tipo:"v\xEDdeo",mime:"video/mpeg"}],we=e=>{let o=String(e||"").toLocaleLowerCase().split(".").pop();return q.find(i=>i.ext===o)?.tipo||"outros"};import K from"cross-fetch";var Oe=e=>new Promise(o=>setTimeout(()=>o(!0),e)),u=e=>Object.keys(e).join("/");var C="https://log.idz.one",F="/loki/api/v1/push",G=async({objeto:e})=>{let o=await K(`${C}${F}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).catch(t=>t);return o.ok?[e]:[e,`Erro ${o.status}: ${await o?.text?.()}`]},g="",Se=e=>{g=e},ze=({app:e,eProducao:o,parametros:t})=>({inquilino:i,usuario:n,parametros:r})=>async(d,a,y)=>{let{__filename:s,detalhes:p,local:l,parametros:v}=y||{},_=`${o?"":"DEV-"}${e}`;g&&s&&(s=s.replace(g,"")),l&&(p=[`${u({local:l})}="${l}"`,...p||[]]),s&&(p=[`${u({__filename:s})}="${s}"`,...p||[]]);let w=`${Date.now()}000000`,L=p?.length?`${a} | ${p.map(j=>JSON.stringify(j)).join(" | ")}`:a,O={streams:[{stream:{app:_,inquilino:i,usuario:n,level:d,...t||{},...r||{},...v||{}},values:[[w,L]]}]};return await G({objeto:O})};var h=e=>{try{return Object.fromEntries(Object.entries(e).map(([o,t])=>[o,t===void 0||t==null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"?t:JSON.stringify(t,null,2)]))}catch(o){throw new Error(`Erro na fun\xE7\xE3o paraObjetoRegistroPg: ${o.message} ${o.stack}`)}},$e=h,Me=h;var Ee=()=>"Ol\xE1 Mundo! (fun\xE7\xE3o)";var Ae="Ol\xE1 Mundo! (vari\xE1vel)";var Fe=(...e)=>e.map(o=>o==null?"":String(o).normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").toLowerCase()).join(" ");var b=class{constructor({caminho:o,acaoIr:t,rotulo:i}){this._partesCaminho=[];this._acaoIr=t,this._partesCaminho=(Array.isArray(o)?o:[o]).filter(Boolean).map(n=>String(n)).flatMap(n=>n.split("/")).filter(Boolean),this.rotulo=i}get caminho(){return`/${this._partesCaminho.join("/")}`}set caminho(o){this._partesCaminho=o.split("/").filter(t=>t)}endereco(o,t){let i=new URL(typeof window<"u"?window.location.href:"http://localhost");i.pathname=this.caminho,i.search="";let n=Object.entries(o);for(let[r,d]of n)i.searchParams.set(String(r),JSON.stringify(d));return i.hash="",t&&(i.hash=`#${i.search}`,i.search=""),i.href}ir(o){this._acaoIr?this._acaoIr(this.endereco(o)):typeof window<"u"&&(window.location.href=this.endereco(o))}get parametros(){let o=new URL(typeof window<"u"?window.location.href:"http://localhost"),t=o.searchParams,i=Object.fromEntries(t.entries()),n=o.hash;if(n){let r=Object.fromEntries(new URLSearchParams(n.slice(1)).entries());return{...i,...r}}for(let r in i)try{i[r]=JSON.parse(i[r])}catch{}return i}};var J=(r=>(r.UN="UN",r.KG="KG",r.TON="TON",r.g="g",r["M\xB3"]="M\xB3",r.Lt="Lt",r))(J||{}),De=[{sigla_unidade:"KG",nome:"Quilograma",sigla_normalizada:"KG",normalizar:e=>e,tipo:"massa"},{sigla_unidade:"g",nome:"Grama",sigla_normalizada:"KG",normalizar:e=>e/1e3,tipo:"massa"},{sigla_unidade:"TON",nome:"Tonelada",sigla_normalizada:"KG",normalizar:e=>e*1e3,tipo:"massa"},{sigla_unidade:"Lt",nome:"Litro",sigla_normalizada:"Lt",normalizar:e=>e,tipo:"volume"},{sigla_unidade:"M\xB3",nome:"Metro C\xFAbico",sigla_normalizada:"Lt",normalizar:e=>e*1e3,tipo:"volume"},{sigla_unidade:"UN",nome:"Unidade",sigla_normalizada:"UN",normalizar:e=>e,tipo:"unidade"}];import{NIL as D,v3 as V,v4 as B}from"uuid";var R=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Re=e=>R.test(String(e||"")),Q=(e,o)=>V(typeof e=="string"?e:typeof e=="number"?String(e):JSON.stringify(e),o?Q(o):D),Y=B,Qe=Y;export{b as TipagemRotas,X as aleatorio,x as cacheM,te as cacheMFixo,oe as cacheMemoria,k as camposComuns,be as cdn_carro_de_boi,m as dayjsbr,Se as defineCwd,R as erUuid,Oe as esperar,q as extensoes,ze as logger,u as nomeVariavel,Me as objetoPg,z as operadores,h as paraObjetoRegistroPg,$e as pgObjeto,G as postLogger,J as siglas_unidades_medida,Fe as texto_busca,we as tipoArquivo,S as tipoUsuarioResiduos,T as tx,Ee as umaFuncao,Ae as umaVariavel,De as unidades_medida,Qe as uuid,Q as uuidV3,Y as uuidV4,re as uuid_null,Re as validarUuid,ee as verCacheM}; +var f="ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(""),X=e=>`eli-${Array.from({length:e||8}).map(()=>f[(999*Math.random()|0)%f.length]).join("")}`;var d={};globalThis.cacheMemoria_cache=d;var x=(e,o,t)=>{let i=typeof e=="string"?e:typeof e=="number"?String(e):encodeURIComponent(JSON.stringify(e)),n=t&&new Date().getTime()+t*1e3;o!==void 0&&(d[i]={valor:o,validade:n});let r=d[i];if(!(r?.validade&&r.validaded,oe=x,te=e=>o=>x(e,o);var re="00000000-0000-0000-0000-000000000000",k=(a=>(a.codigo="codigo",a.excluido="excluido",a.data_hora_criacao="data_hora_criacao",a.data_hora_atualizacao="data_hora_atualizacao",a.codigo_usuario_criacao="codigo_usuario_criacao",a.codigo_usuario_atualizacao="codigo_usuario_atualizacao",a.versao="versao",a))(k||{}),T=(o=>(o.token="token",o))(T||{}),S=(t=>(t.Usuario="usuario",t.Fornecedor="fornecedor",t))(S||{});var z=(t=>(t["="]="=",t["!="]="!=",t[">"]=">",t[">="]=">=",t["<"]="<",t["<="]="<=",t.like="like",t.in="in",t))(z||{});import m from"dayjs";import"dayjs/locale/pt-br";import N from"dayjs/plugin/duration";import $ from"dayjs/plugin/isSameOrAfter";import M from"dayjs/plugin/isSameOrBefore";import P from"dayjs/plugin/minMax";import U from"dayjs/plugin/relativeTime";import A from"dayjs/plugin/timezone";import E from"dayjs/plugin/utc";import I from"dayjs/plugin/weekOfYear";m.extend(E);m.extend(A);m.extend(I);m.extend(M);m.extend($);m.extend(P);m.extend(U);m.extend(N);m.locale("pt-br");var be="https://carro-de-boi-idz-one.b-cdn.net";var q=[{ext:"gif",tipo:"imagem",mime:"image/gif"},{ext:"jpg",tipo:"imagem",mime:"image/jpeg"},{ext:"jpeg",tipo:"imagem",mime:"image/jpeg"},{ext:"png",tipo:"imagem",mime:"image/png"},{ext:"bmp",tipo:"imagem",mime:"image/bmp"},{ext:"webp",tipo:"imagem",mime:"image/webp"},{ext:"tiff",tipo:"imagem",mime:"image/tiff"},{ext:"svg",tipo:"imagem",mime:"image/svg+xml"},{ext:"ico",tipo:"imagem",mime:"image/x-icon"},{ext:"pdf",tipo:"documento",mime:"application/pdf"},{ext:"doc",tipo:"documento",mime:"application/msword"},{ext:"docx",tipo:"documento",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:"xls",tipo:"documento",mime:"application/vnd.ms-excel"},{ext:"xlsx",tipo:"documento",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:"ppt",tipo:"documento",mime:"application/vnd.ms-powerpoint"},{ext:"pptx",tipo:"documento",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:"txt",tipo:"documento",mime:"text/plain"},{ext:"odt",tipo:"documento",mime:"application/vnd.oasis.opendocument.text"},{ext:"ods",tipo:"documento",mime:"application/vnd.oasis.opendocument.spreadsheet"},{ext:"rtf",tipo:"documento",mime:"application/rtf"},{ext:"csv",tipo:"documento",mime:"text/csv"},{ext:"mp4",tipo:"v\xEDdeo",mime:"video/mp4"},{ext:"avi",tipo:"v\xEDdeo",mime:"video/x-msvideo"},{ext:"mkv",tipo:"v\xEDdeo",mime:"video/x-matroska"},{ext:"mov",tipo:"v\xEDdeo",mime:"video/quicktime"},{ext:"wmv",tipo:"v\xEDdeo",mime:"video/x-ms-wmv"},{ext:"flv",tipo:"v\xEDdeo",mime:"video/x-flv"},{ext:"webm",tipo:"v\xEDdeo",mime:"video/webm"},{ext:"3gp",tipo:"v\xEDdeo",mime:"video/3gpp"},{ext:"mpeg",tipo:"v\xEDdeo",mime:"video/mpeg"}],we=e=>{let o=String(e||"").toLocaleLowerCase().split(".").pop();return q.find(i=>i.ext===o)?.tipo||"outros"};import K from"cross-fetch";var Oe=e=>new Promise(o=>setTimeout(()=>o(!0),e)),u=e=>Object.keys(e).join("/");var C="https://log.idz.one",F="/loki/api/v1/push",G=async({objeto:e})=>{let o=await K(`${C}${F}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}).catch(t=>t);return o.ok?[e]:[e,`Erro ${o.status}: ${await o?.text?.()}`]},g="",Se=e=>{g=e},ze=({app:e,eProducao:o,parametros:t})=>({inquilino:i,usuario:n,parametros:r})=>async(s,a,y)=>{let{__filename:p,detalhes:c,local:l,parametros:v}=y||{},_=`${o?"":"DEV-"}${e}`;g&&p&&(p=p.replace(g,"")),l&&(c=[`${u({local:l})}="${l}"`,...c||[]]),p&&(c=[`${u({__filename:p})}="${p}"`,...c||[]]);let w=`${Date.now()}000000`,L=c?.length?`${a} | ${c.map(j=>JSON.stringify(j)).join(" | ")}`:a,O={streams:[{stream:{app:_,inquilino:i,usuario:n,level:s,...t||{},...r||{},...v||{}},values:[[w,L]]}]};return await G({objeto:O})};var h=e=>{try{return Object.fromEntries(Object.entries(e).map(([o,t])=>[o,t===void 0||t==null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"?t:JSON.stringify(t,null,2)]))}catch(o){throw new Error(`Erro na fun\xE7\xE3o paraObjetoRegistroPg: ${o.message} ${o.stack}`)}},$e=h,Me=h;var Ue=()=>"Ol\xE1 Mundo! (fun\xE7\xE3o)";var Ee="Ol\xE1 Mundo! (vari\xE1vel)";var Fe=(...e)=>e.map(o=>o==null?"":String(o).normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/\s+/g," ").toLowerCase()).join(" ");var b=class{constructor({caminho:o,acaoIr:t,rotulo:i}){this._partesCaminho=[];this._acaoIr=t,this._partesCaminho=(Array.isArray(o)?o:[o]).filter(Boolean).map(n=>String(n)).flatMap(n=>n.split("/")).filter(Boolean),this.rotulo=i}get caminho(){return`/${this._partesCaminho.join("/")}`}set caminho(o){this._partesCaminho=o.split("/").filter(t=>t)}endereco(o,t){let i=new URL(typeof window<"u"?window.location.href:"http://localhost");i.pathname=this.caminho,i.search="";let n=Object.entries(o);for(let[r,s]of n)i.searchParams.set(String(r),JSON.stringify(s));return i.hash="",t&&(i.hash=`#${i.search}`,i.search=""),i.href}ir(o){this._acaoIr?this._acaoIr(this.endereco(o)):typeof window<"u"&&(window.location.href=this.endereco(o))}parametros(o){let t=o?new URL(o):new URL(typeof window<"u"?window.location.href:"http://localhost"),i=t.searchParams,n=Object.fromEntries(i.entries()),r=t.hash;if(r){let s=Object.fromEntries(new URLSearchParams(r.slice(1)).entries());return{...n,...s}}for(let s in n)try{n[s]=JSON.parse(n[s])}catch{}return n}};var J=(r=>(r.UN="UN",r.KG="KG",r.TON="TON",r.g="g",r["M\xB3"]="M\xB3",r.Lt="Lt",r))(J||{}),De=[{sigla_unidade:"KG",nome:"Quilograma",sigla_normalizada:"KG",normalizar:e=>e,tipo:"massa"},{sigla_unidade:"g",nome:"Grama",sigla_normalizada:"KG",normalizar:e=>e/1e3,tipo:"massa"},{sigla_unidade:"TON",nome:"Tonelada",sigla_normalizada:"KG",normalizar:e=>e*1e3,tipo:"massa"},{sigla_unidade:"Lt",nome:"Litro",sigla_normalizada:"Lt",normalizar:e=>e,tipo:"volume"},{sigla_unidade:"M\xB3",nome:"Metro C\xFAbico",sigla_normalizada:"Lt",normalizar:e=>e*1e3,tipo:"volume"},{sigla_unidade:"UN",nome:"Unidade",sigla_normalizada:"UN",normalizar:e=>e,tipo:"unidade"}];import{NIL as D,v3 as V,v4 as R}from"uuid";var B=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Be=e=>B.test(String(e||"")),Q=(e,o)=>V(typeof e=="string"?e:typeof e=="number"?String(e):JSON.stringify(e),o?Q(o):D),Y=R,Qe=Y;export{b as TipagemRotas,X as aleatorio,x as cacheM,te as cacheMFixo,oe as cacheMemoria,k as camposComuns,be as cdn_carro_de_boi,m as dayjsbr,Se as defineCwd,B as erUuid,Oe as esperar,q as extensoes,ze as logger,u as nomeVariavel,Me as objetoPg,z as operadores,h as paraObjetoRegistroPg,$e as pgObjeto,G as postLogger,J as siglas_unidades_medida,Fe as texto_busca,we as tipoArquivo,S as tipoUsuarioResiduos,T as tx,Ue as umaFuncao,Ee as umaVariavel,De as unidades_medida,Qe as uuid,Q as uuidV3,Y as uuidV4,re as uuid_null,Be as validarUuid,ee as verCacheM}; diff --git a/package.json b/package.json index 60eb65e..dbe7e3c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "p-comuns", - "version": "0.225.0", + "version": "0.228.0", "description": "", "main": "./dist-back/index.js", "module": "./dist-front/index.mjs", @@ -15,7 +15,8 @@ "scripts": { "biome": "pnpm exec biome check --write", "check": "pnpm run biome && npx tsc --noEmit", - "build": "npm --no-git-tag-version version minor && pnpm run biome && tsup --config ./tsup/tsup.config.ts" + "build": "npm --no-git-tag-version version minor && pnpm run biome && tsup --config ./tsup/tsup.config.ts", + "teste": "npx vitest run src/testes/TipagemRotas.test.ts" }, "author": { "name": "AZTECA SOFTWARE LTDA", @@ -33,6 +34,7 @@ "@biomejs/biome": "2.1.4", "@types/node": "^20.19.11", "tsup": "8.5.0", - "typescript": "~5.9.2" + "typescript": "~5.9.2", + "vitest": "^3.2.4" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 561f0b3..1ab951a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,10 +29,13 @@ importers: version: 20.19.11 tsup: specifier: 8.5.0 - version: 8.5.0(typescript@5.9.2) + version: 8.5.0(postcss@8.5.6)(typescript@5.9.2) typescript: specifier: ~5.9.2 version: 5.9.2 + vitest: + specifier: ^3.2.4 + version: 3.2.4(@types/node@20.19.11) packages: @@ -366,12 +369,47 @@ packages: cpu: [x64] os: [win32] + '@types/chai@5.2.2': + resolution: {integrity: sha512-8kB30R7Hwqf40JPiKhVzodJs2Qc1ZJ5zuT3uzw5Hq/dhNCl3G3l83jfpdI1e20BP348+fV7VIL/+FxaXkqBmWg==} + + '@types/deep-eql@4.0.2': + resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + '@types/estree@1.0.8': resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} '@types/node@20.19.11': resolution: {integrity: sha512-uug3FEEGv0r+jrecvUUpbY8lLisvIjg6AAic6a2bSP5OEOLeJsDSnvhCDov7ipFFMXS3orMpzlmi0ZcuGkBbow==} + '@vitest/expect@3.2.4': + resolution: {integrity: sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==} + + '@vitest/mocker@3.2.4': + resolution: {integrity: sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ==} + peerDependencies: + msw: ^2.4.9 + vite: ^5.0.0 || ^6.0.0 || ^7.0.0-0 + peerDependenciesMeta: + msw: + optional: true + vite: + optional: true + + '@vitest/pretty-format@3.2.4': + resolution: {integrity: sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==} + + '@vitest/runner@3.2.4': + resolution: {integrity: sha512-oukfKT9Mk41LreEW09vt45f8wx7DordoWUZMYdY/cyAk7w5TWkTRCNZYF7sX7n2wB7jyGAl74OxgwhPgKaqDMQ==} + + '@vitest/snapshot@3.2.4': + resolution: {integrity: sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ==} + + '@vitest/spy@3.2.4': + resolution: {integrity: sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==} + + '@vitest/utils@3.2.4': + resolution: {integrity: sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==} + acorn@8.15.0: resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==} engines: {node: '>=0.4.0'} @@ -396,6 +434,10 @@ packages: any-promise@1.3.0: resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} + assertion-error@2.0.1: + resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} + engines: {node: '>=12'} + balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} @@ -412,6 +454,14 @@ packages: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} + chai@5.3.3: + resolution: {integrity: sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==} + engines: {node: '>=18'} + + check-error@2.1.1: + resolution: {integrity: sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==} + engines: {node: '>= 16'} + chokidar@4.0.3: resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==} engines: {node: '>= 14.16.0'} @@ -453,6 +503,10 @@ packages: supports-color: optional: true + deep-eql@5.0.2: + resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} + engines: {node: '>=6'} + eastasianwidth@0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} @@ -462,11 +516,21 @@ packages: emoji-regex@9.2.2: resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} + es-module-lexer@1.7.0: + resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==} + esbuild@0.25.9: resolution: {integrity: sha512-CRbODhYyQx3qp7ZEwzxOk4JBqmD/seJrzPa/cGjY1VtIn5E09Oi9/dB4JwctnfZ8Q8iT7rioVv5k/FNT/uf54g==} engines: {node: '>=18'} hasBin: true + estree-walker@3.0.3: + resolution: {integrity: sha512-7RUKfXgSMMkzt6ZuXmqapOurLGPPfgj6l9uRZ7lRGolvk0y2yocc35LdcxKC5PQZdn2DMqioAQ2NoWcrTKmm6g==} + + expect-type@1.2.2: + resolution: {integrity: sha512-JhFGDVJ7tmDJItKhYgJCGLOWjuK9vPxiXoUFLwLDc99NlmklilbiQJwoctZtt13+xMw91MCk/REan6MWHqDjyA==} + engines: {node: '>=12.0.0'} + fdir@6.5.0: resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} engines: {node: '>=12.0.0'} @@ -506,6 +570,9 @@ packages: resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} engines: {node: '>=10'} + js-tokens@9.0.1: + resolution: {integrity: sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==} + lilconfig@3.1.3: resolution: {integrity: sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==} engines: {node: '>=14'} @@ -520,6 +587,9 @@ packages: lodash.sortby@4.7.0: resolution: {integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==} + loupe@3.2.1: + resolution: {integrity: sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==} + lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} @@ -543,6 +613,11 @@ packages: mz@2.7.0: resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} + nanoid@3.3.11: + resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + node-fetch@2.7.0: resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} engines: {node: 4.x || >=6.0.0} @@ -570,6 +645,10 @@ packages: pathe@2.0.3: resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} + pathval@2.0.1: + resolution: {integrity: sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==} + engines: {node: '>= 14.16'} + picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} @@ -602,6 +681,10 @@ packages: yaml: optional: true + postcss@8.5.6: + resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==} + engines: {node: ^10 || ^12 || >=14} + punycode@2.3.1: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} @@ -627,15 +710,28 @@ packages: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} + siginfo@2.0.0: + resolution: {integrity: sha512-ybx0WO1/8bSBLEWXZvEd7gMW3Sn3JFlW3TvX1nREbDLRNQNaeNN8WK0meBwPdAaOI7TtRRRJn/Es1zhrrCHu7g==} + signal-exit@4.1.0: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} + source-map-js@1.2.1: + resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} + engines: {node: '>=0.10.0'} + source-map@0.8.0-beta.0: resolution: {integrity: sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==} engines: {node: '>= 8'} deprecated: The work that was done in this beta branch won't be included in future versions + stackback@0.0.2: + resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} + + std-env@3.9.0: + resolution: {integrity: sha512-UGvjygr6F6tpH7o2qyqR6QYpwraIjKSdtzyBdyytFOHmPZY917kwdwLG0RbOjWOnKmnm3PeHjaoLLMie7kPLQw==} + string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} @@ -652,6 +748,9 @@ packages: resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} engines: {node: '>=12'} + strip-literal@3.0.0: + resolution: {integrity: sha512-TcccoMhJOM3OebGhSBEmp3UZ2SfDMZUEBdRA/9ynfLi8yYajyWX3JiXArcJt4Umh4vISpspkQIY8ZZoCqjbviA==} + sucrase@3.35.0: resolution: {integrity: sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==} engines: {node: '>=16 || 14 >=14.17'} @@ -664,6 +763,9 @@ packages: thenify@3.3.1: resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} + tinybench@2.9.0: + resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} + tinyexec@0.3.2: resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} @@ -671,6 +773,22 @@ packages: resolution: {integrity: sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==} engines: {node: '>=12.0.0'} + tinyglobby@0.2.15: + resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==} + engines: {node: '>=12.0.0'} + + tinypool@1.1.1: + resolution: {integrity: sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==} + engines: {node: ^18.0.0 || >=20.0.0} + + tinyrainbow@2.0.0: + resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==} + engines: {node: '>=14.0.0'} + + tinyspy@4.0.3: + resolution: {integrity: sha512-t2T/WLB2WRgZ9EpE4jgPJ9w+i66UZfDc8wHh0xrwiRNN+UwH98GIJkTeZqX9rg0i0ptwzqW+uYeIF0T4F8LR7A==} + engines: {node: '>=14.0.0'} + tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} @@ -718,6 +836,79 @@ packages: resolution: {integrity: sha512-0/A9rDy9P7cJ+8w1c9WD9V//9Wj15Ce2MPz8Ri6032usz+NfePxx5AcN3bN+r6ZL6jEo066/yNYB3tn4pQEx+A==} hasBin: true + vite-node@3.2.4: + resolution: {integrity: sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + hasBin: true + + vite@7.1.5: + resolution: {integrity: sha512-4cKBO9wR75r0BeIWWWId9XK9Lj6La5X846Zw9dFfzMRw38IlTk2iCcUt6hsyiDRcPidc55ZParFYDXi0nXOeLQ==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + peerDependencies: + '@types/node': ^20.19.0 || >=22.12.0 + jiti: '>=1.21.0' + less: ^4.0.0 + lightningcss: ^1.21.0 + sass: ^1.70.0 + sass-embedded: ^1.70.0 + stylus: '>=0.54.8' + sugarss: ^5.0.0 + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + jiti: + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + + vitest@3.2.4: + resolution: {integrity: sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@types/debug': ^4.1.12 + '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 + '@vitest/browser': 3.2.4 + '@vitest/ui': 3.2.4 + happy-dom: '*' + jsdom: '*' + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@types/debug': + optional: true + '@types/node': + optional: true + '@vitest/browser': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + webidl-conversions@3.0.1: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} @@ -735,6 +926,11 @@ packages: engines: {node: '>= 8'} hasBin: true + why-is-node-running@2.3.0: + resolution: {integrity: sha512-hUrmaWBdVDcxvYqnyh09zunKzROWjbZTiNy8dBEjkS7ehEDQibXJ7XvlmtbwuTclUiIyN+CyXQD4Vmko8fNm8w==} + engines: {node: '>=8'} + hasBin: true + wrap-ansi@7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} @@ -947,12 +1143,60 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.49.0': optional: true + '@types/chai@5.2.2': + dependencies: + '@types/deep-eql': 4.0.2 + + '@types/deep-eql@4.0.2': {} + '@types/estree@1.0.8': {} '@types/node@20.19.11': dependencies: undici-types: 6.21.0 + '@vitest/expect@3.2.4': + dependencies: + '@types/chai': 5.2.2 + '@vitest/spy': 3.2.4 + '@vitest/utils': 3.2.4 + chai: 5.3.3 + tinyrainbow: 2.0.0 + + '@vitest/mocker@3.2.4(vite@7.1.5(@types/node@20.19.11))': + dependencies: + '@vitest/spy': 3.2.4 + estree-walker: 3.0.3 + magic-string: 0.30.18 + optionalDependencies: + vite: 7.1.5(@types/node@20.19.11) + + '@vitest/pretty-format@3.2.4': + dependencies: + tinyrainbow: 2.0.0 + + '@vitest/runner@3.2.4': + dependencies: + '@vitest/utils': 3.2.4 + pathe: 2.0.3 + strip-literal: 3.0.0 + + '@vitest/snapshot@3.2.4': + dependencies: + '@vitest/pretty-format': 3.2.4 + magic-string: 0.30.18 + pathe: 2.0.3 + + '@vitest/spy@3.2.4': + dependencies: + tinyspy: 4.0.3 + + '@vitest/utils@3.2.4': + dependencies: + '@vitest/pretty-format': 3.2.4 + loupe: 3.2.1 + tinyrainbow: 2.0.0 + acorn@8.15.0: {} ansi-regex@5.0.1: {} @@ -967,6 +1211,8 @@ snapshots: any-promise@1.3.0: {} + assertion-error@2.0.1: {} + balanced-match@1.0.2: {} brace-expansion@2.0.2: @@ -980,6 +1226,16 @@ snapshots: cac@6.7.14: {} + chai@5.3.3: + dependencies: + assertion-error: 2.0.1 + check-error: 2.1.1 + deep-eql: 5.0.2 + loupe: 3.2.1 + pathval: 2.0.1 + + check-error@2.1.1: {} + chokidar@4.0.3: dependencies: readdirp: 4.1.2 @@ -1014,12 +1270,16 @@ snapshots: dependencies: ms: 2.1.3 + deep-eql@5.0.2: {} + eastasianwidth@0.2.0: {} emoji-regex@8.0.0: {} emoji-regex@9.2.2: {} + es-module-lexer@1.7.0: {} + esbuild@0.25.9: optionalDependencies: '@esbuild/aix-ppc64': 0.25.9 @@ -1049,6 +1309,12 @@ snapshots: '@esbuild/win32-ia32': 0.25.9 '@esbuild/win32-x64': 0.25.9 + estree-walker@3.0.3: + dependencies: + '@types/estree': 1.0.8 + + expect-type@1.2.2: {} + fdir@6.5.0(picomatch@4.0.3): optionalDependencies: picomatch: 4.0.3 @@ -1088,6 +1354,8 @@ snapshots: joycon@3.1.1: {} + js-tokens@9.0.1: {} + lilconfig@3.1.3: {} lines-and-columns@1.2.4: {} @@ -1096,6 +1364,8 @@ snapshots: lodash.sortby@4.7.0: {} + loupe@3.2.1: {} + lru-cache@10.4.3: {} magic-string@0.30.18: @@ -1123,6 +1393,8 @@ snapshots: object-assign: 4.1.1 thenify-all: 1.6.0 + nanoid@3.3.11: {} + node-fetch@2.7.0: dependencies: whatwg-url: 5.0.0 @@ -1140,6 +1412,8 @@ snapshots: pathe@2.0.3: {} + pathval@2.0.1: {} + picocolors@1.1.1: {} picomatch@4.0.3: {} @@ -1152,9 +1426,17 @@ snapshots: mlly: 1.8.0 pathe: 2.0.3 - postcss-load-config@6.0.1: + postcss-load-config@6.0.1(postcss@8.5.6): dependencies: lilconfig: 3.1.3 + optionalDependencies: + postcss: 8.5.6 + + postcss@8.5.6: + dependencies: + nanoid: 3.3.11 + picocolors: 1.1.1 + source-map-js: 1.2.1 punycode@2.3.1: {} @@ -1194,12 +1476,20 @@ snapshots: shebang-regex@3.0.0: {} + siginfo@2.0.0: {} + signal-exit@4.1.0: {} + source-map-js@1.2.1: {} + source-map@0.8.0-beta.0: dependencies: whatwg-url: 7.1.0 + stackback@0.0.2: {} + + std-env@3.9.0: {} + string-width@4.2.3: dependencies: emoji-regex: 8.0.0 @@ -1220,6 +1510,10 @@ snapshots: dependencies: ansi-regex: 6.2.0 + strip-literal@3.0.0: + dependencies: + js-tokens: 9.0.1 + sucrase@3.35.0: dependencies: '@jridgewell/gen-mapping': 0.3.13 @@ -1238,6 +1532,8 @@ snapshots: dependencies: any-promise: 1.3.0 + tinybench@2.9.0: {} + tinyexec@0.3.2: {} tinyglobby@0.2.14: @@ -1245,6 +1541,17 @@ snapshots: fdir: 6.5.0(picomatch@4.0.3) picomatch: 4.0.3 + tinyglobby@0.2.15: + dependencies: + fdir: 6.5.0(picomatch@4.0.3) + picomatch: 4.0.3 + + tinypool@1.1.1: {} + + tinyrainbow@2.0.0: {} + + tinyspy@4.0.3: {} + tr46@0.0.3: {} tr46@1.0.1: @@ -1255,7 +1562,7 @@ snapshots: ts-interface-checker@0.1.13: {} - tsup@8.5.0(typescript@5.9.2): + tsup@8.5.0(postcss@8.5.6)(typescript@5.9.2): dependencies: bundle-require: 5.1.0(esbuild@0.25.9) cac: 6.7.14 @@ -1266,7 +1573,7 @@ snapshots: fix-dts-default-cjs-exports: 1.0.1 joycon: 3.1.1 picocolors: 1.1.1 - postcss-load-config: 6.0.1 + postcss-load-config: 6.0.1(postcss@8.5.6) resolve-from: 5.0.0 rollup: 4.49.0 source-map: 0.8.0-beta.0 @@ -1275,6 +1582,7 @@ snapshots: tinyglobby: 0.2.14 tree-kill: 1.2.2 optionalDependencies: + postcss: 8.5.6 typescript: 5.9.2 transitivePeerDependencies: - jiti @@ -1290,6 +1598,80 @@ snapshots: uuid@11.1.0: {} + vite-node@3.2.4(@types/node@20.19.11): + dependencies: + cac: 6.7.14 + debug: 4.4.1 + es-module-lexer: 1.7.0 + pathe: 2.0.3 + vite: 7.1.5(@types/node@20.19.11) + transitivePeerDependencies: + - '@types/node' + - jiti + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - tsx + - yaml + + vite@7.1.5(@types/node@20.19.11): + dependencies: + esbuild: 0.25.9 + fdir: 6.5.0(picomatch@4.0.3) + picomatch: 4.0.3 + postcss: 8.5.6 + rollup: 4.49.0 + tinyglobby: 0.2.15 + optionalDependencies: + '@types/node': 20.19.11 + fsevents: 2.3.3 + + vitest@3.2.4(@types/node@20.19.11): + dependencies: + '@types/chai': 5.2.2 + '@vitest/expect': 3.2.4 + '@vitest/mocker': 3.2.4(vite@7.1.5(@types/node@20.19.11)) + '@vitest/pretty-format': 3.2.4 + '@vitest/runner': 3.2.4 + '@vitest/snapshot': 3.2.4 + '@vitest/spy': 3.2.4 + '@vitest/utils': 3.2.4 + chai: 5.3.3 + debug: 4.4.1 + expect-type: 1.2.2 + magic-string: 0.30.18 + pathe: 2.0.3 + picomatch: 4.0.3 + std-env: 3.9.0 + tinybench: 2.9.0 + tinyexec: 0.3.2 + tinyglobby: 0.2.14 + tinypool: 1.1.1 + tinyrainbow: 2.0.0 + vite: 7.1.5(@types/node@20.19.11) + vite-node: 3.2.4(@types/node@20.19.11) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 20.19.11 + transitivePeerDependencies: + - jiti + - less + - lightningcss + - msw + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + - tsx + - yaml + webidl-conversions@3.0.1: {} webidl-conversions@4.0.2: {} @@ -1309,6 +1691,11 @@ snapshots: dependencies: isexe: 2.0.0 + why-is-node-running@2.3.0: + dependencies: + siginfo: 2.0.0 + stackback: 0.0.2 + wrap-ansi@7.0.0: dependencies: ansi-styles: 4.3.0 diff --git a/src/testes/TipagemRotas.test.ts b/src/testes/TipagemRotas.test.ts new file mode 100644 index 0000000..a4458d4 --- /dev/null +++ b/src/testes/TipagemRotas.test.ts @@ -0,0 +1,29 @@ +import { describe, expect, it } from "vitest" +import { TipagemRotas } from "../tipagemRotas" + +describe("TipagemRotas", () => { + it("deve montar _partesCaminho a partir de string ou array, normalizando barras", () => { + const r1 = new TipagemRotas<{ q: string }>({ caminho: "aplicacao/func" }) + expect(r1.caminho).toBe("/aplicacao/func") + + const r2 = new TipagemRotas<{ q: string }>({ + caminho: ["aplicacao", "func"], + }) + expect(r2.caminho).toBe("/aplicacao/func") + + const r3 = new TipagemRotas<{ q: string }>({ caminho: "/a//b///c/" }) + expect(r3.caminho).toBe("/a/b/c") + }) + + it("Valores de entrada com mesmo valor dos valores de saída", () => { + type tipagem = { nome: string; idade: number } + const r1 = new TipagemRotas({ caminho: "aplicacao/func" }) + const objetoEntrada: tipagem = { idade: 21, nome: "João" } + + const rota = r1.endereco(objetoEntrada) + + const parametros = r1.parametros(rota) + + expect(parametros.nome).toBe(objetoEntrada.nome) + }) +}) diff --git a/src/tipagemRotas.ts b/src/tipagemRotas.ts index 4810681..24054d4 100644 --- a/src/tipagemRotas.ts +++ b/src/tipagemRotas.ts @@ -106,10 +106,14 @@ export class TipagemRotas { ** {q:"query"} */ - get parametros() { - const url = new URL( - typeof window !== "undefined" ? window.location.href : "http://localhost", - ) + parametros(urlEntrada?: string) { + const url = urlEntrada + ? new URL(urlEntrada) + : new URL( + typeof window !== "undefined" + ? window.location.href + : "http://localhost", + ) const query = url.searchParams const queryObj = Object.fromEntries(query.entries()) @@ -130,4 +134,5 @@ export class TipagemRotas { return queryObj as Partial } + }