Skip to content

Commit cda328e

Browse files
authored
fix: update schema for index and methods properties (#1397)
1 parent b3950e5 commit cda328e

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/options.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"type": "array",
2525
"items": {
2626
"type": "string",
27-
"minlength": "1"
27+
"minLength": 1
2828
}
2929
},
3030
"headers": {
@@ -116,7 +116,7 @@
116116
},
117117
{
118118
"type": "string",
119-
"minlength": "1"
119+
"minLength": 1
120120
}
121121
]
122122
}

test/__snapshots__/validation-options.test.js.snap.webpack5

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,37 +42,37 @@ exports[`validation should throw an error on the "headers" option with "true" va
4242
exports[`validation should throw an error on the "index" option with "{}" value 1`] = `
4343
"Invalid options object. Dev Middleware has been initialized using an options object that does not match the API schema.
4444
- options.index should be one of these:
45-
boolean | string
45+
boolean | non-empty string
4646
-> Allows to serve an index of the directory.
4747
-> Read more at https://github.com/webpack/webpack-dev-middleware#index
4848
Details:
4949
* options.index should be a boolean.
50-
* options.index should be a string."
50+
* options.index should be a non-empty string."
5151
`;
5252

5353
exports[`validation should throw an error on the "index" option with "0" value 1`] = `
5454
"Invalid options object. Dev Middleware has been initialized using an options object that does not match the API schema.
5555
- options.index should be one of these:
56-
boolean | string
56+
boolean | non-empty string
5757
-> Allows to serve an index of the directory.
5858
-> Read more at https://github.com/webpack/webpack-dev-middleware#index
5959
Details:
6060
* options.index should be a boolean.
61-
* options.index should be a string."
61+
* options.index should be a non-empty string."
6262
`;
6363

6464
exports[`validation should throw an error on the "methods" option with "{}" value 1`] = `
6565
"Invalid options object. Dev Middleware has been initialized using an options object that does not match the API schema.
6666
- options.methods should be an array:
67-
[string, ...]
67+
[non-empty string, ...]
6868
-> Allows to pass the list of HTTP request methods accepted by the middleware.
6969
-> Read more at https://github.com/webpack/webpack-dev-middleware#methods"
7070
`;
7171

7272
exports[`validation should throw an error on the "methods" option with "true" value 1`] = `
7373
"Invalid options object. Dev Middleware has been initialized using an options object that does not match the API schema.
7474
- options.methods should be an array:
75-
[string, ...]
75+
[non-empty string, ...]
7676
-> Allows to pass the list of HTTP request methods accepted by the middleware.
7777
-> Read more at https://github.com/webpack/webpack-dev-middleware#methods"
7878
`;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy