<commit_before># invoke-fn

> A faster alternative to `Function#apply`.

[![MIT License](https://img.shields.io/badge/license-MIT_License-green.svg?style=flat-square)](https://github.com/gearcase/invoke-fn/blob/master/LICENSE)

[![build:?](https://img.shields.io/travis/gearcase/invoke-fn/master.svg?style=flat-square)](https://travis-ci.org/gearcase/invoke-fn)
[![coverage:?](https://img.shields.io/coveralls/gearcase/invoke-fn/master.svg?style=flat-square)](https://coveralls.io/github/gearcase/invoke-fn)



## Install

```
$ npm install --save invoke-fn 
```



## Usage

> For more use-cases see the [tests](https://github.com/gearcase/invoke-fn/blob/master/test/spec/index.js)

```js

var invoke = require('invoke-fn');

// invoke(func, thisArg, args);

var obj = {
  add: function () {
    var result = 0;
    for (var i = 0, length = arguments.length; i < length; i++) {
      result += arguments[i]
    }
    return result;
  }
}
    
invoke(function (a, b, c, d) {
  return this.add(a, b, c, d);
}, obj, [1, 2, 3, 4]);

// => 10
```

## Related

- [invoke-fn](https://github.com/gearcase/invoke-fn) - A faster alternative to `Function#apply`.
- [invoke-before](https://github.com/gearcase/invoke-before) - Returns a function that will only be executed before being called N times.
- [invoke-after](https://github.com/gearcase/invoke-after) - Returns a function that will only be executed after being called N times.
- [invoke-once](https://github.com/gearcase/invoke-once) - Restrict the given function only be invoked once.
- [try-invoke](https://github.com/gearcase/try-invoke) - Attempts to invoke the given function, returning either the result or the caught error object.
- [is-native](https://github.com/gearcase/is-native) - Checks if the given value is a native function.
- [to-source-code](https://github.com/gearcase/to-source-code.git) - Converts function to its source code.


## Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please [create an issue](https://github.com/gearcase/invoke-fn/issues/new).
<commit_msg>related<commit_after># invoke-fn

> A faster alternative to `Function#apply`.

[![MIT License](https://img.shields.io/badge/license-MIT_License-green.svg?style=flat-square)](https://github.com/gearcase/invoke-fn/blob/master/LICENSE)

[![build:?](https://img.shields.io/travis/gearcase/invoke-fn/master.svg?style=flat-square)](https://travis-ci.org/gearcase/invoke-fn)
[![coverage:?](https://img.shields.io/coveralls/gearcase/invoke-fn/master.svg?style=flat-square)](https://coveralls.io/github/gearcase/invoke-fn)


## Install

```
$ npm install --save invoke-fn 
```

## Usage

> For more use-cases see the [tests](https://github.com/gearcase/invoke-fn/blob/master/test/spec/index.js)

```js

var invoke = require('invoke-fn');

// invoke(func, thisArg, args);

var obj = {
  add: function () {
    var result = 0;
    for (var i = 0, length = arguments.length; i < length; i++) {
      result += arguments[i]
    }
    return result;
  }
}
    
invoke(function (a, b, c, d) {
  return this.add(a, b, c, d);
}, obj, [1, 2, 3, 4]);

// => 10
```

## Related

- [invoke-fn](https://github.com/gearcase/invoke-fn) - A faster alternative to `Function#apply`.
- [invoke-before](https://github.com/gearcase/invoke-before) - Returns a function that will only be executed before being called N times.
- [invoke-after](https://github.com/gearcase/invoke-after) - Returns a function that will only be executed after being called N times.
- [invoke-once](https://github.com/gearcase/invoke-once) - Restrict the given function only be invoked once.
- [try-invoke](https://github.com/gearcase/try-invoke) - Attempts to invoke the given function, returning either the result or the caught error object.
- [is-native](https://github.com/gearcase/is-native) - Checks if the given value is a native function.
- [to-source-code](https://github.com/gearcase/to-source-code.git) - Converts function to its source code.


## Contributing

Pull requests and stars are highly welcome.

For bugs and feature requests, please [create an issue](https://github.com/gearcase/invoke-fn/issues/new).

{'fraction_non_alphanumeric': 0.1681522524692845, 'fraction_numerical': 0.003854492893278728, 'mean_word_length': 3.9311163895486936, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 30, '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': '6213201', 'n_tokens_mistral': 1428, 'n_tokens_neox': 1384, 'n_words': 320}