The Boxer

typescript instance of 사용시 본문

카테고리 없음

typescript instance of 사용시

Prower 2021. 8. 6. 10:50
728x90
반응형

instanceof checks if the constructors are the same. The thing is that your code gets its own copy of the constructor from the code in the library (because that's how it is, it's not your fault), so they are not the same instance anymore.

The constructors still share the same name though:

 

from: https://stackoverflow.com/questions/59265098/instanceof-not-work-correctly-in-typescript-library-project

 

instanceof not work correctly in typescript library project

I build a typescript library project. and use some classes from a public package. let's say a simple function to test it is a BadRequestException or not import { BadRequestException } from "@nestjs/

stackoverflow.com

 

728x90
반응형
Comments