@aofl/server-environment
Advanced tools
Comparing version
@@ -1,2 +0,2 @@ | ||
module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s="QfWi")}({QfWi:function(e,t,n){"use strict";n.r(t);var r={DEV:"development",STAGE:"stage",PROD:"production"};function o(e,t){return e instanceof RegExp&&e.test(location.hostname)?r.DEV:t instanceof RegExp&&t.test(location.hostname)?r.STAGE:r.PROD}n.d(t,"environmentTypeEnumerate",(function(){return r})),n.d(t,"getServerEnvironment",(function(){return o}))}}); | ||
module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/",n(n.s="QfWi")}({QfWi:function(e,t,n){"use strict";n.r(t);var r={DEV:"development",STAGE:"stage",PROD:"production"},o=function(e,t){return e instanceof RegExp&&e.test(location.hostname)?r.DEV:t instanceof RegExp&&t.test(location.hostname)?r.STAGE:r.PROD};n.d(t,"environmentTypeEnumerate",(function(){return r})),n.d(t,"getServerEnvironment",(function(){return o}))}}); | ||
//# sourceMappingURL=index.js.map |
@@ -19,3 +19,3 @@ /** | ||
*/ | ||
export function getServerEnvironment(devRegex, stageRegex) { | ||
const getServerEnvironment = (devRegex, stageRegex) => { | ||
if (devRegex instanceof RegExp && devRegex.test(location.hostname)) { | ||
@@ -30,2 +30,6 @@ return environmentTypeEnumerate.DEV; | ||
return environmentTypeEnumerate.PROD; | ||
} | ||
}; | ||
export { | ||
getServerEnvironment | ||
}; |
{ | ||
"name": "@aofl/server-environment", | ||
"version": "3.0.0-beta.30", | ||
"version": "3.0.0-beta.32", | ||
"description": "Helps determine dev, stage, prod environments based on hostname", | ||
@@ -34,3 +34,3 @@ "main": "index.js", | ||
"devDependencies": { | ||
"@aofl/cli": "^3.0.0-beta.30", | ||
"@aofl/cli": "^3.0.0-beta.32", | ||
"cross-env": "^6.0.3", | ||
@@ -40,4 +40,3 @@ "jsdoc": "^3.6.3", | ||
"tsd-jsdoc": "^2.4.0" | ||
}, | ||
"gitHead": "7bb6b9b6e2c1d77cf7e65680aeb6a4c60e0300f4" | ||
} | ||
} |
@@ -1,2 +0,3 @@ | ||
import {getServerEnvironment, environmentTypeEnumerate} from '../'; | ||
import {environmentTypeEnumerate} from '../modules/environment-type-enumerate'; | ||
import {getServerEnvironment} from '../modules/server-environment-service'; | ||
@@ -3,0 +4,0 @@ describe('@aofl/getServerEnvironment', function() { |
Sorry, the diff of this file is not supported yet
129
3.2%8920
-10.23%11
-8.33%