Skip to content

Commit 97f4c81

Browse files
fix: minor typographical fix
1 parent 4acc8c7 commit 97f4c81

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

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)