From cdd914b65b908a67ad7ce22331ad164872b6de8c Mon Sep 17 00:00:00 2001 From: stdlib-bot Date: Sun, 12 Jan 2025 03:24:40 +0000 Subject: [PATCH] Auto-generated commit --- CHANGELOG.md | 5 ++++- README.md | 3 +++ docs/types/index.d.ts | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7381b24..4c84d65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@
-## Unreleased (2025-01-11) +## Unreleased (2025-01-12)
@@ -20,6 +20,7 @@ ##### Features +- [`e661213`](https://github.com/stdlib-js/stdlib/commit/e66121352ef767cdb87d19e938b1eccf7970fa3a) - update namespace TypeScript declarations [(#4706)](https://github.com/stdlib-js/stdlib/pull/4706) - [`d11aaf3`](https://github.com/stdlib-js/stdlib/commit/d11aaf3e4ea651384185655584eea9c5b8ca9ae2) - add `isSortedAscending` to namespace - [`8b1548f`](https://github.com/stdlib-js/stdlib/commit/8b1548fb45c1ff131f5edac20cb984344a2d28ec) - update namespace TypeScript declarations [(#3190)](https://github.com/stdlib-js/stdlib/pull/3190) - [`43aa58f`](https://github.com/stdlib-js/stdlib/commit/43aa58f81dcad604f11a5715a1546c015b0a9623) - add `isByteOrder` to namespace @@ -172,6 +173,8 @@ A total of 3 people contributed to this release. Thank you to the following cont
+- [`e661213`](https://github.com/stdlib-js/stdlib/commit/e66121352ef767cdb87d19e938b1eccf7970fa3a) - **feat:** update namespace TypeScript declarations [(#4706)](https://github.com/stdlib-js/stdlib/pull/4706) _(by stdlib-bot)_ +- [`cff470f`](https://github.com/stdlib-js/stdlib/commit/cff470f9608165100c8c122fce70c40b1af864ec) - **docs:** update namespace table of contents (#4708) _(by stdlib-bot, Planeshifter)_ - [`d11aaf3`](https://github.com/stdlib-js/stdlib/commit/d11aaf3e4ea651384185655584eea9c5b8ca9ae2) - **feat:** add `isSortedAscending` to namespace _(by Athan Reines)_ - [`5a848eb`](https://github.com/stdlib-js/stdlib/commit/5a848ebda6a2ff9cc34cfa5cf93ffce65b8bab0e) - **feat:** add `array/base/assert/is-sorted-ascending` _(by Athan Reines)_ - [`1d9e4dd`](https://github.com/stdlib-js/stdlib/commit/1d9e4dd5514ba4f3c1063dff732e37254dc0dd84) - **docs:** add missing comment _(by Athan Reines)_ diff --git a/README.md b/README.md index 6f7541e..75f75c3 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,7 @@ The namespace exports the following: - [`isSafeDataTypeCast( from, to )`][@stdlib/array/base/assert/is-safe-data-type-cast]: determine whether an array data type can be safely cast to another array data type. - [`isSameKindDataTypeCast( from, to )`][@stdlib/array/base/assert/is-same-kind-data-type-cast]: determine whether an array data type can be safely cast to, or is of the same "kind" as, another array data type. - [`isSignedIntegerDataType( value )`][@stdlib/array/base/assert/is-signed-integer-data-type]: test if an input value is a supported array signed integer data type. +- [`isSortedAscending( x )`][@stdlib/array/base/assert/is-sorted-ascending]: test if an array is sorted in ascending order. - [`isUnsignedIntegerDataType( value )`][@stdlib/array/base/assert/is-unsigned-integer-data-type]: test if an input value is a supported array unsigned integer data type. @@ -319,6 +320,8 @@ Copyright © 2016-2025. The Stdlib [Authors][stdlib-authors]. [@stdlib/array/base/assert/is-signed-integer-data-type]: https://github.com/stdlib-js/array-base-assert-is-signed-integer-data-type +[@stdlib/array/base/assert/is-sorted-ascending]: https://github.com/stdlib-js/array-base-assert-is-sorted-ascending + [@stdlib/array/base/assert/is-unsigned-integer-data-type]: https://github.com/stdlib-js/array-base-assert-is-unsigned-integer-data-type diff --git a/docs/types/index.d.ts b/docs/types/index.d.ts index 3fcbbb1..20bcb67 100644 --- a/docs/types/index.d.ts +++ b/docs/types/index.d.ts @@ -42,6 +42,7 @@ import isRealFloatingPointDataType = require( '@stdlib/array-base-assert-is-real import isSafeDataTypeCast = require( '@stdlib/array-base-assert-is-safe-data-type-cast' ); import isSameKindDataTypeCast = require( '@stdlib/array-base-assert-is-same-kind-data-type-cast' ); import isSignedIntegerDataType = require( '@stdlib/array-base-assert-is-signed-integer-data-type' ); +import isSortedAscending = require( '@stdlib/array-base-assert-is-sorted-ascending' ); import isUnsignedIntegerDataType = require( '@stdlib/array-base-assert-is-unsigned-integer-data-type' ); /** @@ -689,6 +690,38 @@ interface Namespace { */ isSignedIntegerDataType: typeof isSignedIntegerDataType; + /** + * Tests if an array is sorted in ascending order. + * + * @param x - input array + * @returns boolean indicating if an array is sorted in ascending order + * + * @example + * var out = ns.isSortedAscending( [ 1, 2, 3 ] ); + * // returns true + * + * @example + * var out = ns.isSortedAscending( [ 3, 2, 1 ] ); + * // returns false + * + * @example + * var out = ns.isSortedAscending( [ 3, 3, 3 ] ); + * // returns true + * + * @example + * var out = ns.isSortedAscending( [ 3 ] ); + * // returns true + * + * @example + * var out = ns.isSortedAscending( [] ); + * // returns false + * + * @example + * var out = ns.isSortedAscending( [ 1, 3, 2 ] ); + * // returns false + */ + isSortedAscending: typeof isSortedAscending; + /** * Tests whether an input value is a supported array unsigned integer data type. *