UNPKG

1.08 kBJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = void 0;
7function _open() {
8 const data = _interopRequireDefault(require("open"));
9 _open = function () {
10 return data;
11 };
12 return data;
13}
14var _throwIfNonHttpProtocol = _interopRequireDefault(require("./throwIfNonHttpProtocol"));
15var _logger = _interopRequireDefault(require("./logger"));
16function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17/**
18 * Copyright (c) Facebook, Inc. and its affiliates.
19 *
20 * This source code is licensed under the MIT license found in the
21 * LICENSE file in the root directory of this source tree.
22 *
23 * @format
24 */
25
26async function launchDefaultBrowser(url) {
27 try {
28 (0, _throwIfNonHttpProtocol.default)(url);
29 await (0, _open().default)(url);
30 } catch (err) {
31 if (err instanceof Error) {
32 _logger.default.error('Browser exited with error:', err.message);
33 }
34 }
35}
36var _default = launchDefaultBrowser;
37exports.default = _default;
38
39//# sourceMappingURL=launchDefaultBrowser.js.map
\No newline at end of file