webpack 5.90.3 → 5.92.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of webpack might be problematic. Click here for more details.

Files changed (257) hide show
  1. package/README.md +5 -5
  2. package/bin/webpack.js +6 -3
  3. package/lib/APIPlugin.js +14 -6
  4. package/lib/AutomaticPrefetchPlugin.js +1 -1
  5. package/lib/BannerPlugin.js +3 -1
  6. package/lib/Cache.js +8 -2
  7. package/lib/CacheFacade.js +3 -3
  8. package/lib/Chunk.js +7 -4
  9. package/lib/ChunkGraph.js +52 -25
  10. package/lib/ChunkGroup.js +23 -17
  11. package/lib/CleanPlugin.js +8 -6
  12. package/lib/Compilation.js +295 -120
  13. package/lib/Compiler.js +223 -87
  14. package/lib/ConcatenationScope.js +3 -3
  15. package/lib/ConditionalInitFragment.js +4 -5
  16. package/lib/ContextModule.js +95 -41
  17. package/lib/ContextModuleFactory.js +4 -2
  18. package/lib/ContextReplacementPlugin.js +3 -2
  19. package/lib/DefinePlugin.js +18 -6
  20. package/lib/Dependency.js +12 -10
  21. package/lib/DependencyTemplate.js +17 -7
  22. package/lib/DllModule.js +1 -0
  23. package/lib/DllReferencePlugin.js +7 -3
  24. package/lib/EntryOptionPlugin.js +4 -1
  25. package/lib/EntryPlugin.js +6 -1
  26. package/lib/Entrypoint.js +1 -1
  27. package/lib/EvalDevToolModulePlugin.js +11 -0
  28. package/lib/ExportsInfo.js +23 -8
  29. package/lib/ExternalModule.js +160 -35
  30. package/lib/ExternalModuleFactoryPlugin.js +37 -2
  31. package/lib/FileSystemInfo.js +69 -42
  32. package/lib/FlagDependencyExportsPlugin.js +21 -7
  33. package/lib/Generator.js +4 -4
  34. package/lib/HookWebpackError.js +2 -2
  35. package/lib/HotModuleReplacementPlugin.js +108 -45
  36. package/lib/IgnorePlugin.js +4 -1
  37. package/lib/InitFragment.js +5 -3
  38. package/lib/LibManifestPlugin.js +17 -9
  39. package/lib/Module.js +41 -14
  40. package/lib/ModuleFactory.js +3 -3
  41. package/lib/ModuleFilenameHelpers.js +30 -17
  42. package/lib/ModuleGraph.js +60 -31
  43. package/lib/ModuleGraphConnection.js +2 -1
  44. package/lib/MultiCompiler.js +62 -9
  45. package/lib/NodeStuffPlugin.js +14 -3
  46. package/lib/NormalModule.js +13 -13
  47. package/lib/NormalModuleFactory.js +18 -9
  48. package/lib/NormalModuleReplacementPlugin.js +5 -1
  49. package/lib/Parser.js +1 -1
  50. package/lib/PlatformPlugin.js +39 -0
  51. package/lib/ProgressPlugin.js +1 -1
  52. package/lib/ProvidePlugin.js +3 -1
  53. package/lib/RawModule.js +2 -1
  54. package/lib/RecordIdsPlugin.js +4 -4
  55. package/lib/ResolverFactory.js +6 -4
  56. package/lib/RuntimeModule.js +4 -4
  57. package/lib/RuntimePlugin.js +1 -0
  58. package/lib/RuntimeTemplate.js +124 -52
  59. package/lib/SourceMapDevToolPlugin.js +4 -1
  60. package/lib/Stats.js +11 -4
  61. package/lib/Template.js +5 -5
  62. package/lib/TemplatedPathPlugin.js +48 -7
  63. package/lib/Watching.js +67 -60
  64. package/lib/WebpackError.js +6 -6
  65. package/lib/WebpackOptionsApply.js +18 -5
  66. package/lib/asset/AssetGenerator.js +15 -0
  67. package/lib/asset/RawDataUrlModule.js +3 -1
  68. package/lib/async-modules/AwaitDependenciesInitFragment.js +2 -2
  69. package/lib/buildChunkGraph.js +120 -67
  70. package/lib/cache/IdleFileCachePlugin.js +8 -3
  71. package/lib/cache/MemoryCachePlugin.js +1 -1
  72. package/lib/cache/MemoryWithGcCachePlugin.js +6 -2
  73. package/lib/cache/PackFileCacheStrategy.js +51 -18
  74. package/lib/cache/ResolverCachePlugin.js +22 -14
  75. package/lib/cache/getLazyHashedEtag.js +2 -2
  76. package/lib/cli.js +5 -5
  77. package/lib/config/browserslistTargetHandler.js +7 -1
  78. package/lib/config/defaults.js +108 -34
  79. package/lib/config/normalization.js +3 -1
  80. package/lib/config/target.js +18 -11
  81. package/lib/container/ContainerEntryDependency.js +2 -1
  82. package/lib/container/ContainerEntryModule.js +4 -2
  83. package/lib/container/ContainerPlugin.js +14 -10
  84. package/lib/container/FallbackModule.js +1 -1
  85. package/lib/container/RemoteRuntimeModule.js +12 -3
  86. package/lib/css/CssExportsGenerator.js +68 -25
  87. package/lib/css/CssGenerator.js +34 -6
  88. package/lib/css/CssLoadingRuntimeModule.js +217 -98
  89. package/lib/css/CssModulesPlugin.js +238 -107
  90. package/lib/css/CssParser.js +24 -15
  91. package/lib/css/walkCssTokens.js +1 -1
  92. package/lib/debug/ProfilingPlugin.js +28 -3
  93. package/lib/dependencies/AMDDefineDependencyParserPlugin.js +9 -5
  94. package/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js +4 -1
  95. package/lib/dependencies/CommonJsDependencyHelpers.js +2 -1
  96. package/lib/dependencies/CommonJsExportRequireDependency.js +33 -18
  97. package/lib/dependencies/CommonJsExportsDependency.js +13 -5
  98. package/lib/dependencies/CommonJsExportsParserPlugin.js +20 -15
  99. package/lib/dependencies/CommonJsImportsParserPlugin.js +1 -2
  100. package/lib/dependencies/ContextDependencyHelpers.js +49 -29
  101. package/lib/dependencies/ContextElementDependency.js +8 -1
  102. package/lib/dependencies/CssExportDependency.js +2 -2
  103. package/lib/dependencies/CssLocalIdentifierDependency.js +71 -9
  104. package/lib/dependencies/CssUrlDependency.js +10 -7
  105. package/lib/dependencies/ExportsInfoDependency.js +5 -4
  106. package/lib/dependencies/ExternalModuleDependency.js +4 -2
  107. package/lib/dependencies/ExternalModuleInitFragment.js +5 -3
  108. package/lib/dependencies/HarmonyEvaluatedImportSpecifierDependency.js +4 -4
  109. package/lib/dependencies/HarmonyExportDependencyParserPlugin.js +43 -23
  110. package/lib/dependencies/HarmonyExportHeaderDependency.js +1 -1
  111. package/lib/dependencies/HarmonyExportImportedSpecifierDependency.js +73 -32
  112. package/lib/dependencies/HarmonyExportInitFragment.js +10 -2
  113. package/lib/dependencies/HarmonyImportDependency.js +28 -12
  114. package/lib/dependencies/HarmonyImportDependencyParserPlugin.js +70 -19
  115. package/lib/dependencies/HarmonyImportSideEffectDependency.js +7 -6
  116. package/lib/dependencies/HarmonyImportSpecifierDependency.js +47 -35
  117. package/lib/dependencies/ImportDependency.js +9 -2
  118. package/lib/dependencies/ImportEagerDependency.js +4 -2
  119. package/lib/dependencies/ImportMetaContextDependency.js +7 -0
  120. package/lib/dependencies/ImportMetaContextDependencyParserPlugin.js +25 -14
  121. package/lib/dependencies/ImportMetaPlugin.js +1 -1
  122. package/lib/dependencies/ImportParserPlugin.js +15 -5
  123. package/lib/dependencies/ImportWeakDependency.js +4 -2
  124. package/lib/dependencies/LoaderDependency.js +2 -1
  125. package/lib/dependencies/LoaderImportDependency.js +2 -1
  126. package/lib/dependencies/LoaderPlugin.js +2 -2
  127. package/lib/dependencies/ModuleDependency.js +4 -5
  128. package/lib/dependencies/PureExpressionDependency.js +64 -47
  129. package/lib/dependencies/RequireContextPlugin.js +1 -1
  130. package/lib/dependencies/RequireEnsureDependenciesBlockParserPlugin.js +26 -14
  131. package/lib/dependencies/RequireEnsureDependency.js +1 -1
  132. package/lib/dependencies/URLDependency.js +7 -4
  133. package/lib/dependencies/WorkerDependency.js +1 -1
  134. package/lib/dependencies/WorkerPlugin.js +2 -1
  135. package/lib/dependencies/getFunctionExpression.js +3 -1
  136. package/lib/esm/ModuleChunkLoadingRuntimeModule.js +92 -3
  137. package/lib/hmr/LazyCompilationPlugin.js +2 -2
  138. package/lib/ids/ChunkModuleIdRangePlugin.js +1 -1
  139. package/lib/ids/DeterministicChunkIdsPlugin.js +1 -1
  140. package/lib/ids/DeterministicModuleIdsPlugin.js +1 -1
  141. package/lib/ids/IdHelpers.js +6 -6
  142. package/lib/ids/NamedChunkIdsPlugin.js +1 -1
  143. package/lib/ids/NamedModuleIdsPlugin.js +1 -1
  144. package/lib/ids/SyncModuleIdsPlugin.js +2 -2
  145. package/lib/index.js +11 -0
  146. package/lib/javascript/BasicEvaluatedExpression.js +2 -2
  147. package/lib/javascript/ChunkHelpers.js +2 -2
  148. package/lib/javascript/CommonJsChunkFormatPlugin.js +1 -1
  149. package/lib/javascript/JavascriptGenerator.js +0 -1
  150. package/lib/javascript/JavascriptModulesPlugin.js +174 -17
  151. package/lib/javascript/JavascriptParser.js +204 -71
  152. package/lib/javascript/JavascriptParserHelpers.js +1 -1
  153. package/lib/javascript/StartupHelpers.js +22 -5
  154. package/lib/library/AbstractLibraryPlugin.js +2 -2
  155. package/lib/library/AmdLibraryPlugin.js +2 -2
  156. package/lib/library/AssignLibraryPlugin.js +3 -3
  157. package/lib/library/ExportPropertyLibraryPlugin.js +2 -2
  158. package/lib/library/JsonpLibraryPlugin.js +2 -2
  159. package/lib/library/ModuleLibraryPlugin.js +2 -2
  160. package/lib/library/SystemLibraryPlugin.js +2 -2
  161. package/lib/library/UmdLibraryPlugin.js +33 -12
  162. package/lib/logging/Logger.js +27 -2
  163. package/lib/logging/createConsoleLogger.js +13 -9
  164. package/lib/node/CommonJsChunkLoadingPlugin.js +2 -1
  165. package/lib/node/NodeEnvironmentPlugin.js +14 -8
  166. package/lib/node/NodeTemplatePlugin.js +1 -1
  167. package/lib/node/NodeWatchFileSystem.js +37 -26
  168. package/lib/node/ReadFileChunkLoadingRuntimeModule.js +2 -1
  169. package/lib/node/ReadFileCompileWasmPlugin.js +1 -1
  170. package/lib/node/RequireChunkLoadingRuntimeModule.js +2 -1
  171. package/lib/node/nodeConsole.js +24 -1
  172. package/lib/optimize/AggressiveMergingPlugin.js +1 -1
  173. package/lib/optimize/AggressiveSplittingPlugin.js +1 -0
  174. package/lib/optimize/ConcatenatedModule.js +140 -121
  175. package/lib/optimize/EnsureChunkConditionsPlugin.js +1 -1
  176. package/lib/optimize/InnerGraph.js +8 -3
  177. package/lib/optimize/InnerGraphPlugin.js +36 -13
  178. package/lib/optimize/LimitChunkCountPlugin.js +1 -2
  179. package/lib/optimize/ModuleConcatenationPlugin.js +13 -3
  180. package/lib/optimize/RealContentHashPlugin.js +3 -3
  181. package/lib/optimize/RemoveParentModulesPlugin.js +1 -0
  182. package/lib/optimize/RuntimeChunkPlugin.js +6 -1
  183. package/lib/optimize/SideEffectsFlagPlugin.js +48 -17
  184. package/lib/optimize/SplitChunksPlugin.js +10 -10
  185. package/lib/performance/SizeLimitsPlugin.js +13 -2
  186. package/lib/rules/ObjectMatcherRulePlugin.js +15 -1
  187. package/lib/rules/RuleSetCompiler.js +9 -7
  188. package/lib/runtime/EnsureChunkRuntimeModule.js +2 -1
  189. package/lib/runtime/GetTrustedTypesPolicyRuntimeModule.js +2 -1
  190. package/lib/runtime/LoadScriptRuntimeModule.js +1 -1
  191. package/lib/runtime/StartupChunkDependenciesPlugin.js +1 -1
  192. package/lib/schemes/HttpUriPlugin.js +1 -1
  193. package/lib/serialization/BinaryMiddleware.js +4 -4
  194. package/lib/serialization/FileMiddleware.js +4 -3
  195. package/lib/serialization/NullPrototypeObjectSerializer.js +2 -2
  196. package/lib/serialization/ObjectMiddleware.js +8 -5
  197. package/lib/serialization/PlainObjectSerializer.js +2 -2
  198. package/lib/serialization/Serializer.js +19 -0
  199. package/lib/serialization/SerializerMiddleware.js +2 -2
  200. package/lib/serialization/SingleItemMiddleware.js +2 -2
  201. package/lib/serialization/types.js +1 -1
  202. package/lib/sharing/ConsumeSharedModule.js +2 -2
  203. package/lib/sharing/ConsumeSharedPlugin.js +17 -3
  204. package/lib/sharing/ConsumeSharedRuntimeModule.js +9 -2
  205. package/lib/sharing/ProvideSharedPlugin.js +13 -6
  206. package/lib/sharing/resolveMatchedConfigs.js +3 -3
  207. package/lib/sharing/utils.js +13 -6
  208. package/lib/stats/DefaultStatsFactoryPlugin.js +20 -20
  209. package/lib/stats/DefaultStatsPrinterPlugin.js +1 -1
  210. package/lib/stats/StatsFactory.js +2 -2
  211. package/lib/stats/StatsPrinter.js +6 -6
  212. package/lib/util/ArrayQueue.js +14 -21
  213. package/lib/util/AsyncQueue.js +1 -1
  214. package/lib/util/Queue.js +8 -2
  215. package/lib/util/SortableSet.js +16 -4
  216. package/lib/util/StackedCacheMap.js +26 -0
  217. package/lib/util/TupleQueue.js +8 -2
  218. package/lib/util/WeakTupleMap.js +57 -13
  219. package/lib/util/binarySearchBounds.js +1 -1
  220. package/lib/util/cleverMerge.js +26 -13
  221. package/lib/util/comparators.js +37 -15
  222. package/lib/util/conventions.js +129 -0
  223. package/lib/util/createHash.js +3 -5
  224. package/lib/util/deprecation.js +3 -3
  225. package/lib/util/deterministicGrouping.js +2 -2
  226. package/lib/util/findGraphRoots.js +1 -1
  227. package/lib/util/fs.js +383 -69
  228. package/lib/util/hash/BatchedHash.js +3 -0
  229. package/lib/util/hash/xxhash64.js +2 -2
  230. package/lib/util/identifier.js +5 -5
  231. package/lib/util/mergeScope.js +79 -0
  232. package/lib/util/runtime.js +2 -17
  233. package/lib/util/semver.js +3 -0
  234. package/lib/util/smartGrouping.js +3 -3
  235. package/lib/wasm-async/AsyncWasmLoadingRuntimeModule.js +4 -2
  236. package/lib/wasm-async/AsyncWebAssemblyGenerator.js +1 -1
  237. package/lib/wasm-async/AsyncWebAssemblyJavascriptGenerator.js +4 -2
  238. package/lib/wasm-async/AsyncWebAssemblyModulesPlugin.js +3 -3
  239. package/lib/wasm-sync/WasmChunkLoadingRuntimeModule.js +16 -7
  240. package/lib/wasm-sync/WebAssemblyGenerator.js +40 -19
  241. package/lib/wasm-sync/WebAssemblyModulesPlugin.js +1 -1
  242. package/lib/wasm-sync/WebAssemblyParser.js +7 -4
  243. package/lib/wasm-sync/WebAssemblyUtils.js +2 -1
  244. package/lib/web/FetchCompileWasmPlugin.js +1 -1
  245. package/lib/web/JsonpChunkLoadingRuntimeModule.js +3 -2
  246. package/lib/webpack.js +19 -6
  247. package/lib/webworker/ImportScriptsChunkLoadingRuntimeModule.js +2 -1
  248. package/package.json +40 -39
  249. package/schemas/WebpackOptions.check.js +1 -1
  250. package/schemas/WebpackOptions.json +97 -8
  251. package/schemas/plugins/BannerPlugin.check.js +1 -1
  252. package/schemas/plugins/BannerPlugin.json +5 -1
  253. package/schemas/plugins/css/CssAutoGeneratorOptions.check.js +1 -1
  254. package/schemas/plugins/css/CssGeneratorOptions.check.js +1 -1
  255. package/schemas/plugins/css/CssGlobalGeneratorOptions.check.js +1 -1
  256. package/schemas/plugins/css/CssModuleGeneratorOptions.check.js +1 -1
  257. package/types.d.ts +1826 -639
