MCPcopy Create free account
hub / github.com/chakra-ui/panda / hasTokenReference

Function hasTokenReference

packages/token-dictionary/src/utils.ts:33–33  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

31const tokenFunctionRegex = /token\(([^)]+)\)/g
32const closingParenthesisRegex = /\)$/g
33const hasTokenReference = (str: string) => str.includes('token(')
34
35const tokenReplacer = (a: string, b?: string) =>
36 b ? (a.endsWith(')') ? a.replace(closingParenthesisRegex, `, ${b})`) : `var(${a}, ${b})`) : a

Callers 1

isTokenReferenceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected