Skip to content

Commit 8e35898

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into feat/add-stats-strided-selmax
2 parents 19e6a35 + 6f2e5f6 commit 8e35898

1,684 files changed

Lines changed: 57706 additions & 3576 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest/lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ var windowShim = require( './window.js' );
4848

4949
var debug = logger( 'jsdoc-doctest' );
5050
var ROOT_DIR = rootDir();
51-
var RE_ANNOTATION = /(?:\n|^)(?!function\s|class\s)(?:var|let|const)? ?([a-zA-Z0-9._]+) ?=?[^;]*;\n\/\/ ?(returns|([A-Za-z][A-Za-z_0-9]*)? ?=>|throws) {0,1}([\s\S]*?)(\n|$)/g;
51+
var RE_ANNOTATION = /(?:\n|^)(?!function\s|class\s)(?:var|let|const)? ?([a-zA-Z0-9._]+) ?=?[^;]*;[ \t]*(?:\/\/[^\n]*)?\n\/\/ ?(returns|([A-Za-z][A-Za-z_0-9]*)? ?=>|throws) {0,1}([\s\S]*?)(\n|$)/g;
5252
var RE_CONSOLE = /console\.(?:dir|error|log)/;
5353
var RE_MODULE_TAG = /\* @module[^\n]*\n/g;
5454
var NODE_SHEBANG = /#!\/usr\/bin\/env node/;

lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest/test/fixtures/invalid.js

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,6 +1021,140 @@ test = {
10211021
};
10221022
invalid.push( test );
10231023

1024+
test = {
1025+
'code': [
1026+
'\'use strict\'',
1027+
'',
1028+
'/**',
1029+
'* Squares a number.',
1030+
'*',
1031+
'* @param {number} x - input value',
1032+
'* @returns {number} x*x',
1033+
'* @example',
1034+
'* var y = square( 3.0 ); // x squared',
1035+
'* // returns 12.0',
1036+
'*',
1037+
'* y = square( 2.0 ); // x squared',
1038+
'* // returns 4.0',
1039+
'*/',
1040+
'function square( x ) {',
1041+
' return x*x;',
1042+
'}'
1043+
].join( '\n' ),
1044+
'errors': [
1045+
{
1046+
'message': 'Displayed return value is `12.0`, but expected `9` instead',
1047+
'type': null
1048+
}
1049+
],
1050+
'output': [
1051+
'\'use strict\'',
1052+
'',
1053+
'/**',
1054+
'* Squares a number.',
1055+
'*',
1056+
'* @param {number} x - input value',
1057+
'* @returns {number} x*x',
1058+
'* @example',
1059+
'* var y = square( 3.0 ); // x squared',
1060+
'* // returns 9',
1061+
'*',
1062+
'* y = square( 2.0 ); // x squared',
1063+
'* // returns 4.0',
1064+
'*/',
1065+
'function square( x ) {',
1066+
' return x*x;',
1067+
'}'
1068+
].join( '\n' )
1069+
};
1070+
invalid.push( test );
1071+
1072+
test = {
1073+
'code': [
1074+
'/**',
1075+
'* Squares a number.',
1076+
'*',
1077+
'* @param {number} x - input value',
1078+
'* @returns {number} x*x',
1079+
'* @example',
1080+
'* console.log( square( 3.0 ) ); // x squared',
1081+
'* // => 12.0',
1082+
'*',
1083+
'* console.log( square( 2.0 ) ); // x squared',
1084+
'* // => 4.0',
1085+
'*/',
1086+
'function square( x ) {',
1087+
' return x*x;',
1088+
'}'
1089+
].join( '\n' ),
1090+
'errors': [
1091+
{
1092+
'message': 'Displayed return value is `12.0`, but expected `9` instead',
1093+
'type': null
1094+
}
1095+
],
1096+
'output': [
1097+
'/**',
1098+
'* Squares a number.',
1099+
'*',
1100+
'* @param {number} x - input value',
1101+
'* @returns {number} x*x',
1102+
'* @example',
1103+
'* console.log( square( 3.0 ) ); // x squared',
1104+
'* // => 9',
1105+
'*',
1106+
'* console.log( square( 2.0 ) ); // x squared',
1107+
'* // => 4.0',
1108+
'*/',
1109+
'function square( x ) {',
1110+
' return x*x;',
1111+
'}'
1112+
].join( '\n' )
1113+
};
1114+
invalid.push( test );
1115+
1116+
test = {
1117+
'code': [
1118+
'\'use strict\'',
1119+
'',
1120+
'/**',
1121+
'* Squares a number.',
1122+
'*',
1123+
'* @param {number} x - input value',
1124+
'* @returns {number} x*x',
1125+
'* @example',
1126+
'* var y = square( 3.0 ); // oh; interesting',
1127+
'* // returns 12.0',
1128+
'*/',
1129+
'function square( x ) {',
1130+
' return x*x;',
1131+
'}'
1132+
].join( '\n' ),
1133+
'errors': [
1134+
{
1135+
'message': 'Displayed return value is `12.0`, but expected `9` instead',
1136+
'type': null
1137+
}
1138+
],
1139+
'output': [
1140+
'\'use strict\'',
1141+
'',
1142+
'/**',
1143+
'* Squares a number.',
1144+
'*',
1145+
'* @param {number} x - input value',
1146+
'* @returns {number} x*x',
1147+
'* @example',
1148+
'* var y = square( 3.0 ); // oh; interesting',
1149+
'* // returns 9',
1150+
'*/',
1151+
'function square( x ) {',
1152+
' return x*x;',
1153+
'}'
1154+
].join( '\n' )
1155+
};
1156+
invalid.push( test );
1157+
10241158