package/lib/util/fs.js CHANGED
@@ -11,7 +11,8 @@ const path = require("path");
11
11
  /** @typedef {import("../FileSystemInfo").FileSystemInfoEntry} FileSystemInfoEntry */
12
12
 
13
13
  /**
14
- * @typedef {Object} IStats
14
+ * @template T
15
+ * @typedef {object} IStatsBase
15
16
  * @property {() => boolean} isFile
16
17
  * @property {() => boolean} isDirectory
17
18
  * @property {() => boolean} isBlockDevice
@@ -19,20 +20,20 @@ const path = require("path");
19
20
  * @property {() => boolean} isSymbolicLink
20
21
  * @property {() => boolean} isFIFO
21
22
  * @property {() => boolean} isSocket
22
- * @property {number | bigint} dev
23
- * @property {number | bigint} ino
24
- * @property {number | bigint} mode
25
- * @property {number | bigint} nlink
26
- * @property {number | bigint} uid
27
- * @property {number | bigint} gid
28
- * @property {number | bigint} rdev
29
- * @property {number | bigint} size
30
- * @property {number | bigint} blksize
31
- * @property {number | bigint} blocks
32
- * @property {number | bigint} atimeMs
33
- * @property {number | bigint} mtimeMs
34
- * @property {number | bigint} ctimeMs
35
- * @property {number | bigint} birthtimeMs
23
+ * @property {T} dev
24
+ * @property {T} ino
25
+ * @property {T} mode
26
+ * @property {T} nlink
27
+ * @property {T} uid
28
+ * @property {T} gid
29
+ * @property {T} rdev
30
+ * @property {T} size
31
+ * @property {T} blksize
32
+ * @property {T} blocks
33
+ * @property {T} atimeMs
34
+ * @property {T} mtimeMs
35
+ * @property {T} ctimeMs
36
+ * @property {T} birthtimeMs
36
37
  * @property {Date} atime
37
38
  * @property {Date} mtime
38
39
  * @property {Date} ctime
@@ -40,7 +41,15 @@ const path = require("path");
40
41
  */
