expensify-common
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -15,2 +15,3 @@ "use strict"; | ||
const APIDeferred_1 = __importDefault(require("./APIDeferred")); | ||
const utils_1 = require("./utils"); | ||
/** | ||
@@ -50,3 +51,3 @@ * @param {Network} network | ||
.done((codeRevision) => { | ||
if (codeRevision.trim() === window.CODE_REVISION) { | ||
if ((0, utils_1.isWindowAvailable)() && codeRevision.trim() === window.CODE_REVISION) { | ||
console.debug('Code revision is up to date'); | ||
@@ -53,0 +54,0 @@ promise.resolve(); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const utils_1 = require("./utils"); | ||
const BROWSERS = { | ||
@@ -16,2 +17,5 @@ EDGE: 'Edge', | ||
function searchString() { | ||
if (!(0, utils_1.isWindowAvailable)() || !(0, utils_1.isNavigatorAvailable)()) { | ||
return ''; | ||
} | ||
const data = [ | ||
@@ -75,2 +79,5 @@ { | ||
function getMobileDevice() { | ||
if (!(0, utils_1.isNavigatorAvailable)() || !navigator.userAgent) { | ||
return ''; | ||
} | ||
const data = [ | ||
@@ -77,0 +84,0 @@ { |
@@ -16,5 +16,5 @@ export { default as API } from './API'; | ||
export { default as Templates } from './Templates'; | ||
export { default as Url } from './Url'; | ||
export * as Url from './Url'; | ||
export { default as fastMerge } from './fastMerge'; | ||
export { default as Str } from './str'; | ||
export { default as TLD_REGEX } from './tlds'; |
@@ -65,4 +65,3 @@ "use strict"; | ||
Object.defineProperty(exports, "Templates", { enumerable: true, get: function () { return __importDefault(Templates_1).default; } }); | ||
var Url_1 = require("./Url"); | ||
Object.defineProperty(exports, "Url", { enumerable: true, get: function () { return __importDefault(Url_1).default; } }); | ||
exports.Url = __importStar(require("./Url")); | ||
var fastMerge_1 = require("./fastMerge"); | ||
@@ -69,0 +68,0 @@ Object.defineProperty(exports, "fastMerge", { enumerable: true, get: function () { return __importDefault(fastMerge_1).default; } }); |
@@ -11,2 +11,3 @@ "use strict"; | ||
const Logger_1 = __importDefault(require("./Logger")); | ||
const utils_1 = require("./utils"); | ||
/** | ||
@@ -30,3 +31,3 @@ * Network interface for logger. | ||
function clientLoggingCallback(message) { | ||
if (typeof window.g_printableReport !== 'undefined' && window.g_printableReport === true) { | ||
if ((0, utils_1.isWindowAvailable)() && typeof window.g_printableReport !== 'undefined' && window.g_printableReport === true) { | ||
return; | ||
@@ -41,3 +42,3 @@ } | ||
clientLoggingCallback, | ||
isDebug: window.DEBUG, | ||
isDebug: (0, utils_1.isWindowAvailable)() ? window.DEBUG : false, | ||
}); |
@@ -26,5 +26,6 @@ "use strict"; | ||
*/ | ||
const utils_1 = require("../utils"); | ||
exports.default = { | ||
propTypes: { | ||
extraClasses: window.PropTypes.oneOfType([window.PropTypes.string, window.PropTypes.array, window.PropTypes.object]), | ||
extraClasses: (0, utils_1.isWindowAvailable)() && window.PropTypes.oneOfType([window.PropTypes.string, window.PropTypes.array, window.PropTypes.object]), | ||
}, | ||
@@ -31,0 +32,0 @@ UNSAFE_componentWillReceiveProps(nextProps) { |
@@ -8,3 +8,4 @@ "use strict"; | ||
const PubSub_1 = __importDefault(require("../PubSub")); | ||
const PubSub = window.PubSub || PubSub_1.default; | ||
const utils_1 = require("../utils"); | ||
const PubSub = ((0, utils_1.isWindowAvailable)() && window.PubSub) || PubSub_1.default; | ||
/** | ||
@@ -11,0 +12,0 @@ * This mixin sets up automatic PubSub bindings which will be removed when |
@@ -8,2 +8,3 @@ "use strict"; | ||
const underscore_1 = __importDefault(require("underscore")); | ||
const utils_1 = require("./utils"); | ||
/** | ||
@@ -42,5 +43,7 @@ * Adds our API command to the URL so the API call is more easily identified in the | ||
// Attach a listener to the event indicating that we're leaving a page | ||
window.onbeforeunload = () => { | ||
isNavigatingAway = true; | ||
}; | ||
if ((0, utils_1.isWindowAvailable)()) { | ||
window.onbeforeunload = () => { | ||
isNavigatingAway = true; | ||
}; | ||
} | ||
return { | ||
@@ -47,0 +50,0 @@ /** |
@@ -9,2 +9,3 @@ "use strict"; | ||
const Log_1 = __importDefault(require("./Log")); | ||
const utils_1 = require("./utils"); | ||
/** | ||
@@ -116,2 +117,2 @@ * PubSub | ||
}; | ||
exports.default = window !== undefined && window.PubSub ? window.PubSub : PubSubModule; | ||
exports.default = (0, utils_1.isWindowAvailable)() && window.PubSub ? window.PubSub : PubSubModule; |
{ | ||
"name": "expensify-common", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"author": "Expensify, Inc.", | ||
@@ -5,0 +5,0 @@ "description": "Expensify libraries and components shared across different repos", |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
474905
73
10760
1