/
span-little-big-query-base.js
46 lines (39 loc) · 1.13 KB
/
span-little-big-query-base.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
'use strict';
const {
util: { checkType }
} = require('../../core');
const SpanQueryBase = require('./span-query-base');
/**
* Base class for span queries with `little`, `big` clauses.
*
* **NOTE:** Instantiating this directly should not be required.
* However, if you wish to add a custom implementation for whatever reason,
* this class could be extended.
*
* @extends SpanQueryBase
*/
class SpanLittleBigQueryBase extends SpanQueryBase {
/**
* Sets the `little` clause.
*
* @param {SpanQueryBase} spanQry Any span type query
* @returns {SpanLittleBigQueryBase} returns `this` so that calls can be chained.
*/
little(spanQry) {
checkType(spanQry, SpanQueryBase);
this._queryOpts.little = spanQry;
return this;
}
/**
* Sets the `big` clause.
*
* @param {SpanQueryBase} spanQry Any span type query
* @returns {SpanLittleBigQueryBase} returns `this` so that calls can be chained.
*/
big(spanQry) {
checkType(spanQry, SpanQueryBase);
this._queryOpts.big = spanQry;
return this;
}
}
module.exports = SpanLittleBigQueryBase;