From 58f350272a08facba66473c75187996bf21e3a72 Mon Sep 17 00:00:00 2001 From: Jaysukh-409 Date: Wed, 12 Jun 2024 18:23:20 +0530 Subject: [PATCH] feat: add boolean dtype support in array/next-dtype --- .../array/next-dtype/docs/types/index.d.ts | 18 +++++++++++++++++- .../array/next-dtype/docs/types/test.ts | 4 +++- .../array/next-dtype/lib/next_dtypes.json | 1 + 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/lib/node_modules/@stdlib/array/next-dtype/docs/types/index.d.ts b/lib/node_modules/@stdlib/array/next-dtype/docs/types/index.d.ts index b33a3ab9ad06..8d6818d48125 100644 --- a/lib/node_modules/@stdlib/array/next-dtype/docs/types/index.d.ts +++ b/lib/node_modules/@stdlib/array/next-dtype/docs/types/index.d.ts @@ -1,7 +1,7 @@ /* * @license Apache-2.0 * -* Copyright (c) 2021 The Stdlib Authors. +* Copyright (c) 2024 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. @@ -192,6 +192,22 @@ declare function nextDataType( dtype: 'uint8c' ): 'uint16'; // eslint-disable-li */ declare function nextDataType( dtype: 'generic' ): number; // eslint-disable-line @typescript-eslint/unified-signatures +/** +* Returns the next larger array data type of the same kind. +* +* ## Notes +* +* - If a data type does not have a next larger data type or the next larger type is not supported, the function returns `-1`. +* +* @param dtype - array data type +* @returns next larger data type +* +* @example +* var dt = nextDataType( 'bool' ); +* // returns -1 +*/ +declare function nextDataType( dtype: 'bool' ): number; // eslint-disable-line @typescript-eslint/unified-signatures + /** * Returns the next larger array data type of the same kind. * diff --git a/lib/node_modules/@stdlib/array/next-dtype/docs/types/test.ts b/lib/node_modules/@stdlib/array/next-dtype/docs/types/test.ts index a58ef491875b..5f7e95e6b5cf 100644 --- a/lib/node_modules/@stdlib/array/next-dtype/docs/types/test.ts +++ b/lib/node_modules/@stdlib/array/next-dtype/docs/types/test.ts @@ -1,7 +1,7 @@ /* * @license Apache-2.0 * -* Copyright (c) 2021 The Stdlib Authors. +* Copyright (c) 2024 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. @@ -31,6 +31,8 @@ import nextDataType = require( './index' ); nextDataType( 'complex128' ); // $ExpectType number nextDataType( 'complex64' ); // $ExpectType "complex128" + nextDataType( 'bool' ); // $ExpectType number + nextDataType( 'float64' ); // $ExpectType number nextDataType( 'float32' ); // $ExpectType "float64" diff --git a/lib/node_modules/@stdlib/array/next-dtype/lib/next_dtypes.json b/lib/node_modules/@stdlib/array/next-dtype/lib/next_dtypes.json index fe672ac24ae9..65951d72ad00 100644 --- a/lib/node_modules/@stdlib/array/next-dtype/lib/next_dtypes.json +++ b/lib/node_modules/@stdlib/array/next-dtype/lib/next_dtypes.json @@ -9,6 +9,7 @@ "uint8": "uint16", "uint8c": "uint16", "generic": -1, + "bool": -1, "complex64": "complex128", "complex128": -1 }