Skip to content

Commit

Permalink
fix: parse error codes to numbers, fix docs typo
Browse files Browse the repository at this point in the history
  • Loading branch information
jpudysz committed Aug 29, 2022
1 parent 6e84437 commit 16a80e3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ useEffect(() => {
}
case MockLocationDetectorErrorCode.CantDetermine: {
// always for iOS < 15.0
// for android if coudln't fetch GPS position
// for android and iOS if couldn't fetch GPS position
}
}
})
Expand Down
4 changes: 2 additions & 2 deletions fabric-example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ PODS:
- React-jsinspector (0.68.2)
- React-logger (0.68.2):
- glog
- react-native-mock-location-detector (0.1.0):
- react-native-mock-location-detector (1.0.0):
- RCT-Folly (= 2021.06.28.00-v2)
- RCTRequired
- RCTTypeSafety
Expand Down Expand Up @@ -916,7 +916,7 @@ SPEC CHECKSUMS:
React-jsiexecutor: b7b553412f2ec768fe6c8f27cd6bafdb9d8719e6
React-jsinspector: c5989c77cb89ae6a69561095a61cce56a44ae8e8
React-logger: a0833912d93b36b791b7a521672d8ee89107aff1
react-native-mock-location-detector: c4938e50d836c6d91eba3477e21d6dc6dfe15382
react-native-mock-location-detector: 8659aeac4b0b4e052a7870505a6f90f4e02889e5
React-perflogger: a18b4f0bd933b8b24ecf9f3c54f9bf65180f3fe6
React-RCTActionSheet: 547fe42fdb4b6089598d79f8e1d855d7c23e2162
React-RCTAnimation: bc9440a1c37b06ae9ebbb532d244f607805c6034
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-mock-location-detector",
"version": "1.0.0",
"name": "react-native-turbo-mock-location-detector",
"version": "1.0.1",
"description": "Package helps to detect mocked location on both Android and iOS",
"main": "lib/commonjs/index",
"module": "lib/module/index",
Expand Down Expand Up @@ -45,7 +45,8 @@
},
"homepage": "https://github.com/jpudysz/react-native-mock-location-detector#readme",
"publishConfig": {
"registry": "https://registry.npmjs.org/"
"registry": "https://registry.npmjs.org/",
"access": "public"
},
"devDependencies": {
"@arkweid/lefthook": "0.7.7",
Expand Down
8 changes: 4 additions & 4 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ type MockLocationDetectorResult = {
}

export enum MockLocationDetectorErrorCode {
GPSNotEnabled = 0,
NoLocationPermissionEnabled = 1,
CantDetermine = 2
GPSNotEnabled = '0',
NoLocationPermissionEnabled = '1',
CantDetermine = '2'
}

export type MockLocationDetectorError = {
Expand All @@ -44,7 +44,7 @@ export const isMockingLocation = (): Promise<MockLocationDetectorResult> => {
.isMockingLocation()
.catch(({ code, message }: MockLocationDetectorError) => {
throw {
code,
code: parseInt(code, 10),
message,
}
})
Expand Down

0 comments on commit 16a80e3

Please sign in to comment.