41
42
 
42
43
  /**
43
- * @typedef {Object} IDirent
44
+ * @typedef {IStatsBase<number>} IStats
45
+ */
46
+
47
+ /**
48
+ * @typedef {IStatsBase<bigint> & { atimeNs: bigint, mtimeNs: bigint, ctimeNs: bigint, birthtimeNs: bigint }} IBigIntStats
49
+ */
50
+
51
+ /**
52
+ * @typedef {object} Dirent
44
53
  * @property {() => boolean} isFile
45
54
  * @property {() => boolean} isDirectory
46
55
  * @property {() => boolean} isBlockDevice
@@ -48,21 +57,31 @@ const path = require("path");
48
57
  * @property {() => boolean} isSymbolicLink
49
58
  * @property {() => boolean} isFIFO
50
59
  * @property {() => boolean} isSocket
51
- * @property {string | Buffer} name
60
+ * @property {string} name
61
+ * @property {string} path
52
62
  */
53
63
 
54
- /** @typedef {function((NodeJS.ErrnoException | null)=): void} Callback */
55
- /** @typedef {function((NodeJS.ErrnoException | null)=, Buffer=): void} BufferCallback */
56
- /** @typedef {function((NodeJS.ErrnoException | null)=, Buffer|string=): void} BufferOrStringCallback */
57
- /** @typedef {function((NodeJS.ErrnoException | null)=, (string | Buffer)[] | IDirent[]=): void} DirentArrayCallback */
58
- /** @typedef {function((NodeJS.ErrnoException | null)=, string=): void} StringCallback */
59
- /** @typedef {function((NodeJS.ErrnoException | null)=, number=): void} NumberCallback */
60
- /** @typedef {function((NodeJS.ErrnoException | null)=, IStats=): void} StatsCallback */
61
- /** @typedef {function((NodeJS.ErrnoException | Error | null)=, any=): void} ReadJsonCallback */
62
- /** @typedef {function((NodeJS.ErrnoException | Error | null)=, IStats|string=): void} LstatReadlinkAbsoluteCallback */
64
+ /** @typedef {string | number | boolean | null} JsonPrimitive */
65
+ /** @typedef {JsonValue[]} JsonArray */
66
+ /** @typedef {JsonPrimitive | JsonObject | JsonArray} JsonValue */
67
+ /** @typedef {{[Key in string]: JsonValue} & {[Key in string]?: JsonValue | undefined}} JsonObject */
68
+
69
+ /** @typedef {function(NodeJS.ErrnoException | null): void} NoParamCallback */
70
+ /** @typedef {function(NodeJS.ErrnoException | null, string=): void} StringCallback */
71
+ /** @typedef {function(NodeJS.ErrnoException | null, Buffer=): void} BufferCallback */
72
+ /** @typedef {function(NodeJS.ErrnoException | null, (string | Buffer)=): void} StringOrBufferCallback */
73
+ /** @typedef {function(NodeJS.ErrnoException | null, (string[])=): void} ReaddirStringCallback */
74
+ /** @typedef {function(NodeJS.ErrnoException | null, (Buffer[])=): void} ReaddirBufferCallback */
75
+ /** @typedef {function(NodeJS.ErrnoException | null, (string[] | Buffer[])=): void} ReaddirStringOrBufferCallback */
76
+ /** @typedef {function(NodeJS.ErrnoException | null, (Dirent[])=): void} ReaddirDirentCallback */
77
+ /** @typedef {function(NodeJS.ErrnoException | null, IStats=): void} StatsCallback */
78
+ /** @typedef {function(NodeJS.ErrnoException | null, IBigIntStats=): void} BigIntStatsCallback */
79
+ /** @typedef {function(NodeJS.ErrnoException | null, (IStats | IBigIntStats)=): void} StatsOrBigIntStatsCallback */
80
+ /** @typedef {function(NodeJS.ErrnoException | null, number=): void} NumberCallback */
81
+ /** @typedef {function(NodeJS.ErrnoException | Error | null, JsonObject=): void} ReadJsonCallback */
63
82
 
