UNPKG

@comparison-sorting/specification

Version:
3 lines (2 loc) 1.54 kB
import{copy as r}from"@array-like/copy";import{isSorted as t}from"@comparison-sorting/is-sorted";import{shuffle as o}from"@randomized/random";import{sorted as a}from"@iterable-iterator/sorted";import{range as e}from"@iterable-iterator/range";import{exhaust as i}from"@iterable-iterator/consume";import{list as n}from"@iterable-iterator/list";import{map as m}from"@iterable-iterator/map";import{_chain as c}from"@iterable-iterator/chain";import{product as s}from"@set-theory/cartesian-product";import{star as l}from"@functional-abstraction/functools";import{increasing as p,decreasing as y}from"@total-order/primitive";function f(t,o,a,e){const i=Array.prototype.slice.call(o,a,e);i.sort(t),r(i,0,e-a,o,a)}var d=(r,t)=>p(r,t);const h=r=>a(d,r),b=(r,a,i,n,m,c)=>{const s=h(e(m)),l=n.from(s);o(l,0,m),i(c,l,0,m),r.is(m,l.length,"check length"),r.is(void 0,l[-1],"check left boundary"),r.is(void 0,l[m],"check right boundary"),r.true(t(c,l,0,m),"check sorted"),r.deepEqual(s,h(l),"check data")};b.title=(r,t,o,a,e,i)=>null!=r?r:`${t} (new ${a.name}(${e}), ${i.name})`;const u={compare:[d,(r,t)=>y(r,t)],length:[0,1,2,10,63,64,65],array:[Array,Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array]},E=r=>m(r=>[r],void 0===r[Symbol.iterator]?[r]:r);function g(r,t,o){o=Object.assign({},u,o),i(m(t=>{l((t,o,a,e,i)=>{i.BYTES_PER_ELEMENT&&e>2**(8*i.BYTES_PER_ELEMENT)||r(b,t,o,i,e,a)},n(c(t)))},s([t,E(o.compare),E(o.length),E(o.array)],1)))}export{f as mock,g as test}; //# sourceMappingURL=index.modern.js.map