Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@availity/env-var

Package Overview
Dependencies
Maintainers
6
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@availity/env-var - npm Package Compare versions

Comparing version 1.6.0 to 1.6.2

46

index.js

@@ -27,26 +27,24 @@ let environments = {

return (
Object.keys(environments).reduce((prev, env) => {
if (prev) return prev;
let envTests = environments[env];
if (!Array.isArray(envTests)) {
envTests = [envTests];
}
return Object.keys(environments).reduce((prev, env) => {
if (prev) return prev;
let envTests = environments[env];
if (!Array.isArray(envTests)) {
envTests = [envTests];
}
return (
envTests.some(test => {
switch (Object.prototype.toString.call(test)) {
case '[object String]':
return test === subdomain;
case '[object RegExp]':
return test.test(subdomain);
case '[object Function]':
return test();
default:
return false;
}
}) && env
);
}, '') || 'local'
);
return (
envTests.some(test => {
switch (Object.prototype.toString.call(test)) {
case '[object String]':
return test === subdomain;
case '[object RegExp]':
return test.test(subdomain);
case '[object Function]':
return test();
default:
return false;
}
}) && env
);
}, '');
}

@@ -56,3 +54,3 @@

const env = getCurrentEnv(windowOverride);
return varObj[env];
return typeof varObj[env] === 'undefined' ? varObj.local : varObj[env];
}
{
"name": "@availity/env-var",
"version": "1.6.0",
"version": "1.6.2",
"description": "Availity-specific way to determine variables based on the current environment the code is running in",

@@ -5,0 +5,0 @@ "main": "src/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc