Skip to content

Commit 3b389f1

Browse files
authored
Merge pull request #39 from st-tech/feat/readonlymap-verify-return
chore: fix type of ResultMap
2 parents e1a7615 + 475bcb2 commit 3b389f1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/sim/verify.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { validateAASA } from "../aasa.js";
2-
import type { CreateVerify, ResultMap, Verify } from "../types.js";
2+
import type { CreateVerify, Verify, VerifyResult } from "../types.js";
33
import { resolveJson } from "./json.js";
44
import { match } from "./match.js";
55

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

1616
for (const detail of details) {

src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export type JsonOrPath = string | Record<string, unknown>;
22
export type PromiseOr<T> = T | Promise<T>;
3-
export type ResultMap = Map<string, VerifyResult>;
3+
export type ResultMap = ReadonlyMap<string, VerifyResult>;
44
export type VerifyResult = "match" | "block";
55

66
export type CreateVerify = (

0 commit comments

Comments
 (0)