Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const _v = mpath.get(name, obj);
if (!this.$$populatedVirtuals) {
this.$$populatedVirtuals = {};
}
if (options.justOne || options.count) {
this.$$populatedVirtuals[name] = Array.isArray(_v) ?
_v[0] :
_v;
} else {
this.$$populatedVirtuals[name] = Array.isArray(_v) ?
_v :
_v == null ? [] : [_v];
}
mpath.unset(name, obj);
}
});
var _v = mpath.get(name, obj);
if (!this.$$populatedVirtuals) {
this.$$populatedVirtuals = {};
}
if (options.justOne) {
this.$$populatedVirtuals[name] = Array.isArray(_v) ?
_v[0] :
_v;
} else {
this.$$populatedVirtuals[name] = Array.isArray(_v) ?
_v :
_v == null ? [] : [_v];
}
mpath.unset(name, obj);
}
if (this.ownerDocument) {
next();
return this;
} else {
next();
}
});
var _v = mpath.get(name, obj);
if (!this.$$populatedVirtuals) {
this.$$populatedVirtuals = {};
}
if (options.justOne) {
this.$$populatedVirtuals[name] = Array.isArray(_v) ?
_v[0] :
_v;
} else {
this.$$populatedVirtuals[name] = Array.isArray(_v) ?
_v :
_v == null ? [] : [_v];
}
mpath.unset(name, obj);
}
if (this.ownerDocument) {
next();
return this;
} else {
next();
}
});
const _v = mpath.get(name, obj);
if (!this.$$populatedVirtuals) {
this.$$populatedVirtuals = {};
}
if (options.justOne || options.count) {
this.$$populatedVirtuals[name] = Array.isArray(_v) ?
_v[0] :
_v;
} else {
this.$$populatedVirtuals[name] = Array.isArray(_v) ?
_v :
_v == null ? [] : [_v];
}
mpath.unset(name, obj);
}
});
const _v = mpath.get(name, obj);
if (!this.$$populatedVirtuals) {
this.$$populatedVirtuals = {};
}
if (options.justOne || options.count) {
this.$$populatedVirtuals[name] = Array.isArray(_v) ?
_v[0] :
_v;
} else {
this.$$populatedVirtuals[name] = Array.isArray(_v) ?
_v :
_v == null ? [] : [_v];
}
mpath.unset(name, obj);
}
});
var _v = mpath.get(name, obj);
if (!this.$$populatedVirtuals) {
this.$$populatedVirtuals = {};
}
if (options.justOne) {
this.$$populatedVirtuals[name] = Array.isArray(_v) ?
_v[0] :
_v;
} else {
this.$$populatedVirtuals[name] = Array.isArray(_v) ?
_v :
_v == null ? [] : [_v];
}
mpath.unset(name, obj);
}
if (this.ownerDocument) {
next();
return this;
} else {
next();
}
});
var _v = mpath.get(name, obj);
if (!this.$$populatedVirtuals) {
this.$$populatedVirtuals = {};
}
if (options.justOne) {
this.$$populatedVirtuals[name] = Array.isArray(_v) ?
_v[0] :
_v;
} else {
this.$$populatedVirtuals[name] = Array.isArray(_v) ?
_v :
_v == null ? [] : [_v];
}
mpath.unset(name, obj);
}
});
var _v = mpath.get(name, obj);
if (!this.$$populatedVirtuals) {
this.$$populatedVirtuals = {};
}
if (options.justOne) {
this.$$populatedVirtuals[name] = Array.isArray(_v) ?
_v[0] :
_v;
} else {
this.$$populatedVirtuals[name] = Array.isArray(_v) ?
_v :
_v == null ? [] : [_v];
}
mpath.unset(name, obj);
}
});
const _v = mpath.get(name, obj);
if (!this.$$populatedVirtuals) {
this.$$populatedVirtuals = {};
}
if (options.justOne || options.count) {
this.$$populatedVirtuals[name] = Array.isArray(_v) ?
_v[0] :
_v;
} else {
this.$$populatedVirtuals[name] = Array.isArray(_v) ?
_v :
_v == null ? [] : [_v];
}
mpath.unset(name, obj);
}
});
const _v = mpath.get(name, obj);
if (!this.$$populatedVirtuals) {
this.$$populatedVirtuals = {};
}
if (options.justOne || options.count) {
this.$$populatedVirtuals[name] = Array.isArray(_v) ?
_v[0] :
_v;
} else {
this.$$populatedVirtuals[name] = Array.isArray(_v) ?
_v :
_v == null ? [] : [_v];
}
mpath.unset(name, obj);
}
});