We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2383e5d commit 1ec7331Copy full SHA for 1ec7331
Node/src/storage/Storage.ts
@@ -39,18 +39,18 @@ export interface IStorage {
39
}
40
41
export class MemoryStorage implements IStorage {
42
- private store: { [id: string]: any; } = {};
+ private store: { [id: string]: string; } = {};
43
44
public get(id: string, callback: (err: Error, data: any) => void): void {
45
if (this.store.hasOwnProperty(id)) {
46
- callback(null, utils.clone(this.store[id]));
+ callback(null, JSON.parse(this.store[id]));
47
} else {
48
callback(null, null);
49
50
51
52
public save(id: string, data: any, callback?: (err: Error) => void): void {
53
- this.store[id] = utils.clone(data || {});
+ this.store[id] = JSON.stringify(data || {});
54
if (callback) {
55
callback(null);
56
0 commit comments