UNPKG

743 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3const abstract_1 = require("./abstract");
4class 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}
26exports.StringLiteralType = StringLiteralType;
27//# sourceMappingURL=string-literal.js.map
\No newline at end of file