-
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.
WIP: Autogenerate types from official documentation
- Loading branch information
1 parent
1b55e99
commit c17ed30
Showing
327 changed files
with
171,425 additions
and
3 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,26 @@ | ||
// Package imports | ||
import { expect } from "chai" | ||
|
||
export interface DefaultCheckResponseOptions { | ||
doNotCheckForUncheckedKeys?: boolean | ||
} | ||
|
||
export const genericCheckObjectForUncheckedKeys = <DATA_TYPE extends object>( | ||
input: Readonly<DATA_TYPE>, | ||
checkedKeys: ReadonlyArray<string>, | ||
options?: DefaultCheckResponseOptions, | ||
): ReadonlyArray<string> => { | ||
if (options?.doNotCheckForUncheckedKeys) { | ||
return checkedKeys | ||
} | ||
for (const [key, value] of Object.entries(input)) { | ||
if (!checkedKeys.includes(key) && value !== undefined) { | ||
expect.fail( | ||
`Found unchecked key '${key}': '${JSON.stringify( | ||
value, | ||
)}' (${JSON.stringify(input)})`, | ||
) | ||
} | ||
} | ||
return checkedKeys | ||
} |
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,9 @@ | ||
// Type imports | ||
import type { OsuApiV2Types } from "./parseTypes.mjs" | ||
|
||
export const generateTypescriptMochaTestString = ( | ||
type: Readonly<OsuApiV2Types>, | ||
typeFilePath: ReadonlyMap<string, string>, | ||
): string => { | ||
return "TODO" + type.name + (typeFilePath.get(type.name) ?? "NOT FOUND!") | ||
} |
Oops, something went wrong.