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

@app-config/extensions

Package Overview
Dependencies
Maintainers
2
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@app-config/extensions - npm Package Compare versions

Comparing version 2.1.0-alpha.0 to 2.1.0-alpha.1

dist/es/index.test.d.ts

21

dist/es/index.js

@@ -158,4 +158,23 @@ import { join, dirname, resolve, isAbsolute } from 'path';

return (parse) => {
if (typeof value !== 'string')
if (isObject(value)) {
if (!value.$name) {
throw new AppConfigError('$substitute was provided an object without $name');
}
if (typeof value.$name !== 'string') {
throw new AppConfigError('$substitute was provided an object without a string $name');
}
const variableName = value.$name;
const fallback = value.$fallback;
const resolvedValue = process.env[variableName];
if (fallback !== undefined) {
return parse(resolvedValue || fallback, { shouldFlatten: true });
}
if (!resolvedValue) {
throw new AppConfigError(`$substitute could not find ${variableName} environment variable`);
}
return parse(resolvedValue, { shouldFlatten: true });
}
if (typeof value !== 'string') {
throw new AppConfigError('$substitute expects a string value');
}
return parse(performAllSubstitutions(value), { shouldFlatten: true });

@@ -162,0 +181,0 @@ };

@@ -179,4 +179,23 @@ "use strict";

return (parse) => {
if (typeof value !== 'string')
if (utils_1.isObject(value)) {
if (!value.$name) {
throw new core_1.AppConfigError('$substitute was provided an object without $name');
}
if (typeof value.$name !== 'string') {
throw new core_1.AppConfigError('$substitute was provided an object without a string $name');
}
const variableName = value.$name;
const fallback = value.$fallback;
const resolvedValue = process.env[variableName];
if (fallback !== undefined) {
return parse(resolvedValue || fallback, { shouldFlatten: true });
}
if (!resolvedValue) {
throw new core_1.AppConfigError(`$substitute could not find ${variableName} environment variable`);
}
return parse(resolvedValue, { shouldFlatten: true });
}
if (typeof value !== 'string') {
throw new core_1.AppConfigError('$substitute expects a string value');
}
return parse(performAllSubstitutions(value), { shouldFlatten: true });

@@ -183,0 +202,0 @@ };

12

package.json
{
"name": "@app-config/extensions",
"description": "Common parsing extensions for @app-config",
"version": "2.1.0-alpha.0",
"version": "2.1.0-alpha.1",
"license": "MPL-2.0",

@@ -33,9 +33,9 @@ "author": {

"dependencies": {
"@app-config/core": "2.1.0-alpha.0",
"@app-config/node": "2.1.0-alpha.0",
"@app-config/logging": "2.1.0-alpha.0",
"@app-config/utils": "2.1.0-alpha.0"
"@app-config/core": "2.1.0-alpha.1",
"@app-config/node": "2.1.0-alpha.1",
"@app-config/logging": "2.1.0-alpha.1",
"@app-config/utils": "2.1.0-alpha.1"
},
"devDependencies": {
"@app-config/test-utils": "2.1.0-alpha.0"
"@app-config/test-utils": "2.1.0-alpha.1"
},

@@ -42,0 +42,0 @@ "prettier": "@lcdev/prettier",

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