woutervh- / typescript-is

MIT License
959 stars 35 forks source link

Bug: A missing key and a key with a value of undefined are not considered the same #122

Open North101 opened 2 years ago

North101 commented 2 years ago

Example:

interface Foo {
  foo?: string;
}

const foo1: Foo = {
  foo: undefined,
}

const foo2: Foo = {}

console.log(is<Foo>(foo1)); // false
console.log(is<Foo>(foo2)); // true

Should they not both be true?