File tree 7 files changed +241
-202
lines changed
7 files changed +241
-202
lines changed Original file line number Diff line number Diff line change 23
23
- name : Install Deno
24
24
uses : denolib/setup-deno@master
25
25
with :
26
- deno-version : 1 .x.x
26
+ deno-version : 2 .x.x
27
27
28
28
- name : Log versions
29
29
run : |
Original file line number Diff line number Diff line change 33
33
34
34
- name : Publish to JSR
35
35
run : |
36
- deno publish
36
+ deno publish
Original file line number Diff line number Diff line change @@ -16,6 +16,6 @@ export {
16
16
Timestamp ,
17
17
UUID ,
18
18
} from "jsr:@lucsoft/web-bson@^0.3.1" ;
19
- export { crypto as stdCrypto } from "jsr:@std/crypto@^0.224.0 /crypto" ;
20
- export { decodeBase64 , encodeBase64 } from "jsr:@std/encoding@^0.224.0 /base64" ;
21
- export { encodeHex } from "jsr:@std/encoding@^0.224.0 /hex" ;
19
+ export { crypto as stdCrypto } from "jsr:@std/crypto@^1.0.3 /crypto" ;
20
+ export { decodeBase64 , encodeBase64 } from "jsr:@std/encoding@^1.0.5 /base64" ;
21
+ export { encodeHex } from "jsr:@std/encoding@^1.0.5 /hex" ;
Original file line number Diff line number Diff line change @@ -41,9 +41,7 @@ export class MongoClient {
41
41
*
42
42
* @param options Connection options or a MongoDB URI
43
43
*/
44
- async connect (
45
- options : ConnectOptions | string ,
46
- ) : Promise < Database > {
44
+ async connect ( options : ConnectOptions | string ) : Promise < Database > {
47
45
try {
48
46
const parsedOptions = typeof options === "string"
49
47
? await parse ( options )
@@ -59,8 +57,10 @@ export class MongoClient {
59
57
this . #buildInfo = await this . runCommand ( this . #defaultDbName, {
60
58
buildInfo : 1 ,
61
59
} ) ;
62
- } catch ( e ) {
63
- throw new MongoDriverError ( `Connection failed: ${ e . message || e } ` ) ;
60
+ } catch ( e : unknown ) {
61
+ throw new MongoDriverError (
62
+ `Connection failed: ${ e instanceof Error ? e . message : "unknown" } ` ,
63
+ ) ;
64
64
}
65
65
return this . database ( ( options as ConnectOptions ) . db ) ;
66
66
}
@@ -71,12 +71,14 @@ export class MongoClient {
71
71
* @param options Options to pass to the `listDatabases` command
72
72
* @returns A list of databases including their name, size on disk, and whether they are empty
73
73
*/
74
- async listDatabases ( options : {
75
- filter ?: Document ;
76
- nameOnly ?: boolean ;
77
- authorizedCollections ?: boolean ;
78
- comment ?: Document ;
79
- } = { } ) : Promise < ListDatabaseInfo [ ] > {
74
+ async listDatabases (
75
+ options : {
76
+ filter ?: Document ;
77
+ nameOnly ?: boolean ;
78
+ authorizedCollections ?: boolean ;
79
+ comment ?: Document ;
80
+ } = { } ,
81
+ ) : Promise < ListDatabaseInfo [ ] > {
80
82
const { databases } = await this . getCluster ( ) . protocol . commandSingle (
81
83
"admin" ,
82
84
{
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ export class MongoRuntimeError extends MongoDriverError {
73
73
super ( message ) ;
74
74
}
75
75
76
- get name ( ) : string {
76
+ override get name ( ) : string {
77
77
return "MongoRuntimeError" ;
78
78
}
79
79
}
You can’t perform that action at this time.
0 commit comments