UNPKG

2.91 kBSource Map (JSON)View Raw
1{"version":3,"file":"type-parameter.js","sourceRoot":"","sources":["../../../../src/lib/models/types/type-parameter.ts"],"names":[],"mappings":";;AAAA,yCAAkC;AASlC,MAAa,iBAAkB,SAAQ,eAAI;IAavC,YAAY,IAAY;QACpB,KAAK,EAAE,CAAC;QAHH,SAAI,GAAW,eAAe,CAAC;QAIpC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;IAOD,KAAK;QACD,MAAM,KAAK,GAAG,IAAI,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/C,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QACnC,OAAO,KAAK,CAAC;IACjB,CAAC;IAQD,MAAM,CAAC,IAAuB;QAC1B,IAAI,CAAC,CAAC,IAAI,YAAY,iBAAiB,CAAC,EAAE;YACtC,OAAO,KAAK,CAAC;SAChB;QAED,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,EAAE;YACpC,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;SAClD;aAAM,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YAC7C,OAAO,IAAI,CAAC;SACf;aAAM;YACH,OAAO,KAAK,CAAC;SAChB;IACL,CAAC;IAMD,QAAQ;QACJ,MAAM,MAAM,GAAQ,KAAK,CAAC,QAAQ,EAAE,CAAC;QACrC,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QAExB,IAAI,IAAI,CAAC,UAAU,EAAE;YACjB,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;SAClD;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;IAKD,QAAQ;QACJ,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;CACJ;AAtED,8CAsEC","sourcesContent":["import { Type } from './abstract';\n\n/**\n * Represents a type parameter type.\n *\n * ~~~\n * let value: T;\n * ~~~\n */\nexport class TypeParameterType extends Type {\n /**\n *\n */\n readonly name: string;\n\n constraint?: Type;\n\n /**\n * The type name identifier.\n */\n readonly type: string = 'typeParameter';\n\n constructor(name: string) {\n super();\n this.name = name;\n }\n\n /**\n * Clone this type.\n *\n * @return A clone of this type.\n */\n clone(): Type {\n const clone = new TypeParameterType(this.name);\n clone.constraint = this.constraint;\n return clone;\n }\n\n /**\n * Test whether this type equals the given type.\n *\n * @param type The type that should be checked for equality.\n * @returns TRUE if the given type equals this type, FALSE otherwise.\n */\n equals(type: TypeParameterType): boolean {\n if (!(type instanceof TypeParameterType)) {\n return false;\n }\n\n if (this.constraint && type.constraint) {\n return type.constraint.equals(this.constraint);\n } else if (!this.constraint && !type.constraint) {\n return true;\n } else {\n return false;\n }\n }\n\n /**\n * Return a raw object representation of this type.\n * @deprecated Use serializers instead\n */\n toObject(): any {\n const result: any = super.toObject();\n result.name = this.name;\n\n if (this.constraint) {\n result.constraint = this.constraint.toObject();\n }\n\n return result;\n }\n\n /**\n * Return a string representation of this type.\n */\n toString() {\n return this.name;\n }\n}\n"]}
\No newline at end of file