Skip to content

plugins return maps instead of arrays#12

Merged
giladgray merged 4 commits intomasterfrom
gg/objects
Mar 8, 2017
Merged

plugins return maps instead of arrays#12
giladgray merged 4 commits intomasterfrom
gg/objects

Conversation

@giladgray
Copy link
Contributor

  • add documentalist.objectify function to convert array to map
  • update theme and plugins
  • namespace plugin interfaces so the nav is more legible

@blueprint-bot
Copy link

rename css interfaces too

Preview: docs


export interface ITypescriptPluginData {
ts: IInterfaceEntry[];
export interface ITsPluginData {
Copy link
Contributor

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))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

heh, unobjectified then

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Contributor Author

@giladgray giladgray Mar 8, 2017

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.

Copy link
Contributor

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

return documentation;
}

public objectify<T>(array: T[], getKey: (item: T) => string) {
Copy link
Contributor

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.

Copy link
Contributor Author

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

@blueprint-bot
Copy link

ITypescriptPluginData

Preview: docs

@themadcreator
Copy link
Contributor

Fine, but we need to move that objectify method eventually

@giladgray giladgray merged commit 2c4bcdc into master Mar 8, 2017
@giladgray giladgray deleted the gg/objects branch March 8, 2017 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants