Move anonymous function to JavaScript package to override builtin snippets