yeet
This commit is contained in:
42
node_modules/react-native-web/dist/exports/Linking/index.js
generated
vendored
Normal file
42
node_modules/react-native-web/dist/exports/Linking/index.js
generated
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
/**
|
||||
* Copyright (c) Nicolas Gallagher.
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
*
|
||||
*/
|
||||
import { canUseDOM } from 'fbjs/lib/ExecutionEnvironment';
|
||||
import invariant from 'fbjs/lib/invariant';
|
||||
var initialURL = canUseDOM ? window.location.href : '';
|
||||
var Linking = {
|
||||
addEventListener: function addEventListener() {},
|
||||
removeEventListener: function removeEventListener() {},
|
||||
canOpenURL: function canOpenURL() {
|
||||
return Promise.resolve(true);
|
||||
},
|
||||
getInitialURL: function getInitialURL() {
|
||||
return Promise.resolve(initialURL);
|
||||
},
|
||||
openURL: function openURL(url) {
|
||||
try {
|
||||
open(url);
|
||||
return Promise.resolve();
|
||||
} catch (e) {
|
||||
return Promise.reject(e);
|
||||
}
|
||||
},
|
||||
_validateURL: function _validateURL(url) {
|
||||
invariant(typeof url === 'string', 'Invalid URL: should be a string. Was: ' + url);
|
||||
invariant(url, 'Invalid URL: cannot be empty');
|
||||
}
|
||||
};
|
||||
|
||||
var open = function open(url) {
|
||||
if (canUseDOM) {
|
||||
window.location = new URL(url, window.location).toString();
|
||||
}
|
||||
};
|
||||
|
||||
export default Linking;
|
Reference in New Issue
Block a user