-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert common/lib files to Typescript and Jest #37640
Conversation
Pinging @elastic/kibana-canvas |
💚 Build Succeeded |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work.
* @field Name of the column that we are looking for the type of | ||
* @returns The column type or the string 'null' | ||
*/ | ||
export function getFieldType(columns: DatatableColumn[], field?: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add return type. It's only inferred at the moment to be string
.
>( | ||
rows: RowType[], | ||
columns?: string[] | ||
): { [s in ReturnColumns]: s extends keyof RowType ? Array<RowType[s]> : undefined[] } { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: make s
a whole word variable: why not column
? And do we expect an array of undefined
s? I think you want never
.
💚 Build Succeeded |
💚 Build Succeeded |
* Remove unused lib and associated tests * Convert unquote string to TS and Jest * Convert getFieldType to TS and Jest * Convert httpurl to TS and Jest * Remove latest_change and tests * Convert pivot_object_array to TS and Jest * Address PR feedback
* Convert common/lib files to Typescript and Jest (#37640) * Remove unused lib and associated tests * Convert unquote string to TS and Jest * Convert getFieldType to TS and Jest * Convert httpurl to TS and Jest * Remove latest_change and tests * Convert pivot_object_array to TS and Jest * Address PR feedback * Fix type
Summary
This is the first of probably many PRs to convert from Mocha to Jest tests. Since these were mainly small utilities, I went ahead and converted the files to Typescript as well.
A few of the files here (latest_change, find_in_object) were not being used, so they are being deleted.
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.For maintainers