/
proof-of-concept
/
instrawave-compose
Jump to
/
Appearance
Match my system
Paper
GitHub
Slate
Midnight
Terminal
Sign in
proof-of-concept
/
instrawave-compose
Code
Commits
Issues
0
Pull requests
0
Actions
Branches
1
Tags
0
Site
main
Branches
main
instrawave-compose
/
src
/
numbl
/
source.ts
5 lines · 280 B
Copy
Copied
Blame
History
Raw
1
/** Name of the first function defined in a .m source, or null for a plain script. */
2
export
function
extractFunctionName
(
source
:
string
):
string
|
null
{
3
const
m = source.
match
(
/^\s*function\s+(?:\[[^\]]*\]\s*=\s*|\w+\s*=\s*)?([A-Za-z]\w*)\s*\(/m
);
4
return
m ? m[
1
] :
null
;
5
}
↑
↓
move
↵
open
esc
close