UNPKG

x-http-client

Version:

An http client to make it easier to send requests (including JSONP requests) to the server.

15 lines (13 loc) 537 B
/** * Define a static member on the given constructor and its prototype * * @param {Constructor} ctor The constructor to define the static member * @param {string} name The name of the static member * @param {any} value The value of the static member * @throws {Error} Throws error if the name has already existed, or the constructor is not a function */ function defineExports(ctor, name, value) { ctor.prototype.exports = ctor.exports = ctor.exports || {}; ctor.exports[name] = value; } module.exports = defineExports;