Skip to content

Commit

Permalink
Merge pull request #39 from st-tech/feat/readonlymap-verify-return
Browse files Browse the repository at this point in the history
chore: fix type of ResultMap
  • Loading branch information
ssssota authored Jan 10, 2025
2 parents e1a7615 + 475bcb2 commit 3b389f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/sim/verify.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { validateAASA } from "../aasa.js";
import type { CreateVerify, ResultMap, Verify } from "../types.js";
import type { CreateVerify, Verify, VerifyResult } from "../types.js";
import { resolveJson } from "./json.js";
import { match } from "./match.js";

Expand All @@ -10,7 +10,7 @@ export const createVerify: CreateVerify = (json) => {
const aasa = await aasaPromise;
if (!validateAASA(aasa)) throw new Error("Invalid AASA");
const details = aasa.applinks?.details;
const ret: ResultMap = new Map();
const ret = new Map<string, VerifyResult>();
if (!details || details.length === 0) return ret;

for (const detail of details) {
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export type JsonOrPath = string | Record<string, unknown>;
export type PromiseOr<T> = T | Promise<T>;
export type ResultMap = Map<string, VerifyResult>;
export type ResultMap = ReadonlyMap<string, VerifyResult>;
export type VerifyResult = "match" | "block";

export type CreateVerify = (
Expand Down

0 comments on commit 3b389f1

Please sign in to comment.