Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ export class Collection<Schema extends StandardSchemaV1> {
const { take, cursor, skip } = options

invariant(
typeof skip !== 'undefined' ? Number.isInteger(skip) && skip >= 0 : true,
skip !== undefined ? Number.isInteger(skip) && skip >= 0 : true,
'Failed to query the collection: expected the "skip" pagination option to be a number larger or equal to 0 but got %j',
skip,
)
Expand Down
2 changes: 1 addition & 1 deletion src/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export class Query<T> {
return Object.entries(condition).every(([key, selector]) => {
const actualValue = record[key]

if (typeof actualValue === 'undefined') {
if (actualValue === undefined) {
return false
}

Expand Down
4 changes: 2 additions & 2 deletions src/relation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ export abstract class Relation {
returnValue,
)

if (typeof returnValue !== 'undefined') {
if (returnValue !== undefined) {
return returnValue
}

Expand Down Expand Up @@ -516,7 +516,7 @@ class One extends Relation {
/**
* @note `null` is a valid value for nullable relations.
*/
if (typeof record !== 'undefined') {
if (record !== undefined) {
return record
}
}
Expand Down