@onekeyfe/hd-transport-react-native 1.2.0-alpha.185 → 1.2.0-alpha.186
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bleStaleBond.d.ts","sourceRoot":"","sources":["../src/bleStaleBond.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,2BAA2B,EAC5B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,2BAA2B,EAAE,CAAC;AAkBvC,eAAO,MAAM,yBAAyB,UAAW,OAAO,KAAG,OAe1D,CAAC;AAEF,eAAO,MAAM,2BAA2B,UAAW,OAAO,
|
|
1
|
+
{"version":3,"file":"bleStaleBond.d.ts","sourceRoot":"","sources":["../src/bleStaleBond.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,2BAA2B,EAC5B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,2BAA2B,EAAE,CAAC;AAkBvC,eAAO,MAAM,yBAAyB,UAAW,OAAO,KAAG,OAe1D,CAAC;AAEF,eAAO,MAAM,2BAA2B,UAAW,OAAO,UAkBzD,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -218,8 +218,9 @@ const toBleStaleBondHardwareError = (error) => {
|
|
|
218
218
|
}
|
|
219
219
|
const nativeError = (error !== null && error !== void 0 ? error : {});
|
|
220
220
|
const text = nativeErrorText(nativeError);
|
|
221
|
+
const normalizedText = text.toLowerCase();
|
|
221
222
|
const peerRemoved = nativeError.iosErrorCode === IOS_PEER_REMOVED_PAIRING_INFORMATION ||
|
|
222
|
-
|
|
223
|
+
normalizedText.includes('peer removed pairing information');
|
|
223
224
|
return hdShared.ERRORS.TypedError(peerRemoved
|
|
224
225
|
? hdShared.HardwareErrorCode.BlePeerRemovedPairingInformation
|
|
225
226
|
: hdShared.HardwareErrorCode.BleDeviceBondError, text || undefined);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onekeyfe/hd-transport-react-native",
|
|
3
|
-
"version": "1.2.0-alpha.
|
|
3
|
+
"version": "1.2.0-alpha.186",
|
|
4
4
|
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"lint:fix": "eslint . --fix"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@onekeyfe/hd-core": "1.2.0-alpha.
|
|
24
|
-
"@onekeyfe/hd-shared": "1.2.0-alpha.
|
|
25
|
-
"@onekeyfe/hd-transport": "1.2.0-alpha.
|
|
23
|
+
"@onekeyfe/hd-core": "1.2.0-alpha.186",
|
|
24
|
+
"@onekeyfe/hd-shared": "1.2.0-alpha.186",
|
|
25
|
+
"@onekeyfe/hd-transport": "1.2.0-alpha.186",
|
|
26
26
|
"@onekeyfe/react-native-ble-utils": "^0.1.6",
|
|
27
27
|
"react-native-ble-plx": "3.5.1"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "d4b7f8e0e308ed4b95b1d82e385e1ec4b3e0e3f6"
|
|
30
30
|
}
|
|
@@ -16,6 +16,14 @@ describe('native BLE stale bond mapping', () => {
|
|
|
16
16
|
{ iosErrorCode: 14, reason: 'Peer removed pairing information' },
|
|
17
17
|
HardwareErrorCode.BlePeerRemovedPairingInformation,
|
|
18
18
|
],
|
|
19
|
+
[
|
|
20
|
+
{ reason: 'peer removed pairing information' },
|
|
21
|
+
HardwareErrorCode.BlePeerRemovedPairingInformation,
|
|
22
|
+
],
|
|
23
|
+
[
|
|
24
|
+
{ message: 'PEER REMOVED PAIRING INFORMATION' },
|
|
25
|
+
HardwareErrorCode.BlePeerRemovedPairingInformation,
|
|
26
|
+
],
|
|
19
27
|
])('maps %j to %s', (nativeError, errorCode) => {
|
|
20
28
|
expect(isNativeBleStaleBondError(nativeError)).toBe(true);
|
|
21
29
|
expect(toBleStaleBondHardwareError(nativeError)).toMatchObject({ errorCode });
|
package/src/bleStaleBond.ts
CHANGED
|
@@ -47,9 +47,10 @@ export const toBleStaleBondHardwareError = (error: unknown) => {
|
|
|
47
47
|
|
|
48
48
|
const nativeError = (error ?? {}) as NativeBleErrorFields;
|
|
49
49
|
const text = nativeErrorText(nativeError);
|
|
50
|
+
const normalizedText = text.toLowerCase();
|
|
50
51
|
const peerRemoved =
|
|
51
52
|
nativeError.iosErrorCode === IOS_PEER_REMOVED_PAIRING_INFORMATION ||
|
|
52
|
-
|
|
53
|
+
normalizedText.includes('peer removed pairing information');
|
|
53
54
|
|
|
54
55
|
return ERRORS.TypedError(
|
|
55
56
|
peerRemoved
|