build
This commit is contained in:
parent
e36137e33e
commit
f6dcff3693
5 changed files with 6 additions and 10 deletions
|
|
@ -36,7 +36,7 @@ const uuidV3 = (chave, grupo) => {
|
|||
// Converte a chave para string (de forma segura)
|
||||
typeof chave === "string" ? chave : typeof chave === "number" ? String(chave) : JSON.stringify(chave),
|
||||
// Se um grupo foi fornecido, gera um UUID v3 recursivamente com base nele, senão usa NIL
|
||||
grupo ? typeof grupo == "string" && validarUuid(grupo) ? grupo : uuidV3(grupo) : import_uuid.NIL
|
||||
grupo ? uuidV3(grupo) : import_uuid.NIL
|
||||
);
|
||||
};
|
||||
const uuidV4 = import_uuid.v4;
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ declare const validarUuid: (uuid: string | number | undefined | null) => boolean
|
|||
* @param grupo - Opcional. Namespace para separar domínios diferentes de UUIDs.
|
||||
* @returns UUID v3 (determinístico)
|
||||
*/
|
||||
declare const uuidV3: (chave: any, grupo?: string | number) => string;
|
||||
declare const uuidV3: (chave: any, grupo?: any) => string;
|
||||
/**
|
||||
* Gera um UUID v4 (aleatório, não determinístico).
|
||||
*
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "p-comuns",
|
||||
"version": "0.216.0",
|
||||
"version": "0.217.0",
|
||||
"description": "",
|
||||
"main": "./dist-back/index.js",
|
||||
"module": "./dist-front/index.mjs",
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ export const validarUuid = (uuid: string | number | undefined | null) => {
|
|||
* @param grupo - Opcional. Namespace para separar domínios diferentes de UUIDs.
|
||||
* @returns UUID v3 (determinístico)
|
||||
*/
|
||||
export const uuidV3 = (chave: any, grupo?: string | number): string => {
|
||||
export const uuidV3 = (chave: any, grupo?: any): string => {
|
||||
return v3(
|
||||
// Converte a chave para string (de forma segura)
|
||||
typeof chave === "string"
|
||||
|
|
@ -35,11 +35,7 @@ export const uuidV3 = (chave: any, grupo?: string | number): string => {
|
|||
: JSON.stringify(chave),
|
||||
|
||||
// Se um grupo foi fornecido, gera um UUID v3 recursivamente com base nele, senão usa NIL
|
||||
grupo
|
||||
? typeof grupo == "string" && validarUuid(grupo)
|
||||
? grupo
|
||||
: uuidV3(grupo)
|
||||
: NIL,
|
||||
grupo ? uuidV3(grupo) : NIL,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue