twitter/typeahead.js — pull request #256 by thomasboyt (2013-05-22 19:16:10+00:00)
Title: Added transformSuggestions method to dataset

This adds a new, optional dataset method that transforms the matched suggestion list before it's rendered. The main use case for this is custom sorting (like [this method](https://github.com/thomasboyt/comics-notifier/blob/dbc1b35d7b30262c345bd6d2ab787691bf07701a/comics/static/js/main.js#L41) that sorts exact prefix matches ahead of matches on individual tokens, so that searching "Spider" will sort `["Spider-Man"]` above `["Amazing", "Spider-Man"]`).