diff --git a/Documentos/biome.json b/Documentos/biome.json index d32df32..d656ae5 100755 --- a/Documentos/biome.json +++ b/Documentos/biome.json @@ -98,7 +98,7 @@ "enabled": true, "indentStyle": "space", "indentWidth": 2, - "lineWidth": 80, + "lineWidth": 100, "lineEnding": "lf" }, @@ -133,7 +133,7 @@ "enabled": true, "indentStyle": "space", "indentWidth": 2, - "lineWidth": 80, + "lineWidth": 100, "quoteStyle": "double" }, "linter": { @@ -146,7 +146,7 @@ "enabled": true, "indentStyle": "space", "indentWidth": 2, - "lineWidth": 80 + "lineWidth": 100 } } } diff --git a/dist-back/consulta.js b/dist-back/consulta.js index e3b422c..5f4c424 100644 --- a/dist-back/consulta.js +++ b/dist-back/consulta.js @@ -46,17 +46,7 @@ var operadores = /* @__PURE__ */ ((operadores2) => { operadores2["isNull"] = "isNull"; return operadores2; })(operadores || {}); -const zOperadores = import_zod.default.enum([ - "=", - "!=", - ">", - ">=", - "<", - "<=", - "like", - "in", - "isNull" -]); +const zOperadores = import_zod.default.enum(["=", "!=", ">", ">=", "<", "<=", "like", "in", "isNull"]); const zFiltro = import_zod.default.object({ coluna: import_zod.default.string(), valor: import_zod.default.any(), diff --git a/dist-back/tipagemRotas.js b/dist-back/tipagemRotas.js index ce1d130..e68b6ce 100644 --- a/dist-back/tipagemRotas.js +++ b/dist-back/tipagemRotas.js @@ -97,9 +97,7 @@ class TipagemRotas { let queryObj = Object.fromEntries(query.entries()); const hash = url.hash; if (hash) { - const hashObj = Object.fromEntries( - new URLSearchParams(hash.slice(1)).entries() - ); + const hashObj = Object.fromEntries(new URLSearchParams(hash.slice(1)).entries()); queryObj = { ...queryObj, ...hashObj }; } for (const chave in queryObj) { diff --git a/dist-back/variaveisComuns.js b/dist-back/variaveisComuns.js index 8f40e1d..e90c5ef 100644 --- a/dist-back/variaveisComuns.js +++ b/dist-back/variaveisComuns.js @@ -22,9 +22,7 @@ __export(variaveisComuns_exports, { nomeVariavel: () => nomeVariavel }); module.exports = __toCommonJS(variaveisComuns_exports); -const esperar = (ms) => new Promise( - (resolve) => setTimeout(() => resolve(true), ms) -); +const esperar = (ms) => new Promise((resolve) => setTimeout(() => resolve(true), ms)); const nomeVariavel = (v) => Object.keys(v).join("/"); // Annotate the CommonJS export names for ESM import in node: 0 && (module.exports = { diff --git a/package.json b/package.json index 1b3b77c..ff51c4a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "p-comuns", - "version": "0.334.0", + "version": "0.335.0", "description": "", "main": "./dist-front/index.mjs", "module": "./dist-front/index.mjs", diff --git a/pacote.tgz b/pacote.tgz index 792cfbc..3d79669 100644 Binary files a/pacote.tgz and b/pacote.tgz differ diff --git a/src/cacheMemoria.ts b/src/cacheMemoria.ts index 1d2c372..a82d057 100755 --- a/src/cacheMemoria.ts +++ b/src/cacheMemoria.ts @@ -12,11 +12,7 @@ const _cache: { ;(globalThis as any).cacheMemoria_cache = _cache -export const cacheM = ( - chave: any, - valor?: T, - validadeSeg?: number, -): T | undefined => { +export const cacheM = (chave: any, valor?: T, validadeSeg?: number): T | undefined => { // converte a chave e string const txChave: string = typeof chave == "string" diff --git a/src/consulta.ts b/src/consulta.ts index 5e1d331..5faf5f8 100755 --- a/src/consulta.ts +++ b/src/consulta.ts @@ -30,17 +30,7 @@ export type interfaceConsulta = { apenasContagem?: boolean } -export const zOperadores = z.enum([ - "=", - "!=", - ">", - ">=", - "<", - "<=", - "like", - "in", - "isNull", -]) +export const zOperadores = z.enum(["=", "!=", ">", ">=", "<", "<=", "like", "in", "isNull"]) export const zFiltro = z.object({ coluna: z.string(), diff --git a/src/extensoes.ts b/src/extensoes.ts index b321977..274d4d6 100755 --- a/src/extensoes.ts +++ b/src/extensoes.ts @@ -162,9 +162,7 @@ export const extensoes: { * @param nomeArquivo * @returns */ -export const tipoArquivo = ( - nomeArquivo: string | null | undefined, -): tiposArquivo => { +export const tipoArquivo = (nomeArquivo: string | null | undefined): tiposArquivo => { // extenssão do arquivo const extArquivo = String(nomeArquivo || "") .toLocaleLowerCase() diff --git a/src/local/index.ts b/src/local/index.ts index 210f40e..8863ee0 100755 --- a/src/local/index.ts +++ b/src/local/index.ts @@ -2,18 +2,11 @@ * LocalStorage Tipado * Lê ou grava um valor no localStorage, mantendo o tipo genérico . */ -export const localValor = ( - chave_: string | any, - valor?: T | null, -): T | null => { - const localStorage = - "localStorage" in globalThis ? (globalThis as any).localStorage : undefined +export const localValor = (chave_: string | any, valor?: T | null): T | null => { + const localStorage = "localStorage" in globalThis ? (globalThis as any).localStorage : undefined if (typeof localStorage == "undefined") return null - const chave = - typeof chave_ === "string" - ? chave_ - : encodeURIComponent(JSON.stringify(chave_)) + const chave = typeof chave_ === "string" ? chave_ : encodeURIComponent(JSON.stringify(chave_)) try { // Grava valor se fornecido diff --git a/src/postgres.ts b/src/postgres.ts index e3e1787..40dd85b 100755 --- a/src/postgres.ts +++ b/src/postgres.ts @@ -14,9 +14,7 @@ export const paraObjetoRegistroPg = (entrada: { k, v === undefined || v == null ? v - : typeof v == "string" || - typeof v == "number" || - typeof v == "boolean" + : typeof v == "string" || typeof v == "number" || typeof v == "boolean" ? v : JSON.stringify(v, null, 2), ]), diff --git a/src/tipagemRotas.ts b/src/tipagemRotas.ts index 92ce985..d8d76e9 100755 --- a/src/tipagemRotas.ts +++ b/src/tipagemRotas.ts @@ -63,9 +63,7 @@ export class TipagemRotas { */ endereco(query: T, usarComoHash?: boolean) { - const win = - (typeof globalThis !== "undefined" && (globalThis as any).window) || - undefined + const win = (typeof globalThis !== "undefined" && (globalThis as any).window) || undefined const url = new URL(win ? win.location.href : "http://localhost") url.pathname = this.caminho @@ -96,9 +94,7 @@ export class TipagemRotas { if (this._acaoIr) { this._acaoIr(this.endereco({ ...query })) } else { - const win = - (typeof globalThis !== "undefined" && (globalThis as any).window) || - undefined + const win = (typeof globalThis !== "undefined" && (globalThis as any).window) || undefined if (win) { win.location.href = this.endereco({ ...query }) } @@ -124,9 +120,7 @@ export class TipagemRotas { // pegar hash const hash = url.hash if (hash) { - const hashObj = Object.fromEntries( - new URLSearchParams(hash.slice(1)).entries(), - ) + const hashObj = Object.fromEntries(new URLSearchParams(hash.slice(1)).entries()) queryObj = { ...queryObj, ...hashObj } as T } diff --git a/src/tipoFiltro.26.ts b/src/tipoFiltro.26.ts index f3086da..839f59a 100644 --- a/src/tipoFiltro.26.ts +++ b/src/tipoFiltro.26.ts @@ -164,9 +164,7 @@ type IsPlainObject = T extends object ============================================================================= */ type FiltroCampos = { - [K in keyof T]?: IsPlainObject extends true - ? tipoFiltro26 - : PgOpsFor + [K in keyof T]?: IsPlainObject extends true ? tipoFiltro26 : PgOpsFor } /* ============================================================================= diff --git a/src/uuid.ts b/src/uuid.ts index 1b88c91..18c47d4 100755 --- a/src/uuid.ts +++ b/src/uuid.ts @@ -6,8 +6,7 @@ import { NIL, v3, v4 } from "uuid" * @param valor - A string que será validada. * @returns booleano indicando se é um UUID válido. */ -export const erUuid = - /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i +export const erUuid = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i export const validarUuid = (uuid: string | number | undefined | null) => { const retorno = erUuid.test(String(uuid || "")) diff --git a/src/variaveisComuns.ts b/src/variaveisComuns.ts index 9128332..137f6e9 100755 --- a/src/variaveisComuns.ts +++ b/src/variaveisComuns.ts @@ -1,7 +1,5 @@ export const esperar = (ms: number): Promise => - new Promise((resolve: (r: true) => void) => - setTimeout(() => resolve(true), ms), - ) + new Promise((resolve: (r: true) => void) => setTimeout(() => resolve(true), ms)) /** * Usado para retronat o no de uma variável, deve ser usado dentro de um objeto * const nomex = {a: 1, b: 2} @@ -9,5 +7,4 @@ export const esperar = (ms: number): Promise => * @param v * @returns */ -export const nomeVariavel = (v: { [key: string]: any }) => - Object.keys(v).join("/") +export const nomeVariavel = (v: { [key: string]: any }) => Object.keys(v).join("/")