MCPcopy Create free account
hub / github.com/redis/RedisInsight / createCommandPattern

Function createCommandPattern

redisinsight/ui/src/utils/plugins.ts:92–93  ·  view source on GitHub ↗
(matchCommand: string)

Source from the content-addressed store, hash-verified

90 value.replace(/[|\\{}()[\]^$+?.]/g, '\\$&')
91
92const createCommandPattern = (matchCommand: string): string =>
93 `^${matchCommand.split('*').map(escapeRegex).join('\\S*')}(?:\\s|$)`
94
95const doesCommandMatch = (query: string, matchCommand: string): boolean =>
96 testRegex(createCommandPattern(matchCommand), query)

Callers 1

doesCommandMatchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected