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 f193b25 commit 80c1847Copy full SHA for 80c1847
src/surreal.ts
@@ -76,9 +76,9 @@ export class Surreal {
76
http: HttpEngine,
77
https: HttpEngine,
78
};
79
- protected replacer?: ReplacerOptions;
+ protected replacer: ReplacerOptions;
80
81
- constructor({ engines, replacer }: SurrealOptions = {}) {
+ constructor({ engines, replacer: customReplacer }: SurrealOptions = {}) {
82
this.emitter = new Emitter();
83
this.emitter.subscribe(ConnectionStatus.Disconnected, () => this.clean());
84
this.emitter.subscribe(ConnectionStatus.Error, () => this.close());
@@ -90,7 +90,10 @@ export class Surreal {
90
91
}
92
93
- this.replacer = replacer;
+ this.replacer = customReplacer ?? {
94
+ encode: replacer.encode,
95
+ decode: replacer.decode,
96
+ };
97
98
99
/**
0 commit comments