Skip to content

Commit e54e1cd

Browse files
committed
Rename Configs.items -> Configs.input for consistency
1 parent 0f7a3b9 commit e54e1cd

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

ts/kpt-functions/docs/classes/_types_.configs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ It enables performing rich query and mutation operations.
3232

3333
### constructor
3434

35-
\+ **new Configs**(`items`: [KubernetesObject](../interfaces/_types_.kubernetesobject.md)[], `functionConfig?`: [KubernetesObject](../interfaces/_types_.kubernetesobject.md)): *[Configs](_types_.configs.md)*
35+
\+ **new Configs**(`input`: [KubernetesObject](../interfaces/_types_.kubernetesobject.md)[], `functionConfig?`: [KubernetesObject](../interfaces/_types_.kubernetesobject.md)): *[Configs](_types_.configs.md)*
3636

3737
Creates a Config.
3838

3939
**Parameters:**
4040

4141
Name | Type | Default | Description |
4242
------ | ------ | ------ | ------ |
43-
`items` | [KubernetesObject](../interfaces/_types_.kubernetesobject.md)[] | [] | Input Kubernetes objects. If supplied multiple objects with the same (Group, Kind, Namespace, Name) discards all but the last one. Does not preserve insertion order of the passed objects. |
43+
`input` | [KubernetesObject](../interfaces/_types_.kubernetesobject.md)[] | [] | Input Kubernetes objects. If supplied multiple objects with the same (Group, Kind, Namespace, Name) discards all but the last one. Does not preserve insertion order of the passed objects. |
4444
`functionConfig?` | [KubernetesObject](../interfaces/_types_.kubernetesobject.md) | - | Kubernetes object used to parameterize the function's behavior. |
4545

4646
**Returns:** *[Configs](_types_.configs.md)*

ts/kpt-functions/src/types.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,17 @@ export class Configs {
4747
/**
4848
* Creates a Config.
4949
*
50-
* @param items Input Kubernetes objects.
50+
* @param input Input Kubernetes objects.
5151
* If supplied multiple objects with the same (Group, Kind, Namespace, Name) discards all but the last one.
5252
* Does not preserve insertion order of the passed objects.
5353
* @param functionConfig Kubernetes object used to parameterize the function's behavior.
5454
*/
5555
constructor(
56-
items: KubernetesObject[] = [],
56+
input: KubernetesObject[] = [],
5757
functionConfig?: KubernetesObject
5858
) {
5959
this.functionConfig = functionConfig;
60-
this.insert(...items);
60+
this.insert(...input);
6161
}
6262

6363
/**
@@ -68,7 +68,7 @@ export class Configs {
6868
* Returned objects are pass-by-reference; mutating them results in changes being persisted.
6969
*/
7070
getAll(): KubernetesObject[] {
71-
return this.items.map(e => e[1]);
71+
return this.objects.map(e => e[1]);
7272
}
7373

7474
/**
@@ -103,8 +103,8 @@ export class Configs {
103103
insert(...objects: KubernetesObject[]): void {
104104
objects.forEach(o => {
105105
const key: string = kubernetesKeyFn(o);
106-
const [index, found] = this.indexOf(key, this.items, 0);
107-
this.items.splice(index, found ? 1 : 0, [key, o]);
106+
const [index, found] = this.indexOf(key, this.objects, 0);
107+
this.objects.splice(index, found ? 1 : 0, [key, o]);
108108
});
109109
}
110110

@@ -118,9 +118,9 @@ export class Configs {
118118
delete(...objects: KubernetesObject[]): void {
119119
objects.forEach(o => {
120120
const key: string = kubernetesKeyFn(o);
121-
const [index, found] = this.indexOf(key, this.items, 0);
121+
const [index, found] = this.indexOf(key, this.objects, 0);
122122
if (found) {
123-
this.items.splice(index, 1);
123+
this.objects.splice(index, 1);
124124
}
125125
});
126126
}
@@ -129,7 +129,7 @@ export class Configs {
129129
* Deletes all objects.
130130
*/
131131
deleteAll(): void {
132-
this.items = [];
132+
this.objects = [];
133133
}
134134

135135
/**
@@ -234,7 +234,7 @@ export class Configs {
234234
/**
235235
* A sorted array of the contained objects and their keys.
236236
*/
237-
private items: Array<[string, KubernetesObject]> = [];
237+
private objects: Array<[string, KubernetesObject]> = [];
238238

239239
/**
240240
* Object used as parameters to the function.

0 commit comments

Comments
 (0)