Avoid spread operator to fix TypeScript errors
This commit is contained in:
@@ -15,8 +15,7 @@ class And extends LogicalNary {
|
||||
* @param {...import("./Filter.js").default} conditions Conditions.
|
||||
*/
|
||||
constructor(conditions) {
|
||||
const params = ['And'].concat(Array.prototype.slice.call(arguments));
|
||||
super(...params);
|
||||
super('And', Array.prototype.slice.call(arguments));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ class LogicalNary extends Filter {
|
||||
|
||||
/**
|
||||
* @param {!string} tagName The XML tag name for this filter.
|
||||
* @param {...import("./Filter.js").default} conditions Conditions.
|
||||
* @param {Array<import("./Filter.js").default>} conditions Conditions.
|
||||
*/
|
||||
constructor(tagName, conditions) {
|
||||
|
||||
@@ -24,7 +24,7 @@ class LogicalNary extends Filter {
|
||||
/**
|
||||
* @type {Array<import("./Filter.js").default>}
|
||||
*/
|
||||
this.conditions = Array.prototype.slice.call(arguments, 1);
|
||||
this.conditions = conditions;
|
||||
assert(this.conditions.length >= 2, 57); // At least 2 conditions are required.
|
||||
}
|
||||
|
||||
|
||||
@@ -14,8 +14,7 @@ class Or extends LogicalNary {
|
||||
* @param {...import("./Filter.js").default} conditions Conditions.
|
||||
*/
|
||||
constructor(conditions) {
|
||||
const params = ['Or'].concat(Array.prototype.slice.call(arguments));
|
||||
super(...params);
|
||||
super('Or', Array.prototype.slice.call(arguments));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user