diff --git a/lib/base/request.js b/lib/base/request.js index d6b909a5..9fdece91 100644 --- a/lib/base/request.js +++ b/lib/base/request.js @@ -53,6 +53,7 @@ class Request extends EventEmitter { * @param {Template literal} template * @return {String} */ + template () { const values = Array.prototype.slice.call(arguments) const strings = values.shift() @@ -101,7 +102,7 @@ class Request extends EventEmitter { * Add an input parameter to the request. * * @param {String} name Name of the input parameter without @ char. - * @param {*} [type] SQL data type of input parameter. If you omit type, module automaticaly decide which SQL data type should be used based on JS data type. + * @param {*} [type] SQL data type of input parameter. If you omit type, module automatically decides which SQL data type should be used based on JS data type. * @param {*} value Input parameter value. `undefined` and `NaN` values are automatically converted to `null` values. * @return {Request} */ @@ -147,7 +148,7 @@ class Request extends EventEmitter { * Replace an input parameter on the request. * * @param {String} name Name of the input parameter without @ char. - * @param {*} [type] SQL data type of input parameter. If you omit type, module automaticaly decide which SQL data type should be used based on JS data type. + * @param {*} [type] SQL data type of input parameter. If you omit type, module automatically decides which SQL data type should be used based on JS data type. * @param {*} value Input parameter value. `undefined` and `NaN` values are automatically converted to `null` values. * @return {Request} */ @@ -253,7 +254,7 @@ class Request extends EventEmitter { return this } - // Check is method was called as tagged template + // Check if method was called as tagged template if (typeof batch === 'object') { const values = Array.prototype.slice.call(arguments) const strings = values.shift() @@ -376,6 +377,7 @@ class Request extends EventEmitter { * @param {Object} streamOptions - optional options to configure the readable stream with like highWaterMark * @return {Stream} */ + toReadableStream (streamOptions = {}) { this.stream = true this.pause() @@ -407,6 +409,7 @@ class Request extends EventEmitter { * @param {Stream} stream Stream to pipe data into. * @return {Stream} */ + pipe (writableStream) { const readableStream = this.toReadableStream() return readableStream.pipe(writableStream) @@ -450,7 +453,7 @@ class Request extends EventEmitter { return this } - // Check is method was called as tagged template + // Check if method was called as tagged template if (typeof command === 'object') { const values = Array.prototype.slice.call(arguments) const strings = values.shift()