Skip to content

Commit

Permalink
Reformulate the json types to break type recursion
Browse files Browse the repository at this point in the history
Signed-off-by: Fredrik Adelöw <[email protected]>
  • Loading branch information
freben committed Mar 15, 2021
1 parent 5f46e1e commit 0434853
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/loud-masks-smash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@backstage/config': patch
---

Reformulate the json types to break type recursion
3 changes: 2 additions & 1 deletion packages/config/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
* limitations under the License.
*/

export { ConfigReader } from './reader';
export type {
AppConfig,
Config,
JsonArray,
JsonObject,
JsonPrimitive,
JsonValue,
} from './types';
export { ConfigReader } from './reader';
11 changes: 3 additions & 8 deletions packages/config/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,10 @@
* limitations under the License.
*/

export type JsonPrimitive = number | string | boolean | null;
export type JsonObject = { [key in string]?: JsonValue };
export type JsonArray = JsonValue[];
export type JsonValue =
| JsonObject
| JsonArray
| number
| string
| boolean
| null;
export interface JsonArray extends Array<JsonValue> {}
export type JsonValue = JsonObject | JsonArray | JsonPrimitive;

export type AppConfig = {
context: string;
Expand Down

0 comments on commit 0434853

Please sign in to comment.