Skip to content

Commit 964d002

Browse files
committed
Fix issue with arrow function
1 parent d128048 commit 964d002

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/behavior.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ function createFunction(name, func, core, useCoreAPI) {
7070
funcBody = '',
7171
header = '',
7272
action = null,
73-
isArrowFunction = false,
73+
isArrowFunction = true,
7474
isOneLine = false;
7575

76-
if (func.indexOf('function' === 0) && func.indexOf('=>') !== -1) {
77-
isArrowFunction = true;
76+
if (func.trim().indexOf('function') === 0) {
77+
isArrowFunction = false;
7878
}
7979

8080
if (isArrowFunction) {

0 commit comments

Comments
 (0)