64
83
  /**
65
- * @typedef {Object} WatcherInfo
84
+ * @typedef {object} WatcherInfo
66
85
  * @property {Set<string>} changes get current aggregated changes that have not yet send to callback
67
86
  * @property {Set<string>} removals get current aggregated removals that have not yet send to callback
68
87
  * @property {Map<string, FileSystemInfoEntry | "ignore">} fileTimeInfoEntries get info about files
@@ -71,7 +90,7 @@ const path = require("path");
71
90
 
72
91
  // TODO webpack 6 deprecate missing getInfo
73
92
  /**
74
- * @typedef {Object} Watcher
93
+ * @typedef {object} Watcher
75
94
  * @property {function(): void} close closes the watcher and all underlying file watchers
76
95
  * @property {function(): void} pause closes the watcher, but keeps underlying file watchers alive until the next watch call
77
96
  * @property {function(): Set<string>=} getAggregatedChanges get current aggregated changes that have not yet send to callback
@@ -85,59 +104,348 @@ const path = require("path");
85
104
  * @callback WatchMethod
86
105
  * @param {Iterable<string>} files watched files
87
106
  * @param {Iterable<string>} directories watched directories
88
- * @param {Iterable<string>} missing watched exitance entries
107
+ * @param {Iterable<string>} missing watched existence entries
89
108
  * @param {number} startTime timestamp of start time
90
109
  * @param {WatchOptions} options options object
91
- * @param {function(Error=, Map<string, FileSystemInfoEntry | "ignore">, Map<string, FileSystemInfoEntry | "ignore">, Set<string>, Set<string>): void} callback aggregated callback
110
+ * @param {function(Error | null, Map<string, FileSystemInfoEntry | "ignore">, Map<string, FileSystemInfoEntry | "ignore">, Set<string>, Set<string>): void} callback aggregated callback
92
111
  * @param {function(string, number): void} callbackUndelayed callback when the first change was detected
93
112
  * @returns {Watcher} a watcher
94
113
  */
95
114
 
96
- // TODO webpack 6 make optional methods required
115
+ // TODO webpack 6 make optional methods required and avoid using non standard methods like `join`, `relative`, `dirname`, move IntermediateFileSystemExtras methods to InputFilesystem or OutputFilesystem
116
+
117
+ /**
118
+ * @typedef {string | Buffer | URL} PathLike
119
+ */
120
+
121
+ /**
122
+ * @typedef {PathLike | number} PathOrFileDescriptor
123
+ */
124
+
125
+ /**
126
+ * @typedef {object} ObjectEncodingOptions
127
+ * @property {BufferEncoding | null | undefined} [encoding]
128
+ */
129
+
130
+ /**
131
+ * @typedef {{
132
+ * (path: PathOrFileDescriptor, options: ({ encoding?: null | undefined, flag?: string | undefined } & import("events").Abortable) | undefined | null, callback: BufferCallback): void;
133
+ * (path: PathOrFileDescriptor, options: ({ encoding: BufferEncoding, flag?: string | undefined } & import("events").Abortable) | BufferEncoding, callback: StringCallback): void;
134
+ * (path: PathOrFileDescriptor, options: (ObjectEncodingOptions & { flag?: string | undefined } & import("events").Abortable) | BufferEncoding | undefined | null, callback: StringOrBufferCallback): void;
135
+ * (path: PathOrFileDescriptor, callback: BufferCallback): void;
136
+ * }} ReadFile
137
+ */
138
+
139
+ /**
140
+ * @typedef {{
141
+ * (path: PathOrFileDescriptor, options?: { encoding?: null | undefined, flag?: string | undefined } | null): Buffer;
142
+ * (path: PathOrFileDescriptor, options: { encoding: BufferEncoding, flag?: string | undefined } | BufferEncoding): string;
143
+ * (path: PathOrFileDescriptor, options?: (ObjectEncodingOptions & { flag?: string | undefined }) | BufferEncoding | null): string | Buffer;
144
+ * }} ReadFileSync
145
+ */
146
+
147
+ /**
148
+ * @typedef {ObjectEncodingOptions | BufferEncoding | undefined | null} EncodingOption
149
+ */
150
+
151
+ /**
152
+ * @typedef {'buffer'| { encoding: 'buffer' }} BufferEncodingOption
153
+ */
154
+
155
+ /**
156
+ * @typedef {object} StatOptions
157
+ * @property {(boolean | undefined)=} bigint
158
+ */
159
+
160
+ /**
161
+ * @typedef {object} StatSyncOptions
162
+ * @property {(boolean | undefined)=} bigint
163
+ * @property {(boolean | undefined)=} throwIfNoEntry
164
+ */
165
+
166
+ /**
167
+ * @typedef {{
168
+ * (path: PathLike, options: EncodingOption, callback: StringCallback): void;
169
+ * (path: PathLike, options: BufferEncodingOption, callback: BufferCallback): void;
170
+ * (path: PathLike, options: EncodingOption, callback: StringOrBufferCallback): void;
171
+ * (path: PathLike, callback: StringCallback): void;
172
+ * }} Readlink
173
+ */
174
+
175
+ /**
176
+ * @typedef {{
177
+ * (path: PathLike, options?: EncodingOption): string;
178
+ * (path: PathLike, options: BufferEncodingOption): Buffer;
179
+ * (path: PathLike, options?: EncodingOption): string | Buffer;
180
+ * }} ReadlinkSync
181
+ */
182
+
183
+ /**
184
+ * @typedef {{
185
+ * (path: PathLike, options: { encoding: BufferEncoding | null, withFileTypes?: false | undefined, recursive?: boolean | undefined } | BufferEncoding | undefined | null, callback: ReaddirStringCallback): void;
186
+ * (path: PathLike, options: { encoding: 'buffer', withFileTypes?: false | undefined, recursive?: boolean | undefined } | 'buffer', callback: ReaddirBufferCallback): void;
187
+ * (path: PathLike, callback: ReaddirStringCallback): void;
188
+ * (path: PathLike, options: (ObjectEncodingOptions & { withFileTypes?: false | undefined, recursive?: boolean | undefined }) | BufferEncoding | undefined | null, callback: ReaddirStringOrBufferCallback): void;
189
+ * (path: PathLike, options: ObjectEncodingOptions & { withFileTypes: true, recursive?: boolean | undefined }, callback: ReaddirDirentCallback): void;
190
+ * }} Readdir
191
+ */
192
+
193
+ /**
194
+ * @typedef {{
195
+ * (path: PathLike, options?: { encoding: BufferEncoding | null, withFileTypes?: false | undefined, recursive?: boolean | undefined } | BufferEncoding | null): string[];
196
+ * (path: PathLike, options: { encoding: 'buffer', withFileTypes?: false | undefined, recursive?: boolean | undefined } | 'buffer'): Buffer[];
197
+ * (path: PathLike, options?: (ObjectEncodingOptions & { withFileTypes?: false | undefined, recursive?: boolean | undefined }) | BufferEncoding | null): string[] | Buffer[];
198
+ * (path: PathLike, options: ObjectEncodingOptions & { withFileTypes: true, recursive?: boolean | undefined }): Dirent[];
199
+ * }} ReaddirSync
200
+ */
201
+
202
+ /**
203
+ * @typedef {{
204
+ * (path: PathLike, callback: StatsCallback): void;
205
+ * (path: PathLike, options: (StatOptions & { bigint?: false | undefined }) | undefined, callback: StatsCallback): void;
206
+ * (path: PathLike, options: StatOptions & { bigint: true }, callback: BigIntStatsCallback): void;
207
+ * (path: PathLike, options: StatOptions | undefined, callback: StatsOrBigIntStatsCallback): void;
208
+ * }} Stat
209
+ */
210
+
211
+ /**
212
+ * @typedef {{
213
+ * (path: PathLike, options?: undefined): IStats;
214
+ * (path: PathLike, options?: StatSyncOptions & { bigint?: false | undefined, throwIfNoEntry: false }): IStats | undefined;
215
+ * (path: PathLike, options: StatSyncOptions & { bigint: true, throwIfNoEntry: false }): IBigIntStats | undefined;
216
+ * (path: PathLike, options?: StatSyncOptions & { bigint?: false | undefined }): IStats;
217
+ * (path: PathLike, options: StatSyncOptions & { bigint: true }): IBigIntStats;
218
+ * (path: PathLike, options: StatSyncOptions & { bigint: boolean, throwIfNoEntry?: false | undefined }): IStats | IBigIntStats;
219
+ * (path: PathLike, options?: StatSyncOptions): IStats | IBigIntStats | undefined;
220
+ * }} StatSync
221
+ */
222
+
223
+ /**
224
+ * @typedef {{
225
+ * (path: PathLike, callback: StatsCallback): void;
226
+ * (path: PathLike, options: (StatOptions & { bigint?: false | undefined }) | undefined, callback: StatsCallback): void;
227
+ * (path: PathLike, options: StatOptions & { bigint: true }, callback: BigIntStatsCallback): void;
228
+ * (path: PathLike, options: StatOptions | undefined, callback: StatsOrBigIntStatsCallback): void;
229
+ * }} LStat
230
+ */
231
+
232
+ /**
233
+ * @typedef {{
234
+ * (path: PathLike, options?: undefined): IStats;
235
+ * (path: PathLike, options?: StatSyncOptions & { bigint?: false | undefined, throwIfNoEntry: false }): IStats | undefined;
236
+ * (path: PathLike, options: StatSyncOptions & { bigint: true, throwIfNoEntry: false }): IBigIntStats | undefined;
237
+ * (path: PathLike, options?: StatSyncOptions & { bigint?: false | undefined }): IStats;
238
+ * (path: PathLike, options: StatSyncOptions & { bigint: true }): IBigIntStats;
239
+ * (path: PathLike, options: StatSyncOptions & { bigint: boolean, throwIfNoEntry?: false | undefined }): IStats | IBigIntStats;
240
+ * (path: PathLike, options?: StatSyncOptions): IStats | IBigIntStats | undefined;
241
+ * }} LStatSync
242
+ */
243
+
244
+ /**
245
+ * @typedef {{
246
+ * (path: PathLike, options: EncodingOption, callback: StringCallback): void;
247
+ * (path: PathLike, options: BufferEncodingOption, callback: BufferCallback): void;
248
+ * (path: PathLike, options: EncodingOption, callback: StringOrBufferCallback): void;
249
+ * (path: PathLike, callback: StringCallback): void;
250
+ * }} RealPath
251
+ */
252
+
253
+ /**
254
+ * @typedef {{
255
+ * (path: PathLike, options?: EncodingOption): string;
256
+ * (path: PathLike, options: BufferEncodingOption): Buffer;
257
+ * (path: PathLike, options?: EncodingOption): string | Buffer;
258
+ * }} RealPathSync
259
+ */
260
+
261
+ /**
262
+ * @typedef {function(PathOrFileDescriptor, ReadJsonCallback): void} ReadJson
263
+ */
264
+
265
+ /**
266
+ * @typedef {function(PathOrFileDescriptor): JsonObject} ReadJsonSync
267
+ */
97
268
 
