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
188
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.5 to 0.25.6

11

CHANGELOG.md

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

## [0.25.6](https://github.com/cube-js/cube.js/compare/v0.25.5...v0.25.6) (2020-12-30)
### Bug Fixes
* Allow CUBEJS_SCHEDULED_REFRESH_TIMER to be boolean ([4e80645](https://github.com/cube-js/cube.js/commit/4e80645259cbd3a5ad7d92f3d07a1d5a58a6c5ef))
## [0.25.5](https://github.com/cube-js/cube.js/compare/v0.25.4...v0.25.5) (2020-12-30)

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

8

dist/src/env.d.ts

@@ -1,4 +0,6 @@

export declare function convertTimeStrToMs(input: string, envName: string): number;
export declare class InvalidConfiguration extends Error {
constructor(key: string, value: any, description: string);
}
export declare function convertTimeStrToMs(input: string, envName: string, description?: string): number;
export declare function asPortNumber(input: number, envName: string): number;
export declare function asPortOrSocket(input: string, envName: string): number | string;
declare const variables: {

@@ -10,3 +12,3 @@ devMode: () => boolean;

webSockets: () => boolean;
refreshTimer: () => number | undefined;
refreshTimer: () => number | boolean | "" | undefined;
scheduledRefresh: () => boolean | undefined;

@@ -13,0 +15,0 @@ dockerImageVersion: () => string | undefined;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isDockerImage = exports.getEnv = exports.asPortOrSocket = exports.asPortNumber = exports.convertTimeStrToMs = void 0;
exports.isDockerImage = exports.getEnv = exports.asPortNumber = exports.convertTimeStrToMs = exports.InvalidConfiguration = void 0;
const env_var_1 = require("env-var");
function convertTimeStrToMs(input, envName) {
class InvalidConfiguration extends Error {
constructor(key, value, description) {
super(`Value "${value}" is not valid for ${key}. ${description}`);
}
}
exports.InvalidConfiguration = InvalidConfiguration;
function convertTimeStrToMs(input, envName, description = 'Must be number (in seconds) or string in time format (1s, 1m, 1h).') {
if (/^\d+$/.test(input)) {

@@ -20,3 +26,3 @@ return parseInt(input, 10);

}
throw new Error(`${envName} is a time, must be number (in seconds) or string in time format (1s, 1m, 1h)`);
throw new InvalidConfiguration(envName, input, description);
}

@@ -26,6 +32,6 @@ exports.convertTimeStrToMs = convertTimeStrToMs;

if (input < 0) {
throw new Error(`${envName} is a port number, should be a positive integer`);
throw new InvalidConfiguration(envName, input, 'Should be a positive integer.');
}
if (input > 65535) {
throw new Error(`${envName} is a port number, should be lower or equal than 65535`);
throw new InvalidConfiguration(envName, input, 'Should be lower or equal than 65535.');
}

@@ -42,3 +48,11 @@ return input;

}
exports.asPortOrSocket = asPortOrSocket;
function asBoolOrTime(input, envName) {
if (input === 'true') {
return true;
}
if (input === 'false') {
return false;
}
return convertTimeStrToMs(input, envName, 'Should be boolean or number (in seconds) or string in time format (1s, 1m, 1h)');
}
const variables = {

@@ -56,4 +70,4 @@ devMode: () => env_var_1.get('CUBEJS_DEV_MODE')

.asBoolStrict(),
refreshTimer: () => env_var_1.get('CUBEJS_SCHEDULED_REFRESH_TIMER')
.asInt(),
refreshTimer: () => process.env.CUBEJS_SCHEDULED_REFRESH_TIMER
&& asBoolOrTime(process.env.CUBEJS_SCHEDULED_REFRESH_TIMER, 'CUBEJS_SCHEDULED_REFRESH_TIMER'),
scheduledRefresh: () => env_var_1.get('CUBEJS_SCHEDULED_REFRESH')

@@ -60,0 +74,0 @@ .asBool(),

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

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

},
"gitHead": "44ce380a8c7a21748fb898a87ed2d8e6ed6985fd"
"gitHead": "4126b0caa974d5cd16cea5ba695b555fe48df7ce"
}

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