<commit_before>brototype
=========

Bro, do you even javascript?

## Features

You've got a deeply-nested set of objects that may or may not always be there.
We've all seen something like this:
`var myURL = app.config.environment.buildURL('dev');`
which leads to one of our favorite javascript errors...
`error: undefined is not a function`

And the solution only makes the code base ugly:
```js
var myURL;
if (app && app.config && app.config.environment && app.config.environment.buildURL) {
    myURL = app.config.environment.buildURL('dev');
}
```

We all hate that, don't we?

So what if you could just type:
```js
var myURL;
if (Bro(app).doYouEven('config.environment.buildURL')) {
    myURL = app.config.environment.buildURL('dev');
}
```

Or better yet, how about:
```js
var myURL;
Bro(app)
    .iDontAlways('config.environment.buildURL')
    .butWhenIdo(function(val){
        myURL = val;
    });
```

Well, now you can!

## Features

### Testing nested members
```js
if(Bro(object).doYouEven('lift')) {}
```

Or, just use a callback...
```js
Bro(object)
    .doYouEven('property.subproperty', function(subproperty) {
        console.log(subproperty);
    });
```

### Fetching nested members
```js
// get a value if it exists
var value = Bro(object).iCanHaz('cheezeburger');

// get an array of values for paths that exist
var values = Bro(object).iCanHaz(['cheezeburger', 'money', 'beer']);
```

### Calling nested functions
```js
Bro(object)
    .iDontAlways('method')
    .butWhenIdo(function(returnVal) {
        ...
    });
```

### Handling exceptions
```js
Bro(object)
    .braceYourself('method.name')
    .hereComeTheErrors(function(e) {
        console.log('error ' + e + ' happened.');
    });
```

### Bro-oleans
```js
Bro.TOTALLY // true;
Bro.NOWAY   // false;
```

### Check for undefined
```js
if (Bro(someVar).isThatEvenAthing() === Bro.TOTALLY) {<commit_msg>update README.md to reflect proposed API change.<commit_after>brototype
=========

Bro, do you even javascript?

## Features

You've got a deeply-nested set of objects that may or may not always be there.
We've all seen something like this:
`var myURL = app.config.environment.buildURL('dev');`
which leads to one of our favorite javascript errors...
`error: undefined is not a function`

And the solution only makes the code base ugly:
```js
var myURL;
if (app && app.config && app.config.environment && app.config.environment.buildURL) {
    myURL = app.config.environment.buildURL('dev');
}
```

We all hate that, don't we?

So what if you could just type:
```js
var myURL;
if (Bro(app).doYouEven('config.environment.buildURL')) {
    myURL = app.config.environment.buildURL('dev');
}
```

Or better yet, how about:
```js
var myURL;
Bro(app)
    .iDontAlways('config.environment.buildURL')
    .butWhenIdo(function(val){
        myURL = val;
    });
```

Well, now you can!

## Features

### Testing nested members
```js
if(Bro(object).doYouEven('lift')) {}
```

Or, just use a callback...
```js
Bro(object)
    .doYouEven('property.subproperty', function(subproperty) {
        console.log(subproperty);
    });
```

### Fetching nested members
```js
// get a value if it exists
var value = Bro(object).iCanHaz('cheezeburger');

// get an array of values for paths that exist
var values = Bro(object).iCanHaz(['cheezeburger', 'money', 'beer']);
```

### Calling nested functions
```js
Bro(object)
    .iDontAlways('method')
    .butWhenIdo(function(returnVal) {
        ...
    });
```

### Handling exceptions
```js
Bro(object)
    .braceYourself('method.name')
    .hereComeTheErrors(function(e) {
        console.log('error ' + e + ' happened.');
    });
```

### Bro-oleans
```js
Bro.TOTALLY // true;
Bro.NOWAY   // false;
```

### Check for undefined
```js
if (Bro(someVar).isThatEvenAThing() === Bro.TOTALLY) {
{'fraction_non_alphanumeric': 0.16977660972404732, 'fraction_numerical': 0.0, 'mean_word_length': 3.8857509627727858, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '4241307', 'n_tokens_mistral': 1312, 'n_tokens_neox': 1244, 'n_words': 354}