Skip to content
This repository was archived by the owner on Nov 10, 2020. It is now read-only.

Commit d507978

Browse files
committed
Merge pull request #92 from matei-radu/development
Release 3.1.3
2 parents 63248b1 + 4f3657b commit d507978

File tree

9 files changed

+1484
-1561
lines changed

9 files changed

+1484
-1561
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
example/node_modules

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
scripts/*.ts linguist-vendored
66
release-manager/*.ts linguist-vendored
77
example/* linguist-vendored
8+
.eslintrc.js linguist-vendored

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [3.1.3] - 2019-12-14
9+
10+
### Fixed
11+
12+
- The React peer dependency is now `16.8.6` as needed by RN 0.60.0 and upwards.
13+
14+
### Changed
15+
16+
- Bump TypeScript to version `3.7.3`.
17+
818
## [3.1.2] - 2019-10-19
919

1020
### Added
@@ -176,6 +186,7 @@ The following functions have been deprecated. Please see
176186

177187
- `openInApp`: open a valid http(s) URL with an in-app browser.
178188

189+
[3.1.3]: https://github.com/matei-radu/react-native-in-app-browser/compare/v3.1.2...v3.1.3
179190
[3.1.2]: https://github.com/matei-radu/react-native-in-app-browser/compare/v3.1.1...v3.1.2
180191
[3.1.1]: https://github.com/matei-radu/react-native-in-app-browser/compare/v3.1.0...v3.1.1
181192
[3.1.0]: https://github.com/matei-radu/react-native-in-app-browser/compare/v3.0.0...v3.1.0

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ In-App browser support for React Native, using [Chrome Custom Tabs][chromecustom
66
on Android
77
and [Safari View Controller][sfsafariviewcontroller] on iOS.
88

9-
### Features
10-
11-
- [x] Typescript and Flow definitions
12-
- [x] Actively developed
13-
149
## Compatibility
1510

1611
This library will always target the most recent React Native package. If you are

package.json

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@matt-block/react-native-in-app-browser",
3-
"version": "3.1.2",
3+
"version": "3.1.3",
44
"description": "React Native in-app browser",
55
"keywords": [
66
"in-app",
@@ -17,10 +17,10 @@
1717
"types": "types/index.d.ts",
1818
"repository": {
1919
"type": "git",
20-
"url": "https://github.com/matt-block/react-native-in-app-browser.git"
20+
"url": "https://github.com/matei-radu/react-native-in-app-browser.git"
2121
},
22-
"bugs": "https://github.com/matt-block/react-native-in-app-browser/issues",
23-
"homepage": "https://github.com/matt-block/react-native-in-app-browser#readme",
22+
"bugs": "https://github.com/matei-radu/react-native-in-app-browser/issues",
23+
"homepage": "https://github.com/matei-radu/react-native-in-app-browser#readme",
2424
"author": "Matei Bogdan Radu <[email protected]>",
2525
"license": "MIT",
2626
"private": false,
@@ -48,31 +48,32 @@
4848
"devDependencies": {
4949
"@react-native-community/eslint-config": "^0.0.5",
5050
"@team-griffin/install-self-peers": "^1.1.1",
51-
"@types/jest": "^24.0.9",
52-
"@types/react-native": "^0.57.7",
51+
"@types/jest": "^24.0.23",
52+
"@types/react": "^16.8.25",
53+
"@types/react-native": "^0.60.25",
5354
"@types/semver": "^6.2.0",
54-
"@types/shelljs": "^0.8.0",
55+
"@types/shelljs": "^0.8.6",
5556
"@types/tinycolor2": "^1.4.1",
56-
"@typescript-eslint/eslint-plugin": "^2.5.0",
57-
"@typescript-eslint/parser": "^2.5.0",
58-
"commander": "^3.0.2",
59-
"eslint": "^5.0.0",
57+
"@typescript-eslint/eslint-plugin": "^2.11.0",
58+
"@typescript-eslint/parser": "^2.11.0",
59+
"commander": "^4.0.1",
60+
"eslint": "^5.16.0",
6061
"eslint-config-prettier": "^6.4.0",
6162
"eslint-plugin-prettier": "^3.1.1",
62-
"husky": "^1.1.2",
63-
"jest": "^24.1.0",
64-
"lint-staged": "^7.3.0",
63+
"husky": "^3.1.0",
64+
"jest": "^24.9.0",
65+
"lint-staged": "^9.5.0",
6566
"npm-run-all": "^4.1.3",
66-
"prettier": "^1.18.2",
67+
"prettier": "^1.19.1",
6768
"rimraf": "^3.0.0",
6869
"semver": "^6.3.0",
6970
"shelljs": "^0.8.2",
70-
"ts-jest": "^24.0.0",
71-
"ts-node": "^7.0.1",
72-
"typescript": "^3.1.3"
71+
"ts-jest": "^24.2.0",
72+
"ts-node": "^8.5.4",
73+
"typescript": "^3.7.3"
7374
},
7475
"peerDependencies": {
75-
"react": "^16.5.0",
76+
"react": "^16.8.6",
7677
"react-native": ">= 0.60.0"
7778
},
7879
"husky": {
@@ -89,4 +90,4 @@
8990
"dependencies": {
9091
"tinycolor2": "^1.4.1"
9192
}
92-
}
93+
}

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class InAppBrowser {
8585
if (Platform.OS === 'android') {
8686
return NativeModules.RNInAppBrowser.mayLaunchUrl(
8787
url,
88-
additionalUrls ? additionalUrls : []
88+
additionalUrls ?? []
8989
);
9090
}
9191

src/settings.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
// See https://github.com/facebook/react-native/issues/23943
9+
// eslint-disable-next-line @typescript-eslint/no-empty-function
910
jest.doMock('react-native', () => {});
1011

1112
import { sanitize, initialize, defaultSettings, Settings } from './settings';

src/settings.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,7 @@ export const defaultSettings: Settings = {
106106
};
107107

108108
function sanitizeAndroid(settings?: SettingsAndroid): SettingsAndroid {
109-
const sanitized = {
110-
...(defaultSettings.android ? defaultSettings.android : {}),
111-
};
109+
const sanitized = { ...(defaultSettings.android ?? {}) };
112110

113111
if (!settings) {
114112
return sanitized;
@@ -136,7 +134,7 @@ function sanitizeAndroid(settings?: SettingsAndroid): SettingsAndroid {
136134
}
137135

138136
function sanitizeIOS(settings?: SettingsIOS): SettingsIOS {
139-
const sanitized = { ...(defaultSettings.ios ? defaultSettings.ios : {}) };
137+
const sanitized = { ...(defaultSettings.ios ?? {}) };
140138

141139
if (!settings) {
142140
return sanitized;
@@ -163,15 +161,18 @@ function sanitizeIOS(settings?: SettingsIOS): SettingsIOS {
163161
* Also, in case of same properties, provided ones have priority
164162
* over defaults.
165163
*/
164+
export function sanitize(os: 'android', settings?: Settings): SettingsAndroid;
165+
export function sanitize(os: 'ios', settings?: Settings): SettingsIOS;
166+
export function sanitize(os: PlatformOSType, settings?: Settings): {};
166167
export function sanitize(
167168
os: PlatformOSType,
168169
settings?: Settings,
169170
): SettingsAndroid | SettingsIOS {
170171
switch (os) {
171172
case 'android':
172-
return sanitizeAndroid(settings ? settings.android : {});
173+
return sanitizeAndroid(settings?.android);
173174
case 'ios':
174-
return sanitizeIOS(settings ? settings.ios : {});
175+
return sanitizeIOS(settings?.ios);
175176
// Other platforms in the future.
176177
default:
177178
return {};
@@ -192,6 +193,6 @@ export function initialize(settings: Settings): void {
192193
defaultSettings.android = {};
193194
defaultSettings.ios = {};
194195

195-
defaultSettings.android = sanitize('android', settings) as SettingsAndroid;
196-
defaultSettings.ios = sanitize('ios', settings) as SettingsIOS;
196+
defaultSettings.android = sanitize('android', settings);
197+
defaultSettings.ios = sanitize('ios', settings);
197198
}

0 commit comments

Comments
 (0)