time-to-botec

Benchmark sampling in different programming languages
Log | Files | Refs | README

SqDomain.js (668B)


      1 export function wrapDomain(value) {
      2     switch (value.type) {
      3         case "NumericRange":
      4             return new SqNumericRangeDomain(value);
      5         default:
      6             throw new Error(`Unknown type ${value.type}`);
      7     }
      8 }
      9 class SqAbstractDomain {
     10     constructor(_value) {
     11         this._value = _value;
     12     }
     13     toString() {
     14         return this._value.toString();
     15     }
     16 }
     17 class SqNumericRangeDomain extends SqAbstractDomain {
     18     constructor() {
     19         super(...arguments);
     20         this.tag = "NumericRange";
     21     }
     22     get min() {
     23         return this._value.min;
     24     }
     25     get max() {
     26         return this._value.max;
     27     }
     28 }
     29 //# sourceMappingURL=SqDomain.js.map