jshackles/Enhanced_Steam — pull request #343 by EhsanKia (2013-12-26 12:08:02+00:00)
Title: Fixed pack price breakdown and made it futureproof

The current implementation breaks on [Trackmania^2 Stadium](http://store.steampowered.com/app/232910/)'s 3 Pack, because of the upper case P.

The current implementation checks very specific cases, and will need fixing every time new variations appear (like now). This version makes it more robust by checking 8 different variations for each pack size, using only 2 tests for each size.

I've also slightly optimized by not creating a jQuery object and running .find() on every single test. The else statements are a bit of an over optimization but the programmer in me couldn't not put them.

Lastly, I also added a small contains prototype on String to make the code cleaner.

I've tested it on a few packs, and as far as I could tell, it works as expected.