98
269
  /**
99
- * @typedef {Object} OutputFileSystem
100
- * @property {function(string, Buffer|string, Callback): void} writeFile
101
- * @property {function(string, Callback): void} mkdir
102
- * @property {function(string, DirentArrayCallback): void=} readdir
103
- * @property {function(string, Callback): void=} rmdir
104
- * @property {function(string, Callback): void=} unlink
105
- * @property {function(string, StatsCallback): void} stat
106
- * @property {function(string, StatsCallback): void=} lstat
107
- * @property {function(string, BufferOrStringCallback): void} readFile
270
+ * @typedef {function((string | string[] | Set<string>)=): void} Purge
271
+ */
272
+
273
+ /**
274
+ * @typedef {object} InputFileSystem
275
+ * @property {ReadFile} readFile
276
+ * @property {ReadFileSync=} readFileSync
277
+ * @property {Readlink} readlink
278
+ * @property {ReadlinkSync=} readlinkSync
279
+ * @property {Readdir} readdir
280
+ * @property {ReaddirSync=} readdirSync
281
+ * @property {Stat} stat
282
+ * @property {StatSync=} statSync
283
+ * @property {LStat=} lstat
284
+ * @property {LStatSync=} lstatSync
285
+ * @property {RealPath=} realpath
286
+ * @property {RealPathSync=} realpathSync
287
+ * @property {ReadJson=} readJson
288
+ * @property {ReadJsonSync=} readJsonSync
289
+ * @property {Purge=} purge
108
290
  * @property {(function(string, string): string)=} join
109
291
  * @property {(function(string, string): string)=} relative
110
292
  * @property {(function(string): string)=} dirname
111
293
  */
112
294
 
113
295
  /**
114
- * @typedef {Object} InputFileSystem
115
- * @property {function(string, BufferOrStringCallback): void} readFile
116
- * @property {(function(string, ReadJsonCallback): void)=} readJson
117
- * @property {function(string, BufferOrStringCallback): void} readlink
118
- * @property {function(string, DirentArrayCallback): void} readdir
119
- * @property {function(string, StatsCallback): void} stat
120
- * @property {function(string, StatsCallback): void=} lstat
121
- * @property {(function(string, BufferOrStringCallback): void)=} realpath
122
- * @property {(function(string=): void)=} purge
296
+ * @typedef {number | string} Mode
297
+ */
298
+
299
+ /**
300
+ * @typedef {(ObjectEncodingOptions & import("events").Abortable & { mode?: Mode | undefined, flag?: string | undefined, flush?: boolean | undefined }) | BufferEncoding | null} WriteFileOptions
301
+ */
302
+
303
+ /**
304
+ * @typedef {{
305
+ * (file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, options: WriteFileOptions, callback: NoParamCallback): void;
306
+ * (file: PathOrFileDescriptor, data: string | NodeJS.ArrayBufferView, callback: NoParamCallback): void;
307
+ * }} WriteFile
308
+ */
309
+
310
+ /**
311
+ * @typedef {{ recursive?: boolean | undefined, mode?: Mode | undefined }} MakeDirectoryOptions
312
+ */
313
+
314
+ /**
315
+ * @typedef {{
316
+ * (file: PathLike, options: MakeDirectoryOptions & { recursive: true }, callback: StringCallback): void;
317
+ * (file: PathLike, options: Mode | (MakeDirectoryOptions & { recursive?: false | undefined; }) | null | undefined, callback: NoParamCallback): void;
318
+ * (file: PathLike, options: Mode | MakeDirectoryOptions | null | undefined, callback: StringCallback): void;
319
+ * (file: PathLike, callback: NoParamCallback): void;
320
+ * }} Mkdir
321
+ */
322
+
323
+ /**
324
+ * @typedef {{ maxRetries?: number | undefined, recursive?: boolean | undefined, retryDelay?: number | undefined }} RmDirOptions
325
+ */
326
+
327
+ /**
328
+ * @typedef {{
329
+ * (file: PathLike, callback: NoParamCallback): void;
330
+ * (file: PathLike, options: RmDirOptions, callback: NoParamCallback): void;
331
+ * }} Rmdir
332
+ */
333
+
334
+ /**
335
+ * @typedef {function(PathLike, NoParamCallback): void} Unlink
336
+ */
337
+
338
+ /**
339
+ * @typedef {object} OutputFileSystem
340
+ * @property {WriteFile} writeFile
341
+ * @property {Mkdir} mkdir
342
+ * @property {Readdir=} readdir
343
+ * @property {Rmdir=} rmdir
344
+ * @property {Unlink=} unlink
345
+ * @property {Stat} stat
346
+ * @property {LStat=} lstat
347
+ * @property {ReadFile} readFile
123
348
  * @property {(function(string, string): string)=} join
124
349
  * @property {(function(string, string): string)=} relative
125
350
  * @property {(function(string): string)=} dirname
126
351
  */
127
352
 
128
353
  /**
129
- * @typedef {Object} WatchFileSystem
354
+ * @typedef {object} WatchFileSystem
130
355
  * @property {WatchMethod} watch
131
356
  */
132
357
 
133
358
  /**
134
- * @typedef {Object} IntermediateFileSystemExtras
135
- * @property {function(string): void} mkdirSync
136
- * @property {function(string): NodeJS.WritableStream} createWriteStream
137
- * @property {function(string, string, NumberCallback): void} open
138
- * @property {function(number, Buffer, number, number, number, NumberCallback): void} read
139
- * @property {function(number, Callback): void} close
140
- * @property {function(string, string, Callback): void} rename
359
+ * @typedef {{
360
+ * (path: PathLike, options: MakeDirectoryOptions & { recursive: true }): string | undefined;
361
+ * (path: PathLike, options?: Mode | (MakeDirectoryOptions & { recursive?: false | undefined }) | null): void;
362
+ * (path: PathLike, options?: Mode | MakeDirectoryOptions | null): string | undefined;
363
+ * }} MkdirSync
364
+ */
365
+
366
+ /**
367
+ * @typedef {object} StreamOptions
368
+ * @property {(string | undefined)=} flags
369
+ * @property {(BufferEncoding | undefined)} encoding
370
+ * @property {(number | any | undefined)=} fd
371
+ * @property {(number | undefined)=} mode
372
+ * @property {(boolean | undefined)=} autoClose
373
+ * @property {(boolean | undefined)=} emitClose
374
+ * @property {(number | undefined)=} start
375
+ * @property {(AbortSignal | null | undefined)=} signal
376
+ */
377
+
378
+ /**
379
+ * @typedef {object} FSImplementation
380
+ * @property {((...args: any[]) => any)=} open
381
+ * @property {((...args: any[]) => any)=} close
382
+ */
383
+
384
+ /**
385
+ * @typedef {FSImplementation & { write: (...args: any[]) => any; close?: (...args: any[]) => any }} CreateWriteStreamFSImplementation
386
+ */
387
+
388
+ /**
389
+ * @typedef {StreamOptions & { fs?: CreateWriteStreamFSImplementation | null | undefined }} WriteStreamOptions
390
+ */
391
+
392
+ /**
393
+ * @typedef {function(PathLike, (BufferEncoding | WriteStreamOptions)=): NodeJS.WritableStream} CreateWriteStream
394
+ */
395
+
396
+ /**
397
+ * @typedef {number | string} OpenMode
398
+ */
399
+
400
+ /**
401
+ * @typedef {{
402
+ * (file: PathLike, flags: OpenMode | undefined, mode: Mode | undefined | null, callback: NumberCallback): void;
403
+ * (file: PathLike, flags: OpenMode | undefined, callback: NumberCallback): void;
404
+ * (file: PathLike, callback: NumberCallback): void;
405
+ * }} Open
406
+ */
407
+
408
+ /**
409
+ * @typedef {number | bigint} ReadPosition
410
+ */
411
+
412
+ /**
413
+ * @typedef {object} ReadSyncOptions
414
+ * @property {(number | undefined)=} offset
415
+ * @property {(number | undefined)=} length
416
+ * @property {(ReadPosition | null | undefined)=} position
417
+ */
418
+
419
+ /**
420
+ * @template {NodeJS.ArrayBufferView} TBuffer
421
+ * @typedef {object} ReadAsyncOptions
422
+ * @property {(number | undefined)=} offset
423
+ * @property {(number | undefined)=} length
424
+ * @property {(ReadPosition | null | undefined)=} position
425
+ * @property {TBuffer=} buffer
426
+ */
427
+
428
+ /**
429
+ * @template {NodeJS.ArrayBufferView} [TBuffer=Buffer]
430
+ * @typedef {{
431
+ * (fd: number, buffer: TBuffer, offset: number, length: number, position: ReadPosition | null, callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void): void;
432
+ * (fd: number, options: ReadAsyncOptions<TBuffer>, callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: TBuffer) => void): void;
433
+ * (fd: number, callback: (err: NodeJS.ErrnoException | null, bytesRead: number, buffer: NodeJS.ArrayBufferView) => void): void;
434
+ * }} Read
435
+ */
436
+
437
+ /** @typedef {function(number, NoParamCallback): void} Close */
438
+
439
+ /** @typedef {function(PathLike, PathLike, NoParamCallback): void} Rename */
440
+
441
+ /**
442
+ * @typedef {object} IntermediateFileSystemExtras
443
+ * @property {MkdirSync} mkdirSync
444
+ * @property {CreateWriteStream} createWriteStream
445
+ * @property {Open} open
446
+ * @property {Read} read
447
+ * @property {Close} close
448
+ * @property {Rename} rename
141
449
  */
