Skip to content

Commit bd0f9af

Browse files
JamesCullumgithub-actions[bot]
authored andcommitted
[skip_ci] v3.4.0: Build artifacts for Deno
1 parent 404fd71 commit bd0f9af

File tree

2 files changed

+41
-16
lines changed

2 files changed

+41
-16
lines changed

dist/main.cjs

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,8 +1330,23 @@ function derToRaw(signature) {
13301330
...extractBigNum(signature, sStart, signature.length, 32),
13311331
]);
13321332
}
1333+
function isAndroidFacetId(str) {
1334+
return str.startsWith("android:apk-key-hash:");
1335+
}
1336+
1337+
function isIOSFacetId(str) {
1338+
return str.startsWith("ios:bundle-id:");
1339+
}
1340+
13331341

13341342
function checkOrigin(str) {
1343+
if(!str)
1344+
throw new Error("Empty Origin");
1345+
1346+
if (isAndroidFacetId(str) || isIOSFacetId(str)) {
1347+
return str;
1348+
}
1349+
13351350
const originUrl = new URL(str);
13361351
const origin = originUrl.origin;
13371352

@@ -1980,22 +1995,22 @@ async function validateExpectations() {
19801995
if (!Array.isArray(allowCredentials)) {
19811996
throw new Error("expected allowCredentials to be null or array");
19821997
} else {
1983-
for (const index in allowCredentials) {
1984-
if (typeof allowCredentials[index].id === "string") {
1985-
allowCredentials[index].id = coerceToArrayBuffer$1(allowCredentials[index].id, "allowCredentials[" + index + "].id");
1998+
allowCredentials.forEach((allowCredential, index) => {
1999+
if (typeof allowCredential.id === "string") {
2000+
allowCredential.id = coerceToArrayBuffer$1(allowCredential.id, "allowCredentials[" + index + "].id");
19862001
}
1987-
if (allowCredentials[index].id == null || !(allowCredentials[index].id instanceof ArrayBuffer)) {
2002+
if (allowCredential.id == null || !(allowCredential.id instanceof ArrayBuffer)) {
19882003
throw new Error("expected id of allowCredentials[" + index + "] to be ArrayBuffer");
19892004
}
1990-
if (allowCredentials[index].type == null || allowCredentials[index].type !== "public-key") {
2005+
if (allowCredential.type == null || allowCredential.type !== "public-key") {
19912006
throw new Error("expected type of allowCredentials[" + index + "] to be string with value 'public-key'");
19922007
}
1993-
if (allowCredentials[index].transports != null && !Array.isArray(allowCredentials[index].transports)) {
2008+
if (allowCredential.transports != null && !Array.isArray(allowCredential.transports)) {
19942009
throw new Error("expected transports of allowCredentials[" + index + "] to be array or null");
1995-
} else if (allowCredentials[index].transports != null && !allowCredentials[index].transports.every(el => ["usb", "nfc", "ble", "cable", "internal"].includes(el))) {
2010+
} else if (allowCredential.transports != null && !allowCredential.transports.every(el => ["usb", "nfc", "ble", "cable", "internal"].includes(el))) {
19962011
throw new Error("expected transports of allowCredentials[" + index + "] to be string with value 'usb', 'nfc', 'ble', 'cable', 'internal' or null");
19972012
}
1998-
}
2013+
});
19992014
}
20002015
}
20012016

dist/main.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40622,7 +40622,17 @@ function derToRaw(signature) {
4062240622
...extractBigNum(signature, sStart, signature.length, 32),
4062340623
]);
4062440624
}
40625+
function isAndroidFacetId(str) {
40626+
return str.startsWith("android:apk-key-hash:");
40627+
}
40628+
function isIOSFacetId(str) {
40629+
return str.startsWith("ios:bundle-id:");
40630+
}
4062540631
function checkOrigin(str) {
40632+
if (!str) throw new Error("Empty Origin");
40633+
if (isAndroidFacetId(str) || isIOSFacetId(str)) {
40634+
return str;
40635+
}
4062640636
const originUrl = new URL(str);
4062740637
const origin = originUrl.origin;
4062840638
if (origin !== str) {
@@ -42932,19 +42942,19 @@ async function validateExpectations() {
4293242942
if (!Array.isArray(allowCredentials)) {
4293342943
throw new Error("expected allowCredentials to be null or array");
4293442944
} else {
42935-
for(const index in allowCredentials){
42936-
if (typeof allowCredentials[index].id === "string") {
42937-
allowCredentials[index].id = coerceToArrayBuffer(allowCredentials[index].id, "allowCredentials[" + index + "].id");
42945+
allowCredentials.forEach((allowCredential, index)=>{
42946+
if (typeof allowCredential.id === "string") {
42947+
allowCredential.id = coerceToArrayBuffer(allowCredential.id, "allowCredentials[" + index + "].id");
4293842948
}
42939-
if (allowCredentials[index].id == null || !(allowCredentials[index].id instanceof ArrayBuffer)) {
42949+
if (allowCredential.id == null || !(allowCredential.id instanceof ArrayBuffer)) {
4294042950
throw new Error("expected id of allowCredentials[" + index + "] to be ArrayBuffer");
4294142951
}
42942-
if (allowCredentials[index].type == null || allowCredentials[index].type !== "public-key") {
42952+
if (allowCredential.type == null || allowCredential.type !== "public-key") {
4294342953
throw new Error("expected type of allowCredentials[" + index + "] to be string with value 'public-key'");
4294442954
}
42945-
if (allowCredentials[index].transports != null && !Array.isArray(allowCredentials[index].transports)) {
42955+
if (allowCredential.transports != null && !Array.isArray(allowCredential.transports)) {
4294642956
throw new Error("expected transports of allowCredentials[" + index + "] to be array or null");
42947-
} else if (allowCredentials[index].transports != null && !allowCredentials[index].transports.every((el)=>[
42957+
} else if (allowCredential.transports != null && !allowCredential.transports.every((el)=>[
4294842958
"usb",
4294942959
"nfc",
4295042960
"ble",
@@ -42954,7 +42964,7 @@ async function validateExpectations() {
4295442964
)) {
4295542965
throw new Error("expected transports of allowCredentials[" + index + "] to be string with value 'usb', 'nfc', 'ble', 'cable', 'internal' or null");
4295642966
}
42957-
}
42967+
});
4295842968
}
4295942969
}
4296042970
}

0 commit comments

Comments
 (0)