Skip to content

feat: refactor and add protocol support to stats/base/nanrange-by #6440

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 23 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update test.ts
Signed-off-by: Kaushikgtm <[email protected]>
  • Loading branch information
Kaushikgtm authored Mar 29, 2025
commit 57ab24ab623191eea292d6bbb0a65b86cc72c7a6
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* @license Apache-2.0
*
* Copyright (c) 2020 The Stdlib Authors.
* Copyright (c) 2025 The Stdlib Authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,6 +17,7 @@
*/

import nanrangeBy = require( './index' );
import AccessorArray = require( '@stdlib/array/base/accessor' );

const accessor = (): number => {
return 5.0;
Expand All @@ -29,8 +30,8 @@ const accessor = (): number => {
{
const x = new Float64Array( 10 );

nanrangeBy( x.length, x, 1, accessor ); // $ExpectType number
nanrangeBy( x.length, x, 1, accessor, {} ); // $ExpectType number
nanrangeBy( x.length, new AccessorArray( x ), 1, accessor ); // $ExpectType number
nanrangeBy( x.length, new AccessorArray( x ), 1, accessor, {} ); // $ExpectType number
}

// The compiler throws an error if the function is provided a first argument which is not a number...
Expand Down Expand Up @@ -101,8 +102,8 @@ const accessor = (): number => {
{
const x = new Float64Array( 10 );

nanrangeBy.ndarray( x.length, x, 1, 0, accessor ); // $ExpectType number
nanrangeBy.ndarray( x.length, x, 1, 0, accessor, {} ); // $ExpectType number
nanrangeBy.ndarray( x.length, new AccessorArray( x ), 1, 0, accessor ); // $ExpectType number
nanrangeBy.ndarray( x.length, new AccessorArray( x ), 1, 0, accessor, {} ); // $ExpectType number
}

// The compiler throws an error if the `ndarray` method is provided a first argument which is not a number...
Expand Down