UNPKG
@comparison-sorting/is-sorted
Version:
latest (0.0.1)
0.0.1
0.0.0
Order validation for JavaScript
comparison-sorting.github.io/is-sorted
comparison-sorting/is-sorted
@comparison-sorting/is-sorted
/
dist
/
index.cjs
3 lines
(2 loc)
•
199 B
JavaScript
View Raw
1
2
3
function
r
(
r,n,t,e
){
if
(t>=e)
return
e;
for
(;++t<e&&!(
r
(n[t-
1
],n[t])>
0
););
return
t}
exports
.
firstInversion
=r,
exports
.
isSorted
=
function
(
n,t,e,o
){
return
r
(n,t,e,o)===o};
//# sourceMappingURL=index.cjs.map