Skip to content

Commit

Permalink
Fixed Issue SeleniumHQ#1865
Browse files Browse the repository at this point in the history
  • Loading branch information
shbenzer committed Oct 9, 2024
1 parent be5b3e6 commit f6dc2b6
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ export default class ProjectsController {
project: ProjectShape
session: Session

UpdatedJsonStringify(json: string): string {
return json.replace(/("(?:\\"|[^"])*")\s*:/g, (_, p1) => {
return p1.replace(/\s/g, '') + ':';
});
}

async executeHook(
hookName: keyof Pick<
BaseController,
Expand Down Expand Up @@ -198,7 +204,7 @@ export default class ProjectsController {
}

async save_v3(filepath: string): Promise<boolean> {
await fs.writeFile(filepath, JSON.stringify(this.project, undefined, 2))
await fs.writeFile(filepath, this.UpdatedJsonStringify(JSON.stringify(this.project, undefined, 2)))
this.recentProjects.add(filepath)
this.session.projects.filepath = filepath
return true
Expand Down

0 comments on commit f6dc2b6

Please sign in to comment.