Skip to content

Commit e85625b

Browse files
committed
feat: add support for ndarray instance annotation and complex instances in generic arrays
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: passed - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: passed - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent 9723242 commit e85625b

6 files changed

Lines changed: 294 additions & 133 deletions

File tree

lib/node_modules/@stdlib/_tools/doctest/compare-values/README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ var compareValues = require( '@stdlib/_tools/doctest/compare-values' );
3232

3333
#### compareValues( actual, expected )
3434

35-
Checks whether a return value is equal to the value of a return annotation. In case of a mismatch, the function returns an error message; otherwise, it returns `null`.
35+
Checks whether a return value is equal to the value of a return annotation.
3636

3737
```javascript
3838
var out = compareValues( 4.126, '~4.13' );
@@ -42,12 +42,14 @@ out = compareValues( 4.126e-13, '~4.13e-13' );
4242
// returns null
4343

4444
out = compareValues( NaN, 'null' );
45-
// returns 'Displayed return value is `null`, but function returns `NaN` instead'
45+
// returns 'Displayed return value is `null`, but expected `NaN` instead'
4646

4747
out = compareValues( 'Hello World', '"Hello World"' );
48-
// returns '`Hello World` should be wrapped in single quotes'
48+
// returns '`"Hello World"` should be wrapped in single quotes'
4949
```
5050

51+
When an actual value does not match the expected value as described by a return annotation, the function returns an error message; otherwise, the function returns `null`.
52+
5153
</section>
5254

5355
<!-- /.usage -->
@@ -68,10 +70,10 @@ out = compareValues( 'Hello World', '"Hello World"' );
6870
var compareValues = require( '@stdlib/_tools/doctest/compare-values' );
6971

7072
console.log( compareValues( true, 'false' ) );
71-
// => 'Displayed return value is `false`, but function returns `true` instead'
73+
// => 'Displayed return value is `false`, but expected `true` instead'
7274

7375
console.log( compareValues( 0.25, '0.26' ) );
74-
// => 'Displayed return value is `0.26`, but function returns `0.25` instead'
76+
// => 'Displayed return value is `0.26`, but expected `0.25` instead'
7577

7678
console.log( compareValues( 23, '23' ) );
7779
// => null
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* @license Apache-2.0
3+
*
4+
* Copyright (c) 2025 The Stdlib Authors.
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
'use strict';
20+
21+
// MODULES //
22+
23+
var Complex128 = require( '@stdlib/complex/float64/ctor' );
24+
var Complex64 = require( '@stdlib/complex/float32/ctor' );
25+
26+
27+
// MAIN //
28+
29+
var ctors = {
30+
'Complex128': Complex128,
31+
'Complex64': Complex64
32+
};
33+
34+
35+
// EXPORTS //
36+
37+
module.exports = ctors;

0 commit comments

Comments
 (0)