Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
baileympearson committed Jan 15, 2025
1 parent 42d9607 commit ac3bc52
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/encryption_utils.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const { Array } = require('./schema/index.js');
const schemaTypes = require('./schema/index.js');
const SchemaBigInt = require('./schema/bigint');
const SchemaBoolean = require('./schema/boolean');
const SchemaBuffer = require('./schema/buffer');
Expand Down Expand Up @@ -60,7 +60,7 @@ function inferBSONType(schema, path) {
return 'double';
}

if (type instanceof Array) {
if (type instanceof schemaTypes.Array) {
return 'array';
}

Expand Down
9 changes: 7 additions & 2 deletions test/encrypted_schema.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,13 @@ describe('encrypted schema declaration', function() {
}
}

// Don't forget to add `Int8` to the type registry
mongoose.Schema.Types.Int8 = Int8;
this.beforeEach(function() {
// Don't forget to add `Int8` to the type registry
mongoose.Schema.Types.Int8 = Int8;
});
this.afterEach(function() {
delete mongoose.Schema.Types.Int8;
});

it('Then an error is thrown', function() {
assert.throws(() => {
Expand Down

0 comments on commit ac3bc52

Please sign in to comment.