<commit_before># get-constructors
get an array of constructors for objects and classes

# INSTALL

```bash
$ npm install get-constructor
```

or

```html
<script src="get-constructors.js"></script>
```

# USAGE

## constructors

```js
var constructors = require('get-constructors');

var FuncProto = Function.prototype;

constructors({}) // -> [Object]
constructors([]) // -> [Array, Object]

constructors(Object) // -> [Object, FuncProto]
constructors(Array) // -> [Array, FuncProto]

function Klass() {}
constructors(new Klass) // -> [Klass, Object]
constructors(Klass // -> [Klass, FuncProto]
```

## constructors.extendPrototype([Class = Object])

```js
var constructors = require('get-constructors');

var FuncProto = Function.prototype;

constructors.extendPrototype();

{}.constructors // -> [Object]
[].constructors // -> [Array, Object]

Object.constructors // -> [Object, FuncProto]
Array.constructors // -> [Array, FuncProto]

function Klass() {}
new Klass().constructors // -> [Klass, Object]
Klass.constructors // -> [Klass, FuncProto]
```

# LICENSE

  MIT License<commit_msg>modify readme<commit_after>[get-constructors](https://www.npmjs.org/package/get-constructors) - npm
====

get an array of constructors for objects and classes.

# INSTALL:

```bash
$ npm install get-constructor
```

or

```html
<script src="get-constructors.js"></script>
```

# USAGE:

## constructors

```js
var constructors = require('get-constructors');

var FuncProto = Function.prototype;

constructors({}); // -> [Object]
constructors(Object); // -> [Object, FuncProto]

constructors([]); // -> [Array, Object]
constructors(Array); // -> [Array, FuncProto]

function Klass() {}
constructors(new Klass); // -> [Klass, Object]
constructors(Klass); // -> [Klass, FuncProto]

var setProto = Object.setPrototypeOf ? Object.setPrototypeOf :
  function setProto(obj, proto) { obj.__proto__ = proto; };

function SubKlass() {}
SubKlass.prototype = Object.create(Klass.prototype, {
  constructor: { value: SubKlass,
    writable: true, configurable: true }});
setProto(SubKlass, Klass);

constructors(new SubKlass); // -> [SubKlass, Klass, Object]
constructors(SubKlass); // -> [SubKlass, Klass, FuncProto]
```

## constructors.extendPrototype([Class = Object])

```js
var constructors = require('get-constructors');

var FuncProto = Function.prototype;
constructors.extendPrototype();

({}).constructors // -> [Object]
Object.constructors // -> [Object, FuncProto]

[].constructors // -> [Array, Object]
Array.constructors // -> [Array, FuncProto]

function Klass() {}
(new Klass).constructors // -> [Klass, Object]
Klass.constructors // -> [Klass, FuncProto]

var setProto = Object.setPrototypeOf ? Object.setPrototypeOf :
  function setProto(obj, proto) { obj.__proto__ = proto; };

function SubKlass() {}
SubKlass.prototype = Object.create(Klass.prototype, {
  constructor: { value: SubKlass,
    writable: true, configurable: true }});
setProto(SubKlass, Klass);

(new SubKlass).constructors // -> [SubKlass, Klass, Object]
SubKlass.constructors // -> [SubKlass, Klass, FuncProto]
```

# LICENSE:

  MIT License
{'fraction_non_alphanumeric': 0.17429123711340205, 'fraction_numerical': 0.0, 'mean_word_length': 4.676416819012797, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 35, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, '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': '3885971', 'n_tokens_mistral': 1028, 'n_tokens_neox': 1009, 'n_words': 226}