Skip to content

Commit f6dc2b6

Browse files
committed
Fixed Issue SeleniumHQ#1865
1 parent be5b3e6 commit f6dc2b6

File tree

1 file changed

+7
-1
lines changed
  • packages/selenium-ide/src/main/session/controllers/Projects

1 file changed

+7
-1
lines changed

packages/selenium-ide/src/main/session/controllers/Projects/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ export default class ProjectsController {
2222
project: ProjectShape
2323
session: Session
2424

25+
UpdatedJsonStringify(json: string): string {
26+
return json.replace(/("(?:\\"|[^"])*")\s*:/g, (_, p1) => {
27+
return p1.replace(/\s/g, '') + ':';
28+
});
29+
}
30+
2531
async executeHook(
2632
hookName: keyof Pick<
2733
BaseController,
@@ -198,7 +204,7 @@ export default class ProjectsController {
198204
}
199205

200206
async save_v3(filepath: string): Promise<boolean> {
201-
await fs.writeFile(filepath, JSON.stringify(this.project, undefined, 2))
207+
await fs.writeFile(filepath, this.UpdatedJsonStringify(JSON.stringify(this.project, undefined, 2)))
202208
this.recentProjects.add(filepath)
203209
this.session.projects.filepath = filepath
204210
return true

0 commit comments

Comments
 (0)