MCPcopy Create free account
hub / github.com/msgbyte/tailchat / isObjectId

Function isObjectId

client/shared/utils/string-helper.ts:62–72  ·  view source on GitHub ↗
(str: any)

Source from the content-addressed store, hash-verified

60 * 是一个MongoDB的objectId
61 */
62export function isObjectId(str: any): boolean {
63 if (typeof str === 'string' && str.length === 12) {
64 return true;
65 }
66
67 if (typeof str === 'string' && /^[0-9A-Fa-f]{24}$/.test(str)) {
68 return true;
69 }
70
71 return false;
72}

Callers 2

fetchUserInfoFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected