error TS2345: Argument of type ‘T’ is not assignable to parameter of type ‘object’

Change signature of the function, so that generic type T extends type object, introduced in Typescript 2.2. Use this syntax – <T extends object>:

function create<T extends object>(prototype: T, pojo: Object): T {
    ...
    return Object.create(prototype, descriptors) as T;
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)