I have a function like this:
export default ({ subDomain }) => `
{
mutation ${upperCase(subDomain)} {
${lowerCase(subDomain)} {
ok
}
}
}
`
However it returns a string that starts with a new line.
I don't want to write it like this:
export default ({ subDomain }) => `{
mutation ${upperCase(subDomain)} {
${lowerCase(subDomain)} {
ok
}
}
}
`
Is there a way to use a tag this template, to get rid of this new line?
Something like:
export default ({ subDomain }) => trim`
{
mutation ${upperCase(subDomain)} {
${lowerCase(subDomain)} {
ok
}
}
}
`
Why not just put
.trim()
after the template literal?