If you use a parameter object in JavaScript, even if you specify its shape using JSDoc, you’ll only get errors if required properties are missing; not if there are extra properties provided.
e.g.,
```js
class A {
/**
@param {{
id:string
}} params
*/
constructor (params) {
Object.assign(this, params)
}
}
// Error:
new A({})
// No error:
new A({id: ‘x’, foo:‘bar’})
```
According to this thread, it’s a fact-of-life:
[https://stackoverflow.com/questions/49580725/is-it-possible-to-restrict-typesc … ⌘ Read more