cssesc-source 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (908) hide show
  1. checksums.yaml +15 -0
  2. data/lib/cssesc/source.rb +7 -0
  3. data/vendor/LICENSE-MIT.txt +20 -0
  4. data/vendor/README.md +207 -0
  5. data/vendor/bin/cssesc +122 -0
  6. data/vendor/cssesc.js +177 -0
  7. data/vendor/man/cssesc.1 +70 -0
  8. data/vendor/node_modules/grunt-shell/node_modules/stripcolorcodes/MIT-LICENSE.txt +21 -0
  9. data/vendor/node_modules/grunt-shell/node_modules/stripcolorcodes/README.md +43 -0
  10. data/vendor/node_modules/grunt-shell/node_modules/stripcolorcodes/bin/stripcolorcodes.js +18 -0
  11. data/vendor/node_modules/grunt-shell/node_modules/stripcolorcodes/index.js +3 -0
  12. data/vendor/node_modules/grunt-shell/node_modules/stripcolorcodes/package.json +42 -0
  13. data/vendor/node_modules/grunt-shell/node_modules/stripcolorcodes/test/fixture/with-colors +2 -0
  14. data/vendor/node_modules/grunt-shell/node_modules/stripcolorcodes/test/fixture/without-colors +2 -0
  15. data/vendor/node_modules/grunt-shell/node_modules/stripcolorcodes/test/stripcolorcodes-test.js +20 -0
  16. data/vendor/node_modules/grunt-shell/package.json +53 -0
  17. data/vendor/node_modules/grunt-shell/readme.md +221 -0
  18. data/vendor/node_modules/grunt-shell/tasks/shell.js +54 -0
  19. data/vendor/node_modules/grunt-template/LICENSE-MIT.txt +20 -0
  20. data/vendor/node_modules/grunt-template/README.md +123 -0
  21. data/vendor/node_modules/grunt-template/package.json +50 -0
  22. data/vendor/node_modules/grunt-template/tasks/template.js +44 -0
  23. data/vendor/node_modules/grunt/CONTRIBUTING.md +1 -0
  24. data/vendor/node_modules/grunt/LICENSE-MIT +22 -0
  25. data/vendor/node_modules/grunt/README.md +16 -0
  26. data/vendor/node_modules/grunt/internal-tasks/bump.js +151 -0
  27. data/vendor/node_modules/grunt/internal-tasks/subgrunt.js +34 -0
  28. data/vendor/node_modules/grunt/lib/grunt.js +156 -0
  29. data/vendor/node_modules/grunt/lib/grunt/cli.js +128 -0
  30. data/vendor/node_modules/grunt/lib/grunt/config.js +118 -0
  31. data/vendor/node_modules/grunt/lib/grunt/event.js +16 -0
  32. data/vendor/node_modules/grunt/lib/grunt/fail.js +84 -0
  33. data/vendor/node_modules/grunt/lib/grunt/file.js +440 -0
  34. data/vendor/node_modules/grunt/lib/grunt/help.js +129 -0
  35. data/vendor/node_modules/grunt/lib/grunt/log.js +352 -0
  36. data/vendor/node_modules/grunt/lib/grunt/option.js +42 -0
  37. data/vendor/node_modules/grunt/lib/grunt/task.js +451 -0
  38. data/vendor/node_modules/grunt/lib/grunt/template.js +95 -0
  39. data/vendor/node_modules/grunt/lib/grunt/util.js +188 -0
  40. data/vendor/node_modules/grunt/lib/util/task.js +323 -0
  41. data/vendor/node_modules/grunt/node_modules/async/LICENSE +19 -0
  42. data/vendor/node_modules/grunt/node_modules/async/Makefile +25 -0
  43. data/vendor/node_modules/grunt/node_modules/async/README.md +1021 -0
  44. data/vendor/node_modules/grunt/node_modules/async/index.js +3 -0
  45. data/vendor/node_modules/grunt/node_modules/async/lib/async.js +692 -0
  46. data/vendor/node_modules/grunt/node_modules/async/package.json +32 -0
  47. data/vendor/node_modules/grunt/node_modules/coffee-script/CNAME +1 -0
  48. data/vendor/node_modules/grunt/node_modules/coffee-script/LICENSE +22 -0
  49. data/vendor/node_modules/grunt/node_modules/coffee-script/README +51 -0
  50. data/vendor/node_modules/grunt/node_modules/coffee-script/Rakefile +78 -0
  51. data/vendor/node_modules/grunt/node_modules/coffee-script/bin/cake +7 -0
  52. data/vendor/node_modules/grunt/node_modules/coffee-script/bin/coffee +7 -0
  53. data/vendor/node_modules/grunt/node_modules/coffee-script/extras/jsl.conf +44 -0
  54. data/vendor/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/browser.js +92 -0
  55. data/vendor/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/cake.js +111 -0
  56. data/vendor/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/coffee-script.js +167 -0
  57. data/vendor/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/command.js +500 -0
  58. data/vendor/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/grammar.js +606 -0
  59. data/vendor/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/helpers.js +77 -0
  60. data/vendor/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/index.js +11 -0
  61. data/vendor/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/lexer.js +788 -0
  62. data/vendor/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/nodes.js +2986 -0
  63. data/vendor/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/optparse.js +138 -0
  64. data/vendor/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/parser.js +683 -0
  65. data/vendor/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/repl.js +261 -0
  66. data/vendor/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/rewriter.js +349 -0
  67. data/vendor/node_modules/grunt/node_modules/coffee-script/lib/coffee-script/scope.js +146 -0
  68. data/vendor/node_modules/grunt/node_modules/coffee-script/package.json +47 -0
  69. data/vendor/node_modules/grunt/node_modules/colors/MIT-LICENSE.txt +22 -0
  70. data/vendor/node_modules/grunt/node_modules/colors/ReadMe.md +77 -0
  71. data/vendor/node_modules/grunt/node_modules/colors/colors.js +342 -0
  72. data/vendor/node_modules/grunt/node_modules/colors/example.html +76 -0
  73. data/vendor/node_modules/grunt/node_modules/colors/example.js +77 -0
  74. data/vendor/node_modules/grunt/node_modules/colors/package.json +29 -0
  75. data/vendor/node_modules/grunt/node_modules/colors/test.js +70 -0
  76. data/vendor/node_modules/grunt/node_modules/colors/themes/winston-dark.js +12 -0
  77. data/vendor/node_modules/grunt/node_modules/colors/themes/winston-light.js +12 -0
  78. data/vendor/node_modules/grunt/node_modules/dateformat/Readme.md +67 -0
  79. data/vendor/node_modules/grunt/node_modules/dateformat/lib/dateformat.js +165 -0
  80. data/vendor/node_modules/grunt/node_modules/dateformat/package.json +20 -0
  81. data/vendor/node_modules/grunt/node_modules/dateformat/test/test_weekofyear.js +4 -0
  82. data/vendor/node_modules/grunt/node_modules/dateformat/test/test_weekofyear.sh +27 -0
  83. data/vendor/node_modules/grunt/node_modules/eventemitter2/README.md +212 -0
  84. data/vendor/node_modules/grunt/node_modules/eventemitter2/index.js +1 -0
  85. data/vendor/node_modules/grunt/node_modules/eventemitter2/lib/eventemitter2.js +561 -0
  86. data/vendor/node_modules/grunt/node_modules/eventemitter2/package.json +62 -0
  87. data/vendor/node_modules/grunt/node_modules/exit/Gruntfile.js +48 -0
  88. data/vendor/node_modules/grunt/node_modules/exit/LICENSE-MIT +22 -0
  89. data/vendor/node_modules/grunt/node_modules/exit/README.md +75 -0
  90. data/vendor/node_modules/grunt/node_modules/exit/lib/exit.js +41 -0
  91. data/vendor/node_modules/grunt/node_modules/exit/package.json +51 -0
  92. data/vendor/node_modules/grunt/node_modules/exit/test/exit_test.js +121 -0
  93. data/vendor/node_modules/grunt/node_modules/exit/test/fixtures/10-stderr.txt +10 -0
  94. data/vendor/node_modules/grunt/node_modules/exit/test/fixtures/10-stdout-stderr.txt +20 -0
  95. data/vendor/node_modules/grunt/node_modules/exit/test/fixtures/10-stdout.txt +10 -0
  96. data/vendor/node_modules/grunt/node_modules/exit/test/fixtures/100-stderr.txt +100 -0
  97. data/vendor/node_modules/grunt/node_modules/exit/test/fixtures/100-stdout-stderr.txt +200 -0
  98. data/vendor/node_modules/grunt/node_modules/exit/test/fixtures/100-stdout.txt +100 -0
  99. data/vendor/node_modules/grunt/node_modules/exit/test/fixtures/1000-stderr.txt +1000 -0
  100. data/vendor/node_modules/grunt/node_modules/exit/test/fixtures/1000-stdout-stderr.txt +2000 -0
  101. data/vendor/node_modules/grunt/node_modules/exit/test/fixtures/1000-stdout.txt +1000 -0
  102. data/vendor/node_modules/grunt/node_modules/exit/test/fixtures/create-files.sh +8 -0
  103. data/vendor/node_modules/grunt/node_modules/exit/test/fixtures/log-broken.js +23 -0
  104. data/vendor/node_modules/grunt/node_modules/exit/test/fixtures/log.js +25 -0
  105. data/vendor/node_modules/grunt/node_modules/findup-sync/Gruntfile.js +25 -0
  106. data/vendor/node_modules/grunt/node_modules/findup-sync/LICENSE-MIT +22 -0
  107. data/vendor/node_modules/grunt/node_modules/findup-sync/README.md +44 -0
  108. data/vendor/node_modules/grunt/node_modules/findup-sync/lib/findup-sync.js +46 -0
  109. data/vendor/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/README.md +164 -0
  110. data/vendor/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/dist/lodash.compat.js +5152 -0
  111. data/vendor/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/dist/lodash.compat.min.js +42 -0
  112. data/vendor/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/dist/lodash.js +4983 -0
  113. data/vendor/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/dist/lodash.min.js +40 -0
  114. data/vendor/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/dist/lodash.underscore.js +4307 -0
  115. data/vendor/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/dist/lodash.underscore.min.js +34 -0
  116. data/vendor/node_modules/grunt/node_modules/findup-sync/node_modules/lodash/package.json +62 -0
  117. data/vendor/node_modules/grunt/node_modules/findup-sync/package.json +48 -0
  118. data/vendor/node_modules/grunt/node_modules/findup-sync/test/findup-sync_test.js +48 -0
  119. data/vendor/node_modules/grunt/node_modules/findup-sync/test/fixtures/a.txt +0 -0
  120. data/vendor/node_modules/grunt/node_modules/findup-sync/test/fixtures/a/b/bar.txt +0 -0
  121. data/vendor/node_modules/grunt/node_modules/findup-sync/test/fixtures/a/foo.txt +0 -0
  122. data/vendor/node_modules/grunt/node_modules/findup-sync/test/fixtures/aaa.txt +0 -0
  123. data/vendor/node_modules/grunt/node_modules/getobject/Gruntfile.js +48 -0
  124. data/vendor/node_modules/grunt/node_modules/getobject/LICENSE-MIT +22 -0
  125. data/vendor/node_modules/grunt/node_modules/getobject/README.md +20 -0
  126. data/vendor/node_modules/grunt/node_modules/getobject/lib/getobject.js +60 -0
  127. data/vendor/node_modules/grunt/node_modules/getobject/package.json +48 -0
  128. data/vendor/node_modules/grunt/node_modules/getobject/test/namespace_test.js +51 -0
  129. data/vendor/node_modules/grunt/node_modules/glob/LICENSE +27 -0
  130. data/vendor/node_modules/grunt/node_modules/glob/README.md +233 -0
  131. data/vendor/node_modules/grunt/node_modules/glob/examples/g.js +9 -0
  132. data/vendor/node_modules/grunt/node_modules/glob/examples/usr-local.js +9 -0
  133. data/vendor/node_modules/grunt/node_modules/glob/glob.js +643 -0
  134. data/vendor/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/LICENSE +27 -0
  135. data/vendor/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/README.md +33 -0
  136. data/vendor/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/graceful-fs.js +442 -0
  137. data/vendor/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/package.json +49 -0
  138. data/vendor/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/test/open.js +46 -0
  139. data/vendor/node_modules/grunt/node_modules/glob/node_modules/graceful-fs/test/ulimit.js +158 -0
  140. data/vendor/node_modules/grunt/node_modules/glob/node_modules/inherits/README.md +51 -0
  141. data/vendor/node_modules/grunt/node_modules/glob/node_modules/inherits/inherits.js +29 -0
  142. data/vendor/node_modules/grunt/node_modules/glob/node_modules/inherits/package.json +30 -0
  143. data/vendor/node_modules/grunt/node_modules/glob/package.json +40 -0
  144. data/vendor/node_modules/grunt/node_modules/glob/test/00-setup.js +176 -0
  145. data/vendor/node_modules/grunt/node_modules/glob/test/bash-comparison.js +63 -0
  146. data/vendor/node_modules/grunt/node_modules/glob/test/bash-results.json +348 -0
  147. data/vendor/node_modules/grunt/node_modules/glob/test/cwd-test.js +55 -0
  148. data/vendor/node_modules/grunt/node_modules/glob/test/mark.js +74 -0
  149. data/vendor/node_modules/grunt/node_modules/glob/test/nocase-nomagic.js +113 -0
  150. data/vendor/node_modules/grunt/node_modules/glob/test/pause-resume.js +73 -0
  151. data/vendor/node_modules/grunt/node_modules/glob/test/root-nomount.js +39 -0
  152. data/vendor/node_modules/grunt/node_modules/glob/test/root.js +46 -0
  153. data/vendor/node_modules/grunt/node_modules/glob/test/zz-cleanup.js +11 -0
  154. data/vendor/node_modules/grunt/node_modules/hooker/LICENSE-MIT +22 -0
  155. data/vendor/node_modules/grunt/node_modules/hooker/README.md +186 -0
  156. data/vendor/node_modules/grunt/node_modules/hooker/child.js +101 -0
  157. data/vendor/node_modules/grunt/node_modules/hooker/dist/ba-hooker.js +169 -0
  158. data/vendor/node_modules/grunt/node_modules/hooker/dist/ba-hooker.min.js +4 -0
  159. data/vendor/node_modules/grunt/node_modules/hooker/grunt.js +47 -0
  160. data/vendor/node_modules/grunt/node_modules/hooker/lib/hooker.js +174 -0
  161. data/vendor/node_modules/grunt/node_modules/hooker/package.json +45 -0
  162. data/vendor/node_modules/grunt/node_modules/hooker/parent.js +17 -0
  163. data/vendor/node_modules/grunt/node_modules/hooker/test/hooker_test.js +435 -0
  164. data/vendor/node_modules/grunt/node_modules/iconv-lite/LICENSE +21 -0
  165. data/vendor/node_modules/grunt/node_modules/iconv-lite/README.md +72 -0
  166. data/vendor/node_modules/grunt/node_modules/iconv-lite/README.md~ +54 -0
  167. data/vendor/node_modules/grunt/node_modules/iconv-lite/encodings/big5.js +9 -0
  168. data/vendor/node_modules/grunt/node_modules/iconv-lite/encodings/gbk.js +9 -0
  169. data/vendor/node_modules/grunt/node_modules/iconv-lite/encodings/singlebyte.js +340 -0
  170. data/vendor/node_modules/grunt/node_modules/iconv-lite/encodings/table/big5.js +1 -0
  171. data/vendor/node_modules/grunt/node_modules/iconv-lite/encodings/table/gbk.js +1 -0
  172. data/vendor/node_modules/grunt/node_modules/iconv-lite/generation/generate-big5-table.js +25 -0
  173. data/vendor/node_modules/grunt/node_modules/iconv-lite/generation/generate-singlebyte.js +142 -0
  174. data/vendor/node_modules/grunt/node_modules/iconv-lite/index.js +231 -0
  175. data/vendor/node_modules/grunt/node_modules/iconv-lite/package.json +80 -0
  176. data/vendor/node_modules/grunt/node_modules/iconv-lite/test/big5-test.js +36 -0
  177. data/vendor/node_modules/grunt/node_modules/iconv-lite/test/big5File.txt +13 -0
  178. data/vendor/node_modules/grunt/node_modules/iconv-lite/test/cyrillic-test.js +86 -0
  179. data/vendor/node_modules/grunt/node_modules/iconv-lite/test/gbk-test.js +38 -0
  180. data/vendor/node_modules/grunt/node_modules/iconv-lite/test/gbkFile.txt +14 -0
  181. data/vendor/node_modules/grunt/node_modules/iconv-lite/test/greek-test.js +79 -0
  182. data/vendor/node_modules/grunt/node_modules/iconv-lite/test/main-test.js +55 -0
  183. data/vendor/node_modules/grunt/node_modules/iconv-lite/test/performance.js +67 -0
  184. data/vendor/node_modules/grunt/node_modules/iconv-lite/test/turkish-test.js +90 -0
  185. data/vendor/node_modules/grunt/node_modules/js-yaml/HISTORY.md +155 -0
  186. data/vendor/node_modules/grunt/node_modules/js-yaml/LICENSE +21 -0
  187. data/vendor/node_modules/grunt/node_modules/js-yaml/README.md +249 -0
  188. data/vendor/node_modules/grunt/node_modules/js-yaml/bin/js-yaml.js +125 -0
  189. data/vendor/node_modules/grunt/node_modules/js-yaml/examples/custom_types.js +104 -0
  190. data/vendor/node_modules/grunt/node_modules/js-yaml/examples/custom_types.yaml +18 -0
  191. data/vendor/node_modules/grunt/node_modules/js-yaml/examples/dumper.js +31 -0
  192. data/vendor/node_modules/grunt/node_modules/js-yaml/examples/dumper.json +22 -0
  193. data/vendor/node_modules/grunt/node_modules/js-yaml/examples/sample_document.js +15 -0
  194. data/vendor/node_modules/grunt/node_modules/js-yaml/examples/sample_document.yaml +197 -0
  195. data/vendor/node_modules/grunt/node_modules/js-yaml/index.js +1 -0
  196. data/vendor/node_modules/grunt/node_modules/js-yaml/lib/js-yaml.js +33 -0
  197. data/vendor/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/common.js +60 -0
  198. data/vendor/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/dumper.js +437 -0
  199. data/vendor/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/exception.js +25 -0
  200. data/vendor/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/loader.js +1549 -0
  201. data/vendor/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/mark.js +78 -0
  202. data/vendor/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/require.js +23 -0
  203. data/vendor/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/schema.js +103 -0
  204. data/vendor/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/schema/default.js +16 -0
  205. data/vendor/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/schema/minimal.js +13 -0
  206. data/vendor/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/schema/safe.js +25 -0
  207. data/vendor/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type.js +82 -0
  208. data/vendor/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/binary.js +118 -0
  209. data/vendor/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/bool.js +74 -0
  210. data/vendor/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/float.js +102 -0
  211. data/vendor/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/int.js +85 -0
  212. data/vendor/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/js/function.js +56 -0
  213. data/vendor/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js +56 -0
  214. data/vendor/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js +28 -0
  215. data/vendor/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/map.js +11 -0
  216. data/vendor/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/merge.js +18 -0
  217. data/vendor/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/null.js +36 -0
  218. data/vendor/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/omap.js +53 -0
  219. data/vendor/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/pairs.js +41 -0
  220. data/vendor/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/seq.js +11 -0
  221. data/vendor/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/set.js +31 -0
  222. data/vendor/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/str.js +11 -0
  223. data/vendor/node_modules/grunt/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +91 -0
  224. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/HISTORY.md +109 -0
  225. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/LICENSE +21 -0
  226. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/README.md +239 -0
  227. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/arguments.js +36 -0
  228. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/choice.js +22 -0
  229. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/constants.js +59 -0
  230. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/help.js +13 -0
  231. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/nargs.js +33 -0
  232. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/parents.js +28 -0
  233. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/prefix_chars.js +23 -0
  234. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/sub_commands.js +49 -0
  235. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/sum.js +35 -0
  236. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/examples/testformatters.js +270 -0
  237. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/index.js +1 -0
  238. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action.js +146 -0
  239. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/append.js +55 -0
  240. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/append/constant.js +47 -0
  241. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/count.js +40 -0
  242. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/help.js +48 -0
  243. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store.js +50 -0
  244. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store/constant.js +43 -0
  245. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store/false.js +27 -0
  246. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/store/true.js +26 -0
  247. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/subparsers.js +148 -0
  248. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action/version.js +50 -0
  249. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/action_container.js +481 -0
  250. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argparse.js +14 -0
  251. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argument/error.js +50 -0
  252. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argument/exclusive.js +54 -0
  253. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argument/group.js +75 -0
  254. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/argument_parser.js +1165 -0
  255. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/const.js +18 -0
  256. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/help/added_formatters.js +88 -0
  257. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/help/formatter.js +803 -0
  258. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/lib/namespace.js +77 -0
  259. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile +4 -0
  260. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Gemfile.lock +17 -0
  261. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/README.markdown +814 -0
  262. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/Rakefile +23 -0
  263. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/component.json +11 -0
  264. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/dist/underscore.string.min.js +1 -0
  265. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/lib/underscore.string.js +673 -0
  266. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/libpeerconnection.log +0 -0
  267. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/package.json +73 -0
  268. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/run-qunit.js +45 -0
  269. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/speed.js +148 -0
  270. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/strings.js +685 -0
  271. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/strings_standalone.js +12 -0
  272. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test.html +31 -0
  273. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_standalone.html +18 -0
  274. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/arrays.js +200 -0
  275. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/chaining.js +59 -0
  276. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/collections.js +426 -0
  277. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/functions.js +259 -0
  278. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/index.html +45 -0
  279. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/objects.js +548 -0
  280. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/speed.js +75 -0
  281. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/utility.js +249 -0
  282. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/vendor/jquery.js +9404 -0
  283. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/vendor/jslitmus.js +670 -0
  284. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/vendor/qunit.css +235 -0
  285. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/test_underscore/vendor/qunit.js +1977 -0
  286. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore.string/test/underscore.js +1201 -0
  287. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/CNAME +1 -0
  288. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/CONTRIBUTING.md +9 -0
  289. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/LICENSE +22 -0
  290. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/README.md +19 -0
  291. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/favicon.ico +0 -0
  292. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.html +2467 -0
  293. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/index.js +1 -0
  294. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/package.json +35 -0
  295. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore-min.js +1 -0
  296. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/node_modules/underscore/underscore.js +1226 -0
  297. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/argparse/package.json +50 -0
  298. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/README.md +73 -0
  299. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/bin/esparse.js +117 -0
  300. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/bin/esvalidate.js +177 -0
  301. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/esprima.js +3908 -0
  302. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/package.json +59 -0
  303. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/compat.js +239 -0
  304. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/reflect.js +422 -0
  305. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/run.js +66 -0
  306. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/runner.js +387 -0
  307. data/vendor/node_modules/grunt/node_modules/js-yaml/node_modules/esprima/test/test.js +20238 -0
  308. data/vendor/node_modules/grunt/node_modules/js-yaml/package.json +60 -0
  309. data/vendor/node_modules/grunt/node_modules/lodash/README.md +140 -0
  310. data/vendor/node_modules/grunt/node_modules/lodash/lodash.js +4258 -0
  311. data/vendor/node_modules/grunt/node_modules/lodash/lodash.min.js +35 -0
  312. data/vendor/node_modules/grunt/node_modules/lodash/lodash.underscore.js +3688 -0
  313. data/vendor/node_modules/grunt/node_modules/lodash/lodash.underscore.min.js +28 -0
  314. data/vendor/node_modules/grunt/node_modules/lodash/package.json +62 -0
  315. data/vendor/node_modules/grunt/node_modules/minimatch/LICENSE +23 -0
  316. data/vendor/node_modules/grunt/node_modules/minimatch/README.md +218 -0
  317. data/vendor/node_modules/grunt/node_modules/minimatch/minimatch.js +1055 -0
  318. data/vendor/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS +14 -0
  319. data/vendor/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/LICENSE +23 -0
  320. data/vendor/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/README.md +97 -0
  321. data/vendor/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js +252 -0
  322. data/vendor/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/package.json +33 -0
  323. data/vendor/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/test/basic.js +369 -0
  324. data/vendor/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/test/foreach.js +52 -0
  325. data/vendor/node_modules/grunt/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js +50 -0
  326. data/vendor/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/LICENSE +27 -0
  327. data/vendor/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/README.md +53 -0
  328. data/vendor/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/bench.js +283 -0
  329. data/vendor/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/package.json +42 -0
  330. data/vendor/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/sigmund.js +39 -0
  331. data/vendor/node_modules/grunt/node_modules/minimatch/node_modules/sigmund/test/basic.js +24 -0
  332. data/vendor/node_modules/grunt/node_modules/minimatch/package.json +40 -0
  333. data/vendor/node_modules/grunt/node_modules/minimatch/test/basic.js +399 -0
  334. data/vendor/node_modules/grunt/node_modules/minimatch/test/brace-expand.js +33 -0
  335. data/vendor/node_modules/grunt/node_modules/minimatch/test/caching.js +14 -0
  336. data/vendor/node_modules/grunt/node_modules/minimatch/test/defaults.js +274 -0
  337. data/vendor/node_modules/grunt/node_modules/minimatch/test/extglob-ending-with-state-char.js +8 -0
  338. data/vendor/node_modules/grunt/node_modules/nopt/LICENSE +23 -0
  339. data/vendor/node_modules/grunt/node_modules/nopt/README.md +208 -0
  340. data/vendor/node_modules/grunt/node_modules/nopt/bin/nopt.js +44 -0
  341. data/vendor/node_modules/grunt/node_modules/nopt/examples/my-program.js +30 -0
  342. data/vendor/node_modules/grunt/node_modules/nopt/lib/nopt.js +552 -0
  343. data/vendor/node_modules/grunt/node_modules/nopt/node_modules/abbrev/LICENSE +23 -0
  344. data/vendor/node_modules/grunt/node_modules/nopt/node_modules/abbrev/README.md +23 -0
  345. data/vendor/node_modules/grunt/node_modules/nopt/node_modules/abbrev/lib/abbrev.js +111 -0
  346. data/vendor/node_modules/grunt/node_modules/nopt/node_modules/abbrev/package.json +29 -0
  347. data/vendor/node_modules/grunt/node_modules/nopt/package.json +36 -0
  348. data/vendor/node_modules/grunt/node_modules/rimraf/AUTHORS +6 -0
  349. data/vendor/node_modules/grunt/node_modules/rimraf/LICENSE +23 -0
  350. data/vendor/node_modules/grunt/node_modules/rimraf/README.md +21 -0
  351. data/vendor/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/LICENSE +23 -0
  352. data/vendor/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/README.md +5 -0
  353. data/vendor/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js +312 -0
  354. data/vendor/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/package.json +40 -0
  355. data/vendor/node_modules/grunt/node_modules/rimraf/node_modules/graceful-fs/test/open.js +41 -0
  356. data/vendor/node_modules/grunt/node_modules/rimraf/package.json +59 -0
  357. data/vendor/node_modules/grunt/node_modules/rimraf/rimraf.js +161 -0
  358. data/vendor/node_modules/grunt/node_modules/rimraf/test/run.sh +10 -0
  359. data/vendor/node_modules/grunt/node_modules/rimraf/test/setup.sh +47 -0
  360. data/vendor/node_modules/grunt/node_modules/rimraf/test/test-async.js +5 -0
  361. data/vendor/node_modules/grunt/node_modules/rimraf/test/test-fiber.js +0 -0
  362. data/vendor/node_modules/grunt/node_modules/rimraf/test/test-sync.js +3 -0
  363. data/vendor/node_modules/grunt/node_modules/underscore.string/Gemfile +5 -0
  364. data/vendor/node_modules/grunt/node_modules/underscore.string/Gemfile.lock +34 -0
  365. data/vendor/node_modules/grunt/node_modules/underscore.string/README.markdown +668 -0
  366. data/vendor/node_modules/grunt/node_modules/underscore.string/Rakefile +28 -0
  367. data/vendor/node_modules/grunt/node_modules/underscore.string/dist/underscore.string.min.js +1 -0
  368. data/vendor/node_modules/grunt/node_modules/underscore.string/lib/underscore.string.js +525 -0
  369. data/vendor/node_modules/grunt/node_modules/underscore.string/package.json +72 -0
  370. data/vendor/node_modules/grunt/node_modules/underscore.string/test/run-qunit.js +44 -0
  371. data/vendor/node_modules/grunt/node_modules/underscore.string/test/speed.js +138 -0
  372. data/vendor/node_modules/grunt/node_modules/underscore.string/test/strings.js +438 -0
  373. data/vendor/node_modules/grunt/node_modules/underscore.string/test/strings_standalone.js +12 -0
  374. data/vendor/node_modules/grunt/node_modules/underscore.string/test/test.html +31 -0
  375. data/vendor/node_modules/grunt/node_modules/underscore.string/test/test_standalone.html +18 -0
  376. data/vendor/node_modules/grunt/node_modules/underscore.string/test/test_underscore/arrays.js +166 -0
  377. data/vendor/node_modules/grunt/node_modules/underscore.string/test/test_underscore/chaining.js +59 -0
  378. data/vendor/node_modules/grunt/node_modules/underscore.string/test/test_underscore/collections.js +270 -0
  379. data/vendor/node_modules/grunt/node_modules/underscore.string/test/test_underscore/functions.js +198 -0
  380. data/vendor/node_modules/grunt/node_modules/underscore.string/test/test_underscore/objects.js +535 -0
  381. data/vendor/node_modules/grunt/node_modules/underscore.string/test/test_underscore/speed.js +70 -0
  382. data/vendor/node_modules/grunt/node_modules/underscore.string/test/test_underscore/temp.js +27 -0
  383. data/vendor/node_modules/grunt/node_modules/underscore.string/test/test_underscore/temp_tests.html +19 -0
  384. data/vendor/node_modules/grunt/node_modules/underscore.string/test/test_underscore/test.html +43 -0
  385. data/vendor/node_modules/grunt/node_modules/underscore.string/test/test_underscore/utility.js +155 -0
  386. data/vendor/node_modules/grunt/node_modules/underscore.string/test/test_underscore/vendor/jquery.js +19 -0
  387. data/vendor/node_modules/grunt/node_modules/underscore.string/test/test_underscore/vendor/jslitmus.js +670 -0
  388. data/vendor/node_modules/grunt/node_modules/underscore.string/test/test_underscore/vendor/qunit.css +196 -0
  389. data/vendor/node_modules/grunt/node_modules/underscore.string/test/test_underscore/vendor/qunit.js +2360 -0
  390. data/vendor/node_modules/grunt/node_modules/underscore.string/test/underscore.js +999 -0
  391. data/vendor/node_modules/grunt/node_modules/which/LICENSE +23 -0
  392. data/vendor/node_modules/grunt/node_modules/which/README.md +5 -0
  393. data/vendor/node_modules/grunt/node_modules/which/bin/which +14 -0
  394. data/vendor/node_modules/grunt/node_modules/which/package.json +31 -0
  395. data/vendor/node_modules/grunt/node_modules/which/which.js +104 -0
  396. data/vendor/node_modules/grunt/package.json +82 -0
  397. data/vendor/node_modules/istanbul/CHANGELOG.md +57 -0
  398. data/vendor/node_modules/istanbul/LICENSE +24 -0
  399. data/vendor/node_modules/istanbul/README.md +205 -0
  400. data/vendor/node_modules/istanbul/index.js +115 -0
  401. data/vendor/node_modules/istanbul/lib/cli.js +74 -0
  402. data/vendor/node_modules/istanbul/lib/collector.js +121 -0
  403. data/vendor/node_modules/istanbul/lib/command/check-coverage.js +115 -0
  404. data/vendor/node_modules/istanbul/lib/command/common/run-with-cover.js +199 -0
  405. data/vendor/node_modules/istanbul/lib/command/cover.js +33 -0
  406. data/vendor/node_modules/istanbul/lib/command/help.js +58 -0
  407. data/vendor/node_modules/istanbul/lib/command/index.js +33 -0
  408. data/vendor/node_modules/istanbul/lib/command/instrument.js +244 -0
  409. data/vendor/node_modules/istanbul/lib/command/report.js +97 -0
  410. data/vendor/node_modules/istanbul/lib/command/test.js +31 -0
  411. data/vendor/node_modules/istanbul/lib/hook.js +187 -0
  412. data/vendor/node_modules/istanbul/lib/instrumenter.js +759 -0
  413. data/vendor/node_modules/istanbul/lib/object-utils.js +341 -0
  414. data/vendor/node_modules/istanbul/lib/register-plugins.js +15 -0
  415. data/vendor/node_modules/istanbul/lib/report/cobertura.js +207 -0
  416. data/vendor/node_modules/istanbul/lib/report/html.js +517 -0
  417. data/vendor/node_modules/istanbul/lib/report/index.js +60 -0
  418. data/vendor/node_modules/istanbul/lib/report/json.js +55 -0
  419. data/vendor/node_modules/istanbul/lib/report/lcov.js +49 -0
  420. data/vendor/node_modules/istanbul/lib/report/lcovonly.js +93 -0
  421. data/vendor/node_modules/istanbul/lib/report/none.js +20 -0
  422. data/vendor/node_modules/istanbul/lib/report/teamcity.js +82 -0
  423. data/vendor/node_modules/istanbul/lib/report/templates/foot.txt +102 -0
  424. data/vendor/node_modules/istanbul/lib/report/templates/head.txt +200 -0
  425. data/vendor/node_modules/istanbul/lib/report/text-summary.js +72 -0
  426. data/vendor/node_modules/istanbul/lib/report/text.js +210 -0
  427. data/vendor/node_modules/istanbul/lib/store/fslookup.js +60 -0
  428. data/vendor/node_modules/istanbul/lib/store/index.js +122 -0
  429. data/vendor/node_modules/istanbul/lib/store/memory.js +55 -0
  430. data/vendor/node_modules/istanbul/lib/store/tmp.js +80 -0
  431. data/vendor/node_modules/istanbul/lib/util/factory.js +88 -0
  432. data/vendor/node_modules/istanbul/lib/util/file-matcher.js +60 -0
  433. data/vendor/node_modules/istanbul/lib/util/file-writer.js +131 -0
  434. data/vendor/node_modules/istanbul/lib/util/flow-control.js +26 -0
  435. data/vendor/node_modules/istanbul/lib/util/help-formatter.js +24 -0
  436. data/vendor/node_modules/istanbul/lib/util/input-error.js +12 -0
  437. data/vendor/node_modules/istanbul/lib/util/insertion-text.js +109 -0
  438. data/vendor/node_modules/istanbul/lib/util/meta.js +13 -0
  439. data/vendor/node_modules/istanbul/lib/util/tree-summarizer.js +213 -0
  440. data/vendor/node_modules/istanbul/lib/util/writer.js +56 -0
  441. data/vendor/node_modules/istanbul/lib/util/yui-load-hook.js +49 -0
  442. data/vendor/node_modules/istanbul/lib/vendor/prettify.css +1 -0
  443. data/vendor/node_modules/istanbul/lib/vendor/prettify.js +1 -0
  444. data/vendor/node_modules/istanbul/node_modules/abbrev/LICENSE +23 -0
  445. data/vendor/node_modules/istanbul/node_modules/abbrev/README.md +23 -0
  446. data/vendor/node_modules/istanbul/node_modules/abbrev/lib/abbrev.js +111 -0
  447. data/vendor/node_modules/istanbul/node_modules/abbrev/package.json +29 -0
  448. data/vendor/node_modules/istanbul/node_modules/async/LICENSE +19 -0
  449. data/vendor/node_modules/istanbul/node_modules/async/README.md +1414 -0
  450. data/vendor/node_modules/istanbul/node_modules/async/component.json +11 -0
  451. data/vendor/node_modules/istanbul/node_modules/async/lib/async.js +955 -0
  452. data/vendor/node_modules/istanbul/node_modules/async/package.json +43 -0
  453. data/vendor/node_modules/istanbul/node_modules/escodegen/LICENSE.BSD +19 -0
  454. data/vendor/node_modules/istanbul/node_modules/escodegen/LICENSE.source-map +27 -0
  455. data/vendor/node_modules/istanbul/node_modules/escodegen/README.md +99 -0
  456. data/vendor/node_modules/istanbul/node_modules/escodegen/bin/escodegen.js +45 -0
  457. data/vendor/node_modules/istanbul/node_modules/escodegen/bin/esgenerate.js +45 -0
  458. data/vendor/node_modules/istanbul/node_modules/escodegen/component.json +48 -0
  459. data/vendor/node_modules/istanbul/node_modules/escodegen/escodegen.browser.js +3072 -0
  460. data/vendor/node_modules/istanbul/node_modules/escodegen/escodegen.js +2275 -0
  461. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/estraverse/LICENSE.BSD +19 -0
  462. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/estraverse/README.md +29 -0
  463. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/estraverse/estraverse.js +315 -0
  464. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/estraverse/package.json +41 -0
  465. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/CHANGELOG.md +112 -0
  466. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/LICENSE +28 -0
  467. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/Makefile.dryice.js +166 -0
  468. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/README.md +434 -0
  469. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/build/assert-shim.js +56 -0
  470. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/build/mini-require.js +152 -0
  471. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/build/prefix-source-map.jsm +20 -0
  472. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/build/prefix-utils.jsm +18 -0
  473. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/build/suffix-browser.js +8 -0
  474. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/build/suffix-source-map.jsm +6 -0
  475. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/build/suffix-utils.jsm +21 -0
  476. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/build/test-prefix.js +8 -0
  477. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/build/test-suffix.js +3 -0
  478. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map.js +8 -0
  479. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/array-set.js +97 -0
  480. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/base64-vlq.js +144 -0
  481. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/base64.js +42 -0
  482. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/binary-search.js +81 -0
  483. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/source-map-consumer.js +477 -0
  484. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/source-map-generator.js +380 -0
  485. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/source-node.js +371 -0
  486. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/lib/source-map/util.js +205 -0
  487. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/node_modules/amdefine/LICENSE +58 -0
  488. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/node_modules/amdefine/README.md +171 -0
  489. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/node_modules/amdefine/amdefine.js +299 -0
  490. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/node_modules/amdefine/intercept.js +36 -0
  491. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/node_modules/amdefine/package.json +36 -0
  492. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/package.json +110 -0
  493. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/run-tests.js +71 -0
  494. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-api.js +26 -0
  495. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-array-set.js +104 -0
  496. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-base64-vlq.js +24 -0
  497. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-base64.js +35 -0
  498. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-binary-search.js +54 -0
  499. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-dog-fooding.js +72 -0
  500. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-source-map-consumer.js +451 -0
  501. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-source-map-generator.js +417 -0
  502. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/test-source-node.js +365 -0
  503. data/vendor/node_modules/istanbul/node_modules/escodegen/node_modules/source-map/test/source-map/util.js +161 -0
  504. data/vendor/node_modules/istanbul/node_modules/escodegen/package.json +58 -0
  505. data/vendor/node_modules/istanbul/node_modules/esprima/README.md +73 -0
  506. data/vendor/node_modules/istanbul/node_modules/esprima/bin/esparse.js +117 -0
  507. data/vendor/node_modules/istanbul/node_modules/esprima/bin/esvalidate.js +177 -0
  508. data/vendor/node_modules/istanbul/node_modules/esprima/esprima.js +3908 -0
  509. data/vendor/node_modules/istanbul/node_modules/esprima/package.json +59 -0
  510. data/vendor/node_modules/istanbul/node_modules/esprima/test/compat.js +239 -0
  511. data/vendor/node_modules/istanbul/node_modules/esprima/test/reflect.js +422 -0
  512. data/vendor/node_modules/istanbul/node_modules/esprima/test/run.js +66 -0
  513. data/vendor/node_modules/istanbul/node_modules/esprima/test/runner.js +387 -0
  514. data/vendor/node_modules/istanbul/node_modules/esprima/test/test.js +20238 -0
  515. data/vendor/node_modules/istanbul/node_modules/fileset/LICENSE-MIT +22 -0
  516. data/vendor/node_modules/istanbul/node_modules/fileset/README.md +87 -0
  517. data/vendor/node_modules/istanbul/node_modules/fileset/lib/fileset.js +64 -0
  518. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/glob/LICENSE +27 -0
  519. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/glob/README.md +250 -0
  520. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/glob/examples/g.js +9 -0
  521. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/glob/examples/usr-local.js +9 -0
  522. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/glob/glob.js +680 -0
  523. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/inherits/LICENSE +16 -0
  524. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/inherits/README.md +42 -0
  525. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/inherits/inherits.js +1 -0
  526. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/inherits/inherits_browser.js +23 -0
  527. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/inherits/package.json +33 -0
  528. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/glob/node_modules/inherits/test.js +25 -0
  529. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/glob/package.json +39 -0
  530. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/glob/test/00-setup.js +176 -0
  531. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/glob/test/bash-comparison.js +63 -0
  532. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/glob/test/bash-results.json +350 -0
  533. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/glob/test/cwd-test.js +55 -0
  534. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/glob/test/globstar-match.js +19 -0
  535. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/glob/test/mark.js +74 -0
  536. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/glob/test/new-glob-optional-options.js +10 -0
  537. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/glob/test/nocase-nomagic.js +113 -0
  538. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/glob/test/pause-resume.js +73 -0
  539. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/glob/test/root-nomount.js +39 -0
  540. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/glob/test/root.js +46 -0
  541. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/glob/test/stat.js +32 -0
  542. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/glob/test/zz-cleanup.js +11 -0
  543. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/LICENSE +23 -0
  544. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/README.md +218 -0
  545. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/minimatch.js +1055 -0
  546. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS +14 -0
  547. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/lru-cache/LICENSE +23 -0
  548. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/lru-cache/README.md +97 -0
  549. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js +252 -0
  550. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/lru-cache/package.json +33 -0
  551. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/lru-cache/test/basic.js +369 -0
  552. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/lru-cache/test/foreach.js +52 -0
  553. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js +50 -0
  554. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/sigmund/LICENSE +27 -0
  555. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/sigmund/README.md +53 -0
  556. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/sigmund/bench.js +283 -0
  557. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/sigmund/package.json +42 -0
  558. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/sigmund/sigmund.js +39 -0
  559. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/node_modules/sigmund/test/basic.js +24 -0
  560. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/package.json +40 -0
  561. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/test/basic.js +399 -0
  562. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/test/brace-expand.js +33 -0
  563. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/test/caching.js +14 -0
  564. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/test/defaults.js +274 -0
  565. data/vendor/node_modules/istanbul/node_modules/fileset/node_modules/minimatch/test/extglob-ending-with-state-char.js +8 -0
  566. data/vendor/node_modules/istanbul/node_modules/fileset/package.json +34 -0
  567. data/vendor/node_modules/istanbul/node_modules/fileset/tests/fixtures/an (odd) filename.js +1 -0
  568. data/vendor/node_modules/istanbul/node_modules/fileset/tests/helper.js +61 -0
  569. data/vendor/node_modules/istanbul/node_modules/fileset/tests/test.js +133 -0
  570. data/vendor/node_modules/istanbul/node_modules/handlebars/LICENSE +19 -0
  571. data/vendor/node_modules/istanbul/node_modules/handlebars/README.markdown +391 -0
  572. data/vendor/node_modules/istanbul/node_modules/handlebars/bin/handlebars +213 -0
  573. data/vendor/node_modules/istanbul/node_modules/handlebars/bower.json +9 -0
  574. data/vendor/node_modules/istanbul/node_modules/handlebars/dist/handlebars.js +2278 -0
  575. data/vendor/node_modules/istanbul/node_modules/handlebars/dist/handlebars.min.js +2 -0
  576. data/vendor/node_modules/istanbul/node_modules/handlebars/dist/handlebars.runtime.js +362 -0
  577. data/vendor/node_modules/istanbul/node_modules/handlebars/dist/handlebars.runtime.min.js +1 -0
  578. data/vendor/node_modules/istanbul/node_modules/handlebars/global-test.js +18 -0
  579. data/vendor/node_modules/istanbul/node_modules/handlebars/global.js +4 -0
  580. data/vendor/node_modules/istanbul/node_modules/handlebars/handlebars-source.gemspec +21 -0
  581. data/vendor/node_modules/istanbul/node_modules/handlebars/handlebars.js.nuspec +17 -0
  582. data/vendor/node_modules/istanbul/node_modules/handlebars/lib/handlebars.js +43 -0
  583. data/vendor/node_modules/istanbul/node_modules/handlebars/lib/handlebars/base.js +166 -0
  584. data/vendor/node_modules/istanbul/node_modules/handlebars/lib/handlebars/browser-prefix.js +3 -0
  585. data/vendor/node_modules/istanbul/node_modules/handlebars/lib/handlebars/browser-suffix.js +1 -0
  586. data/vendor/node_modules/istanbul/node_modules/handlebars/lib/handlebars/compiler/ast.js +138 -0
  587. data/vendor/node_modules/istanbul/node_modules/handlebars/lib/handlebars/compiler/base.js +21 -0
  588. data/vendor/node_modules/istanbul/node_modules/handlebars/lib/handlebars/compiler/compiler.js +1305 -0
  589. data/vendor/node_modules/istanbul/node_modules/handlebars/lib/handlebars/compiler/index.js +16 -0
  590. data/vendor/node_modules/istanbul/node_modules/handlebars/lib/handlebars/compiler/parser.js +483 -0
  591. data/vendor/node_modules/istanbul/node_modules/handlebars/lib/handlebars/compiler/printer.js +138 -0
  592. data/vendor/node_modules/istanbul/node_modules/handlebars/lib/handlebars/compiler/visitor.js +18 -0
  593. data/vendor/node_modules/istanbul/node_modules/handlebars/lib/handlebars/runtime.js +106 -0
  594. data/vendor/node_modules/istanbul/node_modules/handlebars/lib/handlebars/source.rb +11 -0
  595. data/vendor/node_modules/istanbul/node_modules/handlebars/lib/handlebars/utils.js +83 -0
  596. data/vendor/node_modules/istanbul/node_modules/handlebars/min.sh +11 -0
  597. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/LICENSE +21 -0
  598. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/example/bool.js +10 -0
  599. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/example/boolean_double.js +7 -0
  600. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/example/boolean_single.js +7 -0
  601. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/example/default_hash.js +8 -0
  602. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/example/default_singles.js +7 -0
  603. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/example/divide.js +8 -0
  604. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/example/line_count.js +20 -0
  605. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/example/line_count_options.js +29 -0
  606. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/example/line_count_wrap.js +29 -0
  607. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/example/nonopt.js +4 -0
  608. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/example/reflect.js +2 -0
  609. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/example/short.js +3 -0
  610. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/example/string.js +11 -0
  611. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/example/usage-options.js +19 -0
  612. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/example/xup.js +10 -0
  613. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/index.js +478 -0
  614. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/package.json +46 -0
  615. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/readme.markdown +487 -0
  616. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/test/_.js +71 -0
  617. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/test/_/argv.js +2 -0
  618. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/test/_/bin.js +3 -0
  619. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/test/parse.js +446 -0
  620. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/optimist/test/usage.js +292 -0
  621. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/LICENSE +29 -0
  622. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/README.md +588 -0
  623. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/bin/uglifyjs +402 -0
  624. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/lib/ast.js +985 -0
  625. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/lib/compress.js +2028 -0
  626. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/lib/mozilla-ast.js +267 -0
  627. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/lib/output.js +1229 -0
  628. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/lib/parse.js +1410 -0
  629. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/lib/scope.js +581 -0
  630. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/lib/sourcemap.js +81 -0
  631. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/lib/transform.js +217 -0
  632. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/lib/utils.js +295 -0
  633. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/CHANGELOG.md +112 -0
  634. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/LICENSE +28 -0
  635. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/Makefile.dryice.js +166 -0
  636. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/README.md +434 -0
  637. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/build/assert-shim.js +56 -0
  638. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/build/mini-require.js +152 -0
  639. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/build/prefix-source-map.jsm +20 -0
  640. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/build/prefix-utils.jsm +18 -0
  641. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/build/suffix-browser.js +8 -0
  642. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/build/suffix-source-map.jsm +6 -0
  643. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/build/suffix-utils.jsm +21 -0
  644. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/build/test-prefix.js +8 -0
  645. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/build/test-suffix.js +3 -0
  646. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map.js +8 -0
  647. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/array-set.js +97 -0
  648. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64-vlq.js +144 -0
  649. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/base64.js +42 -0
  650. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/binary-search.js +81 -0
  651. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-consumer.js +477 -0
  652. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-map-generator.js +380 -0
  653. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/source-node.js +371 -0
  654. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/lib/source-map/util.js +205 -0
  655. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/LICENSE +58 -0
  656. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/README.md +171 -0
  657. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/amdefine.js +299 -0
  658. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/intercept.js +36 -0
  659. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/node_modules/amdefine/package.json +37 -0
  660. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/package.json +110 -0
  661. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/run-tests.js +71 -0
  662. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-api.js +26 -0
  663. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-array-set.js +104 -0
  664. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-base64-vlq.js +24 -0
  665. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-base64.js +35 -0
  666. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-binary-search.js +54 -0
  667. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-dog-fooding.js +72 -0
  668. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-consumer.js +451 -0
  669. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-map-generator.js +417 -0
  670. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/test-source-node.js +365 -0
  671. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/node_modules/source-map/test/source-map/util.js +161 -0
  672. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/package.json +39 -0
  673. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/test/compress/arrays.js +12 -0
  674. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/test/compress/blocks.js +49 -0
  675. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/test/compress/conditionals.js +143 -0
  676. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/test/compress/dead-code.js +89 -0
  677. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/test/compress/debugger.js +24 -0
  678. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/test/compress/drop-unused.js +97 -0
  679. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/test/compress/issue-105.js +25 -0
  680. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/test/compress/issue-12.js +11 -0
  681. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/test/compress/issue-143.js +48 -0
  682. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/test/compress/issue-22.js +17 -0
  683. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/test/compress/issue-44.js +31 -0
  684. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/test/compress/issue-59.js +30 -0
  685. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/test/compress/labels.js +163 -0
  686. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/test/compress/loops.js +123 -0
  687. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/test/compress/properties.js +54 -0
  688. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/test/compress/sequences.js +161 -0
  689. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/test/compress/switch.js +260 -0
  690. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/test/compress/typeof.js +25 -0
  691. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/test/run-tests.js +170 -0
  692. data/vendor/node_modules/istanbul/node_modules/handlebars/node_modules/uglify-js/tools/node.js +165 -0
  693. data/vendor/node_modules/istanbul/node_modules/handlebars/package.json +42 -0
  694. data/vendor/node_modules/istanbul/node_modules/handlebars/release-notes.md +93 -0
  695. data/vendor/node_modules/istanbul/node_modules/handlebars/test.js +20 -0
  696. data/vendor/node_modules/istanbul/node_modules/mkdirp/LICENSE +21 -0
  697. data/vendor/node_modules/istanbul/node_modules/mkdirp/examples/pow.js +6 -0
  698. data/vendor/node_modules/istanbul/node_modules/mkdirp/index.js +82 -0
  699. data/vendor/node_modules/istanbul/node_modules/mkdirp/package.json +34 -0
  700. data/vendor/node_modules/istanbul/node_modules/mkdirp/readme.markdown +63 -0
  701. data/vendor/node_modules/istanbul/node_modules/mkdirp/test/chmod.js +38 -0
  702. data/vendor/node_modules/istanbul/node_modules/mkdirp/test/clobber.js +37 -0
  703. data/vendor/node_modules/istanbul/node_modules/mkdirp/test/mkdirp.js +28 -0
  704. data/vendor/node_modules/istanbul/node_modules/mkdirp/test/perm.js +32 -0
  705. data/vendor/node_modules/istanbul/node_modules/mkdirp/test/perm_sync.js +39 -0
  706. data/vendor/node_modules/istanbul/node_modules/mkdirp/test/race.js +41 -0
  707. data/vendor/node_modules/istanbul/node_modules/mkdirp/test/rel.js +32 -0
  708. data/vendor/node_modules/istanbul/node_modules/mkdirp/test/return.js +25 -0
  709. data/vendor/node_modules/istanbul/node_modules/mkdirp/test/return_sync.js +24 -0
  710. data/vendor/node_modules/istanbul/node_modules/mkdirp/test/root.js +18 -0
  711. data/vendor/node_modules/istanbul/node_modules/mkdirp/test/sync.js +32 -0
  712. data/vendor/node_modules/istanbul/node_modules/mkdirp/test/umask.js +28 -0
  713. data/vendor/node_modules/istanbul/node_modules/mkdirp/test/umask_sync.js +32 -0
  714. data/vendor/node_modules/istanbul/node_modules/nopt/LICENSE +23 -0
  715. data/vendor/node_modules/istanbul/node_modules/nopt/README.md +210 -0
  716. data/vendor/node_modules/istanbul/node_modules/nopt/bin/nopt.js +51 -0
  717. data/vendor/node_modules/istanbul/node_modules/nopt/examples/my-program.js +30 -0
  718. data/vendor/node_modules/istanbul/node_modules/nopt/lib/nopt.js +612 -0
  719. data/vendor/node_modules/istanbul/node_modules/nopt/package.json +36 -0
  720. data/vendor/node_modules/istanbul/node_modules/resolve/LICENSE +18 -0
  721. data/vendor/node_modules/istanbul/node_modules/resolve/example/async.js +5 -0
  722. data/vendor/node_modules/istanbul/node_modules/resolve/example/sync.js +3 -0
  723. data/vendor/node_modules/istanbul/node_modules/resolve/index.js +5 -0
  724. data/vendor/node_modules/istanbul/node_modules/resolve/lib/async.js +125 -0
  725. data/vendor/node_modules/istanbul/node_modules/resolve/lib/caller.js +8 -0
  726. data/vendor/node_modules/istanbul/node_modules/resolve/lib/core.js +4 -0
  727. data/vendor/node_modules/istanbul/node_modules/resolve/lib/core.json +38 -0
  728. data/vendor/node_modules/istanbul/node_modules/resolve/lib/node-modules-paths.js +25 -0
  729. data/vendor/node_modules/istanbul/node_modules/resolve/lib/sync.js +80 -0
  730. data/vendor/node_modules/istanbul/node_modules/resolve/package.json +36 -0
  731. data/vendor/node_modules/istanbul/node_modules/resolve/readme.markdown +144 -0
  732. data/vendor/node_modules/istanbul/node_modules/resolve/test/core.js +12 -0
  733. data/vendor/node_modules/istanbul/node_modules/resolve/test/filter.js +18 -0
  734. data/vendor/node_modules/istanbul/node_modules/resolve/test/filter_sync.js +15 -0
  735. data/vendor/node_modules/istanbul/node_modules/resolve/test/mock.js +142 -0
  736. data/vendor/node_modules/istanbul/node_modules/resolve/test/mock_sync.js +68 -0
  737. data/vendor/node_modules/istanbul/node_modules/resolve/test/resolver.js +270 -0
  738. data/vendor/node_modules/istanbul/node_modules/resolve/test/resolver/bar/node_modules/foo/index.js +1 -0
  739. data/vendor/node_modules/istanbul/node_modules/resolve/test/resolver/baz/doom.js +0 -0
  740. data/vendor/node_modules/istanbul/node_modules/resolve/test/resolver/baz/package.json +3 -0
  741. data/vendor/node_modules/istanbul/node_modules/resolve/test/resolver/baz/quux.js +1 -0
  742. data/vendor/node_modules/istanbul/node_modules/resolve/test/resolver/biz/node_modules/garply/lib/index.js +1 -0
  743. data/vendor/node_modules/istanbul/node_modules/resolve/test/resolver/biz/node_modules/garply/package.json +3 -0
  744. data/vendor/node_modules/istanbul/node_modules/resolve/test/resolver/biz/node_modules/grux/index.js +1 -0
  745. data/vendor/node_modules/istanbul/node_modules/resolve/test/resolver/biz/node_modules/tiv/index.js +1 -0
  746. data/vendor/node_modules/istanbul/node_modules/resolve/test/resolver/cup.coffee +1 -0
  747. data/vendor/node_modules/istanbul/node_modules/resolve/test/resolver/foo.js +1 -0
  748. data/vendor/node_modules/istanbul/node_modules/resolve/test/resolver/incorrect_main/index.js +2 -0
  749. data/vendor/node_modules/istanbul/node_modules/resolve/test/resolver/incorrect_main/package.json +3 -0
  750. data/vendor/node_modules/istanbul/node_modules/resolve/test/resolver/mug.coffee +0 -0
  751. data/vendor/node_modules/istanbul/node_modules/resolve/test/resolver/mug.js +0 -0
  752. data/vendor/node_modules/istanbul/node_modules/resolve/test/resolver/other_path/lib/other-lib.js +0 -0
  753. data/vendor/node_modules/istanbul/node_modules/resolve/test/resolver/other_path/root.js +0 -0
  754. data/vendor/node_modules/istanbul/node_modules/resolve/test/resolver/quux/foo/index.js +1 -0
  755. data/vendor/node_modules/istanbul/node_modules/resolve/test/resolver/without_basedir/main.js +6 -0
  756. data/vendor/node_modules/istanbul/node_modules/resolve/test/resolver/without_basedir/node_modules/mymodule.js +1 -0
  757. data/vendor/node_modules/istanbul/node_modules/resolve/test/resolver_sync.js +170 -0
  758. data/vendor/node_modules/istanbul/node_modules/which/LICENSE +23 -0
  759. data/vendor/node_modules/istanbul/node_modules/which/README.md +5 -0
  760. data/vendor/node_modules/istanbul/node_modules/which/bin/which +14 -0
  761. data/vendor/node_modules/istanbul/node_modules/which/package.json +32 -0
  762. data/vendor/node_modules/istanbul/node_modules/which/which.js +104 -0
  763. data/vendor/node_modules/istanbul/node_modules/wordwrap/README.markdown +70 -0
  764. data/vendor/node_modules/istanbul/node_modules/wordwrap/example/center.js +10 -0
  765. data/vendor/node_modules/istanbul/node_modules/wordwrap/example/meat.js +3 -0
  766. data/vendor/node_modules/istanbul/node_modules/wordwrap/index.js +76 -0
  767. data/vendor/node_modules/istanbul/node_modules/wordwrap/package.json +45 -0
  768. data/vendor/node_modules/istanbul/node_modules/wordwrap/test/break.js +30 -0
  769. data/vendor/node_modules/istanbul/node_modules/wordwrap/test/idleness.txt +63 -0
  770. data/vendor/node_modules/istanbul/node_modules/wordwrap/test/wrap.js +31 -0
  771. data/vendor/node_modules/istanbul/package.json +117 -0
  772. data/vendor/node_modules/istanbul/test/browser/support/index.html +153 -0
  773. data/vendor/node_modules/istanbul/test/browser/support/phantom-test.client.js +49 -0
  774. data/vendor/node_modules/istanbul/test/browser/support/server.js +154 -0
  775. data/vendor/node_modules/istanbul/test/browser/test-browser-instrumentation.js +94 -0
  776. data/vendor/node_modules/istanbul/test/cli-helper.js +219 -0
  777. data/vendor/node_modules/istanbul/test/cli/package.json +8 -0
  778. data/vendor/node_modules/istanbul/test/cli/sample-project/amd/ipsum.js +11 -0
  779. data/vendor/node_modules/istanbul/test/cli/sample-project/amd/lorem.js +7 -0
  780. data/vendor/node_modules/istanbul/test/cli/sample-project/lib/bar.js +13 -0
  781. data/vendor/node_modules/istanbul/test/cli/sample-project/lib/foo.js +12 -0
  782. data/vendor/node_modules/istanbul/test/cli/sample-project/lib/util/bad.js +1 -0
  783. data/vendor/node_modules/istanbul/test/cli/sample-project/lib/util/generate-names.js +5 -0
  784. data/vendor/node_modules/istanbul/test/cli/sample-project/node_modules/dependency/index.js +9 -0
  785. data/vendor/node_modules/istanbul/test/cli/sample-project/node_modules/post-require/hook.js +11 -0
  786. data/vendor/node_modules/istanbul/test/cli/sample-project/node_modules/post-require/package.json +5 -0
  787. data/vendor/node_modules/istanbul/test/cli/sample-project/test/amd-run.js +16 -0
  788. data/vendor/node_modules/istanbul/test/cli/sample-project/test/global-leak.js +30 -0
  789. data/vendor/node_modules/istanbul/test/cli/sample-project/test/run.js +25 -0
  790. data/vendor/node_modules/istanbul/test/cli/sample-project/vendor/dummy_vendor_lib.js +9 -0
  791. data/vendor/node_modules/istanbul/test/cli/test-base-cli.js +39 -0
  792. data/vendor/node_modules/istanbul/test/cli/test-check-coverage-command.js +97 -0
  793. data/vendor/node_modules/istanbul/test/cli/test-cobertura-report.js +54 -0
  794. data/vendor/node_modules/istanbul/test/cli/test-cover-command.js +170 -0
  795. data/vendor/node_modules/istanbul/test/cli/test-html-report.js +125 -0
  796. data/vendor/node_modules/istanbul/test/cli/test-instrument-command.js +167 -0
  797. data/vendor/node_modules/istanbul/test/cli/test-json-report.js +60 -0
  798. data/vendor/node_modules/istanbul/test/cli/test-lcov-report.js +58 -0
  799. data/vendor/node_modules/istanbul/test/cli/test-lcovonly-report.js +61 -0
  800. data/vendor/node_modules/istanbul/test/cli/test-lots-of-files.js +87 -0
  801. data/vendor/node_modules/istanbul/test/cli/test-none-report.js +17 -0
  802. data/vendor/node_modules/istanbul/test/cli/test-report-command.js +65 -0
  803. data/vendor/node_modules/istanbul/test/cli/test-teamcity-report.js +54 -0
  804. data/vendor/node_modules/istanbul/test/cli/test-test-command.js +43 -0
  805. data/vendor/node_modules/istanbul/test/common.js +19 -0
  806. data/vendor/node_modules/istanbul/test/helper.js +122 -0
  807. data/vendor/node_modules/istanbul/test/instrumentation/test-do.js +53 -0
  808. data/vendor/node_modules/istanbul/test/instrumentation/test-expressions.js +70 -0
  809. data/vendor/node_modules/istanbul/test/instrumentation/test-for.js +206 -0
  810. data/vendor/node_modules/istanbul/test/instrumentation/test-forin.js +50 -0
  811. data/vendor/node_modules/istanbul/test/instrumentation/test-functions.js +102 -0
  812. data/vendor/node_modules/istanbul/test/instrumentation/test-if.js +393 -0
  813. data/vendor/node_modules/istanbul/test/instrumentation/test-misc.js +35 -0
  814. data/vendor/node_modules/istanbul/test/instrumentation/test-statement.js +182 -0
  815. data/vendor/node_modules/istanbul/test/instrumentation/test-strict.js +121 -0
  816. data/vendor/node_modules/istanbul/test/instrumentation/test-switch.js +155 -0
  817. data/vendor/node_modules/istanbul/test/instrumentation/test-while.js +104 -0
  818. data/vendor/node_modules/istanbul/test/loader.js +38 -0
  819. data/vendor/node_modules/istanbul/test/other/data-complete-copy/baz.js +3 -0
  820. data/vendor/node_modules/istanbul/test/other/data-complete-copy/fixture.xml +1 -0
  821. data/vendor/node_modules/istanbul/test/other/data-complete-copy/foo.js +4 -0
  822. data/vendor/node_modules/istanbul/test/other/data-complete-copy/myfile1 +0 -0
  823. data/vendor/node_modules/istanbul/test/other/data-complete-copy/myfile2 +1 -0
  824. data/vendor/node_modules/istanbul/test/other/data-complete-copy/subdir/x.css +3 -0
  825. data/vendor/node_modules/istanbul/test/other/data/baz.js +3 -0
  826. data/vendor/node_modules/istanbul/test/other/data/foo.js +4 -0
  827. data/vendor/node_modules/istanbul/test/other/data/matcher/general/general.js +2 -0
  828. data/vendor/node_modules/istanbul/test/other/data/matcher/general/node_modules/mod-file.js +2 -0
  829. data/vendor/node_modules/istanbul/test/other/data/matcher/lib/lib-top.js +2 -0
  830. data/vendor/node_modules/istanbul/test/other/data/matcher/node_modules/dep/mod-file.js +2 -0
  831. data/vendor/node_modules/istanbul/test/other/data/matcher/node_modules/mod-file.js +2 -0
  832. data/vendor/node_modules/istanbul/test/other/data/matcher/top.js +2 -0
  833. data/vendor/node_modules/istanbul/test/other/test-collector.js +85 -0
  834. data/vendor/node_modules/istanbul/test/other/test-command-xface.js +35 -0
  835. data/vendor/node_modules/istanbul/test/other/test-file-writer.js +71 -0
  836. data/vendor/node_modules/istanbul/test/other/test-help-formatter.js +31 -0
  837. data/vendor/node_modules/istanbul/test/other/test-hook.js +87 -0
  838. data/vendor/node_modules/istanbul/test/other/test-index-xface.js +17 -0
  839. data/vendor/node_modules/istanbul/test/other/test-input-error.js +10 -0
  840. data/vendor/node_modules/istanbul/test/other/test-insertion-text.js +102 -0
  841. data/vendor/node_modules/istanbul/test/other/test-matcher.js +93 -0
  842. data/vendor/node_modules/istanbul/test/other/test-object-utils.js +201 -0
  843. data/vendor/node_modules/istanbul/test/other/test-store.js +129 -0
  844. data/vendor/node_modules/istanbul/test/other/test-summarizer.js +172 -0
  845. data/vendor/node_modules/istanbul/test/run-again.js +19 -0
  846. data/vendor/node_modules/istanbul/test/run.js +108 -0
  847. data/vendor/node_modules/istanbul/yui-coverage-comparison.md +85 -0
  848. data/vendor/node_modules/qunit-clib/LICENSE.txt +20 -0
  849. data/vendor/node_modules/qunit-clib/README.md +2 -0
  850. data/vendor/node_modules/qunit-clib/package.json +36 -0
  851. data/vendor/node_modules/qunit-clib/qunit-clib.js +570 -0
  852. data/vendor/node_modules/qunitjs/AUTHORS.txt +55 -0
  853. data/vendor/node_modules/qunitjs/History.md +496 -0
  854. data/vendor/node_modules/qunitjs/README.md +62 -0
  855. data/vendor/node_modules/qunitjs/addons/canvas/README.md +17 -0
  856. data/vendor/node_modules/qunitjs/addons/canvas/canvas-test.js +76 -0
  857. data/vendor/node_modules/qunitjs/addons/canvas/canvas.html +15 -0
  858. data/vendor/node_modules/qunitjs/addons/canvas/qunit-canvas.js +6 -0
  859. data/vendor/node_modules/qunitjs/addons/close-enough/README.md +18 -0
  860. data/vendor/node_modules/qunitjs/addons/close-enough/close-enough-test.js +35 -0
  861. data/vendor/node_modules/qunitjs/addons/close-enough/close-enough.html +14 -0
  862. data/vendor/node_modules/qunitjs/addons/close-enough/qunit-close-enough.js +32 -0
  863. data/vendor/node_modules/qunitjs/addons/composite/README.md +26 -0
  864. data/vendor/node_modules/qunitjs/addons/composite/composite-demo-test.html +24 -0
  865. data/vendor/node_modules/qunitjs/addons/composite/index.html +34 -0
  866. data/vendor/node_modules/qunitjs/addons/composite/qunit-composite.css +13 -0
  867. data/vendor/node_modules/qunitjs/addons/composite/qunit-composite.js +112 -0
  868. data/vendor/node_modules/qunitjs/addons/junitlogger/README.md +18 -0
  869. data/vendor/node_modules/qunitjs/addons/junitlogger/index.html +44 -0
  870. data/vendor/node_modules/qunitjs/addons/junitlogger/junitlogger.js +306 -0
  871. data/vendor/node_modules/qunitjs/addons/phantomjs/README.md +16 -0
  872. data/vendor/node_modules/qunitjs/addons/phantomjs/runner.js +127 -0
  873. data/vendor/node_modules/qunitjs/addons/step/README.md +20 -0
  874. data/vendor/node_modules/qunitjs/addons/step/qunit-step.js +26 -0
  875. data/vendor/node_modules/qunitjs/addons/step/step-test.js +15 -0
  876. data/vendor/node_modules/qunitjs/addons/step/step.html +14 -0
  877. data/vendor/node_modules/qunitjs/addons/themes/README.md +6 -0
  878. data/vendor/node_modules/qunitjs/addons/themes/gabe.css +371 -0
  879. data/vendor/node_modules/qunitjs/addons/themes/gabe.html +15 -0
  880. data/vendor/node_modules/qunitjs/addons/themes/ninja.css +196 -0
  881. data/vendor/node_modules/qunitjs/addons/themes/ninja.html +15 -0
  882. data/vendor/node_modules/qunitjs/addons/themes/nv.css +217 -0
  883. data/vendor/node_modules/qunitjs/addons/themes/nv.html +15 -0
  884. data/vendor/node_modules/qunitjs/grunt.js +101 -0
  885. data/vendor/node_modules/qunitjs/package.json +49 -0
  886. data/vendor/node_modules/qunitjs/qunit/qunit.css +244 -0
  887. data/vendor/node_modules/qunitjs/qunit/qunit.js +2152 -0
  888. data/vendor/node_modules/qunitjs/test/async.html +26 -0
  889. data/vendor/node_modules/qunitjs/test/async.js +6 -0
  890. data/vendor/node_modules/qunitjs/test/deepEqual.js +1438 -0
  891. data/vendor/node_modules/qunitjs/test/headless.html +28 -0
  892. data/vendor/node_modules/qunitjs/test/index.html +16 -0
  893. data/vendor/node_modules/qunitjs/test/logs.html +14 -0
  894. data/vendor/node_modules/qunitjs/test/logs.js +184 -0
  895. data/vendor/node_modules/qunitjs/test/narwhal-test.js +22 -0
  896. data/vendor/node_modules/qunitjs/test/node-test.js +22 -0
  897. data/vendor/node_modules/qunitjs/test/swarminject.js +10 -0
  898. data/vendor/node_modules/qunitjs/test/test.js +804 -0
  899. data/vendor/node_modules/regenerate/LICENSE-MIT.txt +20 -0
  900. data/vendor/node_modules/regenerate/README.md +467 -0
  901. data/vendor/node_modules/regenerate/package.json +50 -0
  902. data/vendor/node_modules/regenerate/regenerate.js +617 -0
  903. data/vendor/node_modules/requirejs/README.md +9 -0
  904. data/vendor/node_modules/requirejs/bin/r.js +26059 -0
  905. data/vendor/node_modules/requirejs/package.json +39 -0
  906. data/vendor/node_modules/requirejs/require.js +2054 -0
  907. data/vendor/package.json +56 -0
  908. metadata +949 -0
