-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Completely break story generation, then fix it again
- Loading branch information
Showing
9 changed files
with
435 additions
and
275 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
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
Large diffs are not rendered by default.
Oops, something went wrong.
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 @@ | ||
import * as generatedStories from "./stories.generated"; | ||
|
||
const storyGroups = Object.groupBy(Object.values(generatedStories), (item) => item.groupName); | ||
|
||
export default Object.entries(storyGroups).map(([title, stories]) => ({ title, stories })); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// See https://stackoverflow.com/a/77724124/1470607 | ||
interface ObjectConstructor { | ||
/** | ||
* Groups members of an iterable according to the return value of the passed callback. | ||
* @param items An iterable. | ||
* @param keySelector A callback which will be invoked for each item in items. | ||
*/ | ||
groupBy<K extends PropertyKey, T>( | ||
items: Iterable<T>, | ||
keySelector: (item: T, index: number) => K, | ||
): Partial<Record<K, T[]>>; | ||
} | ||
|
||
interface MapConstructor { | ||
/** | ||
* Groups members of an iterable according to the return value of the passed callback. | ||
* @param items An iterable. | ||
* @param keySelector A callback which will be invoked for each item in items. | ||
*/ | ||
groupBy<K, T>( | ||
items: Iterable<T>, | ||
keySelector: (item: T, index: number) => K, | ||
): Map<K, T[]>; | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.