-
Notifications
You must be signed in to change notification settings - Fork 27
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
plugins return maps instead of arrays #12
Conversation
rename css interfaces tooPreview: docs |
src/plugins/typescript.ts
Outdated
} | ||
|
||
export interface ITypescriptPluginData { | ||
ts: IInterfaceEntry[]; | ||
export interface ITsPluginData { |
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.
I think all these sub interfaces are fine with the shortened "Ts" name, but this one in particular should match the name of the plugin so ITypescriptPluginData
@@ -1,4 +1,4 @@ | |||
- ts.sort((a, b) => a.name.localeCompare(b.name)) | |||
- var toc = Object.keys(ts).sort((a, b) => a.localeCompare(b)) |
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.
heh, unobjectified then
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.
i don't understand your words?
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.
just that you changed this array to an object in this PR and now you're converting back to an array.
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.
well sure we need a sorted array for the table of contents. often both forms are needed at different times, so i guess it's a tradeoff either way.
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.
yeah im fine with these changes, just found it amusing
@@ -172,6 +178,13 @@ export class Documentalist<T> implements IApi<T> { | |||
return documentation; | |||
} | |||
|
|||
public objectify<T>(array: T[], getKey: (item: T) => 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.
This doesn't really belong on the API, this is a stateless utility method.
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.
that is true but we don't have a place for such things
ITypescriptPluginDataPreview: docs |
Fine, but we need to move that objectify method eventually |
documentalist.objectify
function to convert array to map