chat-platform 2.1.1 → 2.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/providers/memory.js +8 -0
package/package.json
CHANGED
package/providers/memory.js
CHANGED
|
@@ -137,6 +137,14 @@ function MemoryFactory() {
|
|
|
137
137
|
}
|
|
138
138
|
return new MemoryStore(userId, { ...statics });
|
|
139
139
|
};
|
|
140
|
+
// this is only to be used in testing to simplify the testing scenarios
|
|
141
|
+
// there's no really need for an async func here
|
|
142
|
+
this.getOrCreateContextSync = function(userId, statics) {
|
|
143
|
+
if (isEmpty(userId)) {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
return new MemoryStore(userId, { ...statics });
|
|
147
|
+
};
|
|
140
148
|
|
|
141
149
|
this.mergeUserId = async function(fromUserId, toUserId) {
|
|
142
150
|
const destination = _storeChatIds[toUserId];
|