chore: Fix some issues in the installation of a package and other rpc things

This commit is contained in:
J H
2024-02-22 16:39:16 -07:00
parent 39964bf077
commit 3bd7596873
2 changed files with 9 additions and 2 deletions

View File

@@ -204,6 +204,14 @@ export class RpcListener {
id, id,
...result, ...result,
})) }))
.then((x) => {
if (
("result" in x && x.result === undefined) ||
!("error" in x || "result" in x)
)
(x as any).result = null
return x
})
.catch((error) => ({ .catch((error) => ({
jsonrpc, jsonrpc,
id, id,

View File

@@ -30,7 +30,6 @@ import { JsonPath, unNestPath } from "../../../Models/JsonPath"
import { HostSystem } from "../../../Interfaces/HostSystem" import { HostSystem } from "../../../Interfaces/HostSystem"
import { RpcResult, matchRpcResult } from "../../RpcListener" import { RpcResult, matchRpcResult } from "../../RpcListener"
import { ServiceInterface } from "../../../../../sdk/dist/cjs/lib/types" import { ServiceInterface } from "../../../../../sdk/dist/cjs/lib/types"
import { createUtils } from "../../../../../sdk/dist/cjs/lib/util"
type Optional<A> = A | undefined | null type Optional<A> = A | undefined | null
function todo(): never { function todo(): never {
@@ -880,7 +879,7 @@ async function updateConfig(
) { ) {
if (!dictionary([string, unknown]).test(spec)) return if (!dictionary([string, unknown]).test(spec)) return
if (!dictionary([string, unknown]).test(mutConfigValue)) return if (!dictionary([string, unknown]).test(mutConfigValue)) return
const utils = createUtils(effects) const utils = util.createUtils(effects)
for (const key in spec) { for (const key in spec) {
const specValue = spec[key] const specValue = spec[key]