mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +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 { deepEqual } from './deepEqual'
|
||||||
import { Watchable } from './Watchable'
|
import { Watchable } from './Watchable'
|
||||||
|
|
||||||
export class GetServiceManifest<
|
export class GetServiceManifest<Mapped = Manifest | null> extends Watchable<
|
||||||
Mapped = Manifest | null,
|
Manifest | null,
|
||||||
> extends Watchable<Manifest | null, Mapped> {
|
Mapped
|
||||||
|
> {
|
||||||
protected readonly label = 'GetServiceManifest'
|
protected readonly label = 'GetServiceManifest'
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@@ -40,8 +41,12 @@ export function getServiceManifest<Mapped>(
|
|||||||
map?: (manifest: Manifest | null) => Mapped,
|
map?: (manifest: Manifest | null) => Mapped,
|
||||||
eq?: (a: Mapped, b: Mapped) => boolean,
|
eq?: (a: Mapped, b: Mapped) => boolean,
|
||||||
): GetServiceManifest<Mapped> {
|
): GetServiceManifest<Mapped> {
|
||||||
return new GetServiceManifest<Mapped>(effects, { packageId }, {
|
return new GetServiceManifest<Mapped>(
|
||||||
map: map ?? ((a) => a as Mapped),
|
effects,
|
||||||
eq: eq ?? ((a, b) => deepEqual(a, b)),
|
{ 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,
|
map?: (interfaces: ServiceInterfaceFilled | null) => Mapped,
|
||||||
eq?: (a: Mapped, b: Mapped) => boolean,
|
eq?: (a: Mapped, b: Mapped) => boolean,
|
||||||
): GetServiceInterface<Mapped> {
|
): GetServiceInterface<Mapped> {
|
||||||
return new GetServiceInterface<Mapped>(effects, { id }, {
|
return new GetServiceInterface<Mapped>(
|
||||||
map: map ?? ((a) => a as Mapped),
|
effects,
|
||||||
eq: eq ?? ((a, b) => deepEqual(a, b)),
|
{ id },
|
||||||
})
|
{
|
||||||
|
map: map ?? ((a) => a as Mapped),
|
||||||
|
eq: eq ?? ((a, b) => deepEqual(a, b)),
|
||||||
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getServiceInterface(
|
export function getServiceInterface(
|
||||||
|
|||||||
@@ -64,9 +64,7 @@ export class GetServiceInterfaces<
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getOwnServiceInterfaces(
|
export function getOwnServiceInterfaces(effects: Effects): GetServiceInterfaces
|
||||||
effects: Effects,
|
|
||||||
): GetServiceInterfaces
|
|
||||||
export function getOwnServiceInterfaces<Mapped>(
|
export function getOwnServiceInterfaces<Mapped>(
|
||||||
effects: Effects,
|
effects: Effects,
|
||||||
map: (interfaces: ServiceInterfaceFilled[]) => Mapped,
|
map: (interfaces: ServiceInterfaceFilled[]) => Mapped,
|
||||||
@@ -77,10 +75,14 @@ export function getOwnServiceInterfaces<Mapped>(
|
|||||||
map?: (interfaces: ServiceInterfaceFilled[]) => Mapped,
|
map?: (interfaces: ServiceInterfaceFilled[]) => Mapped,
|
||||||
eq?: (a: Mapped, b: Mapped) => boolean,
|
eq?: (a: Mapped, b: Mapped) => boolean,
|
||||||
): GetServiceInterfaces<Mapped> {
|
): GetServiceInterfaces<Mapped> {
|
||||||
return new GetServiceInterfaces<Mapped>(effects, {}, {
|
return new GetServiceInterfaces<Mapped>(
|
||||||
map: map ?? ((a) => a as Mapped),
|
effects,
|
||||||
eq: eq ?? ((a, b) => deepEqual(a, b)),
|
{},
|
||||||
})
|
{
|
||||||
|
map: map ?? ((a) => a as Mapped),
|
||||||
|
eq: eq ?? ((a, b) => deepEqual(a, b)),
|
||||||
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getServiceInterfaces(
|
export function getServiceInterfaces(
|
||||||
|
|||||||
Reference in New Issue
Block a user