Skip to content

Commit 204b2c7

Browse files
committed
chore(cli-repl): account for changes to nightly driver typings
Specifically, match the stricter typing in mongodb/node-mongodb-native@dab4c7c.
1 parent 130fd18 commit 204b2c7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/cli-repl/src/crypt-library-paths.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,16 @@ import path from 'path';
22
import { promises as fs, constants as fsConstants } from 'fs';
33
import type { MongoshBus } from '@mongosh/types';
44

5-
export const SHARED_LIBRARY_SUFFIX =
5+
type SharedObjectSuffix = 'so' | 'dylib' | 'dll';
6+
export const SHARED_LIBRARY_SUFFIX: SharedObjectSuffix =
67
process.platform === 'win32'
78
? 'dll'
89
: process.platform === 'darwin'
910
? 'dylib'
1011
: 'so';
1112

1213
export interface CryptLibraryPathResult {
13-
cryptSharedLibPath?: string;
14+
cryptSharedLibPath?: `${string}mongo_crypt_v${number}.${SharedObjectSuffix}`;
1415
expectedVersion?: { version: bigint; versionStr: string };
1516
}
1617

@@ -54,7 +55,7 @@ export async function getCryptLibraryPaths(
5455
),
5556
// Location of the shared library in the zip and tgz packages
5657
path.resolve(bindir, `mongosh_crypt_v1.${SHARED_LIBRARY_SUFFIX}`),
57-
]) {
58+
] as Array<`${string}mongo_crypt_v1.${SharedObjectSuffix}`>) {
5859
try {
5960
const permissionsMismatch = await ensureMatchingPermissions(
6061
libraryCandidate,

0 commit comments

Comments
 (0)