MCPcopy
hub / github.com/labring/FastGPT / parseParentIdInMongo

Function parseParentIdInMongo

packages/global/common/parentFolder/utils.ts:3–17  ·  view source on GitHub ↗
(parentId: ParentIdType)

Source from the content-addressed store, hash-verified

1import { type ParentIdType } from './type';
2
3export const parseParentIdInMongo = (parentId: ParentIdType) => {
4 if (parentId === undefined) return {};
5
6 if (parentId === null || parentId === '')
7 return {
8 parentId: null
9 };
10
11 const pattern = /^[0-9a-fA-F]{24}$/;
12 if (pattern.test(parentId))
13 return {
14 parentId
15 };
16 return {};
17};

Callers 12

listReadableAgentSkillsFunction · 0.90
utils.test.tsFile · 0.90
handlerFunction · 0.90
onUpdateFunction · 0.90
handlerFunction · 0.90
handlerFunction · 0.90
handlerFunction · 0.90
handlerFunction · 0.90
handlerFunction · 0.90
onUpdateFunction · 0.90
createFunction · 0.90
handlerFunction · 0.90

Calls 1

testMethod · 0.80

Tested by

no test coverage detected