MCPcopy Create free account
hub / github.com/formkit/formkit / toFunction

Function toFunction

scripts/transform-pipe.mjs:5–8  ·  view source on GitHub ↗
(functionOrValue)

Source from the content-addressed store, hash-verified

3import { unpluginPureFactory } from 'unplugin-pure'
4
5const toFunction = (functionOrValue) => {
6 if (typeof functionOrValue === 'function') return functionOrValue
7 return () => functionOrValue
8}
9
10const escape = (str) => str.replace(/[-[\]/{}()*+?.\\^$|]/g, '\\$&')
11

Callers 1

mapToFunctionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected