Skip to content

Commit

Permalink
Merge pull request #78 from apigames-core/upstream-master
Browse files Browse the repository at this point in the history
Upgraded to support MongoDB both v4 and v5 drivers
  • Loading branch information
cdimascio authored Apr 14, 2023
2 parents f707687 + c266c0b commit b8d905b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export interface MUUID extends Binary {
* "B" for 32 digits separated by hyphens, enclosed in braces, e.g. {00000000-0000-0000-0000-000000000000}; or
* "P" for 32 digits separated by hyphens, enclosed in parentheses, e.g. (00000000-0000-0000-0000-000000000000)
*/
toString(format?: 'utf8' | 'utf-8' | 'base64' | 'hex'): string;
toString(format?: UUIDFormat): string;
}
export type Mode = {
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
"uuid": "^9.0.0"
},
"peerDependencies": {
"mongodb": "3.6.x || 3.7.x || 4.x"
"mongodb": "3.6.x || 3.7.x || 4.x || 5.x"
},
"devDependencies": {
"eslint": "8.30.0",
"eslint-config-prettier": "^8.5.0",
"eslint": "8.38.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"mocha": "^10.2.0",
"prettier": "^2.8.1",
"mongodb": "4.13.0"
"prettier": "^2.8.7",
"mongodb": "5.2.0"
}
}
2 changes: 1 addition & 1 deletion test/uuid-mongodb_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('MUUID', function () {

it('should convert uuid from mongo BSON binary', () => {
const mUUID = MUUID.from(
Binary(uuidv1(null, Buffer.alloc(16)), Binary.SUBTYPE_UUID)
new Binary(uuidv1(null, Buffer.alloc(16)), Binary.SUBTYPE_UUID)
);
assert.equal(mUUID instanceof Binary, true);
assert.equal(validate(mUUID.toString()), true);
Expand Down

0 comments on commit b8d905b

Please sign in to comment.