Skip to content

Commit

Permalink
fix warnings from tsc once code is onboarded to nats.js
Browse files Browse the repository at this point in the history
  • Loading branch information
aricart committed Aug 10, 2022
1 parent ae9616b commit 24eed1a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 6 additions & 3 deletions nats-base-client/objectstore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export class ObjectStoreImpl implements ObjectStore {
const m = await this.jsm.streams.getMessage(this.stream, {
last_by_subj: meta,
});
const jc = JSONCodec<ObjectInfo>();
const jc = JSONCodec<ServerObjectInfo>();
const info = jc.decode(m.data) as ServerObjectInfo;
return info;
} catch (err) {
Expand Down Expand Up @@ -291,7 +291,7 @@ export class ObjectStoreImpl implements ObjectStore {
): Promise<ObjectInfo> {
const jsi = this.js as JetStreamClientImpl;
const maxPayload = jsi.nc.info?.max_payload || 1024;
meta = meta || {};
meta = meta || {} as ObjectStoreMeta;
meta.options = meta.options || {};
let maxChunk = meta.options?.max_chunk_size || 128 * 1024;
maxChunk = maxChunk > maxPayload ? maxPayload : maxChunk;
Expand Down Expand Up @@ -404,7 +404,10 @@ export class ObjectStoreImpl implements ObjectStore {

const d = deferred<Error | null>();

const r = { info: info!, error: d } as Partial<ObjectResult>;
const r: Partial<ObjectResult> = {
info: new ObjectInfoImpl(info),
error: d,
};
if (info.size === 0) {
r.data = emptyReadableStream();
d.resolve(null);
Expand Down
2 changes: 0 additions & 2 deletions tests/objectstore_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -619,8 +619,6 @@ Deno.test("objectstore - sanitize", async () => {
);

const info = await os.status({ subjects_filter: ">" }) as ObjectStoreInfoImpl;
console.log(info);

assertEquals(info.si.state?.subjects!["$O.test.M.has_dots_here"], 1);
assertEquals(info.si.state.subjects!["$O.test.M.the_spaces_are_here"], 1);

Expand Down

0 comments on commit 24eed1a

Please sign in to comment.