@backstage/config
Advanced tools
Comparing version 0.0.0-nightly-202112321938 to 0.0.0-nightly-202121622848
# @backstage/config | ||
## 0.0.0-nightly-202112321938 | ||
## 0.0.0-nightly-202121622848 | ||
### Patch Changes | ||
- 0434853a5: Reformulate the json types to break type recursion | ||
## 0.1.3 | ||
### Patch Changes | ||
- a1f5e6545: Adds an optional type to `config.get` & `config.getOptional`. This avoids the need for casting. For example: | ||
@@ -8,0 +14,0 @@ |
@@ -5,9 +5,9 @@ 'use strict'; | ||
var cloneDeep2 = require('lodash/cloneDeep'); | ||
var mergeWith2 = require('lodash/mergeWith'); | ||
var cloneDeep = require('lodash/cloneDeep'); | ||
var mergeWith = require('lodash/mergeWith'); | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var cloneDeep2__default = /*#__PURE__*/_interopDefaultLegacy(cloneDeep2); | ||
var mergeWith2__default = /*#__PURE__*/_interopDefaultLegacy(mergeWith2); | ||
var cloneDeep__default = /*#__PURE__*/_interopDefaultLegacy(cloneDeep); | ||
var mergeWith__default = /*#__PURE__*/_interopDefaultLegacy(mergeWith); | ||
@@ -89,3 +89,3 @@ const CONFIG_KEY_PART_PATTERN = /^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i; | ||
} | ||
return mergeWith2__default['default']({}, {value: cloneDeep2__default['default'](fallbackValue)}, {value}, (into, from) => !isObject(from) || !isObject(into) ? from : void 0).value; | ||
return mergeWith__default['default']({}, {value: cloneDeep__default['default'](fallbackValue)}, {value}, (into, from) => !isObject(from) || !isObject(into) ? from : void 0).value; | ||
} | ||
@@ -92,0 +92,0 @@ getConfig(key) { |
@@ -0,6 +1,8 @@ | ||
declare type JsonPrimitive = number | string | boolean | null; | ||
declare type JsonObject = { | ||
[key in string]?: JsonValue; | ||
}; | ||
declare type JsonArray = JsonValue[]; | ||
declare type JsonValue = JsonObject | JsonArray | number | string | boolean | null; | ||
interface JsonArray extends Array<JsonValue> { | ||
} | ||
declare type JsonValue = JsonObject | JsonArray | JsonPrimitive; | ||
declare type AppConfig = { | ||
@@ -57,2 +59,2 @@ context: string; | ||
export { AppConfig, Config, ConfigReader, JsonArray, JsonObject, JsonValue }; | ||
export { AppConfig, Config, ConfigReader, JsonArray, JsonObject, JsonPrimitive, JsonValue }; |
@@ -1,3 +0,3 @@ | ||
import cloneDeep2 from 'lodash/cloneDeep'; | ||
import mergeWith2 from 'lodash/mergeWith'; | ||
import cloneDeep from 'lodash/cloneDeep'; | ||
import mergeWith from 'lodash/mergeWith'; | ||
@@ -79,3 +79,3 @@ const CONFIG_KEY_PART_PATTERN = /^[a-z][a-z0-9]*(?:[-_][a-z][a-z0-9]*)*$/i; | ||
} | ||
return mergeWith2({}, {value: cloneDeep2(fallbackValue)}, {value}, (into, from) => !isObject(from) || !isObject(into) ? from : void 0).value; | ||
return mergeWith({}, {value: cloneDeep(fallbackValue)}, {value}, (into, from) => !isObject(from) || !isObject(into) ? from : void 0).value; | ||
} | ||
@@ -82,0 +82,0 @@ getConfig(key) { |
{ | ||
"name": "@backstage/config", | ||
"description": "Config API used by Backstage core, backend, and CLI", | ||
"version": "0.0.0-nightly-202112321938", | ||
"version": "0.0.0-nightly-202121622848", | ||
"private": false, | ||
@@ -37,3 +37,3 @@ "publishConfig": { | ||
"@types/jest": "^26.0.7", | ||
"@types/node": "^12.0.0" | ||
"@types/node": "^14.14.32" | ||
}, | ||
@@ -40,0 +40,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
47486
504