ts-sort-quick
sync + callback + Promise + Async/Await style quicksort implementation in typescript
Install
npm install ts-sort-quick --save-devyarn add ts-sort-quick -D
commonjs use [sync + callback + Promise + Async/Await]
var quickSort = quickSort; var quickSortSync = quickSortSync;console// output: [2,3, 4, 27, 57,100,343] var quickSortAsync = quickSortAsync; var quickSortAsyncW = quickSortAsync; { var array4 = 3457210027343 var les = await console // output: [2,3, 4, 27, 57,100,343]} var quickSortAsyncAwait = quickSortAsyncAwait; { var array4 = 3457210027343 var les = await console // output: [2,3, 4, 27, 57,100,343]}
es6 use [sync + callback + Promise + Async Await]
console { var array4 = 3457210027343 var les = await console // output: [2,3, 4, 27, 57,100,343]}
umd web browser use [sync + callback + Promise + Async Await]
<script src="https://unpkg.com/ts-sort-quick@1.0.1/umd/index.js"></script> tsSortQuick console tsSortQuick { var array4 = 3457210027343 var les = await tsSortQuick console // output: [2,3, 4, 27, 57,100,343]}
API
quickSortSync: (arr: number[]) => any;
quickSort: (arr: number[], callback: (data: number) => void) => any;
quickSortAsync: (arr: number[]) => any;
quickSortAsyncAwait(arr: number[]): Promise;
- arr - The array to sort in place
- callback - function to get sort array result