Would it be possible to have a copy operation like `Object.assign(...)` to copy only known Properties to the destination?

My sample code looks like:

```js
class A {
    foo?: string;
    constructor(p: any) {
        Object.assign(this, p);
    }
}

const instance = new A({
    foo: 'test',
    bar: 'other'
});

console.log(instance); // yields:     A: { "foo": "test", "bar": "other" }
                       // but i want: A: { "foo": "test" }

```

I know that typings are removed in JS but wonder if it would still be possible with something like decorators.

Checking with `.hasOwnProperty` or similar is not an option because it should allow copy of unset properties like in the example above.