add isUUID method

This commit is contained in:
CounterFire2023 2024-01-17 17:52:19 +08:00
parent b982e43cd7
commit e842df426c
9 changed files with 23 additions and 6 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -26,6 +26,7 @@ __export(string_util_exports, {
hexToBase58: () => hexToBase58,
isObjectId: () => isObjectId,
isTrue: () => isTrue,
isUUID: () => isUUID,
string10to62: () => string10to62,
string62to10: () => string62to10
});
@ -121,6 +122,9 @@ function compressHex(e, r) {
}
return s + o.join("");
}
function isUUID(uuid) {
return reNormalUUID.test(uuid);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
base58ToHex,
@ -130,6 +134,7 @@ function compressHex(e, r) {
hexToBase58,
isObjectId,
isTrue,
isUUID,
string10to62,
string62to10
});

File diff suppressed because one or more lines are too long

View File

@ -27,5 +27,6 @@ declare const base58ToHex: (base58String: string) => string;
declare const hexToBase32: (hexString: string) => string;
declare function compressUuid(e: string, t?: boolean): string;
declare function compressHex(e: string, r: number): string;
declare function isUUID(uuid: string): boolean;
export { base58ToHex, compressHex, compressUuid, hexToBase32, hexToBase58, isObjectId, isTrue, string10to62, string62to10 };
export { base58ToHex, compressHex, compressUuid, hexToBase32, hexToBase58, isObjectId, isTrue, isUUID, string10to62, string62to10 };

View File

@ -27,5 +27,6 @@ declare const base58ToHex: (base58String: string) => string;
declare const hexToBase32: (hexString: string) => string;
declare function compressUuid(e: string, t?: boolean): string;
declare function compressHex(e: string, r: number): string;
declare function isUUID(uuid: string): boolean;
export { base58ToHex, compressHex, compressUuid, hexToBase32, hexToBase58, isObjectId, isTrue, string10to62, string62to10 };
export { base58ToHex, compressHex, compressUuid, hexToBase32, hexToBase58, isObjectId, isTrue, isUUID, string10to62, string62to10 };

View File

@ -90,6 +90,9 @@ function compressHex(e, r) {
}
return s + o.join("");
}
function isUUID(uuid) {
return reNormalUUID.test(uuid);
}
export {
base58ToHex,
compressHex,
@ -98,6 +101,7 @@ export {
hexToBase58,
isObjectId,
isTrue,
isUUID,
string10to62,
string62to10
};

File diff suppressed because one or more lines are too long

View File

@ -140,3 +140,9 @@ export function compressHex(e: string, r: number) {
}
return s + o.join('')
}
export function isUUID(uuid: string) {
return reNormalUUID.test(uuid)
}