Skip to content

Exporting strings with multiple slashes #56

@appy-one

Description

@appy-one

When exporting strings that contains backslashes, the first one is doubled in the exported value:

var { AceBase } = require("acebase")
const db = new AceBase('test');
await db.ref('export').set({ text: 'Strings with multiple \\ backslashes \\ are not \\ exported ok' });
let json = '';
await db.ref('export').export({ write: str => json += str });

After execution, the value of json is {"text":"Strings with multiple \\ backslashes \ are not \ exported ok"}.
The expected value is {"text":"Strings with multiple \ backslashes \ are not \ exported ok"}.

The issue is caused by the escape function in the exportNode method in storage.js, which does a regexp replace on the first occurrence of a backslash

Will be fixed soon

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions