Skip to content

Commit 8e6d202

Browse files
committed
fix: linter
1 parent bc29f37 commit 8e6d202

File tree

4 files changed

+18
-20
lines changed

4 files changed

+18
-20
lines changed

packages/sdk/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export type FunctionInput = CrossplaneInput | Record<string, unknown>
9191
// RunFunctionRequest but is generic so domain SDKs can type it nicely.
9292
export interface RunFunctionRequest<
9393
TComposite = KubernetesResourceLike,
94-
TExtraResources = Record<string, unknown[]>
94+
TExtraResources = Record<string, unknown[]>,
9595
> {
9696
composite: TComposite
9797
extraResources?: TExtraResources
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
import { KubernetesResource } from "../types";
1+
import { KubernetesResource } from "../types.ts"
22

33
/**
44
* Extracts the name from a given composite resource object.
55
*/
66
export function getClaimName(claim: KubernetesResource): string {
7-
const name = claim.metadata.name;
8-
const claimName = claim.metadata.labels?.["crossplane.io/claim-name"];
9-
if (claimName) {
10-
return claimName;
11-
}
12-
throw new Error(`Resource ${name} wasn't created via a claim`);
7+
const name = claim.metadata.name
8+
const claimName = claim.metadata.labels?.["crossplane.io/claim-name"]
9+
if (claimName) {
10+
return claimName
11+
}
12+
throw new Error(`Resource ${name} wasn't created via a claim`)
1313
}
1414

1515
/**
1616
* Extracts the namespace from a given composite resource object.
1717
*/
1818
export function getClaimNamespace(claim: KubernetesResource): string {
19-
const name = claim.metadata.name;
20-
const claimNamespace = claim.metadata.labels?.["crossplane.io/claim-namespace"];
21-
if (claimNamespace) {
22-
return claimNamespace;
23-
}
24-
throw new Error(`Resource ${name} wasn't created via a claim`);
19+
const name = claim.metadata.name
20+
const claimNamespace = claim.metadata.labels?.["crossplane.io/claim-namespace"]
21+
if (claimNamespace) {
22+
return claimNamespace
23+
}
24+
throw new Error(`Resource ${name} wasn't created via a claim`)
2525
}

packages/sdk/src/utils/compositeUtils.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import type { KubernetesResource, KubernetesResourceLike } from '../types.ts'
1+
import type { KubernetesResource, KubernetesResourceLike } from "../types.ts"
22

33
/**
44
* Normalize a KubernetesResourceLike into a plain KubernetesResource.
55
* If the object implements toJSON(), that result is used.
66
*/
77
function normalizeResource(resource: KubernetesResourceLike): KubernetesResource {
8-
if (typeof (resource as any)?.toJSON === 'function') {
8+
if (typeof (resource as any)?.toJSON === "function") {
99
return (resource as any).toJSON() as KubernetesResource
1010
}
1111
return resource as KubernetesResource
@@ -25,9 +25,7 @@ function normalizeResource(resource: KubernetesResourceLike): KubernetesResource
2525
* - intentionally drop spec and all other metadata fields so JS cannot
2626
* accidentally try to own spec or server-managed metadata.
2727
*/
28-
export function toDesiredCompositeResource(
29-
resource: KubernetesResourceLike
30-
): KubernetesResource {
28+
export function toDesiredCompositeResource(resource: KubernetesResourceLike): KubernetesResource {
3129
const normalized = normalizeResource(resource)
3230

3331
return {

packages/server/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export type FunctionInput = CrossplaneInput | Record<string, unknown>
135135
*/
136136
export interface RunFunctionRequest<
137137
TComposite = unknown,
138-
TExtraResources = Record<string, unknown[]>
138+
TExtraResources = Record<string, unknown[]>,
139139
> {
140140
composite: TComposite
141141
extraResources?: TExtraResources

0 commit comments

Comments
 (0)