Skip to content

Commit b20df1f

Browse files
committed
fix: default Schema fields arg to empty object
This should help with the "objectification" of fields.
1 parent 3f8d2cb commit b20df1f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class Schema<T extends TypeMap = any> {
2626
public readonly metadataVersion: MetadataVersion;
2727

2828
constructor(
29-
fields: Field<T[keyof T]>[] | FieldDictionary<T> = [],
29+
fields: Field<T[keyof T]>[] | FieldDictionary<T> = {} as FieldDictionary<T>,
3030
metadata?: Map<string, string> | null,
3131
dictionaries?: Map<number, DataType> | null,
3232
metadataVersion = MetadataVersion.V5) {

0 commit comments

Comments
 (0)