(parent, init)
| 2583 | } |
| 2584 | |
| 2585 | function createClass(parent, init) { |
| 2586 | let klass = function (...args) { |
| 2587 | if (!(this instanceof klass)) { |
| 2588 | return new klass(...args); |
| 2589 | } |
| 2590 | init.apply(this, args); |
| 2591 | }; |
| 2592 | inherits(klass, parent); |
| 2593 | return klass; |
| 2594 | } |
| 2595 | |
| 2596 | // OK, so here's the deal. Consider this code: |
| 2597 | // var db1 = new PouchDB('foo'); |