142
450
 
143
451
  /** @typedef {InputFileSystem & OutputFileSystem & IntermediateFileSystemExtras} IntermediateFileSystem */
@@ -260,7 +568,7 @@ const mkdirpSync = (fs, p) => {
260
568
  fs.mkdirSync(p);
261
569
  } catch (err) {
262
570
  if (err) {
263
- if (err.code === "ENOENT") {
571
+ if (/** @type {NodeJS.ErrnoException} */ (err).code === "ENOENT") {
264
572
  const dir = dirname(fs, p);
265
573
  if (dir === p) {
266
574
  throw err;
@@ -268,7 +576,7 @@ const mkdirpSync = (fs, p) => {
268
576
  mkdirpSync(fs, dir);
269
577
  fs.mkdirSync(p);
270
578
  return;
271
- } else if (err.code === "EEXIST") {
579
+ } else if (/** @type {NodeJS.ErrnoException} */ (err).code === "EEXIST") {
272
580
  return;
273
581
  }
274
582
  throw err;
@@ -284,14 +592,17 @@ exports.mkdirpSync = mkdirpSync;
284
592
  * @returns {void}
285
593
  */
286
594
  const readJson = (fs, p, callback) => {
287
- if ("readJson" in fs) return fs.readJson(p, callback);
595
+ if ("readJson" in fs)
596
+ return /** @type {NonNullable<InputFileSystem["readJson"]>} */ (
597
+ fs.readJson
598
+ )(p, callback);
288
599
  fs.readFile(p, (err, buf) => {
289
600
  if (err) return callback(err);
290
601
  let data;
291
602
  try {
292
- data = JSON.parse(buf.toString("utf-8"));
603
+ data = JSON.parse(/** @type {Buffer} */ (buf).toString("utf-8"));
293
604
  } catch (e) {
294
- return callback(e);
605
+ return callback(/** @type {Error} */ (e));
295
606
  }
296
607
  return callback(null, data);
297
608
  });
@@ -301,7 +612,7 @@ exports.readJson = readJson;
301
612
  /**
302
613
  * @param {InputFileSystem} fs a file system
303
614
  * @param {string} p an absolute path
304
- * @param {ReadJsonCallback} callback callback
615
+ * @param {function(NodeJS.ErrnoException | Error | null, (IStats | string)=): void} callback callback
305
616
  * @returns {void}
306
617
  */
307
618
  const lstatReadlinkAbsolute = (fs, p, callback) => {
@@ -320,13 +631,16 @@ const lstatReadlinkAbsolute = (fs, p, callback) => {
320
631
  };
321
632
  const doStat = () => {
322
633
  if ("lstat" in fs) {
323
- return fs.lstat(p, (err, stats) => {
324
- if (err) return callback(err);
325
- if (stats.isSymbolicLink()) {
326
- return doReadLink();
634
+ return /** @type {NonNullable<InputFileSystem["lstat"]>} */ (fs.lstat)(
635
+ p,
636
+ (err, stats) => {
637
+ if (err) return callback(err);
638
+ if (/** @type {IStats} */ (stats).isSymbolicLink()) {
639
+ return doReadLink();
640
+ }
641
+ callback(null, stats);
327
642
  }
328
- callback(null, stats);
329
- });
643
+ );
330
644
  } else {
331
645
  return fs.stat(p, callback);
332
646
  }
@@ -9,6 +9,9 @@ const Hash = require("../Hash");
9
9
  const MAX_SHORT_STRING = require("./wasm-hash").MAX_SHORT_STRING;
10
10
 
11
11
  class BatchedHash extends Hash {
12
+ /**
13
+ * @param {Hash} hash hash
14
+ */
12
15
  constructor(hash) {
13
16
  super();
14
17
  this.string = undefined;
@@ -10,8 +10,8 @@ const create = require("./wasm-hash");
10
10
  //#region wasm code: xxhash64 (../../../assembly/hash/xxhash64.asm.ts) --initialMemory 1
11
11
  const xxhash64 = new WebAssembly.Module(
12
12
  Buffer.from(
13
- // 1168 bytes
14
- "AGFzbQEAAAABCAJgAX8AYAAAAwQDAQAABQMBAAEGGgV+AUIAC34BQgALfgFCAAt+AUIAC34BQgALByIEBGluaXQAAAZ1cGRhdGUAAQVmaW5hbAACBm1lbW9yeQIACrAIAzAAQtbrgu7q/Yn14AAkAELP1tO+0ser2UIkAUIAJAJC+erQ0OfJoeThACQDQgAkBAvUAQIBfwR+IABFBEAPCyMEIACtfCQEIwAhAiMBIQMjAiEEIwMhBQNAIAIgASkDAELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiECIAMgASkDCELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEDIAQgASkDEELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEEIAUgASkDGELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEFIAFBIGoiASAASQ0ACyACJAAgAyQBIAQkAiAFJAMLpgYCAn8EfiMEQgBSBH4jACIDQgGJIwEiBEIHiXwjAiIFQgyJfCMDIgZCEol8IANCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0gBELP1tO+0ser2UJ+Qh+JQoeVr6+Ytt6bnn9+hUKHla+vmLbem55/fkKdo7Xqg7GNivoAfSAFQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IAZCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0FQsXP2bLx5brqJwsjBCAArXx8IQMDQCABQQhqIgIgAE0EQCADIAEpAwBCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCG4lCh5Wvr5i23puef35CnaO16oOxjYr6AH0hAyACIQEMAQsLIAFBBGoiAiAATQRAIAMgATUCAEKHla+vmLbem55/foVCF4lCz9bTvtLHq9lCfkL5893xmfaZqxZ8IQMgAiEBCwNAIAAgAUcEQCADIAExAABCxc/ZsvHluuonfoVCC4lCh5Wvr5i23puef34hAyABQQFqIQEMAQsLQQAgAyADQiGIhULP1tO+0ser2UJ+IgNCHYggA4VC+fPd8Zn2masWfiIDQiCIIAOFIgNCIIgiBEL//wODQiCGIARCgID8/w+DQhCIhCIEQv+BgIDwH4NCEIYgBEKA/oOAgOA/g0IIiIQiBEKPgLyA8IHAB4NCCIYgBELwgcCHgJ6A+ACDQgSIhCIEQoaMmLDgwIGDBnxCBIhCgYKEiJCgwIABg0InfiAEQrDgwIGDhoyYMIR8NwMAQQggA0L/////D4MiA0L//wODQiCGIANCgID8/w+DQhCIhCIDQv+BgIDwH4NCEIYgA0KA/oOAgOA/g0IIiIQiA0KPgLyA8IHAB4NCCIYgA0LwgcCHgJ6A+ACDQgSIhCIDQoaMmLDgwIGDBnxCBIhCgYKEiJCgwIABg0InfiADQrDgwIGDhoyYMIR8NwMACw==",
13
+ // 1160 bytes
14
+ "AGFzbQEAAAABCAJgAX8AYAAAAwQDAQAABQMBAAEGGgV+AUIAC34BQgALfgFCAAt+AUIAC34BQgALByIEBGluaXQAAAZ1cGRhdGUAAQVmaW5hbAACBm1lbW9yeQIACqgIAzAAQtbrgu7q/Yn14AAkAELP1tO+0ser2UIkAUIAJAJC+erQ0OfJoeThACQDQgAkBAvUAQIBfwR+IABFBEAPCyMEIACtfCQEIwAhAiMBIQMjAiEEIwMhBQNAIAIgASkDAELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiECIAMgASkDCELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEDIAQgASkDEELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEEIAUgASkDGELP1tO+0ser2UJ+fEIfiUKHla+vmLbem55/fiEFIAFBIGoiASAASQ0ACyACJAAgAyQBIAQkAiAFJAMLngYCAn8CfiMEQgBSBH4jAEIBiSMBQgeJfCMCQgyJfCMDQhKJfCMAQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IwFCz9bTvtLHq9lCfkIfiUKHla+vmLbem55/foVCh5Wvr5i23puef35CnaO16oOxjYr6AH0jAkLP1tO+0ser2UJ+Qh+JQoeVr6+Ytt6bnn9+hUKHla+vmLbem55/fkKdo7Xqg7GNivoAfSMDQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9BULFz9my8eW66icLIwQgAK18fCEDA0AgAUEIaiICIABNBEAgAyABKQMAQs/W077Sx6vZQn5CH4lCh5Wvr5i23puef36FQhuJQoeVr6+Ytt6bnn9+Qp2jteqDsY2K+gB9IQMgAiEBDAELCyABQQRqIgIgAE0EQCADIAE1AgBCh5Wvr5i23puef36FQheJQs/W077Sx6vZQn5C+fPd8Zn2masWfCEDIAIhAQsDQCAAIAFHBEAgAyABMQAAQsXP2bLx5brqJ36FQguJQoeVr6+Ytt6bnn9+IQMgAUEBaiEBDAELC0EAIAMgA0IhiIVCz9bTvtLHq9lCfiIDQh2IIAOFQvnz3fGZ9pmrFn4iA0IgiCADhSIDQiCIIgRC//8Dg0IghiAEQoCA/P8Pg0IQiIQiBEL/gYCA8B+DQhCGIARCgP6DgIDgP4NCCIiEIgRCj4C8gPCBwAeDQgiGIARC8IHAh4CegPgAg0IEiIQiBEKGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gBEKw4MCBg4aMmDCEfDcDAEEIIANC/////w+DIgNC//8Dg0IghiADQoCA/P8Pg0IQiIQiA0L/gYCA8B+DQhCGIANCgP6DgIDgP4NCCIiEIgNCj4C8gPCBwAeDQgiGIANC8IHAh4CegPgAg0IEiIQiA0KGjJiw4MCBgwZ8QgSIQoGChIiQoMCAAYNCJ34gA0Kw4MCBg4aMmDCEfDcDAAs=",
15
15
  "base64"
16
16
  )
17
17
  );
@@ -11,7 +11,7 @@ const SEGMENTS_SPLIT_REGEXP = /([|!])/;
11
11
  const WINDOWS_PATH_SEPARATOR_REGEXP = /\\/g;
12
12
 
13
13
  /**
14
- * @typedef {Object} MakeRelativePathsCache
14
+ * @typedef {object} MakeRelativePathsCache
15
15
  * @property {Map<string, Map<string, string>>=} relativePaths
16
16
  */
17
17
 
@@ -100,7 +100,7 @@ const makeCacheable = realFn => {
100
100
 
101
101
  /**
102
102
  * @param {string} str the path with query and fragment
103
- * @param {Object=} associatedObjectForCache an object to which the cache will be attached
103
+ * @param {object=} associatedObjectForCache an object to which the cache will be attached
104
104
  * @returns {ParsedResource} parsed parts
105
105
  */
106
106
  const fn = (str, associatedObjectForCache) => {
@@ -134,7 +134,7 @@ const makeCacheableWithContext = fn => {
134
134
  /**
135
135
  * @param {string} context context used to create relative path
136
136
  * @param {string} identifier identifier used to create relative path
137
- * @param {Object=} associatedObjectForCache an object to which the cache will be attached
137
+ * @param {object=} associatedObjectForCache an object to which the cache will be attached
138
138
  * @returns {string} the returned relative path
139
139
  */
140
140
  const cachedFn = (context, identifier, associatedObjectForCache) => {
@@ -164,7 +164,7 @@ const makeCacheableWithContext = fn => {
164
164
  };
165
165
 
166
166
  /**
167
- * @param {Object=} associatedObjectForCache an object to which the cache will be attached
167
+ * @param {object=} associatedObjectForCache an object to which the cache will be attached
168
168
  * @returns {function(string, string): string} cached function
169
169
  */
170
170
  cachedFn.bindCache = associatedObjectForCache => {
@@ -207,7 +207,7 @@ const makeCacheableWithContext = fn => {
207
207
 
208
208
  /**
209
209
  * @param {string} context context used to create relative path
210
- * @param {Object=} associatedObjectForCache an object to which the cache will be attached
210
+ * @param {object=} associatedObjectForCache an object to which the cache will be attached
211
211
  * @returns {function(string): string} cached function
212
212
  */
213
213
  cachedFn.bindContextCache = (context, associatedObjectForCache) => {