MCPcopy
hub / github.com/Automattic/mongoose / toObject

Method toObject

lib/types/map.js:226–237  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

224 }
225
226 toObject(options) {
227 if (options?.flattenMaps) {
228 const ret = {};
229 const keys = this.keys();
230 for (const key of keys) {
231 ret[key] = clone(this.get(key), options);
232 }
233 return ret;
234 }
235
236 return new Map(this);
237 }
238
239 $toObject() {
240 return this.constructor.prototype.toObject.apply(this, arguments);

Callers 15

model.jsFile · 0.80
_insertManyFunction · 0.80
_updateFunction · 0.80
cast.jsFile · 0.80
utils.jsFile · 0.80
query.jsFile · 0.80
document.jsFile · 0.80
_getPathsToValidateFunction · 0.80
handleAtomicsFunction · 0.80
iterFunction · 0.80
subdocument.jsFile · 0.80
toBSONFunction · 0.80

Calls 2

getMethod · 0.95
cloneFunction · 0.50

Tested by 15

toUUIDFunction · 0.64
gh10293Function · 0.64
toObjectToJSONTestFunction · 0.64
createOneMethod · 0.64
gh14441Function · 0.64
toObjectWithBaseTypingFunction · 0.64
gh10345Function · 0.64
gh11761Function · 0.64
_11767Function · 0.64
mapsFunction · 0.64
getNameFunction · 0.64
gh13772Function · 0.64