Hello,
Given this code sample:
import { Model } from "objectmodel"
const classSchema = {
id: String,
lastName: [String],
firstName: [String]
}
const defaultValues = { lastName: "a" }
class Character extends Model(classSchema).defaultTo(defaultValues) {}
const o = new Character({ id: "1" }) // <- typescript: Expected 0 arguments, but got 1.
console.log(o)
TypeScript underlines { id: "1" } with the error "Expected 0 arguments, but got 1" when creating a new instance of the Character class.
Is there something wrong in this code?
Note that I get the same TypeScript error with the ObjectModel example given at chapter Default values assignment in the doc.
Hello,
Given this code sample:
TypeScript underlines
{ id: "1" }with the error "Expected 0 arguments, but got 1" when creating a new instance of theCharacterclass.Is there something wrong in this code?