Skip to content

Commit 8773586

Browse files
committed
Revert unintentional changes to package-lock.json
1 parent 5533728 commit 8773586

5 files changed

Lines changed: 92 additions & 52 deletions

File tree

export-and-sign/package-lock.json

Lines changed: 29 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

export/index.template.html

Lines changed: 41 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,18 @@
153153
font-size: 0.8em;
154154
color: #666;
155155
}
156-
.strength-weak { background-color: #e74c3c; }
157-
.strength-fair { background-color: #f39c12; }
158-
.strength-good { background-color: #3498db; }
159-
.strength-strong { background-color: #27ae60; }
156+
.strength-weak {
157+
background-color: #e74c3c;
158+
}
159+
.strength-fair {
160+
background-color: #f39c12;
161+
}
162+
.strength-good {
163+
background-color: #3498db;
164+
}
165+
.strength-strong {
166+
background-color: #27ae60;
167+
}
160168
</style>
161169
</head>
162170

@@ -1494,7 +1502,10 @@ <h2>Message log</h2>
14941502
TKHQ.sendMessageUp("ERROR", e.toString(), event.data["requestId"]);
14951503
}
14961504
}
1497-
if (event.data && event.data["type"] == "INJECT_WALLET_EXPORT_BUNDLE_ENCRYPTED") {
1505+
if (
1506+
event.data &&
1507+
event.data["type"] == "INJECT_WALLET_EXPORT_BUNDLE_ENCRYPTED"
1508+
) {
14981509
TKHQ.logMessage(
14991510
`⬇️ Received message ${event.data["type"]}: ${event.data["value"]}, ${event.data["organizationId"]}`
15001511
);
@@ -1716,7 +1727,12 @@ <h2>Message log</h2>
17161727
if (checks.length16) score += 1;
17171728

17181729
// Character variety
1719-
const varietyCount = [checks.lowercase, checks.uppercase, checks.numbers, checks.special].filter(Boolean).length;
1730+
const varietyCount = [
1731+
checks.lowercase,
1732+
checks.uppercase,
1733+
checks.numbers,
1734+
checks.special,
1735+
].filter(Boolean).length;
17201736
if (varietyCount >= 2) score += 1;
17211737
if (varietyCount >= 3) score += 1;
17221738
if (varietyCount >= 4) score += 1;
@@ -1728,7 +1744,8 @@ <h2>Message log</h2>
17281744
let label, feedback;
17291745
if (score <= 1) {
17301746
label = "Weak";
1731-
feedback = "Add more characters and mix letters, numbers, and symbols.";
1747+
feedback =
1748+
"Add more characters and mix letters, numbers, and symbols.";
17321749
} else if (score === 2) {
17331750
label = "Fair";
17341751
feedback = "Consider adding more length or character variety.";
@@ -1745,12 +1762,19 @@ <h2>Message log</h2>
17451762

17461763
// Update strength indicator on input
17471764
passphraseInput.addEventListener("input", () => {
1748-
const { score, label, feedback } = evaluatePassphraseStrength(passphraseInput.value);
1749-
1765+
const { score, label, feedback } = evaluatePassphraseStrength(
1766+
passphraseInput.value
1767+
);
1768+
17501769
// Update fill width and color
1751-
const strengthClasses = ["strength-weak", "strength-fair", "strength-good", "strength-strong"];
1770+
const strengthClasses = [
1771+
"strength-weak",
1772+
"strength-fair",
1773+
"strength-good",
1774+
"strength-strong",
1775+
];
17521776
strengthFill.className = "";
1753-
1777+
17541778
if (score === 0) {
17551779
strengthFill.style.width = "0%";
17561780
strengthText.textContent = "";
@@ -1845,7 +1869,8 @@ <h2>Message log</h2>
18451869

18461870
// Zero out sensitive byte arrays (mutable, so we can wipe them)
18471871
for (let i = 0; i < mnemonicBytes.length; i++) mnemonicBytes[i] = 0;
1848-
for (let i = 0; i < encryptedBytes.length; i++) encryptedBytes[i] = 0;
1872+
for (let i = 0; i < encryptedBytes.length; i++)
1873+
encryptedBytes[i] = 0;
18491874

18501875
// Clear the mnemonic closure reference (can't truly zero a JS string, but removes the easy reference)
18511876
mnemonic = "";
@@ -1862,10 +1887,12 @@ <h2>Message log</h2>
18621887
} catch (e) {
18631888
// Zero out sensitive byte arrays if they were created
18641889
if (mnemonicBytes) {
1865-
for (let i = 0; i < mnemonicBytes.length; i++) mnemonicBytes[i] = 0;
1890+
for (let i = 0; i < mnemonicBytes.length; i++)
1891+
mnemonicBytes[i] = 0;
18661892
}
18671893
if (encryptedBytes) {
1868-
for (let i = 0; i < encryptedBytes.length; i++) encryptedBytes[i] = 0;
1894+
for (let i = 0; i < encryptedBytes.length; i++)
1895+
encryptedBytes[i] = 0;
18691896
}
18701897

18711898
// Clear passphrase fields for security

export/index.test.js

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,8 @@ describe("TKHQ", () => {
466466
});
467467

468468
it("decrypts data encrypted by encryptWithPassphrase correctly", async () => {
469-
const originalText = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about";
469+
const originalText =
470+
"abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about";
470471
const plaintext = new TextEncoder().encode(originalText);
471472
const passphrase = "mySecurePassphrase!";
472473

@@ -486,7 +487,10 @@ describe("TKHQ", () => {
486487
const correctPassphrase = "correctPassphrase";
487488
const wrongPassphrase = "wrongPassphrase";
488489

489-
const encrypted = await TKHQ.encryptWithPassphrase(plaintext, correctPassphrase);
490+
const encrypted = await TKHQ.encryptWithPassphrase(
491+
plaintext,
492+
correctPassphrase
493+
);
490494

491495
// Attempting to decrypt with wrong passphrase should throw
492496
await expect(
@@ -523,10 +527,15 @@ describe("TKHQ", () => {
523527
const mnemonicBytes = new TextEncoder().encode(mnemonic);
524528

525529
// Encrypt
526-
const encrypted = await TKHQ.encryptWithPassphrase(mnemonicBytes, passphrase);
530+
const encrypted = await TKHQ.encryptWithPassphrase(
531+
mnemonicBytes,
532+
passphrase
533+
);
527534

528535
// Convert to base64 (as would be done in displayPassphraseForm)
529-
const encryptedBase64 = btoa(Array.from(encrypted, (b) => String.fromCharCode(b)).join(""));
536+
const encryptedBase64 = btoa(
537+
Array.from(encrypted, (b) => String.fromCharCode(b)).join("")
538+
);
530539
expect(typeof encryptedBase64).toBe("string");
531540
expect(encryptedBase64.length).toBeGreaterThan(0);
532541

@@ -538,7 +547,10 @@ describe("TKHQ", () => {
538547
);
539548

540549
// Decrypt
541-
const decrypted = await TKHQ.decryptWithPassphrase(encryptedFromBase64, passphrase);
550+
const decrypted = await TKHQ.decryptWithPassphrase(
551+
encryptedFromBase64,
552+
passphrase
553+
);
542554
const decryptedMnemonic = new TextDecoder().decode(decrypted);
543555

544556
expect(decryptedMnemonic).toBe(mnemonic);
@@ -586,7 +598,10 @@ describe("Passphrase Form Validation", () => {
586598

587599
// Helper to submit form (triggers validation)
588600
function submitForm(elements) {
589-
const event = new dom.window.Event("submit", { bubbles: true, cancelable: true });
601+
const event = new dom.window.Event("submit", {
602+
bubbles: true,
603+
cancelable: true,
604+
});
590605
elements.formDiv.dispatchEvent(event);
591606
}
592607

export/package-lock.json

Lines changed: 0 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)