Skip to content

Commit c4f6ab2

Browse files
Merge branch 'master' into no-prerender-no-cli-data
2 parents 1434efa + daa51ac commit c4f6ab2

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

.changeset/thick-rivers-explain.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'preact-cli': patch
3+
---
4+
5+
Minor typographical fix

packages/cli/lib/commands/validate-args.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
const { error } = require('../util');
22

33
function validateArgs(argv, options, command) {
4-
let normalizedOptions = options.map(option => option.name.split(',')).reduce((acc, val) => acc.concat(val), []);
4+
let normalizedOptions = options
5+
.map(option => option.name.split(','))
6+
.reduce((acc, val) => acc.concat(val), []);
57
normalizedOptions = normalizedOptions.map(option => {
68
option = option.trim();
79
if (option.startsWith('--')) {
@@ -19,7 +21,7 @@ function validateArgs(argv, options, command) {
1921
error(
2022
`Invalid argument ${arg} passed to ${command}. Please refer to 'preact ${command} --help' for full list of options.\n\n`
2123
);
22-
throw new Error('Invalid argunment found.');
24+
throw new Error('Invalid argument found.');
2325
}
2426
}
2527
}

packages/cli/tests/build.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ describe('preact build', () => {
239239
let dir = await subject('custom-template-3');
240240
const mockExit = jest.spyOn(process, 'exit').mockImplementation(() => {});
241241
expect(build(dir, { 'service-worker': false })).rejects.toEqual(
242-
new Error('Invalid argunment found.')
242+
new Error('Invalid argument found.')
243243
);
244244
expect(mockExit).toHaveBeenCalledWith(1);
245245
mockExit.mockRestore();

0 commit comments

Comments
 (0)