@@ -18,17 +18,8 @@ const ERR_CHUNK_INITIAL =
18
18
/** @typedef {import("./ModuleReason.js") } ModuleReason */
19
19
/** @typedef {import("webpack-sources").Source } Source */
20
20
21
- /** @typedef {(a: Module, b: Module) => -1|0|1 } ModuleSortPredicate */
22
- /** @typedef {(m: Module) => boolean } ModuleFilterPredicate */
23
- /** @typedef {(c: Chunk) => boolean } ChunkFilterPredicate */
24
-
25
- /**
26
- * @typedef {Object } Identifiable an object who contains an identifier function property
27
- * @property {() => string } identifier the resource or unique identifier of something
28
- */
29
-
30
21
/**
31
- * @typedef {Object } WithId an object who has an id property
22
+ * @typedef {Object } WithId an object who has an id property *
32
23
* @property {string | number } id the id of the object
33
24
*/
34
25
@@ -71,13 +62,13 @@ const getModulesIdent = set => {
71
62
72
63
/**
73
64
* @template T
74
- * @param {Set <T> } set the set to convert to array
65
+ * @param {SortableSet <T> } set the sortable set to convert to array
75
66
* @returns {Array<T> } the array returned from Array.from(set)
76
67
*/
77
68
const getArray = set => Array . from ( set ) ;
78
69
79
70
/**
80
- * @param {Set <Module> } set the Set to get the count/size of
71
+ * @param {SortableSet <Module> } set the sortable Set to get the count/size of
81
72
* @returns {number } the size of the modules
82
73
*/
83
74
const getModulesSize = set => {
@@ -111,7 +102,7 @@ class Chunk {
111
102
this . entryModule = undefined ;
112
103
/** @private @type {SortableSet<Module> } */
113
104
this . _modules = new SortableSet ( undefined , sortByIdentifier ) ;
114
- /** @private @type {SortableSet<ChunkGroup | WithId > } */
105
+ /** @private @type {SortableSet<ChunkGroup> } */
115
106
this . _groups = new SortableSet ( undefined , sortById ) ;
116
107
/** @type {Source[] } */
117
108
this . files = [ ] ;
@@ -497,14 +488,14 @@ class Chunk {
497
488
}
498
489
499
490
/**
500
- * @param {ModuleSortPredicate = } sortByFn a predicate function used to sort modules
491
+ * @param {function(Module, Module): -1|0|1 = } sortByFn a predicate function used to sort modules
501
492
* @returns {void }
502
493
*/
503
494
sortModules ( sortByFn ) {
504
495
this . _modules . sortWith ( sortByFn || sortById ) ;
505
496
}
506
497
507
- sortItems ( sortChunks ) {
498
+ sortItems ( ) {
508
499
this . sortModules ( ) ;
509
500
}
510
501
@@ -660,8 +651,8 @@ class Chunk {
660
651
661
652
/**
662
653
*
663
- * @param {ModuleFilterPredicate } filterFn predicate function used to filter modules
664
- * @param {ChunkFilterPredicate } filterChunkFn predicate function used to filter chunks
654
+ * @param {function(Module): boolean } filterFn predicate function used to filter modules
655
+ * @param {function(Chunk): boolean } filterChunkFn predicate function used to filter chunks
665
656
* @returns {boolean } return true if module exists in graph
666
657
*/
667
658
hasModuleInGraph ( filterFn , filterChunkFn ) {
0 commit comments