@@ -42,6 +42,7 @@ import isRealFloatingPointDataType = require( '@stdlib/array/base/assert/is-real
42
42
import isSafeDataTypeCast = require( '@stdlib/array/base/assert/is-safe-data-type-cast' ) ;
43
43
import isSameKindDataTypeCast = require( '@stdlib/array/base/assert/is-same-kind-data-type-cast' ) ;
44
44
import isSignedIntegerDataType = require( '@stdlib/array/base/assert/is-signed-integer-data-type' ) ;
45
+ import isSortedAscending = require( '@stdlib/array/base/assert/is-sorted-ascending' ) ;
45
46
import isUnsignedIntegerDataType = require( '@stdlib/array/base/assert/is-unsigned-integer-data-type' ) ;
46
47
47
48
/**
@@ -689,6 +690,38 @@ interface Namespace {
689
690
*/
690
691
isSignedIntegerDataType : typeof isSignedIntegerDataType ;
691
692
693
+ /**
694
+ * Tests if an array is sorted in ascending order.
695
+ *
696
+ * @param x - input array
697
+ * @returns boolean indicating if an array is sorted in ascending order
698
+ *
699
+ * @example
700
+ * var out = ns.isSortedAscending( [ 1, 2, 3 ] );
701
+ * // returns true
702
+ *
703
+ * @example
704
+ * var out = ns.isSortedAscending( [ 3, 2, 1 ] );
705
+ * // returns false
706
+ *
707
+ * @example
708
+ * var out = ns.isSortedAscending( [ 3, 3, 3 ] );
709
+ * // returns true
710
+ *
711
+ * @example
712
+ * var out = ns.isSortedAscending( [ 3 ] );
713
+ * // returns true
714
+ *
715
+ * @example
716
+ * var out = ns.isSortedAscending( [] );
717
+ * // returns false
718
+ *
719
+ * @example
720
+ * var out = ns.isSortedAscending( [ 1, 3, 2 ] );
721
+ * // returns false
722
+ */
723
+ isSortedAscending : typeof isSortedAscending ;
724
+
692
725
/**
693
726
* Tests whether an input value is a supported array unsigned integer data type.
694
727
*
0 commit comments