mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 10:21:52 +00:00
chore: reformat SDK utility files
This commit is contained in:
@@ -3,9 +3,10 @@ import { Manifest, PackageId } from '../osBindings'
|
||||
import { deepEqual } from './deepEqual'
|
||||
import { Watchable } from './Watchable'
|
||||
|
||||
export class GetServiceManifest<
|
||||
Mapped = Manifest | null,
|
||||
> extends Watchable<Manifest | null, Mapped> {
|
||||
export class GetServiceManifest<Mapped = Manifest | null> extends Watchable<
|
||||
Manifest | null,
|
||||
Mapped
|
||||
> {
|
||||
protected readonly label = 'GetServiceManifest'
|
||||
|
||||
constructor(
|
||||
@@ -40,8 +41,12 @@ export function getServiceManifest<Mapped>(
|
||||
map?: (manifest: Manifest | null) => Mapped,
|
||||
eq?: (a: Mapped, b: Mapped) => boolean,
|
||||
): GetServiceManifest<Mapped> {
|
||||
return new GetServiceManifest<Mapped>(effects, { packageId }, {
|
||||
map: map ?? ((a) => a as Mapped),
|
||||
eq: eq ?? ((a, b) => deepEqual(a, b)),
|
||||
})
|
||||
return new GetServiceManifest<Mapped>(
|
||||
effects,
|
||||
{ packageId },
|
||||
{
|
||||
map: map ?? ((a) => a as Mapped),
|
||||
eq: eq ?? ((a, b) => deepEqual(a, b)),
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
@@ -481,10 +481,14 @@ export function getOwnServiceInterface<Mapped>(
|
||||
map?: (interfaces: ServiceInterfaceFilled | null) => Mapped,
|
||||
eq?: (a: Mapped, b: Mapped) => boolean,
|
||||
): GetServiceInterface<Mapped> {
|
||||
return new GetServiceInterface<Mapped>(effects, { id }, {
|
||||
map: map ?? ((a) => a as Mapped),
|
||||
eq: eq ?? ((a, b) => deepEqual(a, b)),
|
||||
})
|
||||
return new GetServiceInterface<Mapped>(
|
||||
effects,
|
||||
{ id },
|
||||
{
|
||||
map: map ?? ((a) => a as Mapped),
|
||||
eq: eq ?? ((a, b) => deepEqual(a, b)),
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
export function getServiceInterface(
|
||||
|
||||
@@ -64,9 +64,7 @@ export class GetServiceInterfaces<
|
||||
}
|
||||
}
|
||||
|
||||
export function getOwnServiceInterfaces(
|
||||
effects: Effects,
|
||||
): GetServiceInterfaces
|
||||
export function getOwnServiceInterfaces(effects: Effects): GetServiceInterfaces
|
||||
export function getOwnServiceInterfaces<Mapped>(
|
||||
effects: Effects,
|
||||
map: (interfaces: ServiceInterfaceFilled[]) => Mapped,
|
||||
@@ -77,10 +75,14 @@ export function getOwnServiceInterfaces<Mapped>(
|
||||
map?: (interfaces: ServiceInterfaceFilled[]) => Mapped,
|
||||
eq?: (a: Mapped, b: Mapped) => boolean,
|
||||
): GetServiceInterfaces<Mapped> {
|
||||
return new GetServiceInterfaces<Mapped>(effects, {}, {
|
||||
map: map ?? ((a) => a as Mapped),
|
||||
eq: eq ?? ((a, b) => deepEqual(a, b)),
|
||||
})
|
||||
return new GetServiceInterfaces<Mapped>(
|
||||
effects,
|
||||
{},
|
||||
{
|
||||
map: map ?? ((a) => a as Mapped),
|
||||
eq: eq ?? ((a, b) => deepEqual(a, b)),
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
export function getServiceInterfaces(
|
||||
|
||||
Reference in New Issue
Block a user