10251159
// EXPORTS //
10261160

lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-doctest/test/fixtures/valid.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1551,6 +1551,48 @@ test = {
15511551
};
15521552
valid.push( test );
15531553

1554+
test = {
1555+
'code': [
1556+
'/**',
1557+
'* Squares a number.',
1558+
'*',
1559+
'* @param {number} x - input value',
1560+
'* @returns {number} x*x',
1561+
'* @example',
1562+
'* var y = square( 3.0 ); // x squared',
1563+
'* // returns 9.0',
1564+
'*',
1565+
'* y = square( 2.0 ); // x squared',
1566+
'* // returns 4.0',
1567+
'*/',
1568+
'function square( x ) {',
1569+
' return x*x;',
1570+
'}'
1571+
].join( '\n' )
1572+
};
1573+
valid.push( test );
1574+
1575+
test = {
1576+
'code': [
1577+
'/**',
1578+
'* Squares a number.',
1579+
'*',
1580+
'* @param {number} x - input value',
1581+
'* @returns {number} x*x',
1582+
'* @example',
1583+
'* console.log( square( 3.0 ) ); // x squared',
1584+
'* // => 9.0',
1585+
'*',
1586+
'* console.log( square( 2.0 ) ); // x squared',
1587+
'* // => 4.0',
1588+
'*/',
1589+
'function square( x ) {',
1590+
' return x*x;',
1591+
'}'
1592+
].join( '\n' )
1593+
};
1594+
valid.push( test );
1595+
15541596

15551597
// EXPORTS //
15561598