@@ -0,0 +1,9 @@
1
+ ## How to contribute to Underscore.js
2
+
3
+ * Before you open a ticket or send a pull request, [search](https://github.com/documentcloud/underscore/issues) for previous discussions about the same feature or issue. Add to the earlier ticket if you find one.
4
+
5
+ * Before sending a pull request for a feature, be sure to have [tests](http://underscorejs.org/test/).
6
+
7
+ * Use the same coding style as the rest of the [codebase](https://github.com/documentcloud/underscore/blob/master/underscore.js).
8
+
9
+ * In your pull request, do not add documentation or re-build the minified `underscore-min.js` file. We'll do those things before cutting a new release.
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2009-2013 Jeremy Ashkenas, DocumentCloud
2
+
3
+ Permission is hereby granted, free of charge, to any person
4
+ obtaining a copy of this software and associated documentation
5
+ files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use,
7
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the
9
+ Software is furnished to do so, subject to the following
10
+ conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,19 @@
1
+ __
2
+ /\ \ __
3
+ __ __ ___ \_\ \ __ _ __ ____ ___ ___ _ __ __ /\_\ ____
4
+ /\ \/\ \ /' _ `\ /'_ \ /'__`\/\ __\/ ,__\ / ___\ / __`\/\ __\/'__`\ \/\ \ /',__\
5
+ \ \ \_\ \/\ \/\ \/\ \ \ \/\ __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\ __/ __ \ \ \/\__, `\
6
+ \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/
7
+ \/___/ \/_/\/_/\/__,_ /\/____/ \/_/ \/___/ \/____/\/___/ \/_/ \/____/\/_//\ \_\ \/___/
8
+ \ \____/
9
+ \/___/
10
+
11
+ Underscore.js is a utility-belt library for JavaScript that provides
12
+ support for the usual functional suspects (each, map, reduce, filter...)
13
+ without extending any core JavaScript objects.
14
+
15
+ For Docs, License, Tests, and pre-packed downloads, see:
16
+ http://underscorejs.org
17
+
18
+ Many thanks to our contributors:
19
+ https://github.com/documentcloud/underscore/contributors
@@ -0,0 +1,2467 @@
1
+ <!DOCTYPE HTML>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
5
+ <meta http-equiv="X-UA-Compatible" content="chrome=1" />
6
+ <meta name="viewport" content="width=device-width" />
7
+ <link rel="canonical" href="http://underscorejs.org" />
8
+ <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
9
+ <title>Underscore.js</title>
10
+ <style>
11
+ body {
12
+ font-size: 14px;
13
+ line-height: 22px;
14
+ background: #f4f4f4 url(docs/images/background.png);
15
+ color: #000;
16
+ font-family: Helvetica Neue, Helvetica, Arial;
17
+ }
18
+ .interface {
19
+ font-family: "Lucida Grande", "Lucida Sans Unicode", Helvetica, Arial, sans-serif !important;
20
+ }
21
+ div#sidebar {
22
+ background: #fff;
23
+ position: fixed;
24
+ top: 0; left: 0; bottom: 0;
25
+ width: 200px;
26
+ overflow-y: auto;
27
+ overflow-x: hidden;
28
+ -webkit-overflow-scrolling: touch;
29
+ padding: 15px 0 30px 30px;
30
+ border-right: 1px solid #bbb;
31
+ box-shadow: 0 0 20px #ccc; -webkit-box-shadow: 0 0 20px #ccc; -moz-box-shadow: 0 0 20px #ccc;
32
+ }
33
+ a.toc_title, a.toc_title:visited {
34
+ display: block;
35
+ color: black;
36
+ font-weight: bold;
37
+ margin-top: 15px;
38
+ }
39
+ a.toc_title:hover {
40
+ text-decoration: underline;
41
+ }
42
+ #sidebar .version {
43
+ font-size: 10px;
44
+ font-weight: normal;
45
+ }
46
+ ul.toc_section {
47
+ font-size: 11px;
48
+ line-height: 14px;
49
+ margin: 5px 0 0 0;
50
+ padding-left: 0px;
51
+ list-style-type: none;
52
+ font-family: Lucida Grande;
53
+ }
54
+ .toc_section li {
55
+ cursor: pointer;
56
+ margin: 0 0 3px 0;
57
+ }
58
+ .toc_section li a {
59
+ text-decoration: none;
60
+ color: black;
61
+ }
62
+ .toc_section li a:hover {
63
+ text-decoration: underline;
64
+ }
65
+ div.container {
66
+ width: 550px;
67
+ margin: 40px 0 50px 260px;
68
+ }
69
+ img#logo {
70
+ width: 396px;
71
+ height: 69px;
72
+ }
73
+ div.warning {
74
+ margin-top: 15px;
75
+ font: bold 11px Arial;
76
+ color: #770000;
77
+ }
78
+ p {
79
+ margin: 20px 0;
80
+ width: 550px;
81
+ }
82
+ a, a:visited {
83
+ color: #444;
84
+ }
85
+ a:active, a:hover {
86
+ color: #000;
87
+ }
88
+ h1, h2, h3, h4, h5, h6 {
89
+ padding-top: 20px;
90
+ }
91
+ h2 {
92
+ font-size: 20px;
93
+ }
94
+ b.header {
95
+ font-size: 16px;
96
+ line-height: 30px;
97
+ }
98
+ span.alias {
99
+ font-size: 14px;
100
+ font-style: italic;
101
+ margin-left: 20px;
102
+ }
103
+ table, tr, td {
104
+ margin: 0; padding: 0;
105
+ }
106
+ td {
107
+ padding: 2px 12px 2px 0;
108
+ }
109
+ table .rule {
110
+ height: 1px;
111
+ background: #ccc;
112
+ margin: 5px 0;
113
+ }
114
+ ul {
115
+ list-style-type: circle;
116
+ padding: 0 0 0 20px;
117
+ }
118
+ li {
119
+ width: 500px;
120
+ margin-bottom: 10px;
121
+ }
122
+ code, pre, tt {
123
+ font-family: Monaco, Consolas, "Lucida Console", monospace;
124
+ font-size: 12px;
125
+ line-height: 18px;
126
+ font-style: normal;
127
+ }
128
+ tt {
129
+ padding: 0px 3px;
130
+ background: #fff;
131
+ border: 1px solid #ddd;
132
+ zoom: 1;
133
+ }
134
+ code {
135
+ margin-left: 20px;
136
+ }
137
+ pre {
138
+ font-size: 12px;
139
+ padding: 2px 0 2px 15px;
140
+ border-left: 5px solid #bbb;
141
+ margin: 0px 0 30px;
142
+ }
143
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.5) and (max-width: 640px),
144
+ only screen and (-o-min-device-pixel-ratio: 3/2) and (max-width: 640px),
145
+ only screen and (min-device-pixel-ratio: 1.5) and (max-width: 640px) {
146
+ img {
147
+ max-width: 100%;
148
+ }
149
+ div#sidebar {
150
+ -webkit-overflow-scrolling: initial;
151
+ position: relative;
152
+ width: 90%;
153
+ height: 120px;
154
+ left: 0;
155
+ top: -7px;
156
+ padding: 10px 0 10px 30px;
157
+ border: 0;
158
+ }
159
+ img#logo {
160
+ width: auto;
161
+ height: auto;
162
+ }
163
+ div.container {
164
+ margin: 0;
165
+ width: 100%;
166
+ }
167
+ p, div.container ul {
168
+ max-width: 98%;
169
+ overflow-x: scroll;
170
+ }
171
+ pre {
172
+ overflow: scroll;
173
+ }
174
+ }
175
+ </style>
176
+ </head>
177
+ <body>
178
+
179
+ <div id="sidebar" class="interface">
180
+
181
+ <a class="toc_title" href="#">
182
+ Underscore.js <span class="version">(1.4.4)</span>
183
+ </a>
184
+ <ul class="toc_section">
185
+ <li>&raquo; <a href="http://github.com/documentcloud/underscore">GitHub Repository</a></li>
186
+ <li>&raquo; <a href="docs/underscore.html">Annotated Source</a></li>
187
+ </ul>
188
+
189
+ <a class="toc_title" href="#">
190
+ Introduction
191
+ </a>
192
+
193
+ <a class="toc_title" href="#collections">
194
+ Collections
195
+ </a>
196
+ <ul class="toc_section">
197
+ <li>- <a href="#each">each</a></li>
198
+ <li>- <a href="#map">map</a></li>
199
+ <li>- <a href="#reduce">reduce</a></li>
200
+ <li>- <a href="#reduceRight">reduceRight</a></li>
201
+ <li>- <a href="#find">find</a></li>
202
+ <li>- <a href="#filter">filter</a></li>
203
+ <li>- <a href="#where">where</a></li>
204
+ <li>- <a href="#findWhere">findWhere</a></li>
205
+ <li>- <a href="#reject">reject</a></li>
206
+ <li>- <a href="#every">every</a></li>
207
+ <li>- <a href="#some">some</a></li>
208
+ <li>- <a href="#contains">contains</a></li>
209
+ <li>- <a href="#invoke">invoke</a></li>
210
+ <li>- <a href="#pluck">pluck</a></li>
211
+ <li>- <a href="#max">max</a></li>
212
+ <li>- <a href="#min">min</a></li>
213
+ <li>- <a href="#sortBy">sortBy</a></li>
214
+ <li>- <a href="#groupBy">groupBy</a></li>
215
+ <li>- <a href="#countBy">countBy</a></li>
216
+ <li>- <a href="#shuffle">shuffle</a></li>
217
+ <li>- <a href="#toArray">toArray</a></li>
218
+ <li>- <a href="#size">size</a></li>
219
+ </ul>
220
+
221
+ <a class="toc_title" href="#arrays">
222
+ Arrays
223
+ </a>
224
+ <ul class="toc_section">
225
+ <li>- <a href="#first">first</a></li>
226
+ <li>- <a href="#initial">initial</a></li>
227
+ <li>- <a href="#last">last</a></li>
228
+ <li>- <a href="#rest">rest</a></li>
229
+ <li>- <a href="#compact">compact</a></li>
230
+ <li>- <a href="#flatten">flatten</a></li>
231
+ <li>- <a href="#without">without</a></li>
232
+ <li>- <a href="#union">union</a></li>
233
+ <li>- <a href="#intersection">intersection</a></li>
234
+ <li>- <a href="#difference">difference</a></li>
235
+ <li>- <a href="#uniq">uniq</a></li>
236
+ <li>- <a href="#zip">zip</a></li>
237
+ <li>- <a href="#object">object</a></li>
238
+ <li>- <a href="#indexOf">indexOf</a></li>
239
+ <li>- <a href="#lastIndexOf">lastIndexOf</a></li>
240
+ <li>- <a href="#sortedIndex">sortedIndex</a></li>
241
+ <li>- <a href="#range">range</a></li>
242
+ </ul>
243
+
244
+ <a class="toc_title" href="#functions">
245
+ Functions
246
+ </a>
247
+ <ul class="toc_section">
248
+ <li>- <a href="#bind">bind</a></li>
249
+ <li>- <a href="#bindAll">bindAll</a></li>
250
+ <li>- <a href="#partial">partial</a></li>
251
+ <li>- <a href="#memoize">memoize</a></li>
252
+ <li>- <a href="#delay">delay</a></li>
253
+ <li>- <a href="#defer">defer</a></li>
254
+ <li>- <a href="#throttle">throttle</a></li>
255
+ <li>- <a href="#debounce">debounce</a></li>
256
+ <li>- <a href="#once">once</a></li>
257
+ <li>- <a href="#after">after</a></li>
258
+ <li>- <a href="#wrap">wrap</a></li>
259
+ <li>- <a href="#compose">compose</a></li>
260
+ </ul>
261
+
262
+ <a class="toc_title" href="#objects">
263
+ Objects
264
+ </a>
265
+ <ul class="toc_section">
266
+ <li>- <a href="#keys">keys</a></li>
267
+ <li>- <a href="#values">values</a></li>
268
+ <li>- <a href="#pairs">pairs</a></li>
269
+ <li>- <a href="#invert">invert</a></li>
270
+ <li>- <a href="#object-functions">functions</a></li>
271
+ <li>- <a href="#extend">extend</a></li>
272
+ <li>- <a href="#pick">pick</a></li>
273
+ <li>- <a href="#omit">omit</a></li>
274
+ <li>- <a href="#defaults">defaults</a></li>
275
+ <li>- <a href="#clone">clone</a></li>
276
+ <li>- <a href="#tap">tap</a></li>
277
+ <li>- <a href="#has">has</a></li>
278
+ <li>- <a href="#isEqual">isEqual</a></li>
279
+ <li>- <a href="#isEmpty">isEmpty</a></li>
280
+ <li>- <a href="#isElement">isElement</a></li>
281
+ <li>- <a href="#isArray">isArray</a></li>
282
+ <li>- <a href="#isObject">isObject</a></li>
283
+ <li>- <a href="#isArguments">isArguments</a></li>
284
+ <li>- <a href="#isFunction">isFunction</a></li>
285
+ <li>- <a href="#isString">isString</a></li>
286
+ <li>- <a href="#isNumber">isNumber</a></li>
287
+ <li>- <a href="#isFinite">isFinite</a></li>
288
+ <li>- <a href="#isBoolean">isBoolean</a></li>
289
+ <li>- <a href="#isDate">isDate</a></li>
290
+ <li>- <a href="#isRegExp">isRegExp</a></li>
291
+ <li>- <a href="#isNaN">isNaN</a></li>
292
+ <li>- <a href="#isNull">isNull</a></li>
293
+ <li>- <a href="#isUndefined">isUndefined</a></li>
294
+ </ul>
295
+
296
+ <a class="toc_title" href="#utility">
297
+ Utility
298
+ </a>
299
+ <ul class="toc_section">
300
+ <li>- <a href="#noConflict">noConflict</a></li>
301
+ <li>- <a href="#identity">identity</a></li>
302
+ <li>- <a href="#times">times</a></li>
303
+ <li>- <a href="#random">random</a></li>
304
+ <li>- <a href="#mixin">mixin</a></li>
305
+ <li>- <a href="#uniqueId">uniqueId</a></li>
306
+ <li>- <a href="#escape">escape</a></li>
307
+ <li>- <a href="#unescape">unescape</a></li>
308
+ <li>- <a href="#result">result</a></li>
309
+ <li>- <a href="#template">template</a></li>
310
+ </ul>
311
+
312
+ <a class="toc_title" href="#chaining">
313
+ Chaining
314
+ </a>
315
+ <ul class="toc_section">
316
+ <li>- <a href="#chain">chain</a></li>
317
+ <li>- <a href="#value">value</a></li>
318
+ </ul>
319
+
320
+ <a class="toc_title" href="#links">
321
+ Links
322
+ </a>
323
+
324
+ <a class="toc_title" href="#changelog">
325
+ Change Log
326
+ </a>
327
+
328
+ </div>
329
+
330
+ <div class="container">
331
+
332
+ <p id="introduction">
333
+ <img id="logo" src="docs/images/underscore.png" alt="Underscore.js" />
334
+ </p>
335
+
336
+ <p>
337
+ <a href="http://github.com/documentcloud/underscore/">Underscore</a> is a
338
+ utility-belt library for JavaScript that provides a lot of the
339
+ functional programming support that you would expect in
340
+ <a href="http://prototypejs.org/doc/latest/">Prototype.js</a>
341
+ (or <a href="http://www.ruby-doc.org/core/classes/Enumerable.html">Ruby</a>),
342
+ but without extending any of the built-in JavaScript objects. It's the
343
+ tie to go along with <a href="http://docs.jquery.com">jQuery</a>'s tux,
344
+ and <a href="http://backbonejs.org">Backbone.js</a>'s suspenders.
345
+ </p>
346
+
347
+ <p>
348
+ Underscore provides 80-odd functions that support both the usual
349
+ functional suspects: <b>map</b>, <b>select</b>, <b>invoke</b> &mdash;
350
+ as well as more specialized helpers: function binding, javascript
351
+ templating, deep equality testing, and so on. It delegates to built-in
352
+ functions, if present, so modern browsers will use the
353
+ native implementations of <b>forEach</b>, <b>map</b>, <b>reduce</b>,
354
+ <b>filter</b>, <b>every</b>, <b>some</b> and <b>indexOf</b>.
355
+ </p>
356
+
357
+ <p>
358
+ A complete <a href="test/">Test &amp; Benchmark Suite</a>
359
+ is included for your perusal.
360
+ </p>
361
+
362
+ <p>
363
+ You may also read through the <a href="docs/underscore.html">annotated source code</a>.
364
+ </p>
365
+
366
+ <p>
367
+ The project is
368
+ <a href="http://github.com/documentcloud/underscore/">hosted on GitHub</a>.
369
+ You can report bugs and discuss features on the
370
+ <a href="http://github.com/documentcloud/underscore/issues">issues page</a>,
371
+ on Freenode in the <tt>#documentcloud</tt> channel,
372
+ or send tweets to <a href="http://twitter.com/documentcloud">@documentcloud</a>.
373
+ </p>
374
+
375
+ <p>
376
+ <i>Underscore is an open-source component of <a href="http://documentcloud.org/">DocumentCloud</a>.</i>
377
+ </p>
378
+
379
+ <h2>Downloads <i style="padding-left: 12px; font-size:12px;">(Right-click, and use "Save As")</i></h2>
380
+
381
+ <table>
382
+ <tr>
383
+ <td><a href="underscore.js">Development Version (1.4.4)</a></td>
384
+ <td><i>40kb, Uncompressed with Plentiful Comments</i></td>
385
+ </tr>
386
+ <tr>
387
+ <td><a href="underscore-min.js">Production Version (1.4.4)</a></td>
388
+ <td><i>4kb, Minified and Gzipped</i></td>
389
+ </tr>
390
+ <tr>
391
+ <td colspan="2"><div class="rule"></div></td>
392
+ </tr>
393
+ <tr>
394
+ <td><a href="https://raw.github.com/documentcloud/underscore/master/underscore.js">Edge Version</a></td>
395
+ <td><i>Unreleased, current <tt>master</tt>, use at your own risk</i></td>
396
+ </tr>
397
+ </table>
398
+
399
+ <div id="documentation">
400
+
401
+ <h2 id="collections">Collection Functions (Arrays or Objects)</h2>
402
+
403
+ <p id="each">
404
+ <b class="header">each</b><code>_.each(list, iterator, [context])</code>
405
+ <span class="alias">Alias: <b>forEach</b></span>
406
+ <br />
407
+ Iterates over a <b>list</b> of elements, yielding each in turn to an <b>iterator</b>
408
+ function. The <b>iterator</b> is bound to the <b>context</b> object, if one is
409
+ passed. Each invocation of <b>iterator</b> is called with three arguments:
410
+ <tt>(element, index, list)</tt>. If <b>list</b> is a JavaScript object, <b>iterator</b>'s
411
+ arguments will be <tt>(value, key, list)</tt>. Delegates to the native
412
+ <b>forEach</b> function if it exists.
413
+ </p>
414
+ <pre>
415
+ _.each([1, 2, 3], alert);
416
+ =&gt; alerts each number in turn...
417
+ _.each({one : 1, two : 2, three : 3}, alert);
418
+ =&gt; alerts each number value in turn...</pre>
419
+
420
+ <p id="map">
421
+ <b class="header">map</b><code>_.map(list, iterator, [context])</code>
422
+ <span class="alias">Alias: <b>collect</b></span>
423
+ <br />
424
+ Produces a new array of values by mapping each value in <b>list</b>
425
+ through a transformation function (<b>iterator</b>). If the native <b>map</b> method
426
+ exists, it will be used instead. If <b>list</b> is a JavaScript object,
427
+ <b>iterator</b>'s arguments will be <tt>(value, key, list)</tt>.
428
+ </p>
429
+ <pre>
430
+ _.map([1, 2, 3], function(num){ return num * 3; });
431
+ =&gt; [3, 6, 9]
432
+ _.map({one : 1, two : 2, three : 3}, function(num, key){ return num * 3; });
433
+ =&gt; [3, 6, 9]</pre>
434
+
435
+ <p id="reduce">
436
+ <b class="header">reduce</b><code>_.reduce(list, iterator, memo, [context])</code>
437
+ <span class="alias">Aliases: <b>inject, foldl</b></span>
438
+ <br />
439
+ Also known as <b>inject</b> and <b>foldl</b>, <b>reduce</b> boils down a
440
+ <b>list</b> of values into a single value. <b>Memo</b> is the initial state
441
+ of the reduction, and each successive step of it should be returned by
442
+ <b>iterator</b>. The iterator is passed four arguments: the <tt>memo</tt>,
443
+ then the <tt>value</tt> and <tt>index</tt> (or key) of the iteration,
444
+ and finally a reference to the entire <tt>list</tt>.
445
+ </p>
446
+ <pre>
447
+ var sum = _.reduce([1, 2, 3], function(memo, num){ return memo + num; }, 0);
448
+ =&gt; 6
449
+ </pre>
450
+
451
+ <p id="reduceRight">
452
+ <b class="header">reduceRight</b><code>_.reduceRight(list, iterator, memo, [context])</code>
453
+ <span class="alias">Alias: <b>foldr</b></span>
454
+ <br />
455
+ The right-associative version of <b>reduce</b>. Delegates to the
456
+ JavaScript 1.8 version of <b>reduceRight</b>, if it exists. <b>Foldr</b>
457
+ is not as useful in JavaScript as it would be in a language with lazy
458
+ evaluation.
459
+ </p>
460
+ <pre>
461
+ var list = [[0, 1], [2, 3], [4, 5]];
462
+ var flat = _.reduceRight(list, function(a, b) { return a.concat(b); }, []);
463
+ =&gt; [4, 5, 2, 3, 0, 1]
464
+ </pre>
465
+
466
+ <p id="find">
467
+ <b class="header">find</b><code>_.find(list, iterator, [context])</code>
468
+ <span class="alias">Alias: <b>detect</b></span>
469
+ <br />
470
+ Looks through each value in the <b>list</b>, returning the first one that
471
+ passes a truth test (<b>iterator</b>). The function returns as
472
+ soon as it finds an acceptable element, and doesn't traverse the
473
+ entire list.
474
+ </p>
475
+ <pre>
476
+ var even = _.find([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; });
477
+ =&gt; 2
478
+ </pre>
479
+
480
+ <p id="filter">
481
+ <b class="header">filter</b><code>_.filter(list, iterator, [context])</code>
482
+ <span class="alias">Alias: <b>select</b></span>
483
+ <br />
484
+ Looks through each value in the <b>list</b>, returning an array of all
485
+ the values that pass a truth test (<b>iterator</b>). Delegates to the
486
+ native <b>filter</b> method, if it exists.
487
+ </p>
488
+ <pre>
489
+ var evens = _.filter([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; });
490
+ =&gt; [2, 4, 6]
491
+ </pre>
492
+
493
+ <p id="where">
494
+ <b class="header">where</b><code>_.where(list, properties)</code>
495
+ <br />
496
+ Looks through each value in the <b>list</b>, returning an array of all
497
+ the values that contain all of the key-value pairs listed in <b>properties</b>.
498
+ </p>
499
+ <pre>
500
+ _.where(listOfPlays, {author: "Shakespeare", year: 1611});
501
+ =&gt; [{title: "Cymbeline", author: "Shakespeare", year: 1611},
502
+ {title: "The Tempest", author: "Shakespeare", year: 1611}]
503
+ </pre>
504
+
505
+ <p id="findWhere">
506
+ <b class="header">findWhere</b><code>_.findWhere(list, properties)</code>
507
+ <br />
508
+ Looks through the <b>list</b> and returns the <i>first</i> value that matches
509
+ all of the key-value pairs listed in <b>properties</b>.
510
+ </p>
511
+ <pre>
512
+ _.findWhere(publicServicePulitzers, {newsroom: "The New York Times"});
513
+ =&gt; {year: 1918, newsroom: "The New York Times",
514
+ reason: "For its public service in publishing in full so many official reports,
515
+ documents and speeches by European statesmen relating to the progress and
516
+ conduct of the war."}
517
+ </pre>
518
+
519
+ <p id="reject">
520
+ <b class="header">reject</b><code>_.reject(list, iterator, [context])</code>
521
+ <br />
522
+ Returns the values in <b>list</b> without the elements that the truth
523
+ test (<b>iterator</b>) passes. The opposite of <b>filter</b>.
524
+ </p>
525
+ <pre>
526
+ var odds = _.reject([1, 2, 3, 4, 5, 6], function(num){ return num % 2 == 0; });
527
+ =&gt; [1, 3, 5]
528
+ </pre>
529
+
530
+ <p id="every">
531
+ <b class="header">every</b><code>_.every(list, iterator, [context])</code>
532
+ <span class="alias">Alias: <b>all</b></span>
533
+ <br />
534
+ Returns <i>true</i> if all of the values in the <b>list</b> pass the <b>iterator</b>
535
+ truth test. Delegates to the native method <b>every</b>, if present.
536
+ </p>
537
+ <pre>
538
+ _.every([true, 1, null, 'yes'], _.identity);
539
+ =&gt; false
540
+ </pre>
541
+
542
+ <p id="some">
543
+ <b class="header">some</b><code>_.some(list, [iterator], [context])</code>
544
+ <span class="alias">Alias: <b>any</b></span>
545
+ <br />
546
+ Returns <i>true</i> if any of the values in the <b>list</b> pass the
547
+ <b>iterator</b> truth test. Short-circuits and stops traversing the list
548
+ if a true element is found. Delegates to the native method <b>some</b>,
549
+ if present.
550
+ </p>
551
+ <pre>
552
+ _.some([null, 0, 'yes', false]);
553
+ =&gt; true
554
+ </pre>
555
+
556
+ <p id="contains">
557
+ <b class="header">contains</b><code>_.contains(list, value)</code>
558
+ <span class="alias">Alias: <b>include</b></span>
559
+ <br />
560
+ Returns <i>true</i> if the <b>value</b> is present in the <b>list</b>.
561
+ Uses <b>indexOf</b> internally, if <b>list</b> is an Array.
562
+ </p>
563
+ <pre>
564
+ _.contains([1, 2, 3], 3);
565
+ =&gt; true
566
+ </pre>
567
+
568
+ <p id="invoke">
569
+ <b class="header">invoke</b><code>_.invoke(list, methodName, [*arguments])</code>
570
+ <br />
571
+ Calls the method named by <b>methodName</b> on each value in the <b>list</b>.
572
+ Any extra arguments passed to <b>invoke</b> will be forwarded on to the
573
+ method invocation.
574
+ </p>
575
+ <pre>
576
+ _.invoke([[5, 1, 7], [3, 2, 1]], 'sort');
577
+ =&gt; [[1, 5, 7], [1, 2, 3]]
578
+ </pre>
579
+
580
+ <p id="pluck">
581
+ <b class="header">pluck</b><code>_.pluck(list, propertyName)</code>
582
+ <br />
583
+ A convenient version of what is perhaps the most common use-case for
584
+ <b>map</b>: extracting a list of property values.
585
+ </p>
586
+ <pre>
587
+ var stooges = [{name : 'moe', age : 40}, {name : 'larry', age : 50}, {name : 'curly', age : 60}];
588
+ _.pluck(stooges, 'name');
589
+ =&gt; ["moe", "larry", "curly"]
590
+ </pre>
591
+
592
+ <p id="max">
593
+ <b class="header">max</b><code>_.max(list, [iterator], [context])</code>
594
+ <br />
595
+ Returns the maximum value in <b>list</b>. If <b>iterator</b> is passed,
596
+ it will be used on each value to generate the criterion by which the
597
+ value is ranked.
598
+ </p>
599
+ <pre>
600
+ var stooges = [{name : 'moe', age : 40}, {name : 'larry', age : 50}, {name : 'curly', age : 60}];
601
+ _.max(stooges, function(stooge){ return stooge.age; });
602
+ =&gt; {name : 'curly', age : 60};
603
+ </pre>
604
+
605
+ <p id="min">
606
+ <b class="header">min</b><code>_.min(list, [iterator], [context])</code>
607
+ <br />
608
+ Returns the minimum value in <b>list</b>. If <b>iterator</b> is passed,
609
+ it will be used on each value to generate the criterion by which the
610
+ value is ranked.
611
+ </p>
612
+ <pre>
613
+ var numbers = [10, 5, 100, 2, 1000];
614
+ _.min(numbers);
615
+ =&gt; 2
616
+ </pre>
617
+
618
+ <p id="sortBy">
619
+ <b class="header">sortBy</b><code>_.sortBy(list, iterator, [context])</code>
620
+ <br />
621
+ Returns a sorted copy of <b>list</b>, ranked in ascending order by the
622
+ results of running each value through <b>iterator</b>. Iterator may
623
+ also be the string name of the property to sort by (eg. <tt>length</tt>).
624
+ </p>
625
+ <pre>
626
+ _.sortBy([1, 2, 3, 4, 5, 6], function(num){ return Math.sin(num); });
627
+ =&gt; [5, 4, 6, 3, 1, 2]
628
+ </pre>
629
+
630
+ <p id="groupBy">
631
+ <b class="header">groupBy</b><code>_.groupBy(list, iterator, [context])</code>
632
+ <br />
633
+ Splits a collection into sets, grouped by the result of running each
634
+ value through <b>iterator</b>. If <b>iterator</b> is a string instead of
635
+ a function, groups by the property named by <b>iterator</b> on each of
636
+ the values.
637
+ </p>
638
+ <pre>
639
+ _.groupBy([1.3, 2.1, 2.4], function(num){ return Math.floor(num); });
640
+ =&gt; {1: [1.3], 2: [2.1, 2.4]}
641
+
642
+ _.groupBy(['one', 'two', 'three'], 'length');
643
+ =&gt; {3: ["one", "two"], 5: ["three"]}
644
+ </pre>
645
+
646
+ <p id="countBy">
647
+ <b class="header">countBy</b><code>_.countBy(list, iterator, [context])</code>
648
+ <br />
649
+ Sorts a list into groups and returns a count for the number of objects
650
+ in each group.
651
+ Similar to <tt>groupBy</tt>, but instead of returning a list of values,
652
+ returns a count for the number of values in that group.
653
+ </p>
654
+ <pre>
655
+ _.countBy([1, 2, 3, 4, 5], function(num) {
656
+ return num % 2 == 0 ? 'even' : 'odd';
657
+ });
658
+ =&gt; {odd: 3, even: 2}
659
+ </pre>
660
+
661
+ <p id="shuffle">
662
+ <b class="header">shuffle</b><code>_.shuffle(list)</code>
663
+ <br />
664
+ Returns a shuffled copy of the <b>list</b>, using a version of the
665
+ <a href="http://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle">Fisher-Yates shuffle</a>.
666
+ </p>
667
+ <pre>
668
+ _.shuffle([1, 2, 3, 4, 5, 6]);
669
+ =&gt; [4, 1, 6, 3, 5, 2]
670
+ </pre>
671
+
672
+ <p id="toArray">
673
+ <b class="header">toArray</b><code>_.toArray(list)</code>
674
+ <br />
675
+ Converts the <b>list</b> (anything that can be iterated over), into a
676
+ real Array. Useful for transmuting the <b>arguments</b> object.
677
+ </p>
678
+ <pre>
679
+ (function(){ return _.toArray(arguments).slice(1); })(1, 2, 3, 4);
680
+ =&gt; [2, 3, 4]
681
+ </pre>
682
+
683
+ <p id="size">
684
+ <b class="header">size</b><code>_.size(list)</code>
685
+ <br />
686
+ Return the number of values in the <b>list</b>.
687
+ </p>
688
+ <pre>
689
+ _.size({one : 1, two : 2, three : 3});
690
+ =&gt; 3
691
+ </pre>
692
+
693
+ <h2 id="arrays">Array Functions</h2>
694
+
695
+ <p>
696
+ <i>
697
+ Note: All array functions will also work on the <b>arguments</b> object.
698
+ However, Underscore functions are not designed to work on "sparse" arrays.
699
+ </i>
700
+ </p>
701
+
702
+ <p id="first">
703
+ <b class="header">first</b><code>_.first(array, [n])</code>
704
+ <span class="alias">Alias: <b>head</b>, <b>take</b></span>
705
+ <br />
706
+ Returns the first element of an <b>array</b>. Passing <b>n</b> will
707
+ return the first <b>n</b> elements of the array.
708
+ </p>
709
+ <pre>
710
+ _.first([5, 4, 3, 2, 1]);
711
+ =&gt; 5
712
+ </pre>
713
+
714
+ <p id="initial">
715
+ <b class="header">initial</b><code>_.initial(array, [n])</code>
716
+ <br />
717
+ Returns everything but the last entry of the array. Especially useful on
718
+ the arguments object. Pass <b>n</b> to exclude the last <b>n</b> elements
719
+ from the result.
720
+ </p>
721
+ <pre>
722
+ _.initial([5, 4, 3, 2, 1]);
723
+ =&gt; [5, 4, 3, 2]
724
+ </pre>
725
+
726
+ <p id="last">
727
+ <b class="header">last</b><code>_.last(array, [n])</code>
728
+ <br />
729
+ Returns the last element of an <b>array</b>. Passing <b>n</b> will return
730
+ the last <b>n</b> elements of the array.
731
+ </p>
732
+ <pre>
733
+ _.last([5, 4, 3, 2, 1]);
734
+ =&gt; 1
735
+ </pre>
736
+
737
+ <p id="rest">
738
+ <b class="header">rest</b><code>_.rest(array, [index])</code>
739
+ <span class="alias">Alias: <b>tail, drop</b></span>
740
+ <br />
741
+ Returns the <b>rest</b> of the elements in an array. Pass an <b>index</b>
742
+ to return the values of the array from that index onward.
743
+ </p>
744
+ <pre>
745
+ _.rest([5, 4, 3, 2, 1]);
746
+ =&gt; [4, 3, 2, 1]
747
+ </pre>
748
+
749
+ <p id="compact">
750
+ <b class="header">compact</b><code>_.compact(array)</code>
751
+ <br />
752
+ Returns a copy of the <b>array</b> with all falsy values removed.
753
+ In JavaScript, <i>false</i>, <i>null</i>, <i>0</i>, <i>""</i>,
754
+ <i>undefined</i> and <i>NaN</i> are all falsy.
755
+ </p>
756
+ <pre>
757
+ _.compact([0, 1, false, 2, '', 3]);
758
+ =&gt; [1, 2, 3]
759
+ </pre>
760
+
761
+ <p id="flatten">
762
+ <b class="header">flatten</b><code>_.flatten(array, [shallow])</code>
763
+ <br />
764
+ Flattens a nested <b>array</b> (the nesting can be to any depth). If you
765
+ pass <b>shallow</b>, the array will only be flattened a single level.
766
+ </p>
767
+ <pre>
768
+ _.flatten([1, [2], [3, [[4]]]]);
769
+ =&gt; [1, 2, 3, 4];
770
+
771
+ _.flatten([1, [2], [3, [[4]]]], true);
772
+ =&gt; [1, 2, 3, [[4]]];
773
+ </pre>
774
+
775
+ <p id="without">
776
+ <b class="header">without</b><code>_.without(array, [*values])</code>
777
+ <br />
778
+ Returns a copy of the <b>array</b> with all instances of the <b>values</b>
779
+ removed.
780
+ </p>
781
+ <pre>
782
+ _.without([1, 2, 1, 0, 3, 1, 4], 0, 1);
783
+ =&gt; [2, 3, 4]
784
+ </pre>
785
+
786
+ <p id="union">
787
+ <b class="header">union</b><code>_.union(*arrays)</code>
788
+ <br />
789
+ Computes the union of the passed-in <b>arrays</b>: the list of unique items,
790
+ in order, that are present in one or more of the <b>arrays</b>.
791
+ </p>
792
+ <pre>
793
+ _.union([1, 2, 3], [101, 2, 1, 10], [2, 1]);
794
+ =&gt; [1, 2, 3, 101, 10]
795
+ </pre>
796
+
797
+ <p id="intersection">
798
+ <b class="header">intersection</b><code>_.intersection(*arrays)</code>
799
+ <br />
800
+ Computes the list of values that are the intersection of all the <b>arrays</b>.
801
+ Each value in the result is present in each of the <b>arrays</b>.
802
+ </p>
803
+ <pre>
804
+ _.intersection([1, 2, 3], [101, 2, 1, 10], [2, 1]);
805
+ =&gt; [1, 2]
806
+ </pre>
807
+
808
+ <p id="difference">
809
+ <b class="header">difference</b><code>_.difference(array, *others)</code>
810
+ <br />
811
+ Similar to <b>without</b>, but returns the values from <b>array</b> that
812
+ are not present in the <b>other</b> arrays.
813
+ </p>
814
+ <pre>
815
+ _.difference([1, 2, 3, 4, 5], [5, 2, 10]);
816
+ =&gt; [1, 3, 4]
817
+ </pre>
818
+
819
+ <p id="uniq">
820
+ <b class="header">uniq</b><code>_.uniq(array, [isSorted], [iterator])</code>
821
+ <span class="alias">Alias: <b>unique</b></span>
822
+ <br />
823
+ Produces a duplicate-free version of the <b>array</b>, using <i>===</i> to test
824
+ object equality. If you know in advance that the <b>array</b> is sorted,
825
+ passing <i>true</i> for <b>isSorted</b> will run a much faster algorithm.
826
+ If you want to compute unique items based on a transformation, pass an
827
+ <b>iterator</b> function.
828
+ </p>
829
+ <pre>
830
+ _.uniq([1, 2, 1, 3, 1, 4]);
831
+ =&gt; [1, 2, 3, 4]
832
+ </pre>
833
+
834
+ <p id="zip">
835
+ <b class="header">zip</b><code>_.zip(*arrays)</code>
836
+ <br />
837
+ Merges together the values of each of the <b>arrays</b> with the
838
+ values at the corresponding position. Useful when you have separate
839
+ data sources that are coordinated through matching array indexes.
840
+ If you're working with a matrix of nested arrays, <b>zip.apply</b>
841
+ can transpose the matrix in a similar fashion.
842
+ </p>
843
+ <pre>
844
+ _.zip(['moe', 'larry', 'curly'], [30, 40, 50], [true, false, false]);
845
+ =&gt; [["moe", 30, true], ["larry", 40, false], ["curly", 50, false]]
846
+ </pre>
847
+
848
+ <p id="object">
849
+ <b class="header">object</b><code>_.object(list, [values])</code>
850
+ <br />
851
+ Converts arrays into objects. Pass either a single list of
852
+ <tt>[key, value]</tt> pairs, or a list of keys, and a list of values.
853
+ </p>
854
+ <pre>
855
+ _.object(['moe', 'larry', 'curly'], [30, 40, 50]);
856
+ =&gt; {moe: 30, larry: 40, curly: 50}
857
+
858
+ _.object([['moe', 30], ['larry', 40], ['curly', 50]]);
859
+ =&gt; {moe: 30, larry: 40, curly: 50}
860
+ </pre>
861
+
862
+ <p id="indexOf">
863
+ <b class="header">indexOf</b><code>_.indexOf(array, value, [isSorted])</code>
864
+ <br />
865
+ Returns the index at which <b>value</b> can be found in the <b>array</b>,
866
+ or <i>-1</i> if value is not present in the <b>array</b>. Uses the native
867
+ <b>indexOf</b> function unless it's missing. If you're working with a
868
+ large array, and you know that the array is already sorted, pass <tt>true</tt>
869
+ for <b>isSorted</b> to use a faster binary search ... or, pass a number as
870
+ the third argument in order to look for the first matching value in the
871
+ array after the given index.
872
+ </p>
873
+ <pre>
874
+ _.indexOf([1, 2, 3], 2);
875
+ =&gt; 1
876
+ </pre>
877
+
878
+ <p id="lastIndexOf">
879
+ <b class="header">lastIndexOf</b><code>_.lastIndexOf(array, value, [fromIndex])</code>
880
+ <br />
881
+ Returns the index of the last occurrence of <b>value</b> in the <b>array</b>,
882
+ or <i>-1</i> if value is not present. Uses the native <b>lastIndexOf</b>
883
+ function if possible. Pass <b>fromIndex</b> to start your search at a
884
+ given index.
885
+ </p>
886
+ <pre>
887
+ _.lastIndexOf([1, 2, 3, 1, 2, 3], 2);
888
+ =&gt; 4
889
+ </pre>
890
+
891
+ <p id="sortedIndex">
892
+ <b class="header">sortedIndex</b><code>_.sortedIndex(list, value, [iterator], [context])</code>
893
+ <br />
894
+ Uses a binary search to determine the index at which the <b>value</b>
895
+ <i>should</i> be inserted into the <b>list</b> in order to maintain the <b>list</b>'s
896
+ sorted order. If an <b>iterator</b> is passed, it will be used to compute
897
+ the sort ranking of each value, including the <b>value</b> you pass.
898
+ </p>
899
+ <pre>
900
+ _.sortedIndex([10, 20, 30, 40, 50], 35);
901
+ =&gt; 3
902
+ </pre>
903
+
904
+ <p id="range">
905
+ <b class="header">range</b><code>_.range([start], stop, [step])</code>
906
+ <br />
907
+ A function to create flexibly-numbered lists of integers, handy for
908
+ <tt>each</tt> and <tt>map</tt> loops. <b>start</b>, if omitted, defaults
909
+ to <i>0</i>; <b>step</b> defaults to <i>1</i>. Returns a list of integers
910
+ from <b>start</b> to <b>stop</b>, incremented (or decremented) by <b>step</b>,
911
+ exclusive.
912
+ </p>
913
+ <pre>
914
+ _.range(10);
915
+ =&gt; [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
916
+ _.range(1, 11);
917
+ =&gt; [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
918
+ _.range(0, 30, 5);
919
+ =&gt; [0, 5, 10, 15, 20, 25]
920
+ _.range(0, -10, -1);
921
+ =&gt; [0, -1, -2, -3, -4, -5, -6, -7, -8, -9]
922
+ _.range(0);
923
+ =&gt; []
924
+ </pre>
925
+
926
+ <h2 id="functions">Function (uh, ahem) Functions</h2>
927
+
928
+ <p id="bind">
929
+ <b class="header">bind</b><code>_.bind(function, object, [*arguments])</code>
930
+ <br />
931
+ Bind a <b>function</b> to an <b>object</b>, meaning that whenever
932
+ the function is called, the value of <i>this</i> will be the <b>object</b>.
933
+ Optionally, pass <b>arguments</b> to the <b>function</b> to pre-fill them,
934
+ also known as <b>partial application</b>.
935
+ </p>
936
+ <pre>
937
+ var func = function(greeting){ return greeting + ': ' + this.name };
938
+ func = _.bind(func, {name : 'moe'}, 'hi');
939
+ func();
940
+ =&gt; 'hi: moe'
941
+ </pre>
942
+
943
+ <p id="bindAll">
944
+ <b class="header">bindAll</b><code>_.bindAll(object, [*methodNames])</code>
945
+ <br />
946
+ Binds a number of methods on the <b>object</b>, specified by
947
+ <b>methodNames</b>, to be run in the context of that object whenever they
948
+ are invoked. Very handy for binding functions that are going to be used
949
+ as event handlers, which would otherwise be invoked with a fairly useless
950
+ <i>this</i>. If no <b>methodNames</b> are provided, all of the object's
951
+ function properties will be bound to it.
952
+ </p>
953
+ <pre>
954
+ var buttonView = {
955
+ label : 'underscore',
956
+ onClick : function(){ alert('clicked: ' + this.label); },
957
+ onHover : function(){ console.log('hovering: ' + this.label); }
958
+ };
959
+ _.bindAll(buttonView);
960
+ jQuery('#underscore_button').bind('click', buttonView.onClick);
961
+ =&gt; When the button is clicked, this.label will have the correct value...
962
+ </pre>
963
+
964
+ <p id="partial">
965
+ <b class="header">partial</b><code>_.partial(function, [*arguments])</code>
966
+ <br />
967
+ Partially apply a function by filling in any number of its arguments,
968
+ <i>without</i> changing its dynamic <tt>this</tt> value. A close cousin
969
+ of <a href="#bind">bind</a>.
970
+ </p>
971
+ <pre>
972
+ var add = function(a, b) { return a + b; };
973
+ add5 = _.partial(add, 5);
974
+ add5(10);
975
+ =&gt; 15
976
+ </pre>
977
+
978
+ <p id="memoize">
979
+ <b class="header">memoize</b><code>_.memoize(function, [hashFunction])</code>
980
+ <br />
981
+ Memoizes a given <b>function</b> by caching the computed result. Useful
982
+ for speeding up slow-running computations. If passed an optional
983
+ <b>hashFunction</b>, it will be used to compute the hash key for storing
984
+ the result, based on the arguments to the original function. The default
985
+ <b>hashFunction</b> just uses the first argument to the memoized function
986
+ as the key.
987
+ </p>
988
+ <pre>
989
+ var fibonacci = _.memoize(function(n) {
990
+ return n &lt; 2 ? n : fibonacci(n - 1) + fibonacci(n - 2);
991
+ });
992
+ </pre>
993
+
994
+ <p id="delay">
995
+ <b class="header">delay</b><code>_.delay(function, wait, [*arguments])</code>
996
+ <br />
997
+ Much like <b>setTimeout</b>, invokes <b>function</b> after <b>wait</b>
998
+ milliseconds. If you pass the optional <b>arguments</b>, they will be
999
+ forwarded on to the <b>function</b> when it is invoked.
1000
+ </p>
1001
+ <pre>
1002
+ var log = _.bind(console.log, console);
1003
+ _.delay(log, 1000, 'logged later');
1004
+ =&gt; 'logged later' // Appears after one second.
1005
+ </pre>
1006
+
1007
+ <p id="defer">
1008
+ <b class="header">defer</b><code>_.defer(function, [*arguments])</code>
1009
+ <br />
1010
+ Defers invoking the <b>function</b> until the current call stack has cleared,
1011
+ similar to using <b>setTimeout</b> with a delay of 0. Useful for performing
1012
+ expensive computations or HTML rendering in chunks without blocking the UI thread
1013
+ from updating. If you pass the optional <b>arguments</b>, they will be
1014
+ forwarded on to the <b>function</b> when it is invoked.
1015
+ </p>
1016
+ <pre>
1017
+ _.defer(function(){ alert('deferred'); });
1018
+ // Returns from the function before the alert runs.
1019
+ </pre>
1020
+
1021
+ <p id="throttle">
1022
+ <b class="header">throttle</b><code>_.throttle(function, wait)</code>
1023
+ <br />
1024
+ Creates and returns a new, throttled version of the passed function,
1025
+ that, when invoked repeatedly, will only actually call the original function
1026
+ at most once per every <b>wait</b>
1027
+ milliseconds. Useful for rate-limiting events that occur faster than you
1028
+ can keep up with.
1029
+ </p>
1030
+ <pre>
1031
+ var throttled = _.throttle(updatePosition, 100);
1032
+ $(window).scroll(throttled);
1033
+ </pre>
1034
+
1035
+ <p id="debounce">
1036
+ <b class="header">debounce</b><code>_.debounce(function, wait, [immediate])</code>
1037
+ <br />
1038
+ Creates and returns a new debounced version of the passed function that
1039
+ will postpone its execution until after
1040
+ <b>wait</b> milliseconds have elapsed since the last time it
1041
+ was invoked. Useful for implementing behavior that should only happen
1042
+ <i>after</i> the input has stopped arriving. For example: rendering a
1043
+ preview of a Markdown comment, recalculating a layout after the window
1044
+ has stopped being resized, and so on.
1045
+ </p>
1046
+
1047
+ <p>
1048
+ Pass <tt>true</tt> for the <b>immediate</b> parameter to cause
1049
+ <b>debounce</b> to trigger the function on the leading instead of the
1050
+ trailing edge of the <b>wait</b> interval. Useful in circumstances like
1051
+ preventing accidental double-clicks on a "submit" button from firing a
1052
+ second time.
1053
+ </p>
1054
+
1055
+ <pre>
1056
+ var lazyLayout = _.debounce(calculateLayout, 300);
1057
+ $(window).resize(lazyLayout);
1058
+ </pre>
1059
+
1060
+ <p id="once">
1061
+ <b class="header">once</b><code>_.once(function)</code>
1062
+ <br />
1063
+ Creates a version of the function that can only be called one time.
1064
+ Repeated calls to the modified function will have no effect, returning
1065
+ the value from the original call. Useful for initialization functions,
1066
+ instead of having to set a boolean flag and then check it later.
1067
+ </p>
1068
+ <pre>
1069
+ var initialize = _.once(createApplication);
1070
+ initialize();
1071
+ initialize();
1072
+ // Application is only created once.
1073
+ </pre>
1074
+
1075
+ <p id="after">
1076
+ <b class="header">after</b><code>_.after(count, function)</code>
1077
+ <br />
1078
+ Creates a version of the function that will only be run after first
1079
+ being called <b>count</b> times. Useful for grouping asynchronous responses,
1080
+ where you want to be sure that all the async calls have finished, before
1081
+ proceeding.
1082
+ </p>
1083
+ <pre>
1084
+ var renderNotes = _.after(notes.length, render);
1085
+ _.each(notes, function(note) {
1086
+ note.asyncSave({success: renderNotes});
1087
+ });
1088
+ // renderNotes is run once, after all notes have saved.
1089
+ </pre>
1090
+
1091
+ <p id="wrap">
1092
+ <b class="header">wrap</b><code>_.wrap(function, wrapper)</code>
1093
+ <br />
1094
+ Wraps the first <b>function</b> inside of the <b>wrapper</b> function,
1095
+ passing it as the first argument. This allows the <b>wrapper</b> to
1096
+ execute code before and after the <b>function</b> runs, adjust the arguments,
1097
+ and execute it conditionally.
1098
+ </p>
1099
+ <pre>
1100
+ var hello = function(name) { return "hello: " + name; };
1101
+ hello = _.wrap(hello, function(func) {
1102
+ return "before, " + func("moe") + ", after";
1103
+ });
1104
+ hello();
1105
+ =&gt; 'before, hello: moe, after'
1106
+ </pre>
1107
+
1108
+ <p id="compose">
1109
+ <b class="header">compose</b><code>_.compose(*functions)</code>
1110
+ <br />
1111
+ Returns the composition of a list of <b>functions</b>, where each function
1112
+ consumes the return value of the function that follows. In math terms,
1113
+ composing the functions <i>f()</i>, <i>g()</i>, and <i>h()</i> produces
1114
+ <i>f(g(h()))</i>.
1115
+ </p>
1116
+ <pre>
1117
+ var greet = function(name){ return "hi: " + name; };
1118
+ var exclaim = function(statement){ return statement + "!"; };
1119
+ var welcome = _.compose(exclaim, greet);
1120
+ welcome('moe');
1121
+ =&gt; 'hi: moe!'
1122
+ </pre>
1123
+
1124
+ <h2 id="objects">Object Functions</h2>
1125
+
1126
+ <p id="keys">
1127
+ <b class="header">keys</b><code>_.keys(object)</code>
1128
+ <br />
1129
+ Retrieve all the names of the <b>object</b>'s properties.
1130
+ </p>
1131
+ <pre>
1132
+ _.keys({one : 1, two : 2, three : 3});
1133
+ =&gt; ["one", "two", "three"]
1134
+ </pre>
1135
+
1136
+ <p id="values">
1137
+ <b class="header">values</b><code>_.values(object)</code>
1138
+ <br />
1139
+ Return all of the values of the <b>object</b>'s properties.
1140
+ </p>
1141
+ <pre>
1142
+ _.values({one : 1, two : 2, three : 3});
1143
+ =&gt; [1, 2, 3]
1144
+ </pre>
1145
+
1146
+ <p id="pairs">
1147
+ <b class="header">pairs</b><code>_.pairs(object)</code>
1148
+ <br />
1149
+ Convert an object into a list of <tt>[key, value]</tt> pairs.
1150
+ </p>
1151
+ <pre>
1152
+ _.pairs({one: 1, two: 2, three: 3});
1153
+ =&gt; [["one", 1], ["two", 2], ["three", 3]]
1154
+ </pre>
1155
+
1156
+ <p id="invert">
1157
+ <b class="header">invert</b><code>_.invert(object)</code>
1158
+ <br />
1159
+ Returns a copy of the <b>object</b> where the keys have become the values
1160
+ and the values the keys. For this to work, all of your object's values
1161
+ should be unique and string serializable.
1162
+ </p>
1163
+ <pre>
1164
+ _.invert({Moe: "Moses", Larry: "Louis", Curly: "Jerome"});
1165
+ =&gt; {Moses: "Moe", Louis: "Larry", Jerome: "Curly"};
1166
+ </pre>
1167
+
1168
+ <p id="object-functions">
1169
+ <b class="header">functions</b><code>_.functions(object)</code>
1170
+ <span class="alias">Alias: <b>methods</b></span>
1171
+ <br />
1172
+ Returns a sorted list of the names of every method in an object &mdash;
1173
+ that is to say, the name of every function property of the object.
1174
+ </p>
1175
+ <pre>
1176
+ _.functions(_);
1177
+ =&gt; ["all", "any", "bind", "bindAll", "clone", "compact", "compose" ...
1178
+ </pre>
1179
+
1180
+ <p id="extend">
1181
+ <b class="header">extend</b><code>_.extend(destination, *sources)</code>
1182
+ <br />
1183
+ Copy all of the properties in the <b>source</b> objects over to the
1184
+ <b>destination</b> object, and return the <b>destination</b> object.
1185
+ It's in-order, so the last source will override properties of the same
1186
+ name in previous arguments.
1187
+ </p>
1188
+ <pre>
1189
+ _.extend({name : 'moe'}, {age : 50});
1190
+ =&gt; {name : 'moe', age : 50}
1191
+ </pre>
1192
+
1193
+ <p id="pick">
1194
+ <b class="header">pick</b><code>_.pick(object, *keys)</code>
1195
+ <br />
1196
+ Return a copy of the <b>object</b>, filtered to only have values for
1197
+ the whitelisted <b>keys</b> (or array of valid keys).
1198
+ </p>
1199
+ <pre>
1200
+ _.pick({name : 'moe', age: 50, userid : 'moe1'}, 'name', 'age');
1201
+ =&gt; {name : 'moe', age : 50}
1202
+ </pre>
1203
+
1204
+ <p id="omit">
1205
+ <b class="header">omit</b><code>_.omit(object, *keys)</code>
1206
+ <br />
1207
+ Return a copy of the <b>object</b>, filtered to omit the blacklisted
1208
+ <b>keys</b> (or array of keys).
1209
+ </p>
1210
+ <pre>
1211
+ _.omit({name : 'moe', age : 50, userid : 'moe1'}, 'userid');
1212
+ =&gt; {name : 'moe', age : 50}
1213
+ </pre>
1214
+
1215
+ <p id="defaults">
1216
+ <b class="header">defaults</b><code>_.defaults(object, *defaults)</code>
1217
+ <br />
1218
+ Fill in null and undefined properties in <b>object</b> with values from the
1219
+ <b>defaults</b> objects, and return the <b>object</b>. As soon as the
1220
+ property is filled, further defaults will have no effect.
1221
+ </p>
1222
+ <pre>
1223
+ var iceCream = {flavor : "chocolate"};
1224
+ _.defaults(iceCream, {flavor : "vanilla", sprinkles : "lots"});
1225
+ =&gt; {flavor : "chocolate", sprinkles : "lots"}
1226
+ </pre>
1227
+
1228
+ <p id="clone">
1229
+ <b class="header">clone</b><code>_.clone(object)</code>
1230
+ <br />
1231
+ Create a shallow-copied clone of the <b>object</b>. Any nested objects
1232
+ or arrays will be copied by reference, not duplicated.
1233
+ </p>
1234
+ <pre>
1235
+ _.clone({name : 'moe'});
1236
+ =&gt; {name : 'moe'};
1237
+ </pre>
1238
+
1239
+ <p id="tap">
1240
+ <b class="header">tap</b><code>_.tap(object, interceptor)</code>
1241
+ <br />
1242
+ Invokes <b>interceptor</b> with the <b>object</b>, and then returns <b>object</b>.
1243
+ The primary purpose of this method is to "tap into" a method chain, in order to perform operations on intermediate results within the chain.
1244
+ </p>
1245
+ <pre>
1246
+ _.chain([1,2,3,200])
1247
+ .filter(function(num) { return num % 2 == 0; })
1248
+ .tap(alert)
1249
+ .map(function(num) { return num * num })
1250
+ .value();
1251
+ =&gt; // [2, 200] (alerted)
1252
+ =&gt; [4, 40000]
1253
+ </pre>
1254
+
1255
+ <p id="has">
1256
+ <b class="header">has</b><code>_.has(object, key)</code>
1257
+ <br />
1258
+ Does the object contain the given key? Identical to
1259
+ <tt>object.hasOwnProperty(key)</tt>, but uses a safe reference to the
1260
+ <tt>hasOwnProperty</tt> function, in case it's been
1261
+ <a href="http://www.devthought.com/2012/01/18/an-object-is-not-a-hash/">overridden accidentally</a>.
1262
+ </p>
1263
+ <pre>
1264
+ _.has({a: 1, b: 2, c: 3}, "b");
1265
+ =&gt; true
1266
+ </pre>
1267
+
1268
+ <p id="isEqual">
1269
+ <b class="header">isEqual</b><code>_.isEqual(object, other)</code>
1270
+ <br />
1271
+ Performs an optimized deep comparison between the two objects, to determine
1272
+ if they should be considered equal.
1273
+ </p>
1274
+ <pre>
1275
+ var moe = {name : 'moe', luckyNumbers : [13, 27, 34]};
1276
+ var clone = {name : 'moe', luckyNumbers : [13, 27, 34]};
1277
+ moe == clone;
1278
+ =&gt; false
1279
+ _.isEqual(moe, clone);
1280
+ =&gt; true
1281
+ </pre>
1282
+
1283
+ <p id="isEmpty">
1284
+ <b class="header">isEmpty</b><code>_.isEmpty(object)</code>
1285
+ <br />
1286
+ Returns <i>true</i> if <b>object</b> contains no values.
1287
+ </p>
1288
+ <pre>
1289
+ _.isEmpty([1, 2, 3]);
1290
+ =&gt; false
1291
+ _.isEmpty({});
1292
+ =&gt; true
1293
+ </pre>
1294
+
1295
+ <p id="isElement">
1296
+ <b class="header">isElement</b><code>_.isElement(object)</code>
1297
+ <br />
1298
+ Returns <i>true</i> if <b>object</b> is a DOM element.
1299
+ </p>
1300
+ <pre>
1301
+ _.isElement(jQuery('body')[0]);
1302
+ =&gt; true
1303
+ </pre>
1304
+
1305
+ <p id="isArray">
1306
+ <b class="header">isArray</b><code>_.isArray(object)</code>
1307
+ <br />
1308
+ Returns <i>true</i> if <b>object</b> is an Array.
1309
+ </p>
1310
+ <pre>
1311
+ (function(){ return _.isArray(arguments); })();
1312
+ =&gt; false
1313
+ _.isArray([1,2,3]);
1314
+ =&gt; true
1315
+ </pre>
1316
+
1317
+ <p id="isObject">
1318
+ <b class="header">isObject</b><code>_.isObject(value)</code>
1319
+ <br />
1320
+ Returns <i>true</i> if <b>value</b> is an Object. Note that JavaScript
1321
+ arrays and functions are objects, while (normal) strings and numbers are not.
1322
+ </p>
1323
+ <pre>
1324
+ _.isObject({});
1325
+ =&gt; true
1326
+ _.isObject(1);
1327
+ =&gt; false
1328
+ </pre>
1329
+
1330
+ <p id="isArguments">
1331
+ <b class="header">isArguments</b><code>_.isArguments(object)</code>
1332
+ <br />
1333
+ Returns <i>true</i> if <b>object</b> is an Arguments object.
1334
+ </p>
1335
+ <pre>
1336
+ (function(){ return _.isArguments(arguments); })(1, 2, 3);
1337
+ =&gt; true
1338
+ _.isArguments([1,2,3]);
1339
+ =&gt; false
1340
+ </pre>
1341
+
1342
+ <p id="isFunction">
1343
+ <b class="header">isFunction</b><code>_.isFunction(object)</code>
1344
+ <br />
1345
+ Returns <i>true</i> if <b>object</b> is a Function.
1346
+ </p>
1347
+ <pre>
1348
+ _.isFunction(alert);
1349
+ =&gt; true
1350
+ </pre>
1351
+
1352
+ <p id="isString">
1353
+ <b class="header">isString</b><code>_.isString(object)</code>
1354
+ <br />
1355
+ Returns <i>true</i> if <b>object</b> is a String.
1356
+ </p>
1357
+ <pre>
1358
+ _.isString("moe");
1359
+ =&gt; true
1360
+ </pre>
1361
+
1362
+ <p id="isNumber">
1363
+ <b class="header">isNumber</b><code>_.isNumber(object)</code>
1364
+ <br />
1365
+ Returns <i>true</i> if <b>object</b> is a Number (including <tt>NaN</tt>).
1366
+ </p>
1367
+ <pre>
1368
+ _.isNumber(8.4 * 5);
1369
+ =&gt; true
1370
+ </pre>
1371
+
1372
+ <p id="isFinite">
1373
+ <b class="header">isFinite</b><code>_.isFinite(object)</code>
1374
+ <br />
1375
+ Returns <i>true</i> if <b>object</b> is a finite Number.
1376
+ </p>
1377
+ <pre>
1378
+ _.isFinite(-101);
1379
+ =&gt; true
1380
+
1381
+ _.isFinite(-Infinity);
1382
+ =&gt; false
1383
+ </pre>
1384
+
1385
+ <p id="isBoolean">
1386
+ <b class="header">isBoolean</b><code>_.isBoolean(object)</code>
1387
+ <br />
1388
+ Returns <i>true</i> if <b>object</b> is either <i>true</i> or <i>false</i>.
1389
+ </p>
1390
+ <pre>
1391
+ _.isBoolean(null);
1392
+ =&gt; false
1393
+ </pre>
1394
+
1395
+ <p id="isDate">
1396
+ <b class="header">isDate</b><code>_.isDate(object)</code>
1397
+ <br />
1398
+ Returns <i>true</i> if <b>object</b> is a Date.
1399
+ </p>
1400
+ <pre>
1401
+ _.isDate(new Date());
1402
+ =&gt; true
1403
+ </pre>
1404
+
1405
+ <p id="isRegExp">
1406
+ <b class="header">isRegExp</b><code>_.isRegExp(object)</code>
1407
+ <br />
1408
+ Returns <i>true</i> if <b>object</b> is a RegExp.
1409
+ </p>
1410
+ <pre>
1411
+ _.isRegExp(/moe/);
1412
+ =&gt; true
1413
+ </pre>
1414
+
1415
+ <p id="isNaN">
1416
+ <b class="header">isNaN</b><code>_.isNaN(object)</code>
1417
+ <br />
1418
+ Returns <i>true</i> if <b>object</b> is <i>NaN</i>.<br /> Note: this is not
1419
+ the same as the native <b>isNaN</b> function, which will also return
1420
+ true if the variable is <i>undefined</i>.
1421
+ </p>
1422
+ <pre>
1423
+ _.isNaN(NaN);
1424
+ =&gt; true
1425
+ isNaN(undefined);
1426
+ =&gt; true
1427
+ _.isNaN(undefined);
1428
+ =&gt; false
1429
+ </pre>
1430
+
1431
+ <p id="isNull">
1432
+ <b class="header">isNull</b><code>_.isNull(object)</code>
1433
+ <br />
1434
+ Returns <i>true</i> if the value of <b>object</b> is <i>null</i>.
1435
+ </p>
1436
+ <pre>
1437
+ _.isNull(null);
1438
+ =&gt; true
1439
+ _.isNull(undefined);
1440
+ =&gt; false
1441
+ </pre>
1442
+
1443
+ <p id="isUndefined">
1444
+ <b class="header">isUndefined</b><code>_.isUndefined(value)</code>
1445
+ <br />
1446
+ Returns <i>true</i> if <b>value</b> is <i>undefined</i>.
1447
+ </p>
1448
+ <pre>
1449
+ _.isUndefined(window.missingVariable);
1450
+ =&gt; true
1451
+ </pre>
1452
+
1453
+ <h2 id="utility">Utility Functions</h2>
1454
+
1455
+ <p id="noConflict">
1456
+ <b class="header">noConflict</b><code>_.noConflict()</code>
1457
+ <br />
1458
+ Give control of the "_" variable back to its previous owner. Returns
1459
+ a reference to the <b>Underscore</b> object.
1460
+ </p>
1461
+ <pre>
1462
+ var underscore = _.noConflict();</pre>
1463
+
1464
+ <p id="identity">
1465
+ <b class="header">identity</b><code>_.identity(value)</code>
1466
+ <br />
1467
+ Returns the same value that is used as the argument. In math:
1468
+ <tt>f(x) = x</tt><br />
1469
+ This function looks useless, but is used throughout Underscore as
1470
+ a default iterator.
1471
+ </p>
1472
+ <pre>
1473
+ var moe = {name : 'moe'};
1474
+ moe === _.identity(moe);
1475
+ =&gt; true</pre>
1476
+
1477
+ <p id="times">
1478
+ <b class="header">times</b><code>_.times(n, iterator, [context])</code>
1479
+ <br />
1480
+ Invokes the given iterator function <b>n</b> times. Each invocation of
1481
+ <b>iterator</b> is called with an <tt>index</tt> argument.
1482
+ <br />
1483
+ <i>Note: this example uses the <a href="#chaining">chaining syntax</a></i>.
1484
+ </p>
1485
+ <pre>
1486
+ _(3).times(function(n){ genie.grantWishNumber(n); });</pre>
1487
+
1488
+ <p id="random">
1489
+ <b class="header">random</b><code>_.random(min, max)</code>
1490
+ <br />
1491
+ Returns a random integer between <b>min</b> and <b>max</b>, inclusive.
1492
+ If you only pass one argument, it will return a number between <tt>0</tt>
1493
+ and that number.
1494
+ </p>
1495
+ <pre>
1496
+ _.random(0, 100);
1497
+ =&gt; 42</pre>
1498
+
1499
+ <p id="mixin">
1500
+ <b class="header">mixin</b><code>_.mixin(object)</code>
1501
+ <br />
1502
+ Allows you to extend Underscore with your own utility functions. Pass
1503
+ a hash of <tt>{name: function}</tt> definitions to have your functions
1504
+ added to the Underscore object, as well as the OOP wrapper.
1505
+ </p>
1506
+ <pre>
1507
+ _.mixin({
1508
+ capitalize : function(string) {
1509
+ return string.charAt(0).toUpperCase() + string.substring(1).toLowerCase();
1510
+ }
1511
+ });
1512
+ _("fabio").capitalize();
1513
+ =&gt; "Fabio"
1514
+ </pre>
1515
+
1516
+ <p id="uniqueId">
1517
+ <b class="header">uniqueId</b><code>_.uniqueId([prefix])</code>
1518
+ <br />
1519
+ Generate a globally-unique id for client-side models or DOM elements
1520
+ that need one. If <b>prefix</b> is passed, the id will be appended to it.
1521
+ </p>
1522
+ <pre>
1523
+ _.uniqueId('contact_');
1524
+ =&gt; 'contact_104'</pre>
1525
+
1526
+ <p id="escape">
1527
+ <b class="header">escape</b><code>_.escape(string)</code>
1528
+ <br />
1529
+ Escapes a string for insertion into HTML, replacing
1530
+ <tt>&amp;</tt>, <tt>&lt;</tt>, <tt>&gt;</tt>, <tt>&quot;</tt>, <tt>&#x27;</tt>, and <tt>&#x2F;</tt> characters.
1531
+ </p>
1532
+ <pre>
1533
+ _.escape('Curly, Larry &amp; Moe');
1534
+ =&gt; "Curly, Larry &amp;amp; Moe"</pre>
1535
+
1536
+ <p id="unescape">
1537
+ <b class="header">unescape</b><code>_.unescape(string)</code>
1538
+ <br />
1539
+ The opposite of <a href="#escape"><b>escape</b></a>, replaces
1540
+ <tt>&amp;amp;</tt>, <tt>&amp;lt;</tt>, <tt>&amp;gt;</tt>,
1541
+ <tt>&amp;quot;</tt>, <tt>&amp;#x27;</tt>, and <tt>&amp;#x2F;</tt>
1542
+ with their unescaped counterparts.
1543
+ </p>
1544
+ <pre>
1545
+ _.unescape('Curly, Larry &amp;amp; Moe');
1546
+ =&gt; "Curly, Larry &amp; Moe"</pre>
1547
+
1548
+ <p id="result">
1549
+ <b class="header">result</b><code>_.result(object, property)</code>
1550
+ <br />
1551
+ If the value of the named property is a function then invoke it; otherwise, return it.
1552
+ </p>
1553
+ <pre>
1554
+ var object = {cheese: 'crumpets', stuff: function(){ return 'nonsense'; }};
1555
+ _.result(object, 'cheese');
1556
+ =&gt; "crumpets"
1557
+ _.result(object, 'stuff');
1558
+ =&gt; "nonsense"</pre>
1559
+
1560
+ <p id="template">
1561
+ <b class="header">template</b><code>_.template(templateString, [data], [settings])</code>
1562
+ <br />
1563
+ Compiles JavaScript templates into functions that can be evaluated
1564
+ for rendering. Useful for rendering complicated bits of HTML from JSON
1565
+ data sources. Template functions can both interpolate variables, using
1566
+ <tt>&lt;%= &hellip; %&gt;</tt>, as well as execute arbitrary JavaScript code, with
1567
+ <tt>&lt;% &hellip; %&gt;</tt>. If you wish to interpolate a value, and have
1568
+ it be HTML-escaped, use <tt>&lt;%- &hellip; %&gt;</tt> When you evaluate a template function, pass in a
1569
+ <b>data</b> object that has properties corresponding to the template's free
1570
+ variables. If you're writing a one-off, you can pass the <b>data</b>
1571
+ object as the second parameter to <b>template</b> in order to render
1572
+ immediately instead of returning a template function. The <b>settings</b> argument
1573
+ should be a hash containing any <tt>_.templateSettings</tt> that should be overridden.
1574
+ </p>
1575
+
1576
+ <pre>
1577
+ var compiled = _.template("hello: &lt;%= name %&gt;");
1578
+ compiled({name : 'moe'});
1579
+ =&gt; "hello: moe"
1580
+
1581
+ var list = "&lt;% _.each(people, function(name) { %&gt; &lt;li&gt;&lt;%= name %&gt;&lt;/li&gt; &lt;% }); %&gt;";
1582
+ _.template(list, {people : ['moe', 'curly', 'larry']});
1583
+ =&gt; "&lt;li&gt;moe&lt;/li&gt;&lt;li&gt;curly&lt;/li&gt;&lt;li&gt;larry&lt;/li&gt;"
1584
+
1585
+ var template = _.template("&lt;b&gt;&lt;%- value %&gt;&lt;/b&gt;");
1586
+ template({value : '&lt;script&gt;'});
1587
+ =&gt; "&lt;b&gt;&amp;lt;script&amp;gt;&lt;/b&gt;"</pre>
1588
+
1589
+ <p>
1590
+ You can also use <tt>print</tt> from within JavaScript code. This is
1591
+ sometimes more convenient than using <tt>&lt;%= ... %&gt;</tt>.
1592
+ </p>
1593
+
1594
+ <pre>
1595
+ var compiled = _.template("&lt;% print('Hello ' + epithet); %&gt;");
1596
+ compiled({epithet: "stooge"});
1597
+ =&gt; "Hello stooge."</pre>
1598
+
1599
+ <p>
1600
+ If ERB-style delimiters aren't your cup of tea, you can change Underscore's
1601
+ template settings to use different symbols to set off interpolated code.
1602
+ Define an <b>interpolate</b> regex to match expressions that should be
1603
+ interpolated verbatim, an <b>escape</b> regex to match expressions that should
1604
+ be inserted after being HTML escaped, and an <b>evaluate</b> regex to match
1605
+ expressions that should be evaluated without insertion into the resulting
1606
+ string. You may define or omit any combination of the three.
1607
+ For example, to perform
1608
+ <a href="http://github.com/janl/mustache.js#readme">Mustache.js</a>
1609
+ style templating:
1610
+ </p>
1611
+
1612
+ <pre>
1613
+ _.templateSettings = {
1614
+ interpolate : /\{\{(.+?)\}\}/g
1615
+ };
1616
+
1617
+ var template = _.template("Hello {{ name }}!");
1618
+ template({name : "Mustache"});
1619
+ =&gt; "Hello Mustache!"</pre>
1620
+
1621
+ <p>
1622
+ By default, <b>template</b> places the values from your data in the local scope
1623
+ via the <tt>with</tt> statement. However, you can specify a single variable name
1624
+ with the <b>variable</b> setting. This can significantly improve the speed
1625
+ at which a template is able to render.
1626
+ </p>
1627
+
1628
+ <pre>
1629
+ _.template("Using 'with': <%= data.answer %>", {answer: 'no'}, {variable: 'data'});
1630
+ =&gt; "Using 'with': no"</pre>
1631
+
1632
+ <p>
1633
+ Precompiling your templates can be a big help when debugging errors you can't
1634
+ reproduce. This is because precompiled templates can provide line numbers and
1635
+ a stack trace, something that is not possible when compiling templates on the client.
1636
+ The <b>source</b> property is available on the compiled template
1637
+ function for easy precompilation.
1638
+ </p>
1639
+
1640
+ <pre>&lt;script&gt;
1641
+ JST.project = <%= _.template(jstText).source %>;
1642
+ &lt;/script&gt;</pre>
1643
+
1644
+
1645
+ <h2 id="chaining">Chaining</h2>
1646
+
1647
+ <p>
1648
+ You can use Underscore in either an object-oriented or a functional style,
1649
+ depending on your preference. The following two lines of code are
1650
+ identical ways to double a list of numbers.
1651
+ </p>
1652
+
1653
+ <pre>
1654
+ _.map([1, 2, 3], function(n){ return n * 2; });
1655
+ _([1, 2, 3]).map(function(n){ return n * 2; });</pre>
1656
+
1657
+ <p>
1658
+ Calling <tt>chain</tt> will cause all future method calls to return
1659
+ wrapped objects. When you've finished the computation, use
1660
+ <tt>value</tt> to retrieve the final value. Here's an example of chaining
1661
+ together a <b>map/flatten/reduce</b>, in order to get the word count of
1662
+ every word in a song.
1663
+ </p>
1664
+
1665
+ <pre>
1666
+ var lyrics = [
1667
+ {line : 1, words : "I'm a lumberjack and I'm okay"},
1668
+ {line : 2, words : "I sleep all night and I work all day"},
1669
+ {line : 3, words : "He's a lumberjack and he's okay"},
1670
+ {line : 4, words : "He sleeps all night and he works all day"}
1671
+ ];
1672
+
1673
+ _.chain(lyrics)
1674
+ .map(function(line) { return line.words.split(' '); })
1675
+ .flatten()
1676
+ .reduce(function(counts, word) {
1677
+ counts[word] = (counts[word] || 0) + 1;
1678
+ return counts;
1679
+ }, {})
1680
+ .value();
1681
+
1682
+ =&gt; {lumberjack : 2, all : 4, night : 2 ... }</pre>
1683
+
1684
+ <p>
1685
+ In addition, the
1686
+ <a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/prototype">Array prototype's methods</a>
1687
+ are proxied through the chained Underscore object, so you can slip a
1688
+ <tt>reverse</tt> or a <tt>push</tt> into your chain, and continue to
1689
+ modify the array.
1690
+ </p>
1691
+
1692
+ <p id="chain">
1693
+ <b class="header">chain</b><code>_.chain(obj)</code>
1694
+ <br />
1695
+ Returns a wrapped object. Calling methods on this object will continue
1696
+ to return wrapped objects until <tt>value</tt> is used.
1697
+ </p>
1698
+ <pre>
1699
+ var stooges = [{name : 'curly', age : 25}, {name : 'moe', age : 21}, {name : 'larry', age : 23}];
1700
+ var youngest = _.chain(stooges)
1701
+ .sortBy(function(stooge){ return stooge.age; })
1702
+ .map(function(stooge){ return stooge.name + ' is ' + stooge.age; })
1703
+ .first()
1704
+ .value();
1705
+ =&gt; "moe is 21"
1706
+ </pre>
1707
+
1708
+ <p id="value">
1709
+ <b class="header">value</b><code>_(obj).value()</code>
1710
+ <br />
1711
+ Extracts the value of a wrapped object.
1712
+ </p>
1713
+ <pre>
1714
+ _([1, 2, 3]).value();
1715
+ =&gt; [1, 2, 3]
1716
+ </pre>
1717
+
1718
+ <h2 id="links">Links &amp; Suggested Reading</h2>
1719
+
1720
+ <p>
1721
+ The Underscore documentation is also available in
1722
+ <a href="http://learning.github.com/underscore/">Simplified Chinese</a>.
1723
+ </p>
1724
+
1725
+ <p>
1726
+ <a href="http://mirven.github.com/underscore.lua/">Underscore.lua</a>,
1727
+ a Lua port of the functions that are applicable in both languages.
1728
+ Includes OOP-wrapping and chaining.
1729
+ (<a href="http://github.com/mirven/underscore.lua">source</a>)
1730
+ </p>
1731
+
1732
+ <p>
1733
+ <a href="http://underscorem.org">Underscore.m</a>, an Objective-C port
1734
+ of many of the Underscore.js functions, using a syntax that encourages
1735
+ chaining.
1736
+ (<a href="https://github.com/robb/Underscore.m">source</a>)
1737
+ </p>
1738
+
1739
+ <p>
1740
+ <a href="http://kmalakoff.github.com/_.m/">_.m</a>, an alternative
1741
+ Objective-C port that tries to stick a little closer to the original
1742
+ Underscore.js API.
1743
+ (<a href="https://github.com/kmalakoff/_.m">source</a>)
1744
+ </p>
1745
+
1746
+ <p>
1747
+ <a href="http://brianhaveri.github.com/Underscore.php/">Underscore.php</a>,
1748
+ a PHP port of the functions that are applicable in both languages.
1749
+ Includes OOP-wrapping and chaining.
1750
+ (<a href="http://github.com/brianhaveri/Underscore.php">source</a>)
1751
+ </p>
1752
+
1753
+ <p>
1754
+ <a href="http://vti.github.com/underscore-perl/">Underscore-perl</a>,
1755
+ a Perl port of many of the Underscore.js functions,
1756
+ aimed at on Perl hashes and arrays.
1757
+ (<a href="https://github.com/vti/underscore-perl/">source</a>)
1758
+ </p>
1759
+
1760
+ <p>
1761
+ <a href="http://russplaysguitar.github.com/UnderscoreCF/">Underscore.cfc</a>,
1762
+ a Coldfusion port of many of the Underscore.js functions.
1763
+ (<a href="https://github.com/russplaysguitar/underscorecf">source</a>)
1764
+ </p>
1765
+
1766
+ <p>
1767
+ <a href="https://github.com/edtsech/underscore.string">Underscore.string</a>,
1768
+ an Underscore extension that adds functions for string-manipulation:
1769
+ <tt>trim</tt>, <tt>startsWith</tt>, <tt>contains</tt>, <tt>capitalize</tt>,
1770
+ <tt>reverse</tt>, <tt>sprintf</tt>, and more.
1771
+ </p>
1772
+
1773
+ <p>
1774
+ Ruby's <a href="http://ruby-doc.org/core/classes/Enumerable.html">Enumerable</a> module.
1775
+ </p>
1776
+
1777
+ <p>
1778
+ <a href="http://www.prototypejs.org/">Prototype.js</a>, which provides
1779
+ JavaScript with collection functions in the manner closest to Ruby's Enumerable.
1780
+ </p>
1781
+
1782
+ <p>
1783
+ Oliver Steele's
1784
+ <a href="http://osteele.com/sources/javascript/functional/">Functional JavaScript</a>,
1785
+ which includes comprehensive higher-order function support as well as string lambdas.
1786
+ </p>
1787
+
1788
+ <p>
1789
+ Michael Aufreiter's <a href="http://github.com/michael/data">Data.js</a>,
1790
+ a data manipulation + persistence library for JavaScript.
1791
+ </p>
1792
+
1793
+ <p>
1794
+ Python's <a href="http://docs.python.org/library/itertools.html">itertools</a>.
1795
+ </p>
1796
+
1797
+ <h2 id="changelog">Change Log</h2>
1798
+
1799
+ <p>
1800
+ <b class="header">1.4.4</b> &mdash; <small><i>Jan. 30, 2013</i></small> &mdash; <a href="https://github.com/documentcloud/underscore/compare/1.4.3...1.4.4">Diff</a><br />
1801
+ <ul>
1802
+ <li>
1803
+ Added <tt>_.findWhere</tt>, for finding the first element in a list
1804
+ that matches a particular set of keys and values.
1805
+ </li>
1806
+ <li>
1807
+ Added <tt>_.partial</tt>, for partially applying a function <i>without</i>
1808
+ changing its dynamic reference to <tt>this</tt>.
1809
+ </li>
1810
+ <li>
1811
+ Simplified <tt>bind</tt> by removing some edge cases involving
1812
+ constructor functions. In short: don't <tt>_.bind</tt> your
1813
+ constructors.
1814
+ </li>
1815
+ <li>
1816
+ A minor optimization to <tt>invoke</tt>.
1817
+ </li>
1818
+ <li>
1819
+ Fix bug in the minified version due to the minifier incorrectly
1820
+ optimizing-away <tt>isFunction</tt>.
1821
+ </li>
1822
+ </ul>
1823
+ </p>
1824
+
1825
+ <p>
1826
+ <b class="header">1.4.3</b> &mdash; <small><i>Dec. 4, 2012</i></small> &mdash; <a href="https://github.com/documentcloud/underscore/compare/1.4.2...1.4.3">Diff</a><br />
1827
+ <ul>
1828
+ <li>
1829
+ Improved Underscore compatibility with Adobe's JS engine that can be
1830
+ used to script Illustrator, Photoshop, and friends.
1831
+ </li>
1832
+ <li>
1833
+ Added a default <tt>_.identity</tt> iterator to <tt>countBy</tt> and
1834
+ <tt>groupBy</tt>.
1835
+ </li>
1836
+ <li>
1837
+ The <tt>uniq</tt> function can now take <tt>array, iterator, context</tt>
1838
+ as the argument list.
1839
+ </li>
1840
+ <li>
1841
+ The <tt>times</tt> function now returns the mapped array of iterator
1842
+ results.
1843
+ </li>
1844
+ <li>
1845
+ Simplified and fixed bugs in <tt>throttle</tt>.
1846
+ </li>
1847
+ </ul>
1848
+ </p>
1849
+
1850
+ <p>
1851
+ <b class="header">1.4.2</b> &mdash; <small><i>Oct. 1, 2012</i></small> &mdash; <a href="https://github.com/documentcloud/underscore/compare/1.4.1...1.4.2">Diff</a><br />
1852
+ <ul>
1853
+ <li>
1854
+ For backwards compatibility, returned to pre-1.4.0 behavior when
1855
+ passing <tt>null</tt> to iteration functions. They now become no-ops
1856
+ again.
1857
+ </li>
1858
+ </ul>
1859
+ </p>
1860
+
1861
+ <p>
1862
+ <b class="header">1.4.1</b> &mdash; <small><i>Oct. 1, 2012</i></small> &mdash; <a href="https://github.com/documentcloud/underscore/compare/1.4.0...1.4.1">Diff</a><br />
1863
+ <ul>
1864
+ <li>
1865
+ Fixed a 1.4.0 regression in the <tt>lastIndexOf</tt> function.
1866
+ </li>
1867
+ </ul>
1868
+ </p>
1869
+
1870
+ <p>
1871
+ <b class="header">1.4.0</b> &mdash; <small><i>Sept. 27, 2012</i></small> &mdash; <a href="https://github.com/documentcloud/underscore/compare/1.3.3...1.4.0">Diff</a><br />
1872
+ <ul>
1873
+ <li>
1874
+ Added a <tt>pairs</tt> function, for turning a JavaScript object
1875
+ into <tt>[key, value]</tt> pairs ... as well as an <tt>object</tt>
1876
+ function, for converting an array of <tt>[key, value]</tt> pairs
1877
+ into an object.
1878
+ </li>
1879
+ <li>
1880
+ Added a <tt>countBy</tt> function, for counting the number of objects
1881
+ in a list that match a certain criteria.
1882
+ </li>
1883
+ <li>
1884
+ Added an <tt>invert</tt> function, for performing a simple inversion
1885
+ of the keys and values in an object.
1886
+ </li>
1887
+ <li>
1888
+ Added a <tt>where</tt> function, for easy cases of filtering a list
1889
+ for objects with specific values.
1890
+ </li>
1891
+ <li>
1892
+ Added an <tt>omit</tt> function, for filtering an object to remove
1893
+ certain keys.
1894
+ </li>
1895
+ <li>
1896
+ Added a <tt>random</tt> function, to return a random number in a
1897
+ given range.
1898
+ </li>
1899
+ <li>
1900
+ <tt>_.debounce</tt>'d functions now return their last updated value,
1901
+ just like <tt>_.throttle</tt>'d functions do.
1902
+ </li>
1903
+ <li>
1904
+ The <tt>sortBy</tt> function now runs a stable sort algorithm.
1905
+ </li>
1906
+ <li>
1907
+ Added the optional <tt>fromIndex</tt> option to <tt>indexOf</tt> and
1908
+ <tt>lastIndexOf</tt>.
1909
+ </li>
1910
+ <li>
1911
+ "Sparse" arrays are no longer supported in Underscore iteration
1912
+ functions. Use a <tt>for</tt> loop instead (or better yet, an object).
1913
+ </li>
1914
+ <li>
1915
+ The <tt>min</tt> and <tt>max</tt> functions may now be called on
1916
+ <i>very</i> large arrays.
1917
+ </li>
1918
+ <li>
1919
+ Interpolation in templates now represents <tt>null</tt> and
1920
+ <tt>undefined</tt> as the empty string.
1921
+ </li>
1922
+ <li>
1923
+ <del>Underscore iteration functions no longer accept <tt>null</tt> values
1924
+ as a no-op argument. You'll get an early error instead.</del>
1925
+ </li>
1926
+ <li>
1927
+ A number of edge-cases fixes and tweaks, which you can spot in the
1928
+ <a href="https://github.com/documentcloud/underscore/compare/1.3.3...1.4.0">diff</a>.
1929
+ Depending on how you're using Underscore, <b>1.4.0</b> may be more
1930
+ backwards-incompatible than usual &mdash; please test when you upgrade.
1931
+ </li>
1932
+ </ul>
1933
+ </p>
1934
+
1935
+ <p>
1936
+ <b class="header">1.3.3</b> &mdash; <small><i>April 10, 2012</i></small><br />
1937
+ <ul>
1938
+ <li>
1939
+ Many improvements to <tt>_.template</tt>, which now provides the
1940
+ <tt>source</tt> of the template function as a property, for potentially
1941
+ even more efficient pre-compilation on the server-side. You may now
1942
+ also set the <tt>variable</tt> option when creating a template,
1943
+ which will cause your passed-in data to be made available under the
1944
+ variable you named, instead of using a <tt>with</tt> statement &mdash;
1945
+ significantly improving the speed of rendering the template.
1946
+ </li>
1947
+ <li>
1948
+ Added the <tt>pick</tt> function, which allows you to filter an
1949
+ object literal with a whitelist of allowed property names.
1950
+ </li>
1951
+ <li>
1952
+ Added the <tt>result</tt> function, for convenience when working
1953
+ with APIs that allow either functions or raw properties.
1954
+ </li>
1955
+ <li>
1956
+ Added the <tt>isFinite</tt> function, because sometimes knowing that
1957
+ a value is a number just ain't quite enough.
1958
+ </li>
1959
+ <li>
1960
+ The <tt>sortBy</tt> function may now also be passed the string name
1961
+ of a property to use as the sort order on each object.
1962
+ </li>
1963
+ <li>
1964
+ Fixed <tt>uniq</tt> to work with sparse arrays.
1965
+ </li>
1966
+ <li>
1967
+ The <tt>difference</tt> function now performs a shallow flatten
1968
+ instead of a deep one when computing array differences.
1969
+ </li>
1970
+ <li>
1971
+ The <tt>debounce</tt> function now takes an <tt>immediate</tt>
1972
+ parameter, which will cause the callback to fire on the leading
1973
+ instead of the trailing edge.
1974
+ </li>
1975
+ </ul>
1976
+ </p>
1977
+
1978
+ <p>
1979
+ <b class="header">1.3.1</b> &mdash; <small><i>Jan. 23, 2012</i></small><br />
1980
+ <ul>
1981
+ <li>
1982
+ Added an <tt>_.has</tt> function, as a safer way to use <tt>hasOwnProperty</tt>.
1983
+ </li>
1984
+ <li>
1985
+ Added <tt>_.collect</tt> as an alias for <tt>_.map</tt>. Smalltalkers, rejoice.
1986
+ </li>
1987
+ <li>
1988
+ Reverted an old change so that <tt>_.extend</tt> will correctly copy
1989
+ over keys with undefined values again.
1990
+ </li>
1991
+ <li>
1992
+ Bugfix to stop escaping slashes within interpolations in <tt>_.template</tt>.
1993
+ </li>
1994
+ </ul>
1995
+ </p>
1996
+
1997
+ <p>
1998
+ <b class="header">1.3.0</b> &mdash; <small><i>Jan. 11, 2012</i></small><br />
1999
+ <ul>
2000
+ <li>
2001
+ Removed AMD (RequireJS) support from Underscore. If you'd like to use
2002
+ Underscore with RequireJS, you can load it as a normal script, wrap
2003
+ or patch your copy, or download a forked version.
2004
+ </li>
2005
+ </ul>
2006
+ </p>
2007
+
2008
+ <p>
2009
+ <b class="header">1.2.4</b> &mdash; <small><i>Jan. 4, 2012</i></small><br />
2010
+ <ul>
2011
+ <li>
2012
+ You now can (and probably should, as it's simpler)
2013
+ write <tt>_.chain(list)</tt>
2014
+ instead of <tt>_(list).chain()</tt>.
2015
+ </li>
2016
+ <li>
2017
+ Fix for escaped characters in Underscore templates, and for supporting
2018
+ customizations of <tt>_.templateSettings</tt> that only define one or
2019
+ two of the required regexes.
2020
+ </li>
2021
+ <li>
2022
+ Fix for passing an array as the first argument to an <tt>_.wrap</tt>'d function.
2023
+ </li>
2024
+ <li>
2025
+ Improved compatibility with ClojureScript, which adds a <tt>call</tt>
2026
+ function to <tt>String.prototype</tt>.
2027
+ </li>
2028
+ </ul>
2029
+ </p>
2030
+
2031
+ <p>
2032
+ <b class="header">1.2.3</b> &mdash; <small><i>Dec. 7, 2011</i></small><br />
2033
+ <ul>
2034
+ <li>
2035
+ Dynamic scope is now preserved for compiled <tt>_.template</tt> functions,
2036
+ so you can use the value of <tt>this</tt> if you like.
2037
+ </li>
2038
+ <li>
2039
+ Sparse array support of <tt>_.indexOf</tt>, <tt>_.lastIndexOf</tt>.
2040
+ </li>
2041
+ <li>
2042
+ Both <tt>_.reduce</tt> and <tt>_.reduceRight</tt> can now be passed an
2043
+ explicitly <tt>undefined</tt> value. (There's no reason why you'd
2044
+ want to do this.)
2045
+ </li>
2046
+ </ul>
2047
+ </p>
2048
+
2049
+ <p>
2050
+ <b class="header">1.2.2</b> &mdash; <small><i>Nov. 14, 2011</i></small><br />
2051
+ <ul>
2052
+ <li>
2053
+ Continued tweaks to <tt>_.isEqual</tt> semantics. Now JS primitives are
2054
+ considered equivalent to their wrapped versions, and arrays are compared
2055
+ by their numeric properties only <small>(#351)</small>.
2056
+ </li>
2057
+ <li>
2058
+ <tt>_.escape</tt> no longer tries to be smart about not double-escaping
2059
+ already-escaped HTML entities. Now it just escapes regardless <small>(#350)</small>.
2060
+ </li>
2061
+ <li>
2062
+ In <tt>_.template</tt>, you may now leave semicolons out of evaluated
2063
+ statements if you wish: <tt>&lt;% }) %&gt;</tt> <small>(#369)</small>.
2064
+ </li>
2065
+ <li>
2066
+ <tt>_.after(callback, 0)</tt> will now trigger the callback immediately,
2067
+ making "after" easier to use with asynchronous APIs <small>(#366)</small>.
2068
+ </li>
2069
+ </ul>
2070
+ </p>
2071
+
2072
+ <p>
2073
+ <b class="header">1.2.1</b> &mdash; <small><i>Oct. 24, 2011</i></small><br />
2074
+ <ul>
2075
+ <li>
2076
+ Several important bug fixes for <tt>_.isEqual</tt>, which should now
2077
+ do better on mutated Arrays, and on non-Array objects with
2078
+ <tt>length</tt> properties. <small>(#329)</small>
2079
+ </li>
2080
+ <li>
2081
+ <b>jrburke</b> contributed Underscore exporting for AMD module loaders,
2082
+ and <b>tonylukasavage</b> for Appcelerator Titanium.
2083
+ <small>(#335, #338)</small>
2084
+ </li>
2085
+ <li>
2086
+ You can now <tt>_.groupBy(list, 'property')</tt> as a shortcut for
2087
+ grouping values by a particular common property.
2088
+ </li>
2089
+ <li>
2090
+ <tt>_.throttle</tt>'d functions now fire immediately upon invocation,
2091
+ and are rate-limited thereafter <small>(#170, #266)</small>.
2092
+ </li>
2093
+ <li>
2094
+ Most of the <tt>_.is[Type]</tt> checks no longer ducktype.
2095
+ </li>
2096
+ <li>
2097
+ The <tt>_.bind</tt> function now also works on constructors, a-la
2098
+ ES5 ... but you would never want to use <tt>_.bind</tt> on a
2099
+ constructor function.
2100
+ </li>
2101
+ <li>
2102
+ <tt>_.clone</tt> no longer wraps non-object types in Objects.
2103
+ </li>
2104
+ <li>
2105
+ <tt>_.find</tt> and <tt>_.filter</tt> are now the preferred names for
2106
+ <tt>_.detect</tt> and <tt>_.select</tt>.
2107
+ </li>
2108
+ </ul>
2109
+ </p>
2110
+
2111
+ <p>
2112
+ <b class="header">1.2.0</b> &mdash; <small><i>Oct. 5, 2011</i></small><br />
2113
+ <ul>
2114
+ <li>
2115
+ The <tt>_.isEqual</tt> function now
2116
+ supports true deep equality comparisons, with checks for cyclic structures,
2117
+ thanks to Kit Cambridge.
2118
+ </li>
2119
+ <li>
2120
+ Underscore templates now support HTML escaping interpolations, using
2121
+ <tt>&lt;%- ... %&gt;</tt> syntax.
2122
+ </li>
2123
+ <li>
2124
+ Ryan Tenney contributed <tt>_.shuffle</tt>, which uses a modified
2125
+ Fisher-Yates to give you a shuffled copy of an array.
2126
+ </li>
2127
+ <li>
2128
+ <tt>_.uniq</tt> can now be passed an optional iterator, to determine by
2129
+ what criteria an object should be considered unique.
2130
+ </li>
2131
+ <li>
2132
+ <tt>_.last</tt> now takes an optional argument which will return the last
2133
+ N elements of the list.
2134
+ </li>
2135
+ <li>
2136
+ A new <tt>_.initial</tt> function was added, as a mirror of <tt>_.rest</tt>,
2137
+ which returns all the initial values of a list (except the last N).
2138
+ </li>
2139
+ </ul>
2140
+ </p>
2141
+
2142
+ <p>
2143
+ <b class="header">1.1.7</b> &mdash; <small><i>July 13, 2011</i></small><br />
2144
+ Added <tt>_.groupBy</tt>, which aggregates a collection into groups of like items.
2145
+ Added <tt>_.union</tt> and <tt>_.difference</tt>, to complement the
2146
+ (re-named) <tt>_.intersection</tt>.
2147
+ Various improvements for support of sparse arrays.
2148
+ <tt>_.toArray</tt> now returns a clone, if directly passed an array.
2149
+ <tt>_.functions</tt> now also returns the names of functions that are present
2150
+ in the prototype chain.
2151
+ </p>
2152
+
2153
+ <p>
2154
+ <b class="header">1.1.6</b> &mdash; <small><i>April 18, 2011</i></small><br />
2155
+ Added <tt>_.after</tt>, which will return a function that only runs after
2156
+ first being called a specified number of times.
2157
+ <tt>_.invoke</tt> can now take a direct function reference.
2158
+ <tt>_.every</tt> now requires an iterator function to be passed, which
2159
+ mirrors the ECMA5 API.
2160
+ <tt>_.extend</tt> no longer copies keys when the value is undefined.
2161
+ <tt>_.bind</tt> now errors when trying to bind an undefined value.
2162
+ </p>
2163
+
2164
+ <p>
2165
+ <b class="header">1.1.5</b> &mdash; <small><i>Mar 20, 2011</i></small><br />
2166
+ Added an <tt>_.defaults</tt> function, for use merging together JS objects
2167
+ representing default options.
2168
+ Added an <tt>_.once</tt> function, for manufacturing functions that should
2169
+ only ever execute a single time.
2170
+ <tt>_.bind</tt> now delegates to the native ECMAScript 5 version,
2171
+ where available.
2172
+ <tt>_.keys</tt> now throws an error when used on non-Object values, as in
2173
+ ECMAScript 5.
2174
+ Fixed a bug with <tt>_.keys</tt> when used over sparse arrays.
2175
+ </p>
2176
+
2177
+ <p>
2178
+ <b class="header">1.1.4</b> &mdash; <small><i>Jan 9, 2011</i></small><br />
2179
+ Improved compliance with ES5's Array methods when passing <tt>null</tt>
2180
+ as a value. <tt>_.wrap</tt> now correctly sets <tt>this</tt> for the
2181
+ wrapped function. <tt>_.indexOf</tt> now takes an optional flag for
2182
+ finding the insertion index in an array that is guaranteed to already
2183
+ be sorted. Avoiding the use of <tt>.callee</tt>, to allow <tt>_.isArray</tt>
2184
+ to work properly in ES5's strict mode.
2185
+ </p>
2186
+
2187
+ <p>
2188
+ <b class="header">1.1.3</b> &mdash; <small><i>Dec 1, 2010</i></small><br />
2189
+ In CommonJS, Underscore may now be required with just: <br />
2190
+ <tt>var _ = require("underscore")</tt>.
2191
+ Added <tt>_.throttle</tt> and <tt>_.debounce</tt> functions.
2192
+ Removed <tt>_.breakLoop</tt>, in favor of an ECMA5-style un-<i>break</i>-able
2193
+ each implementation &mdash; this removes the try/catch, and you'll now have
2194
+ better stack traces for exceptions that are thrown within an Underscore iterator.
2195
+ Improved the <b>isType</b> family of functions for better interoperability
2196
+ with Internet Explorer host objects.
2197
+ <tt>_.template</tt> now correctly escapes backslashes in templates.
2198
+ Improved <tt>_.reduce</tt> compatibility with the ECMA5 version:
2199
+ if you don't pass an initial value, the first item in the collection is used.
2200
+ <tt>_.each</tt> no longer returns the iterated collection, for improved
2201
+ consistency with ES5's <tt>forEach</tt>.
2202
+ </p>
2203
+
2204
+ <p>
2205
+ <b class="header">1.1.2</b><br />
2206
+ Fixed <tt>_.contains</tt>, which was mistakenly pointing at
2207
+ <tt>_.intersect</tt> instead of <tt>_.include</tt>, like it should
2208
+ have been. Added <tt>_.unique</tt> as an alias for <tt>_.uniq</tt>.
2209
+ </p>
2210
+
2211
+ <p>
2212
+ <b class="header">1.1.1</b><br />
2213
+ Improved the speed of <tt>_.template</tt>, and its handling of multiline
2214
+ interpolations. Ryan Tenney contributed optimizations to many Underscore
2215
+ functions. An annotated version of the source code is now available.
2216
+ </p>
2217
+
2218
+ <p>
2219
+ <b class="header">1.1.0</b><br />
2220
+ The method signature of <tt>_.reduce</tt> has been changed to match
2221
+ the ECMAScript 5 signature, instead of the Ruby/Prototype.js version.
2222
+ This is a backwards-incompatible change. <tt>_.template</tt> may now be
2223
+ called with no arguments, and preserves whitespace. <tt>_.contains</tt>
2224
+ is a new alias for <tt>_.include</tt>.
2225
+ </p>
2226
+
2227
+ <p>
2228
+ <b class="header">1.0.4</b><br />
2229
+ <a href="http://themoell.com/">Andri Möll</a> contributed the <tt>_.memoize</tt>
2230
+ function, which can be used to speed up expensive repeated computations
2231
+ by caching the results.
2232
+ </p>
2233
+
2234
+ <p>
2235
+ <b class="header">1.0.3</b><br />
2236
+ Patch that makes <tt>_.isEqual</tt> return <tt>false</tt> if any property
2237
+ of the compared object has a <tt>NaN</tt> value. Technically the correct
2238
+ thing to do, but of questionable semantics. Watch out for NaN comparisons.
2239
+ </p>
2240
+
2241
+ <p>
2242
+ <b class="header">1.0.2</b><br />
2243
+ Fixes <tt>_.isArguments</tt> in recent versions of Opera, which have
2244
+ arguments objects as real Arrays.
2245
+ </p>
2246
+
2247
+ <p>
2248
+ <b class="header">1.0.1</b><br />
2249
+ Bugfix for <tt>_.isEqual</tt>, when comparing two objects with the same
2250
+ number of undefined keys, but with different names.
2251
+ </p>
2252
+
2253
+ <p>
2254
+ <b class="header">1.0.0</b><br />
2255
+ Things have been stable for many months now, so Underscore is now
2256
+ considered to be out of beta, at <b>1.0</b>. Improvements since <b>0.6</b>
2257
+ include <tt>_.isBoolean</tt>, and the ability to have <tt>_.extend</tt>
2258
+ take multiple source objects.
2259
+ </p>
2260
+
2261
+ <p>
2262
+ <b class="header">0.6.0</b><br />
2263
+ Major release. Incorporates a number of
2264
+ <a href="http://github.com/ratbeard">Mile Frawley's</a> refactors for
2265
+ safer duck-typing on collection functions, and cleaner internals. A new
2266
+ <tt>_.mixin</tt> method that allows you to extend Underscore with utility
2267
+ functions of your own. Added <tt>_.times</tt>, which works the same as in
2268
+ Ruby or Prototype.js. Native support for ECMAScript 5's <tt>Array.isArray</tt>,
2269
+ and <tt>Object.keys</tt>.
2270
+ </p>
2271
+
2272
+ <p>
2273
+ <b class="header">0.5.8</b><br />
2274
+ Fixed Underscore's collection functions to work on
2275
+ <a href="https://developer.mozilla.org/En/DOM/NodeList">NodeLists</a> and
2276
+ <a href="https://developer.mozilla.org/En/DOM/HTMLCollection">HTMLCollections</a>
2277
+ once more, thanks to
2278
+ <a href="http://github.com/jmtulloss">Justin Tulloss</a>.
2279
+ </p>
2280
+
2281
+ <p>
2282
+ <b class="header">0.5.7</b><br />
2283
+ A safer implementation of <tt>_.isArguments</tt>, and a
2284
+ faster <tt>_.isNumber</tt>,<br />thanks to
2285
+ <a href="http://jedschmidt.com/">Jed Schmidt</a>.
2286
+ </p>
2287
+
2288
+ <p>
2289
+ <b class="header">0.5.6</b><br />
2290
+ Customizable delimiters for <tt>_.template</tt>, contributed by
2291
+ <a href="http://github.com/iamnoah">Noah Sloan</a>.
2292
+ </p>
2293
+
2294
+ <p>
2295
+ <b class="header">0.5.5</b><br />
2296
+ Fix for a bug in MobileSafari's OOP-wrapper, with the arguments object.
2297
+ </p>
2298
+
2299
+ <p>
2300
+ <b class="header">0.5.4</b><br />
2301
+ Fix for multiple single quotes within a template string for
2302
+ <tt>_.template</tt>. See:
2303
+ <a href="http://www.west-wind.com/Weblog/posts/509108.aspx">Rick Strahl's blog post</a>.
2304
+ </p>
2305
+
2306
+ <p>
2307
+ <b class="header">0.5.2</b><br />
2308
+ New implementations of <tt>isArray</tt>, <tt>isDate</tt>, <tt>isFunction</tt>,
2309
+ <tt>isNumber</tt>, <tt>isRegExp</tt>, and <tt>isString</tt>, thanks to
2310
+ a suggestion from
2311
+ <a href="http://www.broofa.com/">Robert Kieffer</a>.
2312
+ Instead of doing <tt>Object#toString</tt>
2313
+ comparisons, they now check for expected properties, which is less safe,
2314
+ but more than an order of magnitude faster. Most other Underscore
2315
+ functions saw minor speed improvements as a result.
2316
+ <a href="http://dolzhenko.org/">Evgeniy Dolzhenko</a>
2317
+ contributed <tt>_.tap</tt>,
2318
+ <a href="http://ruby-doc.org/core-1.9/classes/Object.html#M000191">similar to Ruby 1.9's</a>,
2319
+ which is handy for injecting side effects (like logging) into chained calls.
2320
+ </p>
2321
+
2322
+ <p>
2323
+ <b class="header">0.5.1</b><br />
2324
+ Added an <tt>_.isArguments</tt> function. Lots of little safety checks
2325
+ and optimizations contributed by
2326
+ <a href="http://github.com/iamnoah/">Noah Sloan</a> and
2327
+ <a href="http://themoell.com/">Andri Möll</a>.
2328
+ </p>
2329
+
2330
+ <p>
2331
+ <b class="header">0.5.0</b><br />
2332
+ <b>[API Changes]</b> <tt>_.bindAll</tt> now takes the context object as
2333
+ its first parameter. If no method names are passed, all of the context
2334
+ object's methods are bound to it, enabling chaining and easier binding.
2335
+ <tt>_.functions</tt> now takes a single argument and returns the names
2336
+ of its Function properties. Calling <tt>_.functions(_)</tt> will get you
2337
+ the previous behavior.
2338
+ Added <tt>_.isRegExp</tt> so that <tt>isEqual</tt> can now test for RegExp equality.
2339
+ All of the "is" functions have been shrunk down into a single definition.
2340
+ <a href="http://github.com/grayrest/">Karl Guertin</a> contributed patches.
2341
+ </p>
2342
+
2343
+ <p>
2344
+ <b class="header">0.4.7</b><br />
2345
+ Added <tt>isDate</tt>, <tt>isNaN</tt>, and <tt>isNull</tt>, for completeness.
2346
+ Optimizations for <tt>isEqual</tt> when checking equality between Arrays
2347
+ or Dates. <tt>_.keys</tt> is now <small><i><b>25%&ndash;2X</b></i></small> faster (depending on your
2348
+ browser) which speeds up the functions that rely on it, such as <tt>_.each</tt>.
2349
+ </p>
2350
+
2351
+ <p>
2352
+ <b class="header">0.4.6</b><br />
2353
+ Added the <tt>range</tt> function, a port of the
2354
+ <a href="http://docs.python.org/library/functions.html#range">Python
2355
+ function of the same name</a>, for generating flexibly-numbered lists
2356
+ of integers. Original patch contributed by
2357
+ <a href="http://github.com/kylichuku">Kirill Ishanov</a>.
2358
+ </p>
2359
+
2360
+ <p>
2361
+ <b class="header">0.4.5</b><br />
2362
+ Added <tt>rest</tt> for Arrays and arguments objects, and aliased
2363
+ <tt>first</tt> as <tt>head</tt>, and <tt>rest</tt> as <tt>tail</tt>,
2364
+ thanks to <a href="http://github.com/lukesutton/">Luke Sutton</a>'s patches.
2365
+ Added tests ensuring that all Underscore Array functions also work on
2366
+ <i>arguments</i> objects.
2367
+ </p>
2368
+
2369
+ <p>
2370
+ <b class="header">0.4.4</b><br />
2371
+ Added <tt>isString</tt>, and <tt>isNumber</tt>, for consistency. Fixed
2372
+ <tt>_.isEqual(NaN, NaN)</tt> to return <i>true</i> (which is debatable).
2373
+ </p>
2374
+
2375
+ <p>
2376
+ <b class="header">0.4.3</b><br />
2377
+ Started using the native <tt>StopIteration</tt> object in browsers that support it.
2378
+ Fixed Underscore setup for CommonJS environments.
2379
+ </p>
2380
+
2381
+ <p>
2382
+ <b class="header">0.4.2</b><br />
2383
+ Renamed the unwrapping function to <tt>value</tt>, for clarity.
2384
+ </p>
2385
+
2386
+ <p>
2387
+ <b class="header">0.4.1</b><br />
2388
+ Chained Underscore objects now support the Array prototype methods, so
2389
+ that you can perform the full range of operations on a wrapped array
2390
+ without having to break your chain. Added a <tt>breakLoop</tt> method
2391
+ to <b>break</b> in the middle of any Underscore iteration. Added an
2392
+ <tt>isEmpty</tt> function that works on arrays and objects.
2393
+ </p>
2394
+
2395
+ <p>
2396
+ <b class="header">0.4.0</b><br />
2397
+ All Underscore functions can now be called in an object-oriented style,
2398
+ like so: <tt>_([1, 2, 3]).map(...);</tt>. Original patch provided by
2399
+ <a href="http://macournoyer.com/">Marc-André Cournoyer</a>.
2400
+ Wrapped objects can be chained through multiple
2401
+ method invocations. A <a href="#object-functions"><tt>functions</tt></a> method
2402
+ was added, providing a sorted list of all the functions in Underscore.
2403
+ </p>
2404
+
2405
+ <p>
2406
+ <b class="header">0.3.3</b><br />
2407
+ Added the JavaScript 1.8 function <tt>reduceRight</tt>. Aliased it
2408
+ as <tt>foldr</tt>, and aliased <tt>reduce</tt> as <tt>foldl</tt>.
2409
+ </p>
2410
+
2411
+ <p>
2412
+ <b class="header">0.3.2</b><br />
2413
+ Now runs on stock <a href="http://www.mozilla.org/rhino/">Rhino</a>
2414
+ interpreters with: <tt>load("underscore.js")</tt>.
2415
+ Added <a href="#identity"><tt>identity</tt></a> as a utility function.
2416
+ </p>
2417
+
2418
+ <p>
2419
+ <b class="header">0.3.1</b><br />
2420
+ All iterators are now passed in the original collection as their third
2421
+ argument, the same as JavaScript 1.6's <b>forEach</b>. Iterating over
2422
+ objects is now called with <tt>(value, key, collection)</tt>, for details
2423
+ see <a href="#each"><tt>_.each</tt></a>.
2424
+ </p>
2425
+
2426
+ <p>
2427
+ <b class="header">0.3.0</b><br />
2428
+ Added <a href="http://github.com/dmitryBaranovskiy">Dmitry Baranovskiy</a>'s
2429
+ comprehensive optimizations, merged in
2430
+ <a href="http://github.com/kriskowal/">Kris Kowal</a>'s patches to make Underscore
2431
+ <a href="http://wiki.commonjs.org/wiki/CommonJS">CommonJS</a> and
2432
+ <a href="http://narwhaljs.org/">Narwhal</a> compliant.
2433
+ </p>
2434
+
2435
+ <p>
2436
+ <b class="header">0.2.0</b><br />
2437
+ Added <tt>compose</tt> and <tt>lastIndexOf</tt>, renamed <tt>inject</tt> to
2438
+ <tt>reduce</tt>, added aliases for <tt>inject</tt>, <tt>filter</tt>,
2439
+ <tt>every</tt>, <tt>some</tt>, and <tt>forEach</tt>.
2440
+ </p>
2441
+
2442
+ <p>
2443
+ <b class="header">0.1.1</b><br />
2444
+ Added <tt>noConflict</tt>, so that the "Underscore" object can be assigned to
2445
+ other variables.
2446
+ </p>
2447
+
2448
+ <p>
2449
+ <b class="header">0.1.0</b><br />
2450
+ Initial release of Underscore.js.
2451
+ </p>
2452
+
2453
+ <p>
2454
+ <a href="http://documentcloud.org/" title="A DocumentCloud Project" style="background:none;">
2455
+ <img src="http://jashkenas.s3.amazonaws.com/images/a_documentcloud_project.png" alt="A DocumentCloud Project" />
2456
+ </a>
2457
+ </p>
2458
+
2459
+ </div>
2460
+
2461
+ </div>
2462
+
2463
+ <!-- Include Underscore, so you can play with it in the console. -->
2464
+ <script type="text/javascript" src="underscore.js"></script>
2465
+
2466
+ </body>
2467
+ </html>