MCPcopy Index your code
hub / github.com/omkarcloud/botasaurus / createControls

Function createControls

botasaurus-controls/src/index.ts:1252–1272  ·  view source on GitHub ↗
(input_js: string | Function)

Source from the content-addressed store, hash-verified

1250}
1251
1252function createControls(input_js: string | Function) {
1253 // Create a new instance of Controls
1254 const controls = new Controls()
1255
1256 let getInputFunc: Function;
1257
1258 if (typeof input_js === 'function') {
1259 // If input_js is already a function, use it directly
1260 getInputFunc = input_js;
1261 } else {
1262 // If input_js is a string, create a function from it (legacy behavior)
1263 const code = input_js + "\n return getInput(controls);"
1264 getInputFunc = new Function("controls", code);
1265 }
1266
1267 // Execute the function, passing the 'controls' instance
1268 getInputFunc(controls)
1269
1270 // Return the modified 'controls' instance with all added controls
1271 return controls
1272}
1273
1274
1275export { Controls, createControls, FileTypes }

Callers 2

updateCacheMethod · 0.90
ContentContainerFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected