Jslink code text to image

How do I use the code keyword to jslink widgets.TextInput to widgets.JPG

This works:

text = pn.widgets.TextInput()
jpg = pn.pane.JPG('intro.jpg')
text.jslink(jpg, value='object')

But not this:

text = pn.widgets.TextInput()
jpg = pn.pane.JPG('intro.jpg')
text.jslink(jpg, code={'value': 'target.object = source.value'})

I think it has to do something with:
_target_transforms = {'object': """'<img src="' + value + '"></img>'"""}

Not sure this will work tbh. There is no transform from text to image that is guaranteed to work since we cannot assume anything about the content of the text field. In this case you should use .jscallback instead and write your own transform.

Any tips on how I can write my own transform?

Would it look like
jpg.object =<img src…/img>?