Skip to content

Return undefined + give proper error messages, if types could not be followed #113

@bogeeee

Description

@bogeeee

Request for a proper handling, when a type is a built in one, or from a non transformed module, where we have no RTTI.
Returning any and passing the validation is no good from a security perspective ;)

import { reflect } from 'typescript-rtti';

class A {
    foo() { return window }
}

console.log(reflect(A).getMethod('foo').returnType.toString()); // Got: "any", expected: an Error, returnType is undefined / indicate that type could not be followed
console.log(reflect(A).getMethod('foo').returnType.matchesValue("abc")); // Got: true, expected: an Error, that the type could not be followed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions