We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7634218 commit 699c82dCopy full SHA for 699c82d
lib/schema.js
@@ -692,10 +692,13 @@ Schema.prototype._defaultToObjectOptions = function(json) {
692
* @param {'csfle' | 'queryableEncryption' | undefined} encryptionType plain object with paths to add, or another schema
693
*/
694
Schema.prototype.encryptionType = function encryptionType(encryptionType) {
695
+ if (arguments.length === 0) {
696
+ return this.options.encryptionType;
697
+ }
698
if (typeof encryptionType === 'string' || encryptionType === null) {
699
this.options.encryptionType = encryptionType;
700
} else {
- return this.options.encryptionType;
701
+ throw new TypeError('Invalid encryptionType. Expected a string, null, or no arguments.');
702
}
703
};
704
0 commit comments