Skip to content

Commit bd2e616

Browse files
committed
Add more precise JSDoc for arrays
This documents the value type for arrays of strings in arguments.
1 parent 7f0347c commit bd2e616

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

index.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,10 @@ class Encore {
226226
* If the JavaScript file imports/requires CSS/Sass/LESS files,
227227
* then a CSS file (e.g. main.css) will also be output.
228228
*
229-
* @param {string} name The name (without extension) that will be used
230-
* as the output filename (e.g. app will become app.js)
231-
* in the output directory.
232-
* @param {string|Array} src The path to the source file (or files)
229+
* @param {string} name The name (without extension) that will be used
230+
* as the output filename (e.g. app will become app.js)
231+
* in the output directory.
232+
* @param {string|string[]} src The path to the source file (or files)
233233
* @returns {Encore}
234234
*/
235235
addEntry(name, src) {
@@ -252,7 +252,7 @@ class Encore {
252252
* If the JavaScript files imports/requires CSS/Sass/LESS files,
253253
* then a CSS file (e.g. main.css) will also be output.
254254
*
255-
* @param {Record<string, string|Array>} entries where the Keys are the
255+
* @param {Record<string, string|string[]>} entries where the Keys are the
256256
* names (without extension) that will be used
257257
* as the output filename (e.g. app will become app.js)
258258
* in the output directory. The values are the path(s)
@@ -278,10 +278,10 @@ class Encore {
278278
* is to use addEntry() and then require/import your CSS files from
279279
* within your JavaScript files.
280280
*
281-
* @param {string} name The name (without extension) that will be used
282-
* as the output filename (e.g. app will become app.css)
283-
* in the output directory.
284-
* @param {string|Array} src The path to the source file (or files)
281+
* @param {string} name The name (without extension) that will be used
282+
* as the output filename (e.g. app will become app.css)
283+
* in the output directory.
284+
* @param {string|string[]} src The path to the source file (or files)
285285
* @returns {Encore}
286286
*/
287287
addStyleEntry(name, src) {
@@ -1539,7 +1539,7 @@ class Encore {
15391539
* ```
15401540
*
15411541
* @param {boolean} enabled
1542-
* @param {string|Array} algorithms
1542+
* @param {string|string[]} algorithms
15431543
* @returns {Encore}
15441544
*/
15451545
enableIntegrityHashes(enabled = true, algorithms = ['sha384']) {

lib/WebpackConfig.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -897,6 +897,10 @@ class WebpackConfig {
897897
this.loaderConfigurationCallbacks[name] = callback;
898898
}
899899

900+
/**
901+
* @param {boolean} enabled
902+
* @param {string|string[]} algorithms
903+
*/
900904
enableIntegrityHashes(enabled = true, algorithms = ['sha384']) {
901905
if (!Array.isArray(algorithms)) {
902906
algorithms = [algorithms];

0 commit comments

Comments
 (0)