feat: refactoring project

This commit is contained in:
Carlos
2024-11-23 14:56:07 -05:00
parent f0c2a50c18
commit 1c6db5818d
2351 changed files with 39323 additions and 60326 deletions

View File

@@ -15,15 +15,16 @@ const NONE = Symbol("not sorted");
class SortableSet extends Set {
/**
* Create a new sortable set
* @template T
* @param {Iterable<T>=} initialIterable The initial iterable value
* @typedef {function(T, T): number} SortFunction
* @param {SortFunction=} defaultSort Default sorting function
* @param {SortFunction<T>=} defaultSort Default sorting function
*/
constructor(initialIterable, defaultSort) {
super(initialIterable);
/**
* @private
* @type {undefined | function(T, T): number}}
* @type {undefined | SortFunction<T>}
*/
this._sortFn = defaultSort;
/**
@@ -76,7 +77,7 @@ class SortableSet extends Set {
/**
* Sort with a comparer function
* @param {SortFunction} sortFn Sorting comparer function
* @param {SortFunction<T> | undefined} sortFn Sorting comparer function
* @returns {void}
*/
sortWith(sortFn) {