Skip to content

Commit cbb42ea

Browse files
committed
chore: lint fixes
1 parent efcca2e commit cbb42ea

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

packages/js-evo-sdk/src/util.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ export function generateEntropy(): string {
2222
if (typeof globalThis !== 'undefined' && globalThis.crypto && globalThis.crypto.getRandomValues) {
2323
const buffer = new Uint8Array(32);
2424
globalThis.crypto.getRandomValues(buffer);
25-
return Array.from(buffer).map(b => b.toString(16).padStart(2, '0')).join('');
25+
return Array.from(buffer).map((b) => b.toString(16).padStart(2, '0')).join('');
2626
}
2727

2828
// Fallback for older environments
2929
if (typeof window !== 'undefined' && window.crypto && window.crypto.getRandomValues) {
3030
const buffer = new Uint8Array(32);
3131
window.crypto.getRandomValues(buffer);
32-
return Array.from(buffer).map(b => b.toString(16).padStart(2, '0')).join('');
32+
return Array.from(buffer).map((b) => b.toString(16).padStart(2, '0')).join('');
3333
}
3434

3535
throw new Error('No secure random source available. This environment does not support crypto.randomBytes or crypto.getRandomValues.');

packages/js-evo-sdk/tests/unit/facades/documents.spec.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ describe('DocumentsFacade', () => {
7979

8080
// Check that documentCreate was called
8181
expect(wasmSdk.documentCreate).to.be.calledOnce();
82-
const [contractId, type, ownerId, jsonData, entropy, wif] = wasmSdk.documentCreate.firstCall.args;
82+
const [
83+
contractId, type, ownerId, jsonData, entropy, wif,
84+
] = wasmSdk.documentCreate.firstCall.args;
8385

8486
// Verify all params except entropy
8587
expect(contractId).to.equal('c');

packages/js-evo-sdk/tests/unit/util.spec.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import { asJsonString, generateEntropy } from '../../dist/util.js';
33
describe('Util Functions', () => {
44
describe('asJsonString', () => {
55
it('returns undefined for null', () => {
6-
expect(asJsonString(null)).to.be.undefined;
6+
expect(asJsonString(null)).to.be.undefined();
77
});
88

99
it('returns undefined for undefined', () => {
10-
expect(asJsonString(undefined)).to.be.undefined;
10+
expect(asJsonString(undefined)).to.be.undefined();
1111
});
1212

1313
it('returns string as-is', () => {
@@ -53,15 +53,15 @@ describe('Util Functions', () => {
5353
// Convert hex string to bytes
5454
const bytes = [];
5555
for (let i = 0; i < entropy.length; i += 2) {
56-
bytes.push(parseInt(entropy.substr(i, 2), 16));
56+
bytes.push(parseInt(entropy.substring(i, 2), 16));
5757
}
5858
expect(bytes.length).to.equal(32);
5959
});
6060

6161
it('generates values with good distribution', () => {
6262
// Generate multiple samples and check that we get a variety of hex digits
6363
const samples = [];
64-
for (let i = 0; i < 10; i++) {
64+
for (let i = 0; i < 10; i += 1) {
6565
samples.push(generateEntropy());
6666
}
6767

@@ -74,4 +74,4 @@ describe('Util Functions', () => {
7474
expect(uniqueChars).to.be.at.least(10);
7575
});
7676
});
77-
});
77+
});

0 commit comments

Comments
 (0)