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

@backstage/config

Package Overview
Dependencies
Maintainers
4
Versions
330
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@backstage/config - npm Package Compare versions

Comparing version 0.0.0-nightly-20221220022526 to 0.0.0-nightly-20221230022354

14

CHANGELOG.md
# @backstage/config
## 0.0.0-nightly-20221220022526
## 0.0.0-nightly-20221230022354
### Patch Changes
- ba2d69ee17: Adds the ability to coerce values to their boolean representatives.
Values such as `"true"` `1` `on` and `y` will become `true` when using `getBoolean` and the opposites `false`.
This happens particularly when such parameters are used with environmental substitution as environment variables are always strings.
- Updated dependencies
- @backstage/types@0.0.0-nightly-20221220022526
- @backstage/types@1.0.2
## 1.0.5
### Patch Changes
- Updated dependencies
- @backstage/types@1.0.2
## 1.0.5-next.1

@@ -11,0 +21,0 @@

@@ -205,6 +205,17 @@ 'use strict';

getOptionalBoolean(key) {
return this.readConfigValue(
const value = this.readConfigValue(
key,
(value) => typeof value === "boolean" || { expected: "boolean" }
(val) => typeof val === "boolean" || typeof val === "number" || typeof val === "string" || { expected: "boolean" }
);
if (typeof value === "boolean" || value === void 0) {
return value;
}
const valueString = String(value).trim();
if (/^(?:y|yes|true|1|on)$/i.test(valueString)) {
return true;
}
if (/^(?:n|no|false|0|off)$/i.test(valueString)) {
return false;
}
throw new Error(errors.convert(this.fullKey(key), this.context, "boolean"));
}

@@ -211,0 +222,0 @@ getString(key) {

@@ -196,6 +196,17 @@ import cloneDeep from 'lodash/cloneDeep';

getOptionalBoolean(key) {
return this.readConfigValue(
const value = this.readConfigValue(
key,
(value) => typeof value === "boolean" || { expected: "boolean" }
(val) => typeof val === "boolean" || typeof val === "number" || typeof val === "string" || { expected: "boolean" }
);
if (typeof value === "boolean" || value === void 0) {
return value;
}
const valueString = String(value).trim();
if (/^(?:y|yes|true|1|on)$/i.test(valueString)) {
return true;
}
if (/^(?:n|no|false|0|off)$/i.test(valueString)) {
return false;
}
throw new Error(errors.convert(this.fullKey(key), this.context, "boolean"));
}

@@ -202,0 +213,0 @@ getString(key) {

8

package.json
{
"name": "@backstage/config",
"description": "Config API used by Backstage core, backend, and CLI",
"version": "0.0.0-nightly-20221220022526",
"version": "0.0.0-nightly-20221230022354",
"publishConfig": {

@@ -35,8 +35,8 @@ "access": "public",

"dependencies": {
"@backstage/types": "^0.0.0-nightly-20221220022526",
"@backstage/types": "^1.0.2",
"lodash": "^4.17.21"
},
"devDependencies": {
"@backstage/cli": "^0.0.0-nightly-20221220022526",
"@backstage/test-utils": "^0.0.0-nightly-20221220022526",
"@backstage/cli": "^0.0.0-nightly-20221230022354",
"@backstage/test-utils": "^0.0.0-nightly-20221230022354",
"@types/node": "^16.0.0"

@@ -43,0 +43,0 @@ },

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