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

@cubejs-backend/shared

Package Overview
Dependencies
Maintainers
2
Versions
189
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@cubejs-backend/shared - npm Package Compare versions

Comparing version 0.25.4 to 0.25.5

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

## [0.25.5](https://github.com/cube-js/cube.js/compare/v0.25.4...v0.25.5) (2020-12-30)
### Features
* Allow to specify socket for PORT/TLS_PORT, fix [#1681](https://github.com/cube-js/cube.js/issues/1681) ([b9c4669](https://github.com/cube-js/cube.js/commit/b9c466987ffa41f31fa8b3bda88432175e57cd86))
## [0.25.4](https://github.com/cube-js/cube.js/compare/v0.25.3...v0.25.4) (2020-12-30)

@@ -8,0 +19,0 @@

6

dist/src/env.d.ts
export declare function convertTimeStrToMs(input: string, envName: string): number;
export declare function asPortNumber(input: number, envName: string): number;
export declare function asPortOrSocket(input: string, envName: string): number | string;
declare const variables: {
devMode: () => boolean;
port: () => number;
tlsPort: () => number;
port: () => string | number;
tlsPort: () => string | number;
tls: () => boolean;

@@ -7,0 +9,0 @@ webSockets: () => boolean;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isDockerImage = exports.getEnv = exports.convertTimeStrToMs = void 0;
exports.isDockerImage = exports.getEnv = exports.asPortOrSocket = exports.asPortNumber = exports.convertTimeStrToMs = void 0;
const env_var_1 = require("env-var");

@@ -20,5 +20,23 @@ function convertTimeStrToMs(input, envName) {

}
throw new Error(`Unsupported time format in ${envName}`);
throw new Error(`${envName} is a time, must be number (in seconds) or string in time format (1s, 1m, 1h)`);
}
exports.convertTimeStrToMs = convertTimeStrToMs;
function asPortNumber(input, envName) {
if (input < 0) {
throw new Error(`${envName} is a port number, should be a positive integer`);
}
if (input > 65535) {
throw new Error(`${envName} is a port number, should be lower or equal than 65535`);
}
return input;
}
exports.asPortNumber = asPortNumber;
function asPortOrSocket(input, envName) {
if (/^-?\d+$/.test(input)) {
return asPortNumber(parseInt(input, 10), envName);
}
// @todo Can we check that path for socket is valid?
return input;
}
exports.asPortOrSocket = asPortOrSocket;
const variables = {

@@ -28,10 +46,4 @@ devMode: () => env_var_1.get('CUBEJS_DEV_MODE')

.asBoolStrict(),
port: () => env_var_1.get('PORT')
.default(4000)
.required()
.asPortNumber(),
tlsPort: () => env_var_1.get('TLS_PORT')
.default(4433)
.required()
.asPortNumber(),
port: () => asPortOrSocket(process.env.PORT || '4000', 'PORT'),
tlsPort: () => asPortOrSocket(process.env.TLS_PORT || '4433', 'TLS_PORT'),
tls: () => env_var_1.get('CUBEJS_ENABLE_TLS')

@@ -38,0 +50,0 @@ .default('false')

{
"name": "@cubejs-backend/shared",
"version": "0.25.4",
"version": "0.25.5",
"description": "Shared code for Cube.js backend packages",

@@ -42,3 +42,3 @@ "main": "dist/src/index.js",

},
"gitHead": "f23e16617723f841589237ea7dca053076539e01"
"gitHead": "44ce380a8c7a21748fb898a87ed2d8e6ed6985fd"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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