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

Function mapToFunctions

scripts/transform-pipe.mjs:44–57  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

42}
43
44const mapToFunctions = (options) => {
45 const values = options.values
46 ? Object.assign({}, options.values)
47 : Object.assign({}, options)
48 delete values.delimiters
49 delete values.include
50 delete values.exclude
51
52 return Object.keys(values).reduce((fns, key) => {
53 const functions = Object.assign({}, fns)
54 functions[key] = toFunction(values[key])
55 return functions
56 }, {})
57}
58
59/**
60 * Esbuild only performs a single transform per run since it uses the onLoad

Callers 1

unpluginReplaceFactoryFunction · 0.85

Calls 1

toFunctionFunction · 0.85

Tested by

no test coverage detected