dd
dd copied to clipboard
TypeScript Argument Expectation
Error
TSError: ⨯ Unable to compile TypeScript:
index.ts:15:1 - error TS2554: Expected 3 arguments, but got 1.
Code
import dd from '@nunomaduro/dd';
class Person {
firstName: string;
lastName: string;
constructor(firstName: string, lastName: string) {
this.firstName = firstName;
this.lastName = lastName;
}
}
const person = new Person('Parker', 'McMullin');
dd(person);
Here is a screenshot of what I see the parameters are:

Potential Solution
From what I read in the actual source code, it appears that the typings just need to be updated because dd is only expecting a readonly any[] args list.
Weird. The typings that ship with the package are correct: https://cdn.jsdelivr.net/npm/@nunomaduro/[email protected]/dist/dd.d.ts.
What version of typescript are you using?
v3.3.3, so not too outdated. Here's a REPL.