1
0
Fork 0
mirror of synced 2024-09-08 21:51:58 +12:00

Only call startsWith if string

This commit is contained in:
Mel O'Hagan 2022-09-21 15:25:53 +01:00
parent 8bf3f7bbd9
commit 97e33f8eee

View file

@ -43,7 +43,7 @@
let helpers = handlebarsCompletions() let helpers = handlebarsCompletions()
let getCaretPosition let getCaretPosition
let search = "" let search = ""
let initialValueJS = value?.startsWith("{{ js ") let initialValueJS = typeof value === "string" && value?.startsWith("{{ js ")
let mode = initialValueJS ? "JavaScript" : "Handlebars" let mode = initialValueJS ? "JavaScript" : "Handlebars"
let jsValue = initialValueJS ? value : null let jsValue = initialValueJS ? value : null
let hbsValue = initialValueJS ? null : value let hbsValue = initialValueJS ? null : value