Skip to content

Commit bb81232

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into stats-minabs-new
2 parents 52d0c8a + 3f6ab18 commit bb81232

File tree

40 files changed

+2364
-138
lines changed

40 files changed

+2364
-138
lines changed

lib/node_modules/@stdlib/blas/ext/base/dnansum/benchmark/c/benchmark.length.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ static double benchmark1( int iterations, int len ) {
111111
v = 0.0;
112112
t = tic();
113113
for ( i = 0; i < iterations; i++ ) {
114+
// cppcheck-suppress uninitvar
114115
v = stdlib_strided_dnansum( len, x, 1 );
115116
if ( v != v ) {
116117
printf( "should not return NaN\n" );
@@ -148,6 +149,7 @@ static double benchmark2( int iterations, int len ) {
148149
v = 0.0;
149150
t = tic();
150151
for ( i = 0; i < iterations; i++ ) {
152+
// cppcheck-suppress uninitvar
151153
v = stdlib_strided_dnansum_ndarray( len, x, 1, 0 );
152154
if ( v != v ) {
153155
printf( "should not return NaN\n" );

lib/node_modules/@stdlib/net/disposable-http-server/README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,20 @@ var opts = {
4747
httpServer( opts );
4848
```
4949

50+
The function supports the following parameters:
51+
52+
- **options**: function options.
53+
- **clbk**: callback to invoke upon creating a server (_optional_).
54+
5055
The function accepts the following options:
5156

52-
- **html**: `buffer` or `string` to serve as HTML content.
53-
- **javascript**: `buffer` or `string` to serve as JavaScript.
57+
- **html**: Buffer or string to serve as HTML content.
58+
- **javascript**: Buffer or string to serve as JavaScript.
5459
- **port**: server port. Default: `0` (i.e., randomly assigned).
5560
- **maxport**: max server port (used when port hunting). Default: `=port`.
5661
- **hostname**: server hostname.
5762
- **address**: server address. Default: `"0.0.0.0"`.
58-
- **open**: `boolean` indicating whether to launch a web browser. Default: `false`.
63+
- **open**: boolean indicating whether to launch a web browser. Default: `false`.
5964

6065
To serve HTML content, set the `html` option. Once the content is requested, the server will close.
6166

@@ -127,7 +132,7 @@ httpServer( opts, onReady );
127132

128133
## Notes
129134

130-
- If neither the `html` or `javascript` option is set, the server serves an HTML boilerplate and then closes.
135+
- If neither the `html` nor `javascript` option is set, the server serves an HTML boilerplate and then closes.
131136

132137
</section>
133138

lib/node_modules/@stdlib/net/http-server/README.md

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,29 @@ limitations under the License.
2020

2121
# HTTP Server
2222

23-
> [HTTP][http] server.
23+
> [HTTP][nodejs-http] server.
2424
2525
<section class="usage">
2626

2727
## Usage
2828

2929
```javascript
30-
var httpServer = require( '@stdlib/net/http-server' );
30+
var httpServerFactory = require( '@stdlib/net/http-server' );
3131
```
3232

33-
#### httpServer( \[options,] \[ requestListener] )
33+
#### httpServerFactory( \[options,] \[requestListener] )
3434

35-
Returns a function to create an [HTTP][http] server.
35+
Returns a function to create an [HTTP][nodejs-http] server.
3636

3737
```javascript
38-
var createServer = httpServer();
38+
var httpServer = httpServerFactory();
3939
```
4040

41+
The function supports the following parameters:
42+
43+
- **options**: options (_optional_).
44+
- **requestListener**: callback to invoke upon receiving an HTTP request (_optional_).
45+
4146
To bind a request callback to a server, provide a `requestListener`.
4247

4348
```javascript
@@ -46,25 +51,25 @@ function requestListener( request, response ) {
4651
response.end( 'OK' );
4752
}
4853

49-
var createServer = httpServer( requestListener );
54+
var httpServer = httpServerFactory( requestListener );
5055
```
5156

52-
The function accepts the following `options`:
57+
In addition to the options supported by [`http.createServer`][nodejs-http-create-server], the function accepts the following options:
5358

5459
- **port**: server port. Default: `0` (i.e., randomly assigned).
5560
- **maxport**: max server port when port hunting. Default: `maxport=port`.
5661
- **hostname**: server hostname.
5762
- **address**: server address. Default: `127.0.0.1`.
5863

59-
To specify server options, provide an `options` object.
64+
To specify server options, provide an options object.
6065

6166
```javascript
6267
var opts = {
6368
'port': 7331,
6469
'address': '0.0.0.0'
6570
};
6671

67-
var createServer = httpServer( opts );
72+
var httpServer = httpServerFactory( opts );
6873
```
6974

7075
To specify a range of permissible ports, set the `maxport` option.
@@ -74,14 +79,14 @@ var opts = {
7479
'maxport': 9999
7580
};
7681

77-
var createServer = httpServer( opts );
82+
var httpServer = httpServerFactory( opts );
7883
```
7984

8085
When provided a `maxport` option, a created server will search for the first available `port` on which to listen, starting from `port`.
8186

82-
#### createServer( done )
87+
#### httpServer( done )
8388

84-
Creates an [HTTP][http] server.
89+
Creates an [HTTP][nodejs-http] server.
8590

8691
```javascript
8792
function done( error, server ) {
@@ -92,11 +97,15 @@ function done( error, server ) {
9297
server.close();
9398
}
9499

95-
var createServer = httpServer();
100+
var httpServer = httpServerFactory();
96101

97-
createServer( done );
102+
httpServer( done );
98103
```
99104

105+
The function supports the following parameters:
106+
107+
- **done**: callback to invoke once a server is listening and ready to handle requests.
108+
100109
</section>
101110

102111
<!-- /.usage -->
@@ -105,6 +114,7 @@ createServer( done );
105114

106115
## Notes
107116

117+
- Which server options are supported depends on the Node.js version. Older Node.js versions (e.g., <= v8.12.0) do not support an options object when calling [`http.createServer`][nodejs-http-create-server], and, for those versions, any options supported by [`http.createServer`][nodejs-http-create-server] in later Node.js versions are ignored.
108118
- Port hunting can be useful in a microservice deployment. When a `port` is randomly assigned (`options.port=0`), if a server fails and is restarted, the server is unlikely to bind to its previous `port`. By allowing a constrained search, assuming no lower `ports` within a specified range have freed up in the meantime, the likelihood of listening on the same `port` is increased. A server can typically restart and bind to the same `port` faster than binding to a new `port` and re-registering with a microservice registry, thus minimizing possible service interruption and downtime.
109119

110120
</section>
@@ -122,7 +132,7 @@ createServer( done );
122132
```javascript
123133
var proc = require( 'process' );
124134
var http = require( 'http' );
125-
var httpServer = require( '@stdlib/net/http-server' );
135+
var httpServerFactory = require( '@stdlib/net/http-server' );
126136

127137
function done( error, server ) {
128138
if ( error ) {
@@ -149,10 +159,10 @@ var opts = {
149159
};
150160

151161
// Create a function for creating an HTTP server...
152-
var createServer = httpServer( opts, onRequest );
162+
var httpServer = httpServerFactory( opts, onRequest );
153163

154164
// Create a server:
155-
createServer( done );
165+
httpServer( done );
156166
```
157167

158168
</section>
@@ -171,7 +181,9 @@ createServer( done );
171181

172182
<section class="links">
173183

174-
[http]: https://nodejs.org/api/http.html
184+
[nodejs-http]: https://nodejs.org/api/http.html
185+
186+
[nodejs-http-create-server]: https://nodejs.org/api/http.html#httpcreateserveroptions-requestlistener
175187

176188
</section>
177189

lib/node_modules/@stdlib/net/http-server/docs/repl.txt

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
{{alias}}( [options,] [requestListener] )
33
Returns a function to create an HTTP server.
44

5+
In addition to options documented below, the function supports any options
6+
supported by `http.createServer`. Which server options are supported depends
7+
on the Node.js version. Older Node.js versions (e.g., <= v8.12.0) do not
8+
support an options object when calling `http.createServer`, and, for those
9+
versions, any options supported by `http.createServer` in later Node.js
10+
versions are ignored.
11+
512
Parameters
613
----------
714
options: Object (optional)
@@ -24,30 +31,30 @@
2431

2532
Returns
2633
-------
27-
createServer: Function
34+
httpServer: Function
2835
Function to create an HTTP server.
2936

3037
Examples
3138
--------
3239
// Basic usage:
33-
> var createServer = {{alias}}()
40+
> var httpServer = {{alias}}()
3441
<Function>
3542

3643
// Provide a request callback:
3744
> function onRequest( request, response ) {
3845
... console.log( request.url );
3946
... response.end( 'OK' );
4047
... };
41-
> createServer = {{alias}}( onRequest )
48+
> httpServer = {{alias}}( onRequest )
4249
<Function>
4350

4451
// Specify a specific port:
4552
> var opts = { 'port': 7331 };
46-
> createServer = {{alias}}( opts )
53+
> httpServer = {{alias}}( opts )
4754
<Function>
4855

4956

50-
createServer( done )
57+
httpServer( done )
5158
Creates an HTTP server.
5259

5360
Parameters
@@ -64,8 +71,8 @@ createServer( done )
6471
... console.log( 'Success!' );
6572
... server.close();
6673
... };
67-
> var createServer = {{alias}}();
68-
> createServer( done );
74+
> var httpServer = {{alias}}();
75+
> httpServer( done );
6976

7077
See Also
7178
--------

lib/node_modules/@stdlib/net/http-server/docs/types/index.d.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ type Callback = Nullary | Unary | Binary;
104104
*
105105
* @param done - callback to invoke after creating the server
106106
*/
107-
type createServer = ( done: Callback ) => void;
107+
type httpServer = ( done: Callback ) => void;
108108

109109
/**
110110
* Returns a function which creates an HTTP server.
@@ -113,20 +113,24 @@ type createServer = ( done: Callback ) => void;
113113
* @returns function which creates an HTTP server
114114
*
115115
* @example
116-
* var createServer = httpServer();
116+
* var httpServer = factory();
117117
*
118118
* @example
119119
* function onRequest( request, response ) {
120120
* console.log( request.url );
121121
* response.end( 'OK' );
122122
* }
123-
* var createServer = httpServer( onRequest );
123+
* var httpServer = factory( onRequest );
124124
*/
125-
declare function httpServer( requestListener?: RequestListener ): createServer;
125+
declare function factory( requestListener?: RequestListener ): httpServer;
126126

127127
/**
128128
* Returns a function which creates an HTTP server.
129129
*
130+
* ## Notes
131+
*
132+
* - In addition to options documented below, the function supports any options supported by `http.createServer`. Which server options are supported depends on the Node.js version. Older Node.js versions (e.g., <= v8.12.0) do not support an options object when calling `http.createServer`, and, for those versions, any options supported by `http.createServer` in later Node.js versions are ignored.
133+
*
130134
* @param options - server options
131135
* @param options.port - server port (default: 0)
132136
* @param options.maxport - max server port
@@ -141,7 +145,7 @@ declare function httpServer( requestListener?: RequestListener ): createServer;
141145
* 'port': 7331,
142146
* 'address': '0.0.0.0'
143147
* };
144-
* var createServer = httpServer( opts );
148+
* var httpServer = factory( opts );
145149
*
146150
* @example
147151
* var opts = {
@@ -152,11 +156,11 @@ declare function httpServer( requestListener?: RequestListener ): createServer;
152156
* console.log( request.url );
153157
* response.end( 'OK' );
154158
* }
155-
* var createServer = httpServer( opts, onRequest );
159+
* var httpServer = factory( opts, onRequest );
156160
*/
157-
declare function httpServer( options: Options, requestListener?: RequestListener ): createServer;
161+
declare function factory<T extends Options>( options: T, requestListener?: RequestListener ): httpServer;
158162

159163

160164
// EXPORTS //
161165

162-
export = httpServer;
166+
export = factory;

0 commit comments

Comments
 (0)