DuyTa's picture
Upload folder using huggingface_hub
bc20498 verified
|
raw
history blame
861 Bytes

codedent

build status Coverage Status

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.