Skip to content

Commit

Permalink
fixed strict equality for null
Browse files Browse the repository at this point in the history
  • Loading branch information
WesleyClements committed Mar 18, 2022
1 parent 0736de8 commit 706fb8e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/annotations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ export function defineTypes<S extends Schema, R extends Schema>(
for (let propertyName in fields) {
const propertyOptions: PropertyDefinitionOptions<S, R> = (() => {
const prop = fields[propertyName];
if (isPrimitive(prop) || Array.isArray(prop) || prop["type"] === null) return {
if (isPrimitive(prop) || Array.isArray(prop) || prop["type"] == null) return {
type: prop as DefinitionType
};

Expand All @@ -400,6 +400,7 @@ export function defineTypes<S extends Schema, R extends Schema>(
} else if (Set.isPrototypeOf(options["type"])) {
result.type = { set: options["of"] };
}

return result;
})();
type(propertyOptions.type, context)(target.prototype, propertyName);
Expand Down

0 comments on commit 706fb8e

Please sign in to comment.