UNPKG
hzengine-core
Version:
latest (0.1.3)
0.1.3
0.1.2-dev
An Visual Novel Engine for Zepp OS
hzengine-core
/
src
/
plugins
/
basic_command
/
$.ts
11 lines
(9 loc)
•
304 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
10
11
import
{
HZEngineCore
}
from
"../../index.js"
;
export
function
$_command
(
core: HZEngineCore
) { core.
script
.
use
(
(
ctx, next
) =>
{
if
(ctx.
rawtext
.
trim
().
startsWith
(
"$"
)) { ctx.
rawtext
=
"eval "
+ ctx.
rawtext
.
trim
().
slice
(
1
).
trim
() }
return
next
() }) }