<commit_before>curlyfy
=======

**curlyfy** adds curly brackets to a whitespace indented string like this:

```
/* input */
a
    b
        c
            d
            e
    f
```

```
/* output */
a {
    b {
        c {
            d
            e
        }
    }
    f
}
```

It handles some special cases too:

```
/* input and output, no curly brackets added */

// trailing opening curly bracket
a = {
  b: c
}

// trailing opening square bracket
a = [
  b,
  c
]

// trailing opening parentheses
fn(
  a,
  b,
  c)

// trailing comma
fn(a,
   b,
   c)

```

Usage
-----

```
npm install --save curlyfy
```

```
var curlyfy = require('curlyfy');
var output = curlyfy(input [, options]);
```

Options
-------

**insertSemicolons**: *(default: false)*

Support
[JavaScript semicolon-less style]
(https://docs.npmjs.com/misc/coding-style#semicolons)
gotchas.
Because we guess that if you ditched braces
you will probably ditch semicolons too ;)

For example:

```
var output = curlyfy(input, {insertSemicolons: true})
```

```
/* input */
++i
--i
(x || y).doSomething()
[a, b, c].forEach(doSomething)
```

```
/* output */
;++i
;--i
;(x || y).doSomething()
;[a, b, c].forEach(doSomething)
```

TO-DO:
------

- Handle trailing comments
- Normalize indentations<commit_msg>Add syntax highlighting to README<commit_after>curlyfy
=======

**curlyfy** adds curly brackets to a whitespace indented string like this:

``` javascript
/* input */
a
    b
        c
            d
            e
    f
```

``` javascript
/* output */
a {
    b {
        c {
            d
            e
        }
    }
    f
}
```

It handles some special cases too:

``` javascript
/* input and output, no curly brackets added */

// trailing opening curly bracket
a = {
  b: c
}

// trailing opening square bracket
a = [
  b,
  c
]

// trailing opening parentheses
fn(
  a,
  b,
  c)

// trailing comma
fn(a,
   b,
   c)

```

Usage
-----

``` shell
npm install --save curlyfy
```

``` javascript
var curlyfy = require('curlyfy');
var output = curlyfy(input [, options]);
```

Options
-------

**insertSemicolons**: *(default: false)*

Support
[JavaScript semicolon-less style]
(https://docs.npmjs.com/misc/coding-style#semicolons)
gotchas.
Because we guess that if you ditched braces
you will probably ditch semicolons too ;)

For example:

``` javascript
var output = curlyfy(input, {insertSemicolons: true})
```

``` javascript
/* input */
++i
--i
(x || y).doSomething()
[a, b, c].forEach(doSomething)
```

``` javascript
/* output */
;++i
;--i
;(x || y).doSomething()
;[a, b, c].forEach(doSomething)
```

TO-DO:
------

- Handle trailing comments
- Normalize indentations
{'fraction_non_alphanumeric': 0.1711270260082925, 'fraction_numerical': 0.0, 'mean_word_length': 2.487516425755585, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5842664', 'n_tokens_mistral': 1003, 'n_tokens_neox': 909, 'n_words': 271}