+2
-5
@@ -6,7 +6,4 @@ "use strict"; | ||
| exports.getSpawnEnvWithPg = getSpawnEnvWithPg; | ||
| const _12factor_env_1 = require("12factor-env"); | ||
| const pg_config_1 = require("./pg-config"); | ||
| const parseEnvNumber = (val) => { | ||
| const num = Number(val); | ||
| return !isNaN(num) ? num : undefined; | ||
| }; | ||
| const getPgEnvVars = () => { | ||
@@ -16,3 +13,3 @@ const { PGHOST, PGPORT, PGUSER, PGPASSWORD, PGDATABASE } = process.env; | ||
| ...(PGHOST && { host: PGHOST }), | ||
| ...(PGPORT && { port: parseEnvNumber(PGPORT) }), | ||
| ...(PGPORT && { port: (0, _12factor_env_1.parseEnvNumber)(PGPORT) }), | ||
| ...(PGUSER && { user: PGUSER }), | ||
@@ -19,0 +16,0 @@ ...(PGPASSWORD && { password: PGPASSWORD }), |
+1
-4
@@ -0,6 +1,3 @@ | ||
| import { parseEnvNumber } from '12factor-env'; | ||
| import { defaultPgConfig } from './pg-config'; | ||
| const parseEnvNumber = (val) => { | ||
| const num = Number(val); | ||
| return !isNaN(num) ? num : undefined; | ||
| }; | ||
| export const getPgEnvVars = () => { | ||
@@ -7,0 +4,0 @@ const { PGHOST, PGPORT, PGUSER, PGPASSWORD, PGDATABASE } = process.env; |
+5
-2
| { | ||
| "name": "pg-env", | ||
| "version": "1.18.0", | ||
| "version": "1.18.1", | ||
| "author": "Constructive <developers@constructive.io>", | ||
@@ -38,6 +38,9 @@ "description": "PostgreSQL environment configuration utilities", | ||
| ], | ||
| "dependencies": { | ||
| "12factor-env": "^1.17.1" | ||
| }, | ||
| "devDependencies": { | ||
| "makage": "^0.3.0" | ||
| }, | ||
| "gitHead": "7eb34a3baa10ba3476575967b87ff51b606e042a" | ||
| "gitHead": "e53a570a4a70987e82dc074bd73501971fd82828" | ||
| } |
17796
-0.25%1
Infinity%164
-3.53%+ Added
+ Added