"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const symbols_1 = require("./symbols");
class Type {
    constructor(is, name) {
        this.is = is;
        if (name == null) {
            name = is.name;
            if (name == null) {
                name = "";
            }
            if (name.startsWith("is")) {
                name = name.slice(2);
            }
        }
        this.name = name;
    }
    toString() {
        return name;
    }
    static is(instance) {
        var _a;
        return instance != null && typeof ((_a = instance.is) !== null && _a !== void 0 ? _a : instance[symbols_1.is]) === "function";
    }
}
exports.default = Type;
