@invrs/ads
Advanced tools
Comparing version 0.8.6 to 0.8.7
@@ -13,2 +13,3 @@ "use strict"; | ||
var _exportNames = { | ||
env: true, | ||
store: true, | ||
@@ -19,2 +20,4 @@ init: true, | ||
destroy: true, | ||
envFromHostname: true, | ||
pollUrl: true, | ||
target: true | ||
@@ -26,4 +29,6 @@ }; | ||
exports.destroy = destroy; | ||
exports.envFromHostname = envFromHostname; | ||
exports.pollUrl = pollUrl; | ||
exports.target = target; | ||
exports.store = void 0; | ||
exports.store = exports.env = void 0; | ||
@@ -63,2 +68,4 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); | ||
// Constants | ||
var env = envFromHostname(); | ||
exports.env = env; | ||
var store = (0, _dotStoreMessage.default)((0, _dotStoreIframe.default)(new _dotStore.default())); | ||
@@ -161,3 +168,3 @@ exports.store = store; | ||
divId: id, | ||
url: "http://local.origin.stage.inverse.com:3000/poll", | ||
url: pollUrl(), | ||
width: "100%" | ||
@@ -270,2 +277,28 @@ }); | ||
function envFromHostname() { | ||
var hostname = window.location.hostname; | ||
if (hostname.match(/local\.origin/)) { | ||
return "development"; | ||
} | ||
if (hostname.match(/stage\.inverse/)) { | ||
return "staging"; | ||
} | ||
return "production"; | ||
} | ||
function pollUrl() { | ||
if (env == "development") { | ||
return "http://local.origin.stage.inverse.com:3000/poll"; | ||
} | ||
if (env == "staging") { | ||
return "https://arch.stage.inverse.com/poll"; | ||
} | ||
return "https://arch.inverse.com/poll"; | ||
} | ||
function target(_x6) { | ||
@@ -272,0 +305,0 @@ return _target.apply(this, arguments); |
{ | ||
"name": "@invrs/ads", | ||
"version": "0.8.6", | ||
"version": "0.8.7", | ||
"description": "Inverse ad code", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
49250
531