Skip to content

Commit

Permalink
minor typographical fix (#1522)
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgeorge007 authored Feb 2, 2021
1 parent 4acc8c7 commit daa51ac
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/thick-rivers-explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'preact-cli': patch
---

Minor typographical fix
6 changes: 4 additions & 2 deletions packages/cli/lib/commands/validate-args.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
const { error } = require('../util');

function validateArgs(argv, options, command) {
let normalizedOptions = options.map(option => option.name.split(',')).reduce((acc, val) => acc.concat(val), []);
let normalizedOptions = options
.map(option => option.name.split(','))
.reduce((acc, val) => acc.concat(val), []);
normalizedOptions = normalizedOptions.map(option => {
option = option.trim();
if (option.startsWith('--')) {
Expand All @@ -19,7 +21,7 @@ function validateArgs(argv, options, command) {
error(
`Invalid argument ${arg} passed to ${command}. Please refer to 'preact ${command} --help' for full list of options.\n\n`
);
throw new Error('Invalid argunment found.');
throw new Error('Invalid argument found.');
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/tests/build.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ describe('preact build', () => {
let dir = await subject('custom-template-3');
const mockExit = jest.spyOn(process, 'exit').mockImplementation(() => {});
expect(build(dir, { 'service-worker': false })).rejects.toEqual(
new Error('Invalid argunment found.')
new Error('Invalid argument found.')
);
expect(mockExit).toHaveBeenCalledWith(1);
mockExit.mockRestore();
Expand Down

0 comments on commit daa51ac

Please sign in to comment.