Skip to content

Commit b0b418b

Browse files
committed
Simplified query parameters type check
1 parent 0c25aa1 commit b0b418b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/v1/internal/util.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function isEmptyObjectOrNull(obj) {
3939
}
4040

4141
function isObject(obj) {
42-
return typeof obj === 'object' && !Array.isArray(obj) && Boolean(obj);
42+
return typeof obj === 'object' && !Array.isArray(obj) && obj !== null;
4343
}
4444

4545
/**
@@ -79,7 +79,7 @@ function assertCypherStatement(obj) {
7979
}
8080

8181
function assertQueryParameters(obj) {
82-
if (!isObject(obj) && Boolean(obj)) {
82+
if (!isObject(obj)) {
8383
// objects created with `Object.create(null)` do not have a constructor property
8484
const constructor = obj.constructor ? ' ' + obj.constructor.name : '';
8585
throw new TypeError(`Query parameters are expected to either be undefined/null or an object, given:${constructor} ${obj}`);

0 commit comments

Comments
 (0)