diff --git a/src/dictionary.ts b/src/dictionary.ts index dbb377c..cc8e1d2 100644 --- a/src/dictionary.ts +++ b/src/dictionary.ts @@ -1,14 +1,13 @@ import { objectRuntype } from './object' import { createFail, - setupInternalRuntype, + InternalRuntypeOf, isFail, propagateFail, - getInternalRuntype, - InternalRuntypeOf, + setupInternalRuntype, } from './runtype' +import type { Runtype } from './runtype' import { debugValue } from './runtypeError' -import type { Runtype, InternalRuntype, Fail } from './runtype' const internalObjectRuntype: InternalRuntypeOf = objectRuntype diff --git a/src/record.ts b/src/record.ts index 3cf89ca..1012dce 100644 --- a/src/record.ts +++ b/src/record.ts @@ -58,7 +58,7 @@ export function internalRecord( // checked at all // this is vital to preserve the object shape of an impure record // with optional fields - if (t.meta?.optional && !o.hasOwnProperty(k)) { + if (t.meta?.optional && !Object.prototype.hasOwnProperty.call(o, k)) { break }