Skip to content

Commit 87f82b0

Browse files
committed
style: format files to satisfy prettier/eslint
1 parent becf1ae commit 87f82b0

6 files changed

Lines changed: 31 additions & 12 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ See [docs/adr-nfc-library.md](docs/adr-nfc-library.md) for platform constraints
116116
- [Product flows & system definition](docs/ding-payments.md)
117117
- [Client MVP build plan](docs/build-plan-client-mvp.md)
118118
- [NFC library ADR](docs/adr-nfc-library.md)
119-
- [NFC runtime flow and troubleshooting](docs/nfc-flow.md)
120-
- [NFC device checklist](docs/nfc-device-checklist.md)
119+
- [NFC runtime flow and troubleshooting](docs/nfc-flow.md)
120+
- [NFC device checklist](docs/nfc-device-checklist.md)
121121

122122
## License
123123

src/features/nfc/components/NfcAvailabilityBanner.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ export function NfcAvailabilityBanner() {
1818
return (
1919
<View style={{ backgroundColor: '#FFF4E5', padding: 12 }}>
2020
<Text style={{ color: '#663C00', marginBottom: 8 }}>
21-
NFC no está disponible o está deshabilitado en este dispositivo. Para usar
22-
pagos por NFC, habilítalo en ajustes.
21+
NFC no está disponible o está deshabilitado en este dispositivo. Para usar pagos por NFC,
22+
habilítalo en ajustes.
2323
</Text>
2424
<Pressable onPress={openSettings} style={{ alignSelf: 'flex-start' }}>
2525
<Text style={{ color: '#0B66FF' }}>Abrir ajustes</Text>

src/features/nfc/hooks/useNfc.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,14 @@ export function useNfc() {
6464
setStatus('idle');
6565
};
6666

67-
return { status, lastError, startReading, startWriting, cancel, isAvailable: isNfcAvailable } as const;
67+
return {
68+
status,
69+
lastError,
70+
startReading,
71+
startWriting,
72+
cancel,
73+
isAvailable: isNfcAvailable,
74+
} as const;
6875
}
6976

7077
export default useNfc;

src/features/nfc/schemas/paymentRequest.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,16 @@ import { z } from 'zod';
1010
import { isSupportedAssetCode } from '@/features/wallet/constants/assets';
1111

1212
/** Forbidden fields helper (keep as utility) */
13-
export const forbiddenKeyPatterns = [/secret/i, /private/i, /seed/i, /token/i, /passphrase/i, /password/i, /privKey/i, /keyPair/i];
13+
export const forbiddenKeyPatterns = [
14+
/secret/i,
15+
/private/i,
16+
/seed/i,
17+
/token/i,
18+
/passphrase/i,
19+
/password/i,
20+
/privKey/i,
21+
/keyPair/i,
22+
];
1423

1524
export function assertNoSecrets(obj: Record<string, any>) {
1625
const keys = Object.keys(obj);

src/features/nfc/services/NfcReader.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
import { Platform } from 'react-native';
22

33
import { NfcErrorCode } from './nfcErrors';
4+
import { NFC_READER_TIMEOUT_MS } from '@/features/nfc/constants/nfcConstants';
5+
import { decodePaymentRequest } from '@/features/nfc/services/NfcPayloadCodec';
6+
import type { PaymentRequest } from '@/features/nfc/schemas/paymentRequest';
7+
import { NfcError, toNfcError } from '@/features/nfc/services/NfcService.types';
8+
import { nfcService } from '@/features/nfc/services/nfcServiceImpl';
49

510
export function isNfcAvailable(): boolean {
611
// Basic availability detection: web is not supported here; native platforms
@@ -58,11 +63,6 @@ export class NfcReader {
5863
}
5964

6065
export default NfcReader;
61-
import { NFC_READER_TIMEOUT_MS } from '@/features/nfc/constants/nfcConstants';
62-
import { decodePaymentRequest } from '@/features/nfc/services/NfcPayloadCodec';
63-
import type { PaymentRequest } from '@/features/nfc/schemas/paymentRequest';
64-
import { NfcError, toNfcError } from '@/features/nfc/services/NfcService.types';
65-
import { nfcService } from '@/features/nfc/services/nfcServiceImpl';
6666

6767
export interface NfcReaderSession {
6868
cancel: () => Promise<void>;

src/features/nfc/services/paymentRequestValidation.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ const DEFAULT_SKEW_S = 30; // seconds tolerance
55

66
const dedupeCache: Map<string, number> = new Map();
77

8-
export function validatePaymentRequest(payload: Record<string, any>, opts?: { nowMs?: number; skewS?: number }) {
8+
export function validatePaymentRequest(
9+
payload: Record<string, any>,
10+
opts?: { nowMs?: number; skewS?: number }
11+
) {
912
assertNoSecrets(payload);
1013
const nowMs = opts?.nowMs ?? Date.now();
1114
const skewS = opts?.skewS ?? DEFAULT_SKEW_S;

0 commit comments

Comments
 (0)