Comparing version 8.6.2 to 8.6.3
@@ -31,2 +31,3 @@ /** | ||
module.exports.version = mongoose.version; | ||
module.exports.Aggregate = mongoose.Aggregate; | ||
module.exports.Mongoose = mongoose.Mongoose; | ||
@@ -33,0 +34,0 @@ module.exports.Schema = mongoose.Schema; |
@@ -30,15 +30,2 @@ /*! | ||
/** | ||
* Helper function to convert the buffer input to a string | ||
* @param {Buffer} buf The buffer to convert to a hex-string | ||
* @returns {String} The buffer as a hex-string | ||
* @api private | ||
*/ | ||
function binary2hex(buf) { | ||
// use buffer built-in function to convert from buffer to hex-string | ||
const hex = buf != null && buf.toString('hex'); | ||
return hex; | ||
} | ||
/** | ||
* Convert a String to Binary | ||
@@ -71,3 +58,3 @@ * @param {String} uuidStr The value to process | ||
if (typeof uuidBin !== 'string' && uuidBin != null) { | ||
hex = binary2hex(uuidBin); | ||
hex = uuidBin.toString('hex'); | ||
const uuidStr = hex.substring(0, 8) + '-' + hex.substring(8, 8 + 4) + '-' + hex.substring(12, 12 + 4) + '-' + hex.substring(16, 16 + 4) + '-' + hex.substring(20, 20 + 12); | ||
@@ -95,3 +82,11 @@ return uuidStr; | ||
} | ||
return binaryToString(value); | ||
if (Buffer.isBuffer(value)) { | ||
return binaryToString(value); | ||
} else if (value instanceof Binary) { | ||
return binaryToString(value.buffer); | ||
} else if (utils.isPOJO(value) && value.type === 'Buffer' && Array.isArray(value.data)) { | ||
// Cloned buffers look like `{ type: 'Buffer', data: [5, 224, ...] }` | ||
return binaryToString(Buffer.from(value.data)); | ||
} | ||
return value; | ||
}); | ||
@@ -98,0 +93,0 @@ } |
{ | ||
"name": "mongoose", | ||
"description": "Mongoose MongoDB ODM", | ||
"version": "8.6.2", | ||
"version": "8.6.3", | ||
"author": "Guillermo Rauch <guillermo@learnboost.com>", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
@@ -141,3 +141,3 @@ declare module 'mongoose' { | ||
*/ | ||
depopulate(path?: string | string[]): this; | ||
depopulate<Paths = {}>(path?: string | string[]): MergeType<this, Paths>; | ||
@@ -144,0 +144,0 @@ /** |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2718747
51279