22
33--- @class Astra
44Astra = {
5- version = " @ASTRA_VERSION" ,
5+ version = " @ASTRA_VERSION" ,
66}
77
88ASTRA_INTERNAL__CURRENT_SCRIPT = " "
@@ -14,14 +14,14 @@ ASTRA_INTERNAL__CURRENT_SCRIPT = ""
1414--- Pretty prints any table or value
1515--- @param value any
1616function pprint (...)
17- --- @diagnostic disable-next-line : undefined-global
18- astra_internal__pretty_print (... )
17+ --- @diagnostic disable-next-line : undefined-global
18+ astra_internal__pretty_print (... )
1919end
2020
2121--- @return string
2222function uuid ()
23- --- @diagnostic disable-next-line : undefined-global
24- return astra_internal__uuid ()
23+ --- @diagnostic disable-next-line : undefined-global
24+ return astra_internal__uuid ()
2525end
2626
2727--- Invalidates imported module cache
3030--- function to remove those caches
3131--- @param path string
3232function invalidate_cache (path )
33- --- @diagnostic disable-next-line : undefined-global
34- astra_internal__invalidate_cache (path )
33+ --- @diagnostic disable-next-line : undefined-global
34+ astra_internal__invalidate_cache (path )
3535end
3636
3737--- Represents an async task
4343--- @param callback fun () The callback to run the content of the async task
4444--- @return TaskHandler
4545function spawn_task (callback )
46- --- @diagnostic disable-next-line : undefined-global
47- return astra_internal__spawn_task (callback )
46+ --- @diagnostic disable-next-line : undefined-global
47+ return astra_internal__spawn_task (callback )
4848end
4949
5050--- Starts a new async task with a delay in milliseconds
5151--- @param callback fun () The callback to run the content of the async task
5252--- @param timeout number The delay in milliseconds
5353--- @return TaskHandler
5454function spawn_timeout (callback , timeout )
55- --- @diagnostic disable-next-line : undefined-global
56- return astra_internal__spawn_timeout (callback , timeout )
55+ --- @diagnostic disable-next-line : undefined-global
56+ return astra_internal__spawn_timeout (callback , timeout )
5757end
5858
5959--- Starts a new async task that runs infinitely in a loop but with a delay in milliseconds
6060--- @param callback fun () The callback to run the content of the async task
6161--- @param timeout number The delay in milliseconds
6262--- @return TaskHandler
6363function spawn_interval (callback , timeout )
64- --- @diagnostic disable-next-line : undefined-global
65- return astra_internal__spawn_interval (callback , timeout )
64+ --- @diagnostic disable-next-line : undefined-global
65+ return astra_internal__spawn_interval (callback , timeout )
6666end
6767
6868--- Splits a sentence into an array given the separator
7171--- @return table array
7272--- @nodiscard
7373function string .split (input_str , separator_str )
74- local result_table = {}
75- for word in input_str :gmatch (" ([^" .. separator_str .. " ]+)" ) do
76- table.insert (result_table , word )
77- end
78- return result_table
74+ local result_table = {}
75+ for word in input_str :gmatch (" ([^" .. separator_str .. " ]+)" ) do
76+ table.insert (result_table , word )
77+ end
78+ return result_table
7979end
8080
8181--- Load your own file into env
8282--- @param file_path string
8383function dotenv_load (file_path )
84- --- @diagnostic disable-next-line : undefined-global
85- return astra_internal__dotenv_load (file_path )
84+ --- @diagnostic disable-next-line : undefined-global
85+ return astra_internal__dotenv_load (file_path )
8686end
8787
8888dotenv_load (" .env" )
@@ -101,14 +101,14 @@ dotenv_load(".env.local")
101101--- @param expression string
102102--- @return Regex
103103function regex (expression )
104- --- @diagnostic disable-next-line : undefined-global
105- return astra_internal__regex (expression )
104+ --- @diagnostic disable-next-line : undefined-global
105+ return astra_internal__regex (expression )
106106end
107107
108108--- @param key string
109109function os .getenv (key )
110- --- @diagnostic disable-next-line : undefined-global
111- return astra_internal__getenv (key )
110+ --- @diagnostic disable-next-line : undefined-global
111+ return astra_internal__getenv (key )
112112end
113113
114114--- Sets the environment variable.
117117--- @param key string
118118--- @param value string
119119function os .setenv (key , value )
120- --- @diagnostic disable-next-line : undefined-global
121- return astra_internal__setenv (key , value )
120+ --- @diagnostic disable-next-line : undefined-global
121+ return astra_internal__setenv (key , value )
122122end
0 commit comments