CoolFace
Apppublic

opusdev/vector-similarity-api

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes
inherits_browser.js28 linesDownload Raw Back to inherits
1if (typeof Object.create === 'function') {2  // implementation from standard node.js 'util' module3  module.exports = function inherits(ctor, superCtor) {4    if (superCtor) {5      ctor.super_ = superCtor6      ctor.prototype = Object.create(superCtor.prototype, {7        constructor: {8          value: ctor,9          enumerable: false,10          writable: true,11          configurable: true12        }13      })14    }15  };16} else {17  // old school shim for old browsers18  module.exports = function inherits(ctor, superCtor) {19    if (superCtor) {20      ctor.super_ = superCtor21      var TempCtor = function () {}22      TempCtor.prototype = superCtor.prototype23      ctor.prototype = new TempCtor()24      ctor.prototype.constructor = ctor25    }26  }27}28