question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Raw" string instead of manually building complex nodes

See original GitHub issue

I’ve seen this “template” functionality: https://github.com/facebook/jscodeshift/pull/16

But it doesn’t seem to work for property values? Is there any other way of inserting code as-is (as a string) without building the nodes out?

This doesn’t work…

j.property('init', j.identifier(lang), j.template.statement(`input => "test"`));

Unexpected token, expected ";"

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
mikobcommented, Jun 16, 2019

I was using a function call, and not the template literal syntax. I wasn’t aware of that feature until now, thanks!

0reactions
mikobcommented, Jun 16, 2019

sorry, should have read more carefully, just noticed you already specifically pointed that out.

Read more comments on GitHub >

github_iconTop Results From Across the Web

String.raw() - JavaScript - MDN Web Docs
The static String.raw() method is a tag function of template literals. This is similar to the r prefix in Python, or the @...
Read more >
What is a raw type and why shouldn't we use it? - Stack Overflow
A "raw type" is the use of a generic class without specifying a type argument(s) for its parameterized type(s), e.g. using List instead...
Read more >
Raw Queries - Sequelize
By default the function will return two arguments - a results array, and an object containing metadata (such as amount of affected rows,...
Read more >
Node.js ORMs: Why you shouldn't use them - LogRocket Blog
ORM is a powerful tool, but it adds a layer of complexity that can cause some hiccups. Here's why you may want to...
Read more >
Why the Hell Would I Use Node.js? A Case-by-case Tutorial
The applications would run on the open web stack backed by Node.js and WebSocket. Don't try to build hard real-time systems in Node...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found