lib/node_modules/@stdlib/_tools/links/create/test/test.cli.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ tape( 'the command-line interface tries to insert an entry for the provided URI
153153

154154
exec( cmd.join( ' ' ), done );
155155

156-
expected = 'Error: duplicate entry. Database already contains an entry for the provided URI: https://stdlib.io/.\n';
156+
expected = 'Error: invalid argument. Database already contains an entry for the provided URI. Value: `https://stdlib.io/`.\n';
157157

158158
function done( error, stdout, stderr ) {
159159
t.strictEqual( error instanceof Error, true, 'returns expected value' );
@@ -180,7 +180,7 @@ tape( 'the command-line interface tries to insert an entry for the provided URI
180180
child.stdin.write( 'A standard library for JavaScript and Node.js\n' );
181181
child.stdin.end();
182182

183-
expected = 'Error: duplicate entry. Database already contains an entry for the provided URI: https://stdlib.io/.\n';
183+
expected = 'Error: invalid argument. Database already contains an entry for the provided URI. Value: `https://stdlib.io/`.\n';
184184

185185
function done( error, stdout, stderr ) {
186186
stdout = stdout.toString();
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
<!--
2+
3+
@license Apache-2.0
4+
5+
Copyright (c) 2026 The Stdlib Authors.
6+
7+
Licensed under the Apache License, Version 2.0 (the "License");
8+
you may not use this file except in compliance with the License.
9+
You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing, software
14+
distributed under the License is distributed on an "AS IS" BASIS,
15+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
See the License for the specific language governing permissions and
17+
limitations under the License.
18+
19+
-->
20+
21+
# Includes
22+
23+
> [remark][remark] plugin to insert content from external Markdown files.
24+
25+
<section class="usage">
26+
27+
## Usage
28+
29+
```javascript
30+
var includes = require( '@stdlib/_tools/remark/plugins/remark-includes' );
31+
```
32+
33+
#### includes( \[options\] )
34+
35+
Attaches a plugin to a [remark][remark] processor in order to insert content from external Markdown files between include comment directives.
36+
37+
<!-- eslint-disable node/no-sync -->
38+
39+
```javascript
40+
var join = require( 'path' ).join;
41+
var remark = require( 'remark' );
42+
43+
var opts = {
44+
'dir': join( __dirname, 'snippets' )
45+
};
46+
47+
var str = '# Hello World!\n';
48+
str += '\n';
49+
str += '<!-- <include path="./foo.md"> -->\n';
50+
str += '\n';
51+
str += '<!-- </include> -->\n';
52+
53+
var vfile = remark().use( includes, opts ).processSync( str );
54+
```
55+
56+
The plugin accepts the following options:
57+
58+
- **dir**: base directory for resolving include paths. Default: `null` (i.e., include paths are resolved relative to the processed file's directory).
59+
60+
By default, include paths are resolved relative to the processed file's directory. Accordingly, when processing an in-memory string without a file path, includes may not be resolved unless a base directory is provided via the `dir` option.
61+
62+
</section>
63+
64+
<!-- /.usage -->
65+
66+
<section class="notes">
67+
68+
## Notes
69+
70+
- The plugin recognizes HTML comments of the form
71+
72+
```html
73+
<!-- <include path="./relative/path/to/file.md"> -->
74+
75+
<!-- </include> -->
76+
```
77+
78+
and inserts the parsed Markdown content of the referenced file between the opening and closing comment tags.
79+
80+
- The opening include directive requires a `path` attribute with a double-quoted value.
81+
82+
- Include blocks must be non-overlapping sibling regions. Nested or overlapping include blocks are not supported.
83+
84+
- If a referenced file cannot be found, the plugin issues a warning and leaves the include block unchanged.
85+
86+
- If an opening include directive does not have a matching closing include directive, the plugin issues a warning and leaves the include block unchanged.
87+
88+
</section>
89+
90+
<!-- /.notes -->
91+
92+
<section class="examples">
93+
94+
## Examples
95+
96+
<!-- eslint no-undef: "error", node/no-sync: "off" -->
97+
98+
```javascript
99+
var join = require( 'path' ).join;
100+
var remark = require( 'remark' );
101+
var readFileSync = require( '@stdlib/fs/read-file' ).sync;
102+
var includes = require( '@stdlib/_tools/remark/plugins/remark-includes' );
103+
104+
// Load a Markdown file...
105+
var fpath = join( __dirname, 'examples', 'fixtures', 'simple.txt' );
106+
var opts = {
107+
'encoding': 'utf8'
108+
};
109+
var file = readFileSync( fpath, opts );
110+
111+
// Insert includes:
112+
var vfile = remark().use( includes, {
113+
'dir': join( __dirname, 'examples', 'fixtures' )
114+
}).processSync( file );
115+
116+
console.log( vfile.contents );
117+
```
118+
119+
</section>
120+
121+
<!-- /.examples -->
122+
123+
<!-- Section for related `stdlib` packages. Do not manually edit this section, as it is automatically populated. -->
124+
125+
<section class="related">
126+
127+
</section>
128+
129+
<!-- /.related -->
130+
131+
<!-- Section for all links. Make sure to keep an empty line after the `section` element and another before the `/section` close. -->
132+
133+
<section class="links">
134+
135+
[remark]: https://github.com/wooorm/remark
136+
137+
</section>
138+
139+
<!-- /.links -->
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Bap
2+
3+
Bip bop.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## Greeting
2+
3+
Beep boop.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Hello World!
2+
3+
<!-- <include path="./foo.txt"> -->
4+
5+
<!-- </include> -->
6+
7+
<!-- <include path="./bar.txt"> -->
8+
9+
<!-- </include> -->

0 commit comments

Comments
 (0)