diff --git a/src/heapsort.js b/src/dary.js similarity index 95% rename from src/heapsort.js rename to src/dary.js index 2db9fa5..18bc9e0 100644 --- a/src/heapsort.js +++ b/src/dary.js @@ -4,7 +4,7 @@ * */ -export function dary(arity) { +const dary = (arity) => { /** * Note that here we reverse the order of the * comparison operator since when we extract @@ -13,7 +13,7 @@ export function dary(arity) { * and then pop elements from it until it is empty. */ - const sort = function (compare, a, i, j) { + const sort = (compare, a, i, j) => { // Construct the max-heap let k = i + 1; @@ -109,4 +109,6 @@ export function dary(arity) { }; return sort; -} +}; + +export default dary; diff --git a/src/index.js b/src/index.js index 3865e8c..73f4021 100644 --- a/src/index.js +++ b/src/index.js @@ -1 +1 @@ -export * from './heapsort.js'; +export {default as dary} from './dary.js';