<commit_before>drilldown.js
============

Safely accesses deep properties of objects.

```JavaScript
// npm install drilldown
// bower install drilldown
var dd = require('drilldown');
```

Ever run into this?
```JavaScript
var foo;
foo.bar;
// TypeError: Cannot read property 'bar' of undefined
```

You can now check deeply nested properties cleanly!
```JavaScript
var foo = {abc: {def: {ghi: 'jkl'}}};
dd(foo)('abc')('def')('ghi').val is 'jkl'
dd(foo)('abc')('zzz')('yyy').val is undefined

// You don't need to use this ugly idiom anymore!
(((foo || {}).abc || {}).def || {}).ghi  // no
```

Check if a deep property exists:
```JavaScript
dd(foo)('abc').exists
```

Works with arrays too:
```JavaScript
var foo = {abc: [ {bar: 'def'},{bar: 'ghi'} ]};
dd(foo)('abc')(0)('bar') is 'def'
```

Safely call functions:
```JavaScript
var foo = {abc: {addOne: function(x) { return x + 1; }}};
dd(foo)('abc')('addOne').invoke(5); returns 6
dd(foo)('zzz')('aaa').invoke(5); returns undefined
```

Set values if the original value exists:
```JavaScript
var foo = {abc: {def: {ghi: 'jkl'}}};
var newValue = {ping: 'pong'};

dd(foo)('abc')('def').update(newValue);
//  - foo is now {abc: {def: {ping: 'pong'}}}
//  - {ping: 'pong'} is returned

dd(foo)('abc')('zzz').update(5);
//  - foo is unchanged
//  - undefined is returned
```

To prevent confusion, only own properties are drilled into.

Available dd properties:
 * val - the value
 * exists - true if val is defined
 * update function(value) - sets the value if the value exists
 * invoke - the value if the value is a function, or else a dummy function

Version locking is recommended during release 0.0.x<commit_msg>Recommend version locking at the top<commit_after>drilldown.js
============

Safely accesses deep properties of objects.

```JavaScript
// npm install drilldown
// bower install drilldown
var dd = require('drilldown');
```
Strict version locking is recommended during release 0.0.x

Ever run into this?
```JavaScript
var foo;
foo.bar;
// TypeError: Cannot read property 'bar' of undefined
```

You can now check deeply nested properties cleanly!
```JavaScript
var foo = {abc: {def: {ghi: 'jkl'}}};
dd(foo)('abc')('def')('ghi').val is 'jkl'
dd(foo)('abc')('zzz')('yyy').val is undefined

// You don't need to use this ugly idiom anymore!
(((foo || {}).abc || {}).def || {}).ghi  // no
```

Check if a deep property exists:
```JavaScript
dd(foo)('abc').exists
```

Works with arrays too:
```JavaScript
var foo = {abc: [ {bar: 'def'},{bar: 'ghi'} ]};
dd(foo)('abc')(0)('bar') is 'def'
```

Safely call functions:
```JavaScript
var foo = {abc: {addOne: function(x) { return x + 1; }}};
dd(foo)('abc')('addOne').invoke(5); returns 6
dd(foo)('zzz')('aaa').invoke(5); returns undefined
```

Set values if the original value exists:
```JavaScript
var foo = {abc: {def: {ghi: 'jkl'}}};
var newValue = {ping: 'pong'};

dd(foo)('abc')('def').update(newValue);
//  - foo is now {abc: {def: {ping: 'pong'}}}
//  - {ping: 'pong'} is returned

dd(foo)('abc')('zzz').update(5);
//  - foo is unchanged
//  - undefined is returned
```

To prevent confusion, only own properties are drilled into.

Available dd properties:
 * val - the value
 * exists - true if val is defined
 * update function(value) - sets the value if the value exists
 * invoke - the value if the value is a function, or else a dummy function
{'fraction_non_alphanumeric': 0.19518000595060994, 'fraction_numerical': 0.0047604879500148765, 'mean_word_length': 4.511475409836065, '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': '2510650', 'n_tokens_mistral': 1212, 'n_tokens_neox': 1137, 'n_words': 397}