Skip to content
This repository has been archived by the owner on Jul 4, 2018. It is now read-only.

fluture-js/inspect-f

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

inspect-f

Unmaintained

With the introduction of default arguments to the language, it has become infeasable to maintain a regular expression and string-operation based approach to adjusting indentation.

Don't use this module. Instead, use a parser-based solition.


NPM Version Dependencies Build Status Code Coverage

Cast a function to string and adjust its indentation. Intended for rendering function bodies in pre-tags or consoles and what have you.

npm install --save inspect-f

Usage

Let's say we have this deeply indented function which uses a 6-space indentation scheme:

          function someDeeplyIndentedFunction(a, b){
                return (
                      a + b
                );
          }

Then the following:

const inspectf = require('inspect-f');
console.log(inspectf(2, someDeeplyIndentedFunction));

Would output:

function someDeeplyIndentedFunction(a, b){
  return (
    a + b
  );
}

About

Cast a function to string and adjust its indentation

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published