historical.js
function (val) {
        return val &&
            typeof val === 'object' &&
            !(val instanceof Date) &&
            !(val instanceof ObjectId) &&
            (!Array.isArray(val) || val.length > 0) &&
            !(val instanceof Buffer);
    }
function (val) {
        return val &&
            typeof val === 'object' &&
            !(val instanceof Date) &&
            !(val instanceof ObjectId) &&
            (!Array.isArray(val) || val.length > 0) &&
            !(val instanceof Buffer);
    }
function ( val ) { return val && typeof val === 'object' && ! ( val instanceof Date ) && ! ( val instanceof ObjectId ) && ( ! Array . isArray ( val ) || val . length > 0 ) && ! ( val instanceof Buffer ) ; }
CODE BETWEEN THESE COMMENT LINES WAS ADAPTED FROM THE MONGOOSE CODEBASE
CODE BETWEEN THESE COMMENT LINES WAS ADAPTED FROM THE MONGOOSE CODEBASE