Skip to content

Commit 699c82d

Browse files
vkarpov15Copilot
andauthored
Update lib/schema.js
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 7634218 commit 699c82d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/schema.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,10 +692,13 @@ Schema.prototype._defaultToObjectOptions = function(json) {
692692
* @param {'csfle' | 'queryableEncryption' | undefined} encryptionType plain object with paths to add, or another schema
693693
*/
694694
Schema.prototype.encryptionType = function encryptionType(encryptionType) {
695+
if (arguments.length === 0) {
696+
return this.options.encryptionType;
697+
}
695698
if (typeof encryptionType === 'string' || encryptionType === null) {
696699
this.options.encryptionType = encryptionType;
697700
} else {
698-
return this.options.encryptionType;
701+
throw new TypeError('Invalid encryptionType. Expected a string, null, or no arguments.');
699702
}
700703
};
701704

0 commit comments

Comments
 (0)