@drip_sync/drip
Version:
Scalable incremental sync for MongoDB aggregation pipelines
13 lines (12 loc) • 516 B
JavaScript
;
// See https://www.mongodb.com/docs/manual/reference/bson-types/
Object.defineProperty(exports, "__esModule", { value: true });
exports.isComposite = isComposite;
function isComposite(v) {
return (typeof v === "object" &&
v !== null &&
// See https://github.com/mongodb/js-bson/blob/7f2a6d3c1a21de23555c887928f253bf75c36ce8/src/extended_json.ts#L60
!("_bsontype" in v && typeof v._bsontype === "string") &&
!(v instanceof Date) &&
!(v instanceof RegExp));
}