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

Commit

Permalink
Merge pull request #92 from matei-radu/development
Browse files Browse the repository at this point in the history
Release 3.1.3
  • Loading branch information
matei-radu committed Dec 14, 2019
2 parents 63248b1 + 4f3657b commit d507978
Show file tree
Hide file tree
Showing 9 changed files with 1,484 additions and 1,561 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
example/node_modules
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@
scripts/*.ts linguist-vendored
release-manager/*.ts linguist-vendored
example/* linguist-vendored
.eslintrc.js linguist-vendored
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.1.3] - 2019-12-14

### Fixed

- The React peer dependency is now `16.8.6` as needed by RN 0.60.0 and upwards.

### Changed

- Bump TypeScript to version `3.7.3`.

## [3.1.2] - 2019-10-19

### Added
Expand Down Expand Up @@ -176,6 +186,7 @@ The following functions have been deprecated. Please see

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

[3.1.3]: https://github.com/matei-radu/react-native-in-app-browser/compare/v3.1.2...v3.1.3
[3.1.2]: https://github.com/matei-radu/react-native-in-app-browser/compare/v3.1.1...v3.1.2
[3.1.1]: https://github.com/matei-radu/react-native-in-app-browser/compare/v3.1.0...v3.1.1
[3.1.0]: https://github.com/matei-radu/react-native-in-app-browser/compare/v3.0.0...v3.1.0
Expand Down
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ In-App browser support for React Native, using [Chrome Custom Tabs][chromecustom
on Android
and [Safari View Controller][sfsafariviewcontroller] on iOS.

### Features

- [x] Typescript and Flow definitions
- [x] Actively developed

## Compatibility

This library will always target the most recent React Native package. If you are
Expand Down
41 changes: 21 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@matt-block/react-native-in-app-browser",
"version": "3.1.2",
"version": "3.1.3",
"description": "React Native in-app browser",
"keywords": [
"in-app",
Expand All @@ -17,10 +17,10 @@
"types": "types/index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/matt-block/react-native-in-app-browser.git"
"url": "https://github.com/matei-radu/react-native-in-app-browser.git"
},
"bugs": "https://github.com/matt-block/react-native-in-app-browser/issues",
"homepage": "https://github.com/matt-block/react-native-in-app-browser#readme",
"bugs": "https://github.com/matei-radu/react-native-in-app-browser/issues",
"homepage": "https://github.com/matei-radu/react-native-in-app-browser#readme",
"author": "Matei Bogdan Radu <opensource@mateiradu.dev>",
"license": "MIT",
"private": false,
Expand Down Expand Up @@ -48,31 +48,32 @@
"devDependencies": {
"@react-native-community/eslint-config": "^0.0.5",
"@team-griffin/install-self-peers": "^1.1.1",
"@types/jest": "^24.0.9",
"@types/react-native": "^0.57.7",
"@types/jest": "^24.0.23",
"@types/react": "^16.8.25",
"@types/react-native": "^0.60.25",
"@types/semver": "^6.2.0",
"@types/shelljs": "^0.8.0",
"@types/shelljs": "^0.8.6",
"@types/tinycolor2": "^1.4.1",
"@typescript-eslint/eslint-plugin": "^2.5.0",
"@typescript-eslint/parser": "^2.5.0",
"commander": "^3.0.2",
"eslint": "^5.0.0",
"@typescript-eslint/eslint-plugin": "^2.11.0",
"@typescript-eslint/parser": "^2.11.0",
"commander": "^4.0.1",
"eslint": "^5.16.0",
"eslint-config-prettier": "^6.4.0",
"eslint-plugin-prettier": "^3.1.1",
"husky": "^1.1.2",
"jest": "^24.1.0",
"lint-staged": "^7.3.0",
"husky": "^3.1.0",
"jest": "^24.9.0",
"lint-staged": "^9.5.0",
"npm-run-all": "^4.1.3",
"prettier": "^1.18.2",
"prettier": "^1.19.1",
"rimraf": "^3.0.0",
"semver": "^6.3.0",
"shelljs": "^0.8.2",
"ts-jest": "^24.0.0",
"ts-node": "^7.0.1",
"typescript": "^3.1.3"
"ts-jest": "^24.2.0",
"ts-node": "^8.5.4",
"typescript": "^3.7.3"
},
"peerDependencies": {
"react": "^16.5.0",
"react": "^16.8.6",
"react-native": ">= 0.60.0"
},
"husky": {
Expand All @@ -89,4 +90,4 @@
"dependencies": {
"tinycolor2": "^1.4.1"
}
}
}
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class InAppBrowser {
if (Platform.OS === 'android') {
return NativeModules.RNInAppBrowser.mayLaunchUrl(
url,
additionalUrls ? additionalUrls : []
additionalUrls ?? []
);
}

Expand Down
1 change: 1 addition & 0 deletions src/settings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/

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

import { sanitize, initialize, defaultSettings, Settings } from './settings';
Expand Down
17 changes: 9 additions & 8 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,7 @@ export const defaultSettings: Settings = {
};

function sanitizeAndroid(settings?: SettingsAndroid): SettingsAndroid {
const sanitized = {
...(defaultSettings.android ? defaultSettings.android : {}),
};
const sanitized = { ...(defaultSettings.android ?? {}) };

if (!settings) {
return sanitized;
Expand Down Expand Up @@ -136,7 +134,7 @@ function sanitizeAndroid(settings?: SettingsAndroid): SettingsAndroid {
}

function sanitizeIOS(settings?: SettingsIOS): SettingsIOS {
const sanitized = { ...(defaultSettings.ios ? defaultSettings.ios : {}) };
const sanitized = { ...(defaultSettings.ios ?? {}) };

if (!settings) {
return sanitized;
Expand All @@ -163,15 +161,18 @@ function sanitizeIOS(settings?: SettingsIOS): SettingsIOS {
* Also, in case of same properties, provided ones have priority
* over defaults.
*/
export function sanitize(os: 'android', settings?: Settings): SettingsAndroid;
export function sanitize(os: 'ios', settings?: Settings): SettingsIOS;
export function sanitize(os: PlatformOSType, settings?: Settings): {};
export function sanitize(
os: PlatformOSType,
settings?: Settings,
): SettingsAndroid | SettingsIOS {
switch (os) {
case 'android':
return sanitizeAndroid(settings ? settings.android : {});
return sanitizeAndroid(settings?.android);
case 'ios':
return sanitizeIOS(settings ? settings.ios : {});
return sanitizeIOS(settings?.ios);
// Other platforms in the future.
default:
return {};
Expand All @@ -192,6 +193,6 @@ export function initialize(settings: Settings): void {
defaultSettings.android = {};
defaultSettings.ios = {};

defaultSettings.android = sanitize('android', settings) as SettingsAndroid;
defaultSettings.ios = sanitize('ios', settings) as SettingsIOS;
defaultSettings.android = sanitize('android', settings);
defaultSettings.ios = sanitize('ios', settings);
}
Loading

0 comments on commit d507978

Please sign in to comment.