Skip to content

Commit 66de43c

Browse files
committed
feat: add more options to methods
1 parent a69a5ba commit 66de43c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/core/BaseService.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,8 @@ class BaseService {
200200
return this
201201
}
202202

203+
setParameter(parameter: string): this
204+
setParameter(parameter: string, value?: any): this
203205
setParameter(parameter: string, value?: any): this {
204206
if (!value) {
205207
const options: IParseOptions = Object.assign({}, this.$parsedQs, {
@@ -214,8 +216,10 @@ class BaseService {
214216
return this
215217
}
216218

219+
removeParameters(): this
220+
removeParameters(parameters: any[]): this
217221
removeParameters(parameters = [] as any[]): this {
218-
if (!parameters.length) {
222+
if (!parameters || !parameters.length) {
219223
this.parameters = []
220224
} else {
221225
for (const parameter of parameters) {

0 commit comments

Comments
 (0)