react-native-map-link 3.4.1 → 3.5.0

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.
Files changed (2) hide show
  1. package/lib/utils.js +2 -5
  2. package/package.json +3 -3
package/lib/utils.js CHANGED
@@ -118,15 +118,12 @@ const getDirectionsModeSygic = (directionsMode) => {
118
118
  };
119
119
  exports.getDirectionsModeSygic = getDirectionsModeSygic;
120
120
  const checkOptions = ({ latitude, longitude, address, googleForceLatLon, googlePlaceId, title, app, prefixes, appTitles, appsWhiteList, }) => {
121
- if (!latitude || !longitude) {
122
- throw new MapsException('`showLocation` should contain keys `latitude` and `longitude`.');
121
+ if (!(latitude && longitude) && !address) {
122
+ throw new MapsException('`latitude` & `longitude` or `address` is required. Both cannot be undefined.');
123
123
  }
124
124
  if (address && typeof address !== 'string') {
125
125
  throw new MapsException('Option `address` should be of type `string`.');
126
126
  }
127
- if (!latitude && !longitude && !address) {
128
- throw new MapsException('`latitude` & `longitude` or `address` is required. Both cannot be undefined.');
129
- }
130
127
  if (title && typeof title !== 'string') {
131
128
  throw new MapsException('`title` should be of type `string`.');
132
129
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-map-link",
3
- "version": "3.4.1",
3
+ "version": "3.5.0",
4
4
  "description": "Open the map app of the user's choice with a specific location.",
5
5
  "source": "src/index",
6
6
  "main": "lib/index.js",
@@ -9,10 +9,10 @@
9
9
  "url": "git+https://github.com/includable/react-native-map-link.git"
10
10
  },
11
11
  "scripts": {
12
- "build": "npm run copy-images && tsc --project tsconfig.build.json",
13
12
  "lint": "eslint src --max-warnings=0 && eslint tests --max-warnings=0",
14
- "release": "semantic-release",
13
+ "build": "npm run copy-images && tsc --project tsconfig.build.json",
15
14
  "test": "jest",
15
+ "release": "semantic-release",
16
16
  "copy-images": "mkdir -p ./lib/images && cp -r ./src/images ./lib",
17
17
  "tscheck": "tsc --noEmit"
18
18
  },