From e1d895cc9abb0f7ffac8acc043746cbe2e5f4fe1 Mon Sep 17 00:00:00 2001 From: sigoden Date: Fri, 7 Jun 2024 16:10:05 +0800 Subject: refactor: py/js entry func name (#31) --- tools/demo_tool.js | 2 +- tools/demo_tool.py | 2 +- tools/may_execute_js_code.js | 2 +- tools/may_execute_py_code.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'tools') diff --git a/tools/demo_tool.js b/tools/demo_tool.js index f8fd283..d47fa59 100644 --- a/tools/demo_tool.js +++ b/tools/demo_tool.js @@ -11,6 +11,6 @@ * @property {string[]} [array_optional] - Define a optional string array property * @param {Args} args */ -exports.main = function main(args) { +exports.run = function run(args) { console.log(args); } diff --git a/tools/demo_tool.py b/tools/demo_tool.py index bd353ad..5eb4c09 100644 --- a/tools/demo_tool.py +++ b/tools/demo_tool.py @@ -1,7 +1,7 @@ from typing import List, Literal, Optional -def main( +def run( boolean: bool, string: str, string_enum: Literal["foo", "bar"], diff --git a/tools/may_execute_js_code.js b/tools/may_execute_js_code.js index 2dec177..4706e07 100644 --- a/tools/may_execute_js_code.js +++ b/tools/may_execute_js_code.js @@ -4,6 +4,6 @@ * @property {string} code - Javascript code to execute, such as `console.log("hello world")` * @param {Args} args */ -exports.main = function main({ code }) { +exports.run = function run({ code }) { eval(code); } diff --git a/tools/may_execute_py_code.py b/tools/may_execute_py_code.py index 8e55a8d..5f6af2f 100644 --- a/tools/may_execute_py_code.py +++ b/tools/may_execute_py_code.py @@ -1,4 +1,4 @@ -def main(code: str): +def run(code: str): """Runs the python code. Args: code: Python code to execute, such as `print("hello world")` -- cgit v1.2.3