MCPcopy Index your code
hub / github.com/angular/angular / appendAll

Method appendAll

packages/common/http/src/params.ts:252–267  ·  view source on GitHub ↗

* Constructs a new body with appended values for the given parameter name. * @param params parameters and values * @return A new body with the new value.

(params: {
    [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
  })

Source from the content-addressed store, hash-verified

250 * @return A new body with the new value.
251 */
252 appendAll(params: {
253 [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
254 }): HttpParams {
255 const updates: Update[] = [];
256 Object.keys(params).forEach((param) => {
257 const value = params[param];
258 if (Array.isArray(value)) {
259 value.forEach((_value) => {
260 updates.push({param, value: _value, op: 'a'});
261 });
262 } else {
263 updates.push({param, value: value as string | number | boolean, op: 'a'});
264 }
265 });
266 return this.clone(updates);
267 }
268
269 /**
270 * Replaces the value for a parameter.

Callers 1

params_spec.tsFile · 0.80

Calls 5

cloneMethod · 0.95
isArrayMethod · 0.80
keysMethod · 0.65
forEachMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected