Skip to content

Commit 9658f9c

Browse files
committed
fmt
1 parent 7fcad8a commit 9658f9c

File tree

13 files changed

+232
-229
lines changed

13 files changed

+232
-229
lines changed

sdks/ts/packages/golem-ts-sdk/src/decorators/agent.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ export function agent(options?: AgentDecoratorOptions) {
287287

288288
const agentConfigEntries = Either.getOrThrowWith(
289289
getAgentConfigEntries(classMetadata.constructorArgs),
290-
err => new Error(`Failed to describe agent config: ${err}`),
290+
(err) => new Error(`Failed to describe agent config: ${err}`),
291291
);
292292

293293
const agentType: AgentType = {
@@ -380,22 +380,26 @@ export function agent(options?: AgentDecoratorOptions) {
380380
};
381381
}
382382

383-
function getAgentConfigEntries(constructorParameters: ConstructorArg[]): Either.Either<ConfigKeyValueType[], string> {
383+
function getAgentConfigEntries(
384+
constructorParameters: ConstructorArg[],
385+
): Either.Either<ConfigKeyValueType[], string> {
384386
const entries: ConfigKeyValueType[] = [];
385387

386388
for (const param of constructorParameters) {
387389
if (param.type.kind !== 'config') continue;
388390

389391
for (const prop of param.type.properties) {
390-
391-
const witTypeEither = fromTsType(prop.type, TypeScope.object(param.name, prop.path[-1], prop.type.optional));
392+
const witTypeEither = fromTsType(
393+
prop.type,
394+
TypeScope.object(param.name, prop.path[-1], prop.type.optional),
395+
);
392396
if (Either.isLeft(witTypeEither)) return witTypeEither;
393397

394398
let configValueType: ConfigValueType;
395399
if (prop.secret) {
396-
configValueType = { tag: 'shared', val: witTypeEither.val[0] }
400+
configValueType = { tag: 'shared', val: witTypeEither.val[0] };
397401
} else {
398-
configValueType = { tag: 'local', val: witTypeEither.val[0] }
402+
configValueType = { tag: 'local', val: witTypeEither.val[0] };
399403
}
400404

401405
entries.push({
@@ -405,5 +409,5 @@ function getAgentConfigEntries(constructorParameters: ConstructorArg[]): Either.
405409
}
406410
}
407411

408-
return Either.right(entries);
412+
return Either.right(entries);
409413
}

sdks/ts/packages/golem-ts-sdk/src/internal/mapping/types/handlers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const handlers: { [K in TsType['kind']]: Handler<K> } = {
6767
others: handleOthers,
6868
'unresolved-type': handleUnresolved,
6969
array: handleArray,
70-
'config': unsupported('Config')
70+
config: unsupported('Config'),
7171
};
7272

7373
function unsupported(kind: string): Handler<any> {

sdks/ts/packages/golem-ts-sdk/src/internal/mapping/values/dataValue.ts

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -306,11 +306,9 @@ export function deserializeDataValue(
306306
}
307307
}
308308

309-
function constructConfigType(
310-
typeInfoInternal: TypeInfoInternal & { tag: 'config' }
311-
): Config<any> {
309+
function constructConfigType(typeInfoInternal: TypeInfoInternal & { tag: 'config' }): Config<any> {
312310
// safe as the parent node is config
313-
const properties = (typeInfoInternal.tsType as (Type.Type & { kind: 'config' })).properties;
311+
const properties = (typeInfoInternal.tsType as Type.Type & { kind: 'config' }).properties;
314312

315313
const root: Record<string, any> = {};
316314

@@ -329,7 +327,7 @@ function constructConfigType(
329327
const leafKey = path[path.length - 1];
330328
let leafValue;
331329
if (prop.secret) {
332-
leafValue = new Secret(path, typeInfoInternal)
330+
leafValue = new Secret(path, typeInfoInternal);
333331
} else {
334332
leafValue = loadConfigKey(path, typeInfoInternal);
335333
}
@@ -340,10 +338,7 @@ function constructConfigType(
340338
return new Config(root);
341339
}
342340

343-
export function loadConfigKey(
344-
path: string[],
345-
typeInfoInternal: TypeInfoInternal
346-
): any {
341+
export function loadConfigKey(path: string[], typeInfoInternal: TypeInfoInternal): any {
347342
const witValue = getConfigValue(path);
348343

349344
const dataValue = createSingleElementTupleDataValue({
@@ -357,13 +352,13 @@ export function loadConfigKey(
357352
[
358353
{
359354
name: 'config-type',
360-
type: typeInfoInternal
361-
}
355+
type: typeInfoInternal,
356+
},
362357
],
363358
{ tag: 'anonymous' },
364359
),
365360
(err) => new Error(`Failed to deserialize config: ${err}`),
366-
)
361+
);
367362
}
368363

369364
// Used to serialize the return type of a method back to DataValue

sdks/ts/packages/golem-ts-sdk/src/internal/typeInfoInternal.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ export function isPrincipal(typeInfoInternal: TypeInfoInternal): boolean {
5555
return typeInfoInternal.tag === 'principal';
5656
}
5757

58-
export function isConfig(typeInfoInternal: TypeInfoInternal): typeInfoInternal is (TypeInfoInternal & { tag: 'config'}) {
58+
export function isConfig(
59+
typeInfoInternal: TypeInfoInternal,
60+
): typeInfoInternal is TypeInfoInternal & { tag: 'config' } {
5961
return typeInfoInternal.tag === 'config';
6062
}
6163

0 commit comments

Comments
 (0)