1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const abstract_1 = require("./abstract");
|
4 | class StringLiteralType extends abstract_1.Type {
|
5 | constructor(value) {
|
6 | super();
|
7 | this.type = 'stringLiteral';
|
8 | this.value = value;
|
9 | }
|
10 | clone() {
|
11 | return new StringLiteralType(this.value);
|
12 | }
|
13 | equals(type) {
|
14 | return type instanceof StringLiteralType &&
|
15 | type.value === this.value;
|
16 | }
|
17 | toObject() {
|
18 | const result = super.toObject();
|
19 | result.value = this.value;
|
20 | return result;
|
21 | }
|
22 | toString() {
|
23 | return '"' + this.value + '"';
|
24 | }
|
25 | }
|
26 | exports.StringLiteralType = StringLiteralType;
|
27 |
|
\ | No newline at end of file |