Skip to content

Commit

Permalink
Improve option-to-CLI param transforming Regex
Browse files Browse the repository at this point in the history
  • Loading branch information
shalithasuranga committed May 28, 2024
1 parent 9490817 commit 760f677
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/api/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,7 @@ export function create(url: string, options?: WindowOptions): Promise<void> {
if(key == "processArgs")
continue;

let cliKey: string = key.replace(/[A-Z]|^[a-z]/g, (token: string) => (
"-" + token.toLowerCase()
));
let cliKey: string = '-' + key.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
command += ` --window${cliKey}=${normalize(options[key])}`
}

Expand Down

0 comments on commit 760f677

Please sign in to comment.