react-native-nfc-manager 3.17.2 → 3.17.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -396,7 +396,7 @@ declare module 'react-native-nfc-manager' {
396
396
  isType(record: NdefRecord, tnf: TNF, type: string): boolean;
397
397
  stringify(data: number[], separator: string): string;
398
398
  encodeMessage(records: NdefRecord[]): number[];
399
- decodeMessage(bytes: number[]): NdefRecord[];
399
+ decodeMessage(bytes: number[] | Uint8Array): NdefRecord[];
400
400
  textRecord(text: string, lang?: ISOLangCode, encoding?: any): NdefRecord;
401
401
  uriRecord(uri: URI, id?: any): NdefRecord;
402
402
  wifiSimpleRecord(credentials: WifiSimpleCredentials, id?: any): NdefRecord;
@@ -29,6 +29,7 @@ RCT_EXPORT_METHOD(sendFelicaCommand:(NSArray *)bytes callback: (nonnull RCTRespo
29
29
  return;
30
30
  } else {
31
31
  callback(@[@"not a felica tag", [NSNull null]]);
32
+ return;
32
33
  }
33
34
  }
34
35
  callback(@[@"Not connected", [NSNull null]]);
@@ -28,6 +28,7 @@ RCT_EXPORT_METHOD(sendCommandAPDUBytes:(NSArray *)bytes callback: (nonnull RCTRe
28
28
  return;
29
29
  } else {
30
30
  callback(@[@"not an iso7816 tag", [NSNull null]]);
31
+ return;
31
32
  }
32
33
  }
33
34
  callback(@[@"Not connected", [NSNull null]]);
@@ -69,6 +70,7 @@ RCT_EXPORT_METHOD(sendCommandAPDU:(NSDictionary *)apduData callback: (nonnull RC
69
70
  return;
70
71
  } else {
71
72
  callback(@[@"not an iso7816 tag", [NSNull null]]);
73
+ return;
72
74
  }
73
75
  }
74
76
  callback(@[@"Not connected", [NSNull null]]);
@@ -29,6 +29,7 @@ RCT_EXPORT_METHOD(sendMifareCommand:(NSArray *)bytes callback: (nonnull RCTRespo
29
29
  return;
30
30
  } else {
31
31
  callback(@[@"not a mifare tag", [NSNull null]]);
32
+ return;
32
33
  }
33
34
  }
34
35
  callback(@[@"Not connected", [NSNull null]]);
package/ios/NfcManager.m CHANGED
@@ -415,6 +415,7 @@ RCT_EXPORT_METHOD(getTag: (nonnull RCTResponseSenderBlock)callback)
415
415
  }
416
416
  } else {
417
417
  callback(@[@"No session available", [NSNull null]]);
418
+ return;
418
419
  }
419
420
 
420
421
  if (ndefTag) {
package/ndef-lib/ndef.js CHANGED
@@ -126,15 +126,14 @@ function decodeNdefMessage(ndefBytes) {
126
126
 
127
127
  // ndefBytes can be an array of bytes e.g. [0x03, 0x31, 0xd1] or a Buffer
128
128
  let bytes;
129
- if (ndefBytes instanceof Array) {
130
- bytes = ndefBytes.slice(0);
129
+ if (Array.isArray(ndefBytes) || ndefBytes instanceof Uint8Array) {
130
+ bytes = Array.from(ndefBytes);
131
131
  } else {
132
132
  throw new Error(
133
- 'ndef.decodeMessage requires a Buffer or an Array of bytes',
133
+ 'ndef.decodeMessage requires a Buffer, Uint8Array, or an Array of bytes',
134
134
  );
135
135
  }
136
136
 
137
- bytes = bytes.slice(0); // clone since parsing is destructive
138
137
  let ndef_message = [],
139
138
  tnf_byte,
140
139
  header,
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "react-native-nfc-manager",
3
- "version": "3.17.2",
3
+ "version": "3.17.4",
4
4
  "description": "A NFC module for react native.",
5
5
  "main": "src/index.js",
6
6
  "repository": {
7
7
  "type": "git",
8
- "url": "https://github.com/whitedogg13/react-native-nfc-manager.git"
8
+ "url": "https://github.com/revtel/react-native-nfc-manager.git"
9
9
  },
10
10
  "bugs": {
11
- "url": "https://github.com/whitedogg13/react-native-nfc-manager/issues"
11
+ "url": "https://github.com/revtel/react-native-nfc-manager/issues"
12
12
  },
13
13
  "keywords": [
14
14
  "react-native",
@@ -74,6 +74,8 @@
74
74
  "lint": "eslint .",
75
75
  "lint:fix": "eslint --fix .",
76
76
  "test": "jest -i",
77
- "release": "dotenv -- release-it --"
77
+ "release": "dotenv -- release-it --",
78
+ "typecheck": "tsc --noEmit -p tsconfig.typecheck.json",
79
+ "test:publishing": "node --test scripts/trusted-publishing.test.cjs"
78
80
  }
79
81
  }