Skip to content

Commit ab0a183

Browse files
committed
fix: take into account returning could be boolean
1 parent a8e5490 commit ab0a183

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/BaseModel.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,7 +978,10 @@ export abstract class BaseModel<T> extends Model<BaseModel<T>> {
978978
// noinspection TypeScriptUnresolvedVariable
979979
const returning = (this as any)._options.returning;
980980

981-
if (returning && !~returning.indexOf(name)) {
981+
if (returning &&
982+
Array.isArray(returning) &&
983+
!~returning.indexOf(name)
984+
) {
982985
returning.push(name);
983986
}
984987

0 commit comments

Comments
 (0)