Skip to content

Commit

Permalink
refactor(wasm-api): update type usage
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Apr 19, 2024
1 parent 80a0255 commit ab27740
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/wasm-api/src/object-index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Predicate, Range1_32 } from "@thi.ng/api";
import type { Maybe, Predicate, Range1_32 } from "@thi.ng/api";
import { assert } from "@thi.ng/errors/assert";
import { IDGen } from "@thi.ng/idgen";
import type { ILogger } from "@thi.ng/logger";
Expand Down Expand Up @@ -92,7 +92,7 @@ export class ObjectIndex<T> {
*/
get(id: number): T;
get(id: number, ensure: true): T;
get(id: number, ensure: false): T | undefined;
get(id: number, ensure: false): Maybe<T>;
get(id: number, ensure = true) {
ensure &&
assert(this.idgen.has(id), `missing ${this.name} for ID: ${id}`);
Expand Down

0 comments on commit ab27740

Please sign in to comment.