-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
41eee74
commit c91c70d
Showing
6 changed files
with
236 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@labdigital/storyblok-graphql-codegen-terraform': minor | ||
--- | ||
|
||
Resolve links in richtext |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export const recursivelyModifyObjects = ( | ||
data: any, | ||
objectModifier: (value: Record<string, any>) => Record<string, any> | ||
): any => { | ||
if (Array.isArray(data)) { | ||
return data.map((value: any) => | ||
recursivelyModifyObjects(value, objectModifier) | ||
) | ||
} else if (typeof data === 'object') { | ||
return Object.fromEntries( | ||
Object.entries(objectModifier(data)).map(([key, value]) => [ | ||
key, | ||
recursivelyModifyObjects(value, objectModifier), | ||
]) | ||
) | ||
} else { | ||
return data | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.