Skip to content

Commit

Permalink
feat(NODE-5399): use mongodb-js/saslprep instead of saslprep (#3818)
Browse files Browse the repository at this point in the history
  • Loading branch information
baileympearson authored Aug 17, 2023
1 parent 4cf1e96 commit c0d3927
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
19 changes: 11 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"socks": "^2.7.1"
},
"optionalDependencies": {
"saslprep": "^1.0.3"
"@mongodb-js/saslprep": "^1.1.0"
},
"peerDependencies": {
"@aws-sdk/credential-providers": "^3.201.0",
Expand Down Expand Up @@ -69,7 +69,6 @@
"@types/kerberos": "^1.1.2",
"@types/mocha": "^10.0.1",
"@types/node": "^20.1.0",
"@types/saslprep": "^1.0.1",
"@types/semver": "^7.5.0",
"@types/sinon": "^10.0.14",
"@types/sinon-chai": "^3.2.9",
Expand Down
15 changes: 8 additions & 7 deletions src/deps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,14 @@ export function getSnappy(): SnappyLib | { kModuleError: MongoMissingDependencyE
}
}

export let saslprep: typeof import('saslprep') | { kModuleError: MongoMissingDependencyError } =
makeErrorModule(
new MongoMissingDependencyError(
'Optional module `saslprep` not found.' +
' Please install it to enable Stringprep Profile for User Names and Passwords'
)
);
export let saslprep:
| typeof import('@mongodb-js/saslprep')
| { kModuleError: MongoMissingDependencyError } = makeErrorModule(
new MongoMissingDependencyError(
'Optional module `saslprep` not found.' +
' Please install it to enable Stringprep Profile for User Names and Passwords'
)
);

try {
// Ensure you always wrap an optional require in the try block NODE-3199
Expand Down

0 comments on commit c0d3927

Please sign in to comment.