codedent
v0.1.2
Published
A dedent alternative for just code
Downloads
36,604
Readme
codedent
Usable both as template literal tag or just as callback for strings, removes all spaces found at the very first line of code encountered while sanitizing, keeping everything else around.
import dedent from 'codedent';
dedent`
def this_is_fine():
return "fine"
`;
/**
def this_is_fine():
return "fine"
*/
Differently from dedent module, this one doesn't care about code starting in one line then indented in others ... it's just code as you pass it along, no magic involved.