Compare commits

...

1260 Commits

Author SHA1 Message Date
jdalton
29a7bc4c81 Bump to v2.4.2. 2013-12-01 10:37:29 -07:00
Benjamin Tan
e21e993729 Update v2.4.1 docs 2015-01-23 15:00:16 +08:00
John-David Dalton
0af1a85442 Bump to v2.4.1. 2013-12-02 23:21:16 -08:00
John-David Dalton
10e7bb97ee Add comments to baseBind use of arguments. [ci skip] [closes #416] 2013-12-02 23:11:19 -08:00
John-David Dalton
c319bbc5f3 Ensure _.isEqual performs comparisons between objects with shared property values correctly. [closes #415] 2013-12-02 21:15:00 -08:00
John-David Dalton
9e42f70e5f Add more lodashBadShim tests. 2013-12-02 01:40:20 -08:00
John-David Dalton
ff47152187 Add max-duration option to sauce config. 2013-12-01 21:40:48 -08:00
John-David Dalton
94b6ce5ca0 Excuse some underscore _.debounce and _.throttle tests in sauce. 2013-12-01 21:40:48 -08:00
John-David Dalton
8e1020f134 Tweak _.now unit test. 2013-12-01 21:40:48 -08:00
John-David Dalton
be7a0fef41 Increase sauce idle-timeout from the default of 90 to 300. 2013-12-01 21:40:48 -08:00
Bitdeli Chef
9fe7bb7362 Add a Bitdeli badge to README 2013-12-01 17:55:22 +00:00
John-David Dalton
5d4b121ac1 Remove extra props added for lodashBadShim. 2013-12-01 11:29:41 -06:00
John-David Dalton
cb424a5f78 Better error messages for sauce issues. [ci skip] 2013-11-30 23:11:16 -06:00
John-David Dalton
88ab9d0756 Fix phantomjs browser tests. 2013-11-30 19:57:42 -06:00
John-David Dalton
29f4fd40ed Try a different secure string in travis.yml. 2013-11-30 17:10:53 -06:00
John-David Dalton
b7f7ba06b9 Merge qunit clib and extras. 2013-11-30 16:02:18 -06:00
John-David Dalton
94f8ac8d1d Get test coverage to 100%. 2013-11-30 11:51:11 -06:00
John-David Dalton
72ab38bd2f Remove fork in baseUniq that is never reached and increase test coverage. 2013-11-30 00:29:50 -06:00
John-David Dalton
b3d5466131 Fix tests for commonjs module builds. [ci skip] 2013-11-29 22:11:30 -06:00
John-David Dalton
bafbd8f1b6 Add COVERALLS_REPO_TOKEN to travis.yml. 2013-11-29 21:57:21 -06:00
John-David Dalton
8c1ce03183 Ignore .coveralls.yml. 2013-11-29 21:01:12 -06:00
John-David Dalton
97490b272f Add more unit tests to increase coverage. 2013-11-29 20:54:18 -06:00
John-David Dalton
2afbe9514b Rebuild files and docs. 2013-11-29 20:37:56 -06:00
John-David Dalton
603be609a1 Add sudo to the istanbul command in travis.yml. 2013-11-29 18:48:01 -06:00
John-David Dalton
4590be7b65 Add isNative. 2013-11-29 18:47:25 -06:00
John-David Dalton
097a2f6582 Optimize _.partial and _.partialRight. 2013-11-29 11:21:48 -06:00
John-David Dalton
f818e5bc51 Whitespace nit in test.js. [ci skip] 2013-11-29 08:40:13 -06:00
John-David Dalton
34cf8fc43c Ensure _.partialRight args are applied to __bindData__ in the correct order. [closes #408] 2013-11-29 07:09:21 -06:00
John-David Dalton
7712765c3a Ensure __bindData__ is properly cloned. [closes #408] 2013-11-29 06:31:37 -06:00
John-David Dalton
eaf1304eda Rebuild with xor doc typo fixed and docs with lodash.com link. [ci skip] 2013-11-27 23:46:27 -06:00
John-David Dalton
f97f32df0f Merge pull request #406 from Delapouite/doc
Add home link in docs. [ci skip]
2013-11-27 03:45:22 -06:00
John-David Dalton
79eecd6db4 Remove extraneous test. [ci skip] 2013-11-27 03:42:59 -06:00
Delapouite
5a75d8e788 Add home link in docs. [ci skip] 2013-11-27 10:12:17 +01:00
John-David Dalton
42e58fb73a Add unit test for _.sortBy to ensure arrays returned from callbacks are coerced. 2013-11-26 15:10:55 -06:00
John-David Dalton
dba996b2c4 Fix doc typos. [ci skip] 2013-11-26 15:10:45 -06:00
John-David Dalton
647f0dd34b Bump to v2.4.0. 2013-11-25 23:14:32 -06:00
John-David Dalton
a691a519e8 Add options object to _.mixin. [closes #404] 2013-11-25 13:26:08 -06:00
John-David Dalton
86075973b5 Remove setImmediate use from _.defer. 2013-11-24 15:31:34 -06:00
John-David Dalton
97ea15300c Added unit tests for clearing the timer id of _.delay and _.defer and tests for array chaining methods. 2013-11-24 15:11:45 -06:00
John-David Dalton
a150a8fd52 Update sauce labs excused list in test/underscore.html. [ci skip] 2013-11-24 11:25:12 -06:00
John-David Dalton
ad4e20da52 Fix async test in node when testing modules. [ci skip] 2013-11-24 00:30:13 -06:00
John-David Dalton
e43ab1e46f Add missing semicolon in _#chain doc. [ci skip] 2013-11-22 22:18:53 -08:00
John-David Dalton
e32e280cf1 Update async _.throttle test. 2013-11-22 22:08:51 -08:00
John-David Dalton
c1a07e0943 Cleanup _.xor. 2013-11-22 18:43:51 -08:00
John-David Dalton
93fe641dbf Change sauce detect in test/underscore.html. [ci skip] 2013-11-22 12:42:39 -08:00
John-David Dalton
d8194c0886 Allow _.sortBy to accept an array for callback. 2013-11-22 09:35:39 -08:00
John-David Dalton
75ce4766d3 Fix _.mixin doc typo. [ci skip] 2013-11-21 22:04:59 -08:00
John-David Dalton
7eff3bf854 Add opera to sauce labs and shorten ie-compat tag. 2013-11-21 22:04:38 -08:00
John-David Dalton
af143ae7dc Update alias output in doc TOC. [ci skip] 2013-11-21 10:53:56 -08:00
John-David Dalton
a0e9140dde Use non-minified file for istanbul coverage checks. 2013-11-21 10:52:59 -08:00
John-David Dalton
33e5d46c87 Add _.constant, _.mapValues, and _.xor. 2013-11-21 09:31:55 -08:00
John-David Dalton
f74b206864 Move asyncRetries config to test/test.js. 2013-11-20 19:13:06 -08:00
John-David Dalton
f334ebe577 Revert istanbul change in travis.yml. 2013-11-20 19:11:46 -08:00
John-David Dalton
9c39394d7f Load QUnit extras for cli tests too. 2013-11-20 09:15:39 -08:00
John-David Dalton
8ea0e6977a Move _.createCallback and _.property to the "Utilities" category. 2013-11-20 08:44:53 -08:00
John-David Dalton
bf006473c0 Add _.debounce and _.throttle test for the this binding of func. 2013-11-19 23:33:43 -08:00
John-David Dalton
568af27be4 Change istanbul test file in travis.yml. 2013-11-19 22:34:18 -08:00
John-David Dalton
bd55f86203 Indicate aliases with -> in docs. 2013-11-19 21:26:06 -08:00
John-David Dalton
d95e577639 Expose lodash in the amd fork of the UMD in case it's being loaded with a shim config. [closes #400] 2013-11-19 09:24:12 -08:00
John-David Dalton
a904e54122 Fix _.throttle and _.now tests. 2013-11-19 00:06:20 -08:00
John-David Dalton
2a97655a8d Expose _.now. 2013-11-18 22:34:04 -08:00
John-David Dalton
d878718510 Update sauce platforms with newer chrome versions and more safari versions. 2013-11-18 08:41:41 -08:00
John-David Dalton
416227a2a2 Add build data to sauce. 2013-11-17 22:57:23 -08:00
John-David Dalton
7d1baa8798 Update vendor/benchmark.js. [ci skip] 2013-11-17 18:58:08 -08:00
John-David Dalton
fe2ee64ec9 Expose _.property. 2013-11-16 20:31:18 -08:00
John-David Dalton
96819628d6 Minor doc nit in saucelabs.js. [ci skip] 2013-11-16 12:09:22 -08:00
John-David Dalton
1b30d7909c Minor nit on require path in saucelabs.js. 2013-11-16 09:18:50 -08:00
John-David Dalton
baf253d44e Reduce timer waits because we've fixed the issue with asyncRetries. 2013-11-16 09:18:08 -08:00
John-David Dalton
b7a4d50007 Add coveralls to travis.yml. 2013-11-16 01:14:14 -08:00
John-David Dalton
625b4befb5 Rebuild docs and add links to sauce labs and travis-ci to readme. [ci skip] 2013-11-16 01:14:14 -08:00
John-David Dalton
30678f51bd Fix var _ assignment in index.html. 2013-11-16 01:14:14 -08:00
John-David Dalton
7a4103dd48 Make use of the wait throbber in quint and cleanup the throbber in saucelabs.js. 2013-11-15 22:18:03 -08:00
John-David Dalton
bca3ff2eac Avoid loading lodash when not needed in unit tests. 2013-11-15 22:09:30 -08:00
John-David Dalton
28e2934a89 Allow _.zipObject to accept an array of keys without assuming its an array of key/value pairs. [closes #397] 2013-11-15 00:18:29 -08:00
John-David Dalton
0563af682d Update docdown to avoid escaping characters in code snippets. [ci skip] 2013-11-14 22:40:48 -08:00
John-David Dalton
5ccd63250b Move qunit extras to qunit-extras.js. 2013-11-14 21:02:46 -08:00
John-David Dalton
f262a0745d Avoid require('vm') if testing AMD. 2013-11-14 11:37:15 -08:00
John-David Dalton
c42b63b008 Move compat mode testing to an argument instead of a query param. 2013-11-14 08:47:34 -08:00
John-David Dalton
e7ffb80877 Enable other realm tests for Node too. 2013-11-14 08:30:34 -08:00
John-David Dalton
919166212f Fix istanbul report in travis.yml and tweak async tests. 2013-11-14 01:03:20 -08:00
John-David Dalton
deb124f645 Update ES6 spec link in lodash source too. [ci skip] 2013-11-13 23:28:14 -08:00
John-David Dalton
86b1ff5125 Merge pull request #396 from Delapouite/doc
Update README link to literals string spec. [ci skip]
2013-11-13 09:46:53 -08:00
John-David Dalton
2c8c96149f Fix how sauce runner and tags are parsed. 2013-11-13 08:13:18 -08:00
Delapouite
82e4cc9951 Update README link to literals string spec [ci skip] 2013-11-13 17:06:58 +01:00
John-David Dalton
04df06404f Bump tested Chrome version in readme. [ci skip] 2013-11-13 01:11:50 -08:00
John-David Dalton
f6fcf5fce4 Attempt to make sauce tests public with names, tags, and customized options. 2013-11-13 00:24:08 -08:00
John-David Dalton
ac5e92c879 Update doc whitespace and _.template doc example. [ci skip] 2013-11-13 00:20:17 -08:00
John-David Dalton
37ccc80ba4 Fix _.size doc typo. [ci skip] [closes #394] 2013-11-12 08:59:40 -08:00
John-David Dalton
8153f97899 Update docdown to correctly detect _.noop as a function. [ci skip] 2013-11-12 00:21:45 -08:00
John-David Dalton
8dedc6d3dc Make use of _.noop more in test/test.js. 2013-11-12 00:20:42 -08:00
John-David Dalton
807d75e13a Remove exposing root._ in the AMD fork of the UMD because Lo-Dash is defined as an anonymous module and the issue it solves isn't applicable to it. 2013-11-11 22:07:56 -08:00
John-David Dalton
feac1786e1 Move min tested Node.js version up to match travis-ci to avoid local testing on top of travis-ci. [ci skip] 2013-11-11 19:37:09 -08:00
John-David Dalton
09e0f4e36c Move ui.isModularize lower in test-ui.js, tweak timing tests, and update lodash-es6 link in readme. 2013-11-11 09:27:49 -08:00
John-David Dalton
9999332107 Bump to v2.3.0. 2013-11-10 20:54:17 -08:00
John-David Dalton
d4ec7e5357 Adjust _.throttle timing in test/test.js. 2013-11-10 19:54:37 -08:00
John-David Dalton
064b3caf08 Fix test in newer opera. 2013-11-10 19:32:53 -08:00
John-David Dalton
c83d2e9513 Fix failing tests in old Opera. 2013-11-10 18:10:34 -08:00
John-David Dalton
48ff516215 Move support note to lodash-cli. [ci skip] 2013-11-10 15:33:43 -08:00
John-David Dalton
cdccbb59ab Avoid the use of _.times in timed tests. 2013-11-10 13:52:24 -08:00
John-David Dalton
2fe5a863ac Avoid _.noop use in test/underscore.html and test/backbone.html. 2013-11-10 13:22:47 -08:00
John-David Dalton
7d1fccf474 Ensure _.noop isn't exposed for underscore builds. 2013-11-10 12:03:13 -08:00
John-David Dalton
0a8dbc8831 Minor readme style tweaks. [ci skip] 2013-11-10 11:11:00 -08:00
John-David Dalton
177a3c2cbd Simplify baseCreateWrapper. 2013-11-09 08:38:04 -08:00
John-David Dalton
9f22e634f5 Simplify a _.debounce and a_.throttle test. 2013-11-09 01:06:44 -08:00
John-David Dalton
55a8c7b540 Correct underscore builds & temporarily disable opera testing in sauce until they resolve their issues. 2013-11-08 09:23:40 -08:00
John-David Dalton
76c11fe65a Try opera in saucelabs.js. 2013-11-07 22:24:26 -08:00
John-David Dalton
b15ed00feb Reduce wait times to speed up unit tests. 2013-11-07 20:51:48 -08:00
John-David Dalton
fc3ff34c2d Fix builds. 2013-11-07 20:48:11 -08:00
John-David Dalton
5faa0f55bc Add baseDifference to optimize _.omit & _.without. 2013-11-07 20:43:23 -08:00
John-David Dalton
77f0731c3e Push back timer in _.delay tests. 2013-11-07 20:42:48 -08:00
John-David Dalton
ffff623852 Tweak var names in _.clone and baseFlatten. [ci skip] 2013-11-07 19:27:19 -08:00
John-David Dalton
a6bc40b506 Fix typo in _.contains docs. [ci skip] [closes #393] 2013-11-07 19:04:56 -08:00
John-David Dalton
a034515019 Add DevDocs to the readme. [ci skip] 2013-11-07 09:52:20 -08:00
John-David Dalton
49c8f23bf7 Adjust timing test to avoid false fails in sauce. 2013-11-07 09:19:25 -08:00
John-David Dalton
29b7a71812 Ensure there is a response object before accessing its statusCode. 2013-11-07 09:05:44 -08:00
John-David Dalton
8de3283dd1 Add special thanks to Sauce Labs to readme. [ci skip] 2013-11-06 23:15:07 -08:00
John-David Dalton
4bbe5b3358 Fix minified builds. 2013-11-06 22:10:55 -08:00
John-David Dalton
3dd3af4a73 Optimize _.omit for large arrays by leveraging _.difference which has optimizations for large arrays. 2013-11-06 21:09:58 -08:00
John-David Dalton
7e7b129822 Move the QUnit.config.hidepassed setting up. 2013-11-06 20:05:28 -08:00
John-David Dalton
8bcc1d81d2 Set loader to none by default in test.html and add default values to perf.html too. 2013-11-06 09:27:19 -08:00
John-David Dalton
aa8e92e9a5 Update qunit-clib to avoid issues with non-writable context.clearTimeout. 2013-11-06 08:51:16 -08:00
John-David Dalton
a8196ec99e Update builds & docs. 2013-11-05 23:54:03 -08:00
John-David Dalton
bd3034819e Ensure recursive _.throttle calls still work. 2013-11-05 23:48:07 -08:00
John-David Dalton
7bb86c4e2a Fix typos and rebuild docs & builds. 2013-11-05 21:53:28 -08:00
John-David Dalton
94ed21d1cf Add count check now that we clear timeoutId properly. 2013-11-05 21:44:59 -08:00
John-David Dalton
1bb7c31ee4 Clear timeoutId if func is called in _.debounce. 2013-11-05 21:41:13 -08:00
John-David Dalton
06d12b376c Tweak pull_request detection in saucelabs.js. 2013-11-05 21:17:42 -08:00
John-David Dalton
e9c8137fd8 Add a mix of arguments to _.throttle tests. 2013-11-05 21:14:47 -08:00
John-David Dalton
eaaddf40d2 Fix failing _.debounce test. 2013-11-05 21:14:29 -08:00
John-David Dalton
3e0c565019 Add failing test case for current _.debounce patch. 2013-11-05 21:12:43 -08:00
John-David Dalton
984603112f Push delay back to see if it helps timing tests in travis/sauce. 2013-11-05 19:49:46 -08:00
John-David Dalton
fe29246256 Merge pull request #389 from jayphelps/leaky-pipes
Fixed memory leak with debounce/throttle arguments and context.
2013-11-05 19:04:13 -08:00
Jay Phelps
84d0664112 Fixed memory leak with debounce/throttle arguments and context 2013-11-05 18:50:39 -08:00
John-David Dalton
3d3c59cea6 Minor style tweaks and simplify travis.yml. 2013-11-05 09:28:11 -08:00
John-David Dalton
7940428b9b Add _.bind, _.partial, _.partialRight, & _.curry tests for function length. 2013-11-05 08:36:32 -08:00
John-David Dalton
2e485b9ac5 Tweak test filters for backbone and underscore. 2013-11-05 08:36:02 -08:00
John-David Dalton
b76aa926f6 Add underscore build tests to sauce. 2013-11-05 08:35:31 -08:00
John-David Dalton
58d81546da Minor cleanup in saucelabs.js. 2013-11-05 00:22:50 -08:00
John-David Dalton
7a480990c6 Avoid underscore timing tests in sauce. 2013-11-04 23:18:39 -08:00
John-David Dalton
afb10efd83 Avoid false fail on _.debounce test. 2013-11-04 22:15:29 -08:00
John-David Dalton
e2f05e137f Ensure only 4 sauce runs at once. 2013-11-04 21:38:35 -08:00
John-David Dalton
d72ade9c70 Leverage tunnels in sauce now that sauce-tunnel is updated. 2013-11-04 20:35:29 -08:00
John-David Dalton
64650fcdee Allow sauce to test IE6/7 for Backbone. 2013-11-04 19:31:56 -08:00
John-David Dalton
e1acb7df13 Fix typo. 2013-11-04 09:09:01 -08:00
John-David Dalton
319a30cf3a Tweak wording in readme. [ci skip] 2013-11-04 09:07:32 -08:00
John-David Dalton
e631f1b313 Avoid lodash use in test setups. 2013-11-04 09:07:07 -08:00
John-David Dalton
617f31b47f Make _.reduce, _.reduceRight, & _.transform to use lodash.createCallback. [closes #388] 2013-11-04 08:01:32 -08:00
John-David Dalton
61e9aac92d Avoid buggy tests in safari in sauce. 2013-11-03 22:38:15 -08:00
John-David Dalton
75812804f4 Rebuild minified builds after uglifyjs update. 2013-11-03 20:56:27 -08:00
John-David Dalton
b60f36f211 Tweak timing tests. 2013-11-03 20:38:17 -08:00
John-David Dalton
e342c878d0 Reduce tests so travis-ci won't timeout. 2013-11-03 15:42:02 -08:00
John-David Dalton
c6b3cadf55 Adjust sauce underscore/backbone settings. 2013-11-03 14:38:16 -08:00
John-David Dalton
869a361d09 Add underscore tests to sauce. 2013-11-03 12:49:15 -08:00
John-David Dalton
f83119e188 Avoiding timing issue with _.debounce test and enable sauce support for backbone tests. 2013-11-03 08:07:44 -08:00
John-David Dalton
578c4b444c Add backbone tests to sauce. 2013-11-03 01:08:21 -08:00
John-David Dalton
d63f9be03f Fix legacy and mobile paths in sauce. 2013-11-03 01:14:25 -07:00
John-David Dalton
62fe02415a Fix compat minified build. 2013-11-03 00:20:55 -07:00
John-David Dalton
481970c763 Add quotes to urls in .travis.yml. 2013-11-02 23:35:56 -07:00
John-David Dalton
7c8dc66ba1 Continue tweaking timing based tests. 2013-11-02 23:35:36 -07:00
John-David Dalton
20ffbf5a82 Use the process.cwd() in sauce labs and unroll sauce tests in travis.yml. 2013-11-02 22:52:38 -07:00
John-David Dalton
2b6f26b214 Run sauce labs in node v0.8 until travis-ci updates their 0.10 version. 2013-11-02 21:38:41 -07:00
John-David Dalton
d743ec2d2b Cleanup travis.yml, tweak how pull requests are handled in saucelabs.js, and tweak timing tests in test/test.js. 2013-11-02 20:53:51 -07:00
John-David Dalton
dfab332285 Auto create platforms list based on test url params. 2013-11-02 14:57:58 -07:00
John-David Dalton
bbbce8a981 Change commit depth to 10 in .travis.yml. [ci skip] 2013-11-02 14:35:48 -07:00
John-David Dalton
0dc4ccb42f Add the partial tunnel support back but don't run parallel jobs until sauce fixes their support. 2013-11-02 14:27:38 -07:00
John-David Dalton
b46c2c2527 Remove tunnelId support as it's not fully supported by sauce labs atm. 2013-11-02 14:07:17 -07:00
John-David Dalton
3b128f844b Experiment with a different tunnel id. 2013-11-02 13:44:31 -07:00
John-David Dalton
d38b3d09ba Tweak sauce labs test completion wait time. 2013-11-02 13:26:30 -07:00
John-David Dalton
d35c5ffa04 Update builds and add tunnelId to saucelabs.js. 2013-11-02 13:07:42 -07:00
John-David Dalton
eb7243233e Add IE compat mode testing to travis-ci. 2013-11-02 10:56:00 -07:00
John-David Dalton
21bf629505 Fix typo in saucelabs.js. 2013-11-02 10:13:28 -07:00
John-David Dalton
702022001d Try to avoid more false fails w/ time related tests. 2013-11-02 09:50:19 -07:00
John-David Dalton
d9549ad634 Make saucelabs.js skip running for pull requests, avoid errors when no result object is returned, and add IE 11 to the list of tested browsers. 2013-11-02 09:32:35 -07:00
Blaine Bublitz
daf91dbf95 switch from connect to ecstatic for sauce tests, parse URL for compat in querystring and set header 2013-11-02 00:59:52 -07:00
John-David Dalton
2bc19120d9 Avoid false fail for a _.throttle test in some VMs. 2013-11-01 23:28:20 -07:00
John-David Dalton
8ddfa8cd68 Add _.isEqual tests for wrapped and unwrapped values. 2013-11-01 19:13:36 -07:00
John-David Dalton
076d10358e Add the last of the underscore _.isEqual unit tests. 2013-10-31 22:59:23 -07:00
John-David Dalton
5930983641 Update link to custom builds documentation. [ci skip] 2013-10-31 09:31:08 -07:00
John-David Dalton
a0c5cb51aa Add more _.isEqual tests and ensure _.isEqual(_(false), _(false)) will compare correctly. 2013-10-31 09:01:40 -07:00
John-David Dalton
8e659745fd Update readme. 2013-10-31 00:06:11 -07:00
John-David Dalton
87297d2a07 Cleanup saucelabs.js round two. 2013-10-31 00:02:47 -07:00
John-David Dalton
8f23611f1a Rename window to root. 2013-10-31 00:02:19 -07:00
John-David Dalton
e2affb0f38 See what process.env logs in saucelabs.js. 2013-10-30 20:15:19 -07:00
John-David Dalton
26e6041b7a Reduce false fails at the expense of explicitness. 2013-10-30 19:34:48 -07:00
John-David Dalton
81707a45d5 Fix typo in builds. 2013-10-30 19:34:21 -07:00
John-David Dalton
805f2b28a9 Update builds & docs. 2013-10-30 09:46:58 -07:00
John-David Dalton
22aa02895e Add propertyIsEnumerable check to the _.isArguments fallback. [closes #382] 2013-10-30 09:24:25 -07:00
John-David Dalton
6bb89778b2 Expose _.noop. [closes #380] 2013-10-30 09:20:56 -07:00
John-David Dalton
6631b9e78f Hide passing tests by default. 2013-10-30 01:09:10 -07:00
John-David Dalton
7f7d5b32da Remove debug from perf.js. 2013-10-30 01:04:36 -07:00
John-David Dalton
52def444ab Update builds after cleanup. 2013-10-30 01:04:01 -07:00
John-David Dalton
7d52ab7c54 Add _.partial perf tests. 2013-10-29 23:58:40 -07:00
John-David Dalton
852b324819 Rename createBound to createWrapper and break createWrapper apart. 2013-10-29 23:58:16 -07:00
John-David Dalton
e019441ede Remove opera from sauce labs as they are unable to launch on their end. 2013-10-29 09:33:54 -07:00
John-David Dalton
ac8f8d0dd6 Ensure _.min and _.max can be used as the callback of _.map. [closes #379] 2013-10-29 09:32:40 -07:00
John-David Dalton
3fa2e7e12e Avoid false fail in older firefox. 2013-10-29 08:56:24 -07:00
John-David Dalton
5d099491df Tweak platforms in saucelabs.js. 2013-10-29 01:22:50 -07:00
John-David Dalton
d7ca0f7734 Remove trailing comma. 2013-10-29 01:17:32 -07:00
John-David Dalton
5d31338b02 Move isV8 and setImmediate assignment after nativeCreate is assigned. 2013-10-29 01:14:12 -07:00
John-David Dalton
a44b81d240 Add browsers to saucelabs.js. 2013-10-29 00:45:02 -07:00
John-David Dalton
742e499de0 Remove native Function#bind use. 2013-10-29 00:00:07 -07:00
John-David Dalton
eb395d6d2d Cleanup perf.js. 2013-10-28 23:25:51 -07:00
John-David Dalton
a1383c34b5 First round of sauce support cleanup. 2013-10-28 09:29:57 -07:00
John-David Dalton
e538da3959 Merge branch 'master' of github.com:lodash/lodash 2013-10-28 09:10:37 -07:00
John-David Dalton
687a072dc8 Cleanup tests and add more _.isEqual tests. 2013-10-28 09:10:26 -07:00
John-David Dalton
5dc9881241 Merge pull request #376 from pimterry/saucelabs
Automatic browser tests with SauceLabs in Travis. [ci skip]
2013-10-28 08:22:40 -07:00
pimterry
0b3a7e2f0f Move saucelabs test config into /test 2013-10-28 10:55:34 +00:00
pimterry
123455a5bb Move saucelabs to an explicit travis case, out of the build matrix
This avoids us rebuilding it with every other combination (saucelabs + node .6/8/.10), as that's not really useful
2013-10-28 00:15:10 +00:00
pimterry
34c8d8dd2e Improve console logging output for saucelabs tests, and explicitly close sauce connect 2013-10-28 00:14:59 +00:00
pimterry
3f4c92d739 Add test listener to QUnit to report results for saucelabs 2013-10-28 00:09:45 +00:00
pimterry
eb10245df1 Moved sauce connect management to saucelabs.js, for manual control 2013-10-28 00:09:40 +00:00
Tim Perry
2dbfcbb378 Updated travis config to run the saucelabs tests for various browsers 2013-10-28 00:07:22 +00:00
Tim Perry
a717f5c030 Initial working saucelabs test result recording 2013-10-28 00:07:16 +00:00
Tim Perry
3a711790c5 PoC saucelabs test runner 2013-10-27 22:55:11 +00:00
John-David Dalton
5d77cb0396 Update underscore build with _.difference patch from lodash-cli. [closes #373] 2013-10-26 00:26:23 -07:00
John-David Dalton
9972ea578b Update builds. 2013-10-26 00:25:42 -07:00
John-David Dalton
0bb3762397 Simplify environment detections. 2013-10-26 00:25:09 -07:00
John-David Dalton
fbd6e21152 Add more "Objects" tests to test/test.js. 2013-10-25 09:36:27 -07:00
John-David Dalton
bea62537df Fix asyncTest with rhino -require. 2013-10-25 00:38:19 -07:00
John-David Dalton
fdbe4c5bd5 Avoid broken Function#bind in Narwhal. 2013-10-24 22:45:33 -07:00
John-David Dalton
91e779a52c Remove secure sauce access key since @pimterry is on the case. 2013-10-24 22:25:21 -07:00
John-David Dalton
e2c5e92cd3 Fix failing tests for rhino -require. 2013-10-24 09:09:18 -07:00
John-David Dalton
5929676ea2 Add more "Objects" test and fix tests for node. 2013-10-24 00:18:02 -07:00
John-David Dalton
36e180ab91 Add more "Objects" tests and fix failing tests. 2013-10-23 23:54:03 -07:00
John-David Dalton
1e8fe22553 Use internal slice instead of nativeSlice.call when converting arguments to arrays. 2013-10-23 21:55:05 -07:00
John-David Dalton
8e1bd2d8f3 Add more of Underscore's "Objects" tests to test/test.js. 2013-10-23 21:38:16 -07:00
John-David Dalton
239ce262ef Add sauce secure key in the hope that someone will complete the work required to get sauce testing working. 2013-10-22 22:16:27 -07:00
John-David Dalton
5be66e98c2 Fix flakey _.throttle unit test. 2013-10-22 21:54:47 -07:00
John-David Dalton
cacd072c15 Add "Objects" tests from Underscore to test/test.js. 2013-10-22 09:28:23 -07:00
John-David Dalton
14c6a1bf23 Add docs to an advanced section of createBound. [ci skip] 2013-10-22 09:27:33 -07:00
John-David Dalton
b27dfd4c77 Escape asterisks and other characters in generated docs. [ci skip] 2013-10-21 22:45:37 -07:00
John-David Dalton
4622e9658d Fix doc link hashes for github. [ci skip] 2013-10-21 21:31:08 -07:00
John-David Dalton
f8bda517c3 Add the rest of the underscore "Functions" tests to test/test.js. 2013-10-21 09:21:02 -07:00
John-David Dalton
de3d9fdb8b Fix more doc typos and add more underscore "Functions" tests to test/test.js. 2013-10-21 00:35:01 -07:00
John-David Dalton
c6291bea52 Fix various doc typos and update builds. 2013-10-20 23:48:33 -07:00
John-David Dalton
a266e3c898 Ensure functions are rebound correctly by shallow cloning the __bindData__ before passing it to createBound. [closes #371] 2013-10-20 23:45:53 -07:00
John-David Dalton
f9c34d6808 Add more underscore "functions" tests to test/test.js. 2013-10-20 23:35:42 -07:00
John-David Dalton
10a91cac2f Add more underscore _.template tests to test/test.js. 2013-10-20 17:38:57 -07:00
John-David Dalton
f7e25e9c63 Add note about _.create and update support section of readme. [ci skip] 2013-10-20 17:02:32 -07:00
Kevin Ji
5f821a58a3 Update contributor links. [ci skip] 2013-10-20 17:01:46 -07:00
Kevin Ji
4a2ad4e6f9 Use https for all Twitter contributor links 2013-10-20 13:17:30 -07:00
John-David Dalton
4a2bbb52c1 Fix remove circular dependency in _.create by adding baseCreate. 2013-10-19 16:20:15 -07:00
John-David Dalton
ed401199bd Allow _.create to accept a properties object and rebuild docs and other builds. 2013-10-19 14:57:12 -07:00
John-David Dalton
eee3a263f5 Add _.create to chaining docs. [ci skip] 2013-10-19 13:15:39 -07:00
John-David Dalton
eca1d9aabd Don't expose _.create for underscore build. 2013-10-19 08:38:57 -07:00
John-David Dalton
33ff9cfbb6 Add _.create and alias tests. 2013-10-19 01:08:32 -07:00
John-David Dalton
de8e6d7174 Add _.create. 2013-10-19 01:08:09 -07:00
John-David Dalton
cd9332cddf Add comment to _.parseInt. [ci skip] 2013-10-18 22:18:15 -07:00
John-David Dalton
fb4a861c0d Reduce _.wrap by taking advantage of createBound. 2013-10-18 08:21:30 -07:00
John-David Dalton
c30460df4c Optimize _.isBoolean, _.isNumber, and _.isString for the false case. 2013-10-17 23:59:02 -07:00
John-David Dalton
31e86a36f8 Ensure _.isEqual works with objects created by Object.create(null). 2013-10-17 22:53:40 -07:00
John-David Dalton
0b4fe85b33 Update vendor/curl to 0.8.4. 2013-10-17 09:05:46 -07:00
John-David Dalton
99e7a1705a Update vendor/requirejs to 2.1.9. 2013-10-16 23:28:34 -07:00
John-David Dalton
27c6259b53 Add more underscore "utilities" methods tests. 2013-10-15 22:28:01 -07:00
John-David Dalton
1ecae14bae Move Underscore's chaining tests to test/test.js. 2013-10-15 09:08:45 -07:00
John-David Dalton
c56a09f318 Add doc note to _.forEach about array-like objects. [closes #339] [ci skip] 2013-10-14 23:48:24 -07:00
John-David Dalton
ffec2699ea Add wiki resources page to the readme. [ci skip] 2013-10-14 22:52:00 -07:00
John-David Dalton
46faf0280c Add the rest of the underscore "Collections" tests to test/test.js. 2013-10-14 09:14:54 -07:00
John-David Dalton
3b774ed507 Add JavaScript Jabber podcast to readme. [ci skip] 2013-10-13 21:57:32 -07:00
John-David Dalton
9c62bbbc05 Use npm i shorthand in .travis.yml. [ci skip] 2013-10-13 19:19:08 -07:00
John-David Dalton
dc6b1ef47b More doc tweaks/cleanup. [ci skip]. 2013-10-13 18:06:23 -07:00
John-David Dalton
1f8e1d2a29 Fix typo in baseRandom doc. [ci skip] 2013-10-13 15:55:30 -07:00
John-David Dalton
b30a948601 Update builds, docs, and add a unit test for the _.findWhere alias. 2013-10-13 15:28:51 -07:00
John-David Dalton
e90568e044 Ensure .travis.yml builds the modern build, even though it's available under a different name. 2013-10-13 12:13:31 -07:00
John-David Dalton
c74b5ba3a2 Update vendor/qunit-clib to throw errors for failed tests in ringo, rhino, & narwhal. 2013-10-13 11:26:22 -07:00
John-David Dalton
2085d6afad Ensure minified builds don't mung eachRight. 2013-10-13 11:01:03 -07:00
John-David Dalton
8bfdbd0fed Ensure test fails are reported correctly via .travis.yml. 2013-10-13 10:44:08 -07:00
John-David Dalton
cc3dc6aff0 Fix doc typos. 2013-10-12 21:00:53 -07:00
John-David Dalton
d01284d147 Changes stooges to flintstones and add doc examples to _.findIndex, _.findLastIndex, _.findKey, and _.findLastKey for "_.pluck" and "_.where" shorthands. [closes #362] 2013-10-11 23:47:44 -07:00
John-David Dalton
7b7d5118d6 Add more Underscore "Collections" unit tests to test/test.js. 2013-10-11 23:39:27 -07:00
John-David Dalton
a03a7dcb4a Update vendor/backbone to v1.1.0. 2013-10-10 22:27:32 -07:00
John-David Dalton
dfae413afc Move more Underscore tests into test/test.js. 2013-10-09 21:52:04 -07:00
John-David Dalton
253642a85e Cleanup _.throttle return statement. 2013-10-08 19:33:59 -07:00
John-David Dalton
ce64c8e7d1 Update tested Chrome version in readme. [ci skip] 2013-10-08 00:37:45 -07:00
John-David Dalton
d7ae0105c3 Fix typo in _.range test. 2013-10-07 23:52:15 -07:00
John-David Dalton
e7320e7bd3 Fix typo in _.range doc example. 2013-10-07 23:49:58 -07:00
John-David Dalton
a214565803 Add Underscore's "Array" method category tests to test/test.js. 2013-10-07 23:49:03 -07:00
John-David Dalton
61f1290bea Update vendor/curl.js to v0.8.2. 2013-10-06 23:57:58 -07:00
John-David Dalton
ba5e512d10 Ensure _.template supports single line comments in "evaluate" delimiters in minified builds. [closes #361] 2013-10-05 23:21:47 -07:00
John-David Dalton
624e4bca40 Tweak __bindData__ detection in createBound. 2013-10-04 23:17:06 -07:00
John-David Dalton
613237727d Update path to perf-ui.js in perf/index.html. [ci skip] 2013-10-04 22:36:43 -07:00
John-David Dalton
fd2ddca6f2 Extend baseCreateCallback to functions bound with native Function#bind and those with __bindData__ of false. 2013-10-04 22:35:45 -07:00
John-David Dalton
e114c18031 Ensure _.template coerces the text argument to a string. 2013-10-03 23:30:49 -07:00
John-David Dalton
49e22742de Add test for incorrectly shimmed Object.create. 2013-10-03 09:42:32 -07:00
John-David Dalton
422d7942ef Bump to v2.2.1. 2013-10-03 00:30:29 -07:00
John-David Dalton
a63e7162bc Make doc/parse.php read the version from package.json. [ci skip] 2013-10-02 23:21:41 -07:00
John-David Dalton
1f973b72b8 Keep createObject fallback for modern builds. 2013-10-02 19:47:15 -07:00
John-David Dalton
d3dd97f167 Fix _.mixin creates functions that respect __chain__. 2013-10-02 19:30:49 -07:00
John-David Dalton
f0f17e0041 Updated the tested version of Node.js to 0.10.20 in readme. [ci skip] 2013-10-01 22:20:26 -07:00
John-David Dalton
d6fa8bf233 Add _.pluck to backbone.html in anticipation of Backbone's version bump. [ci skip] 2013-10-01 22:04:43 -07:00
John-David Dalton
ec5e685a1c Remove unneeded keywords from component.json. [ci skip] 2013-10-01 08:39:03 -07:00
John-David Dalton
c88b95751c Reduce setting MAKE in .travis.yml. 2013-09-30 20:21:59 -07:00
John-David Dalton
72ae25bc53 Log the params passed to test.js to the console. 2013-09-30 19:33:18 -07:00
John-David Dalton
02e5cc1da8 Add asset folders and cache busting to worker.js. 2013-09-30 18:53:04 -07:00
John-David Dalton
3d092df56d Tweak isModularize detection. [ci skip] 2013-09-29 20:33:13 -07:00
John-David Dalton
912d5c700c Change before_script to the more appropriate before_install in .travis.yml. 2013-09-29 20:21:45 -07:00
John-David Dalton
6d3c492518 Extend test/test.js to support testing generated npm packages. 2013-09-29 19:19:02 -07:00
John-David Dalton
5e29e3f1cb Tweak wording on _.clone feature note in readme & tweak unit test handling missing _.runInContext. 2013-09-29 14:46:52 -07:00
John-David Dalton
0558495760 Update _.clone unit test for older Safari. 2013-09-29 12:30:34 -07:00
John-David Dalton
0471dfa2f8 Update vendor/qunit-clib to avoid logInline when running on Windows. 2013-09-29 09:53:05 -07:00
John-David Dalton
7883e6544e Remove modularize entry in test-ui.js, update isModularize detection, and avoid a false fail in old Opera. 2013-09-28 22:14:05 -07:00
John-David Dalton
6da87e4a79 Bump to v2.2.0. 2013-09-28 20:29:54 -07:00
John-David Dalton
bafe4fff93 Update vendor/qunit-clib and validate assert counts in each unit test. 2013-09-28 18:27:07 -07:00
John-David Dalton
da782398a2 Allow test.'s to support rhino -require with modularized builds. 2013-09-28 17:13:24 -07:00
John-David Dalton
4b26b46f6a Remove unneeded code from the underscore build of the support object. 2013-09-28 14:02:12 -07:00
John-David Dalton
0f1e69a2df Tweak how isModularize is detected in test/test.js. 2013-09-28 00:25:56 -07:00
John-David Dalton
85f2bd464c Remove "performance" & "speed" keywords from package.json. [ci skip] 2013-09-26 23:47:26 -07:00
John-David Dalton
8a4956b736 Remove openjdk6 from .travis.yml. 2013-09-26 21:55:14 -07:00
John-David Dalton
4a369af4c7 Cleanup baseClone. 2013-09-26 21:05:10 -07:00
John-David Dalton
9749305ecd Make _.clone shallow clone dates, regexps, and boolean/number/string objects. [closes #358] 2013-09-26 20:07:07 -07:00
John-David Dalton
639178dbdc Make qunit-clib less chatty for passed tests. 2013-09-26 08:12:33 -07:00
John-David Dalton
62d038b547 Fix typo in .travis.yml. 2013-09-26 01:10:22 -07:00
John-David Dalton
9b80e3a33b When floating in _.random avoid getting 0 too many times when using arguments like min of -3 and max of 3. 2013-09-25 23:24:58 -07:00
John-David Dalton
0ea54f0458 Optimize .travis.yml narwhal, ringo, and rhino use. 2013-09-25 22:56:51 -07:00
John-David Dalton
374c52f71f Use ln as shorthand for link in the "Notes" section of the readme . [ci skip] 2013-09-25 09:09:04 -07:00
John-David Dalton
60f63e125a Experiment with downloading rhino, ringo, narwhal via .travis.yml. 2013-09-25 07:52:48 -07:00
John-David Dalton
7cfa7f3de4 Use now() in the compat and underscore builds too. 2013-09-24 19:10:09 -07:00
John-David Dalton
92409831c2 Reduce dependency on getObject. 2013-09-24 00:10:16 -07:00
John-David Dalton
e04790a628 Update docs to make the list of aliases more descriptive. [ci skip] 2013-09-23 09:12:50 -07:00
John-David Dalton
cd7bf40508 Have the npm packages link in the readme use the "lodash-modularized" keyword. [ci skip] 2013-09-23 08:38:52 -07:00
John-David Dalton
dc378e9ce7 Bump to v2.1.0. 2013-09-22 22:55:14 -07:00
John-David Dalton
5fcdcec1a8 Tweak test-ui.js for changes in the modularize build option. [ci skip] 2013-09-22 01:15:50 -07:00
John-David Dalton
8773704c8b Strengthen the UMD. 2013-09-20 23:01:53 -07:00
John-David Dalton
291fd1857e Reduce our readme and update docdown. [ci skip] 2013-09-20 21:18:26 -07:00
John-David Dalton
0aa4aeaddc Change directory in .travis.yml before running unit tests. 2013-09-20 19:52:49 -07:00
John-David Dalton
ca81f1b2e8 Add floating argument to _.random. [closes #354] 2013-09-20 00:21:42 -07:00
John-David Dalton
fca3a14410 Update readme with download descriptions. 2013-09-19 23:49:44 -07:00
John-David Dalton
d105e80ed8 Add "include" to .travis.yml. 2013-09-19 22:23:27 -07:00
John-David Dalton
ce63faa597 Add "matrix" to .travis.yml. 2013-09-19 21:12:17 -07:00
John-David Dalton
25c1b63a00 Fix doc typo in _.where. [ci skip] [closes #353, #355] 2013-09-19 18:40:58 -07:00
John-David Dalton
548728abba Avoid PhantomJS 1.9.2 bug in .travis.yml. 2013-09-19 09:33:33 -07:00
John-David Dalton
2ebdbd565a Add tests to check that _.support properties aren't minified. 2013-09-19 09:20:42 -07:00
John-David Dalton
86376616ff Remove testing modern builds by phantomjs in .travis.yml. 2013-09-19 08:53:55 -07:00
John-David Dalton
7c6865f948 Ensure reThis isn't used in Windows 8 apps. 2013-09-19 08:53:19 -07:00
John-David Dalton
c2da0070f5 Add legacy and mobile builds to .travis.yml. 2013-09-18 23:27:11 -07:00
John-David Dalton
bf2a2aed66 Fix typo in _.template docs. 2013-09-18 21:13:34 -07:00
John-David Dalton
403ea0a0e1 Fix _.compose unit test. 2013-09-18 01:20:08 -07:00
John-David Dalton
27976cbe1a Add notes about Infinity and -Infinity to _.min and _.max docs. 2013-09-17 22:54:42 -07:00
John-David Dalton
70147396a4 Add mid check to createCache bailout. 2013-09-17 22:53:10 -07:00
John-David Dalton
d6aed16e7c Allow _.compose to be called without arguments. [closes #352] 2013-09-17 19:40:48 -07:00
John-David Dalton
0414bae820 Avoid creating an enumerable Function#bind in test/index.html. 2013-09-17 19:30:01 -07:00
John-David Dalton
620866bc39 Ensure _.flatten handles empty arrays. 2013-09-17 19:29:09 -07:00
John-David Dalton
55f080e33f Optimize _.isArray fallback, baseFlatten, & _.isArguments for plain objects. 2013-09-17 08:58:18 -07:00
John-David Dalton
9f2b1b03d7 Don't restore undefined native methods in test/index.html. 2013-09-17 00:16:40 -07:00
John-David Dalton
c0a0f3aaf5 Minor whitespace nits in test and perf ui. [ci skip] 2013-09-17 00:05:21 -07:00
John-David Dalton
7726b5c56b Add more bad shim tests. 2013-09-16 23:57:01 -07:00
John-David Dalton
3daff8ab8a Decode custom test/perf build urls. 2013-09-16 23:56:26 -07:00
John-David Dalton
428c2097c7 Cleanup baseFlatten. 2013-09-16 21:20:14 -07:00
John-David Dalton
7786583ecf Avoid long fail message in _.flatten unit test. 2013-09-16 07:25:32 -07:00
John-David Dalton
9b79ea7d30 Minor doc tweaks. [ci skip] 2013-09-15 23:12:04 -07:00
John-David Dalton
3dc8436362 Ensure _.flatten works with extremely large arrays. [closes #349] 2013-09-15 18:37:09 -07:00
John-David Dalton
9f1f2a4845 Keep the defineProperty fallback in place so it can be used in phantom.js without throwing an error. 2013-09-15 17:29:18 -07:00
John-David Dalton
40204e8133 Cleanup docs. 2013-09-15 17:17:57 -07:00
John-David Dalton
133b1067c5 Add Node 0.8 to .travis.yml. 2013-09-14 00:09:56 -07:00
John-David Dalton
5c8287203e Adjust .gitignore to only ignore .min files in the root. 2013-09-13 21:39:12 -07:00
John-David Dalton
061bbb1914 Add lodash source to "files" in package.json. 2013-09-13 21:18:41 -07:00
John-David Dalton
572168ef20 Update Underscore version in license. [ci skip] 2013-09-13 21:18:04 -07:00
John-David Dalton
1aa27f2da3 Change link to npm lodash packages in readme. [ci skip] 2013-09-13 21:16:12 -07:00
John-David Dalton
be76614c90 Update various package configs. 2013-09-13 20:22:09 -07:00
John-David Dalton
e26d355fb7 Minor readme cleanup. 2013-09-13 09:24:55 -07:00
John-David Dalton
d8dbcef5dd Bump to v2.0.0. 2013-09-13 00:10:59 -07:00
John-David Dalton
5d6a6590bf Make worker unit test runnable in older Firefoxes. 2013-09-12 21:11:10 -07:00
John-David Dalton
7dfdfe5b50 Simplify _.bind benchmark. 2013-09-12 20:09:35 -07:00
John-David Dalton
36fcc460f4 Avoid issues with engines that can't manipulate arguments objects with array methods. 2013-09-12 20:09:28 -07:00
John-David Dalton
24b03d42d6 Fix dojo loader in IE < 9. [ci skip] 2013-09-11 22:16:22 -07:00
John-David Dalton
60275d3637 Add "amd" keyword to package.json. [ci skip] 2013-09-11 08:18:47 -07:00
John-David Dalton
9b5b471802 Update Underscore version in copyright header. [ci skip] 2013-09-11 00:18:23 -07:00
John-David Dalton
1edb96f526 Update vole and jam ignore entries. 2013-09-09 21:25:09 -07:00
John-David Dalton
f949bdcfe4 Update builds and docs. 2013-09-09 08:54:39 -07:00
John-David Dalton
21a45a940e Ensure _.first, _.last, and _.sample return the undefined if called with a falsey argument or an empty array if called with a falsey argument and an n value. 2013-09-09 08:21:24 -07:00
John-David Dalton
fb61dfd39d Reduce use of undefined literal. 2013-09-09 07:26:57 -07:00
John-David Dalton
9b5940505b Add _.sample benchmark. 2013-09-08 18:14:48 -06:00
John-David Dalton
8c07a67fe9 Ensure _.sample handles falsey collection arguments. 2013-09-08 15:09:09 -06:00
John-David Dalton
0f9687ce62 Revert part of the PhantomJS cleanup. 2013-09-08 15:07:59 -06:00
John-David Dalton
1460e46d1f Optimize _.sample. 2013-09-08 01:14:42 -05:00
John-David Dalton
692521c49d Update docs and dist. 2013-09-08 00:28:54 -05:00
John-David Dalton
2f1d8cc196 Ensure _.debounce passes vendor/underscore unit tests. 2013-09-07 16:49:10 -05:00
John-David Dalton
eeabb47fb6 Update vendor/underscore to 1.5.2. 2013-09-07 14:38:53 -05:00
John-David Dalton
e078f584eb Cleanup _.debounce. 2013-09-07 08:55:32 -05:00
John-David Dalton
f86322545a Tweak paths in package.json. 2013-09-06 01:21:26 -05:00
John-David Dalton
720e19a01f Cleanup phantomjs support in test.js. 2013-09-05 20:33:52 -05:00
John-David Dalton
3560fed86e Fix test runner with phantomjs and dojo loader. 2013-09-05 00:19:58 -05:00
John-David Dalton
5f8f5a9f85 Add a console.log in test.js when PhantomJS fails to load a given page. 2013-09-04 20:58:10 -05:00
John-David Dalton
1aae24b831 Cleanup _.template docs. [ci skip] 2013-09-04 18:37:50 -05:00
John-David Dalton
b544b1c3d4 Replace var window with root in test.js. 2013-09-04 18:36:14 -05:00
John-David Dalton
f462f87183 Finish making tests runnable for lodash-amd. 2013-09-04 00:07:00 -05:00
John-David Dalton
6ed7ef25b2 Simplify package.json. 2013-09-03 23:12:22 -05:00
John-David Dalton
bc79d09f2d Update vendors, builds, and docs. 2013-09-03 23:11:34 -05:00
John-David Dalton
5b2becb87f Extend phantomjs to work with lodash-amd. 2013-09-03 23:10:49 -05:00
John-David Dalton
cd808fb5a5 Change how lodash-modularie build path is resolved. 2013-09-02 01:01:59 -05:00
John-David Dalton
c8a4e40bcf Use dev branch version of curl-kitchen-sink. 2013-09-02 00:46:22 -05:00
John-David Dalton
911b6c9679 Adjust .travis.yml for consistency. 2013-09-01 19:25:46 -05:00
John-David Dalton
03041f87c3 Tweak how filePath is resolved to work with lodash-node. 2013-09-01 19:25:19 -05:00
John-David Dalton
360c53d6ca Add license to package.json. 2013-09-01 01:34:10 -05:00
John-David Dalton
3f1d555c71 Detect paths containing lodash-amd and lodash-node as modularized. 2013-08-31 13:10:13 -07:00
John-David Dalton
ae1d72265c Make "ignore" entries consistent across package configs. [ci skip] 2013-08-31 12:54:40 -07:00
John-David Dalton
9570c65d88 Tweak Blaine's gravatar src in readme. 2013-08-30 08:59:36 -07:00
John-David Dalton
3e0b04509a Remove mobile builds from /dist/ as their in cons. 2013-08-30 08:51:29 -07:00
John-David Dalton
0884379e0b Correct repo links in contributing.md. 2013-08-30 08:51:29 -07:00
John-David Dalton
ec16532028 Cleanup dot (.) files. 2013-08-30 08:51:29 -07:00
John-David Dalton
c8f13544a8 Remove legacy and backbone builds from dist/. 2013-08-30 08:51:29 -07:00
John-David Dalton
44bfe55413 Move curl.js. 2013-08-30 08:51:29 -07:00
John-David Dalton
b95c1adc86 Use truey instead of truthy, /ht @brucelawson. [ci skip] 2013-08-30 08:51:29 -07:00
John-David Dalton
b3a94c26d9 Remove lesser used backbone and legacy builds from the npm package. 2013-08-30 08:51:28 -07:00
John-David Dalton
159c7238a8 Update repo links in readme. [ci skip] 2013-08-30 08:51:28 -07:00
John-David Dalton
70f40bab1d Add @phated to the contributors in package.json. [ci skip] 2013-08-30 08:51:28 -07:00
John-David Dalton
6c1a9dc14b Rework the doc example for _.after. 2013-08-30 08:51:28 -07:00
John-David Dalton
816381a6a8 Use location.host in test/index.html and test/underscore.html.
Former-commit-id: 34dd4860b7b83ec9b96b3f9062654bdf960ff75f
2013-08-30 08:50:43 -07:00
Blaine Bublitz
dd84bca638 curl legacy loader
Former-commit-id: 08c7c76abe03823e3cdb0e25f76c969fa073226e
2013-08-30 08:50:43 -07:00
John-David Dalton
a5d2019a39 Tweak _.template docs.
Former-commit-id: 7c8842f046bcb1a736c1dddca5871cc78d8a5ceb
2013-08-28 19:57:49 -07:00
John-David Dalton
26cee564c9 Add @phated under the Contributors section of the read me.
Former-commit-id: 9666cfd0e46a307466497e864b142e97771a0215
2013-08-28 19:53:00 -07:00
Blaine Bublitz
316b8a1375 remove old curl, update to curl 0.8.1 kitchen sink dist and use curl legacy config for test instead of js! plugin
Former-commit-id: 9cba27cb9e0e7644a8a824b30fe5e85e85fc165e
2013-08-28 19:06:29 -07:00
John-David Dalton
618b25df08 Update repo paths in component.json and package.json.
Former-commit-id: 4c2b2498786c11d100cd82d006d0a98feba4586e
2013-08-28 11:14:55 -07:00
John-David Dalton
8f9c4cd217 Remove build from this repo to move to lodash-cli.
Former-commit-id: 0f9e802dd744a97494a10537442a28aae40dc72a
2013-08-28 11:14:38 -07:00
John-David Dalton
c6e2e33e87 Add IE fallback for lack of Function#name.
Former-commit-id: 42047271fe596ed064ce2b1a58b70e6c6cd8a4af
2013-08-27 22:34:23 -07:00
John-David Dalton
db605ea7ca Fix basePath in IE.
Former-commit-id: 3c78a042183ffbb52c22a6979f71f842d6a1ea38
2013-08-27 21:54:03 -07:00
John-David Dalton
a1507d4844 Sync underscore build with Underscore v1.5.1.
Former-commit-id: 333f720645f5ffec079bfe11558ed72a3956ed18
2013-08-27 09:12:50 -07:00
John-David Dalton
c6340a64fe Add _.createCallback unit test for calling without an argCount.
Former-commit-id: 1d9e14163a77564c9fecdba56590131e8cfcebe0
2013-08-27 08:22:04 -07:00
John-David Dalton
265b440c37 Tweak _.contains optimization.
Former-commit-id: 4c8040972806b2b18958379fde765858d22ceda8
2013-08-27 08:21:37 -07:00
John-David Dalton
ea8e6d978d Optimize _.contains for arrays.
Former-commit-id: 050743f77e7047f86d5b14b97d35846c9d2e749c
2013-08-26 22:32:20 -07:00
John-David Dalton
c3f5bc6bfb More JSDoc cleanup. [closes #334]
Former-commit-id: dcb55079320e3bcd35c3bf4f36d18f393f16e426
2013-08-26 22:01:44 -07:00
John-David Dalton
e322f6dbe2 Make backbone unit tests pass in IE6.
Former-commit-id: e709e017441d7902d5f09e6901cf4f586953723b
2013-08-26 00:05:00 -07:00
John-David Dalton
83059a013c Update vendor/underscore.
Former-commit-id: 833a6ca3e5a7f9d4a8b22e535d849c106526171e
2013-08-25 22:42:33 -07:00
John-David Dalton
e374392450 Rebuild dist/ files.
Former-commit-id: 3e9c51b17797b9a1ba702c4f38f24c3bc592c1d5
2013-08-25 20:43:30 -07:00
John-David Dalton
72d505b2f1 Update other vendors jsdoc comment blocks.
Former-commit-id: 3dcc92abe376d4c83baf6d2307c0a4343d5dce31
2013-08-25 20:40:24 -07:00
John-David Dalton
a11bff0c7b Make test.'s match var name usage in lodash.js.
Former-commit-id: 680581a0138315def67c213605140c74f7d6ee6a
2013-08-25 20:39:43 -07:00
John-David Dalton
a820ee4c82 Update vendor/docdown to parse more compliant jsdoc syntax.
Former-commit-id: cfd5d1a5eae3a2608ed49ea388c389fb1ea0e489
2013-08-25 20:39:12 -07:00
John-David Dalton
a18be78bd3 Allow defineProperty to be used in the lodash.compat build too.
Former-commit-id: c610fd24ca8cfefab4c355099a034a8b2542aa77
2013-08-25 16:49:42 -07:00
John-David Dalton
83b5806cec Improve jsdoc syntax. [closes #334]
Former-commit-id: a6ab2e8ac7c5b8abd0e63ee025552d6452a3e0a2
2013-08-25 13:01:41 -07:00
John-David Dalton
4d7a1199ea Track the dependents of root in build.js.
Former-commit-id: be19143f8741be40419f83b2919c44c2d19bc9ac
2013-08-25 10:20:53 -07:00
John-David Dalton
d47cac563a Ensure cacheIndexOf works correctly with boolean values.
Former-commit-id: 21f65952b14ddfff892a8c151545ad807a8ec9ef
2013-08-25 01:39:18 -07:00
John-David Dalton
2969290c63 Update contributing, package.json test entry, and add lodash-grunt to the readme. [ci skip]
Former-commit-id: d59c8db9593eb8893d728588f88ce8b2685f3594
2013-08-25 00:50:30 -07:00
John-David Dalton
277557cd99 Fix perf regressions in _.bind, _.groupBy, _.countBy, _.indexBy, and _.reduceRight.
Former-commit-id: 0972dd65af64b7cd1d7f2800a8a59c28183b8aba
2013-08-24 23:32:04 -07:00
John-David Dalton
21db7d438b Reduce the number of times clearTimeout is called in _.debounce.
Former-commit-id: 5b07b6660be4ff6783a8348fc8a122cfab5d10c4
2013-08-24 00:29:56 -07:00
John-David Dalton
61ff2da15c Replace window var with root to better grab the global when using custom IIFEs.
Former-commit-id: f79834c6b53d692e85801d6258cd8beb35c776c2
2013-08-23 08:44:33 -07:00
John-David Dalton
ad8296a535 Correct exportsOptions in build.js.
Former-commit-id: 35c8977e27bea40431392e02c300625ce6459cca
2013-08-22 09:22:31 -07:00
John-David Dalton
aec3318f4c Update vendors.
Former-commit-id: a2830d4097d13884391abe792c319bf1e699df08
2013-08-21 22:03:31 -07:00
John-David Dalton
3297c3a2e2 Round three of modularize exports=node support.
Former-commit-id: ac21e547a6717ddf362e06c031657c9fb18b8c85
2013-08-20 22:31:04 -07:00
John-David Dalton
84759de36f Round two of modularize exports=node support.
Former-commit-id: 8a764774804f194f3fa344219cc8464190c4405f
2013-08-20 09:23:02 -07:00
John-David Dalton
a562126f2f Make _.memoize avoid using keyPrefix if passed a resolver function. [closes #330]
Former-commit-id: 97e3bb353d988c92eea394dfb496ebf7594ae25f
2013-08-19 22:42:32 -07:00
John-David Dalton
1901134601 Add exports=npm and first round of modularize node.js support.
Former-commit-id: fd0ae2328312d5e28dd5d866dc56f613aff54817
2013-08-18 23:46:16 -07:00
John-David Dalton
eecb6986ee Cleanup _.sample and add missing dependency.
Former-commit-id: 428bbdb266bd1d66119007ed6121c3f810bd2cd1
2013-08-18 07:23:38 -07:00
John-David Dalton
508cada017 Add string test for _.shuffle.
Former-commit-id: 420789264a287b5431322b9871a3c1c219ff2722
2013-08-17 08:15:42 -07:00
John-David Dalton
2abae2f21a Add string test for _.sample.
Former-commit-id: 81836be99bc0439d24eb5e6b73a7e6c2803c9516
2013-08-16 23:33:13 -07:00
John-David Dalton
82c17dbde2 Update vendor/docdown.
Former-commit-id: 98cda48e4b63e2cd471c927ba36afbe2bb80938e
2013-08-16 00:31:10 -07:00
John-David Dalton
425499b3aa Add _.sample.
Former-commit-id: 00e27cca2a65e1310b26904173ffec18aa484e48
2013-08-16 00:26:41 -07:00
John-David Dalton
96605766bb Add _.memoize note to readme. [ci skip]
Former-commit-id: 769b9a03b0e2873e86acefcbc31c43f7179a9d54
2013-08-15 22:49:16 -07:00
John-David Dalton
161012b0a7 Ensure _.at can work as a callback for _.map and add similar unit tests for _.assign, _.defaults, _.merge, _.first, _.initial, _.last, and _.rest.
Former-commit-id: 92e71c6bae084029df3cc0e7af78af7ce7566be0
2013-08-15 00:34:09 -07:00
John-David Dalton
0669a053db Clarify a bit more the order is not guaranteed notes on object iteration.
Former-commit-id: bfe3033325bc941a03948fe41056634663a10989
2013-08-14 23:30:29 -07:00
John-David Dalton
ab66e77740 More consistent use of num argument in unit tests.
Former-commit-id: c835a0f19bae4a48572fee39d6db41fc7f34e2dc
2013-08-14 23:29:24 -07:00
John-David Dalton
381cd53551 Add sparse array tests for _.remove.
Former-commit-id: 0c21484ae459fbb1554c73348a566703523ff297
2013-08-13 23:42:29 -07:00
John-David Dalton
1f0e92a752 Add spare array test for _.pull.
Former-commit-id: 38d677a4f2693db0591a6b43fe5a66a7dae39883
2013-08-13 23:36:36 -07:00
John-David Dalton
98b3496717 Fix typo in perf.js.
Former-commit-id: d9572081f88cf96d50b868201eaf9d0b5bc4d63f
2013-08-12 00:04:43 -07:00
John-David Dalton
4200e2e4e4 Simplify delayed function in _.debounce.
Former-commit-id: 1f996fc3b6a8954053332739fdc0c2185fb1fd80
2013-08-10 21:24:49 -07:00
John-David Dalton
e239ae1aba Remove _.debounce from lodash/underscore build test as it's not replaced for the underscore build.
Former-commit-id: 64648d1cc1636bf76748d4396c1a2606fbca1e32
2013-08-10 01:19:55 -07:00
John-David Dalton
2acfc307b7 Use a state object for buildTemplate like buildModule.
Former-commit-id: 850fe162a0a80b5547622f6cc267e66cad3ae4ce
2013-08-10 00:25:47 -07:00
John-David Dalton
186f1cf714 Add _.eachRight alias of _.forEachRight.
Former-commit-id: ff42b599dd22707fe20ab60a7aff47945b5cef73
2013-08-09 23:58:38 -07:00
John-David Dalton
a5cf42b7c8 Ensure modularize underscore exports=amd works without errors in template.js.
Former-commit-id: ae137c924d26b2614ed1ebdb7abb33e4b76124f4
2013-08-09 23:46:20 -07:00
John-David Dalton
fd7dba8860 Fix missing comma.
Former-commit-id: 7c1745b9f3993613ff0e32f574d43c9d78b33c80
2013-08-09 23:12:43 -07:00
John-David Dalton
32d7e365d2 Ensure _.curry test runs with strict builds.
Former-commit-id: 7bb7d8bdb88b49ec1b35fbf9933f43e2fcd61a53
2013-08-09 23:11:50 -07:00
John-David Dalton
1078cc1c91 Add _.debounce var dependency and remove Adobe JS engine cleanup in build.
Former-commit-id: 330e19ecf1a1d33e6207291aa05b103f68541e81
2013-08-09 22:48:44 -07:00
John-David Dalton
c97fc370cd Cleanup compareAscending and createBound.
Former-commit-id: e783a68666aaea16d917fa1db74d2092e5dcaa9a
2013-08-09 22:47:55 -07:00
John-David Dalton
fca8da118e Ensure createBound works with ES5 features removed.
Former-commit-id: 30fd5e615b473c9c9d3c013a4a5d7e1759872ede
2013-08-09 21:23:03 -07:00
John-David Dalton
dda56405e6 Add fallback for Date.now and keep Array#isArray fallback in modern builds.
Former-commit-id: 4c5ca88d73b8624fdebf50b40c0384219008cb7c
2013-08-09 09:26:07 -07:00
John-David Dalton
f0f23d491c Cleanup _.curry.
Former-commit-id: edcc8b2b4c67fa04d8c67e7b7fcdd071c4155e89
2013-08-09 09:08:23 -07:00
John-David Dalton
44c10d720a Use Date.now in modern builds.
Former-commit-id: de4329c5f4eaa92da8447e1232ce28e00a0f885d
2013-08-09 09:01:32 -07:00
John-David Dalton
690e5a7f9c Tweak video link titles in readme. [ci skip]
Former-commit-id: 53330adf487980642cf6fe8c1a8213594731d270
2013-08-09 00:35:27 -07:00
John-David Dalton
e4fdbc3cb4 Add Underscore license url to non-minified copyright header. [ci skip]
Former-commit-id: 32e6b24f284c9492bd81d680818a829eabe9954c
2013-08-09 00:35:04 -07:00
John-David Dalton
fe2b86ba83 Correct removing ES5 features from createBound for non modern builds.
Former-commit-id: 35aacb52d1bfbd18630460f0c8e21e4fd5d716ea
2013-08-09 00:14:39 -07:00
John-David Dalton
8fb9557520 Ensure "Functions" methods throw if not provided a function and remove Adobe JS engine fix from compareAscending for modern builds.
Former-commit-id: 85f2c3579c33440d3f7351f5a0dfb1c09cd0cc7a
2013-08-08 23:39:35 -07:00
John-David Dalton
25c91b398a Fix InDesign bug with _.sortBy.
Former-commit-id: 3ed2c5fcb02885a9b3563cf9081f6e2af8826c6d
2013-08-08 22:23:17 -07:00
John-David Dalton
8a524dd98f Add _.curry.
Former-commit-id: 33282039186323ad4f58d7d7ec19e3c3974dc9b3
2013-08-08 22:11:03 -07:00
John-David Dalton
7371f8927c Have build remove trailing spaces in lines.
Former-commit-id: 580650186c9661b900ebbe846e13ba194fd2c0bc
2013-08-07 22:04:18 -07:00
John-David Dalton
3d4f58d564 Tweak _.remove and _.pull test for phantomjs.
Former-commit-id: ae404a0da2e03636edf0760322330a996b71fc70
2013-08-07 19:28:25 -07:00
John-David Dalton
f0e32c88ec Add _.throttle test.
Former-commit-id: f50fe31ee221d1a3c2835b037b58b13c8afdd70f
2013-08-07 09:19:05 -07:00
John-David Dalton
5ae3eccaf1 Move _.remove to the "Arrays" category and add unit tests.
Former-commit-id: b0542496b45582b8ca59de19e950dc2368deee0a
2013-08-07 08:43:41 -07:00
John-David Dalton
093f12254f Tweak comments and docs. [ci skip]
Former-commit-id: 0aa090919d1566081c90bf7a25c1f6f579a8eec2
2013-08-07 07:58:36 -07:00
John-David Dalton
3a8afe2969 Shorten doc snippet in readme. [ci skip]
Former-commit-id: 1c50d1e818a4765eddfcf51750a7c70a96ac871f
2013-08-06 09:08:13 -07:00
John-David Dalton
fff5ae97f2 Cleanup fix for modularize underscore and _.mixin and add tests for correct indicatorObject use in underscore builds.
Former-commit-id: 7700fb4df90cdc3eca47af037677d71a70908616
2013-08-06 09:07:45 -07:00
John-David Dalton
3c626e3ea5 Cleanup README.md. [ci skip]
Former-commit-id: e63291595bcc925470aa7d4f4889fcfc5c8daf6f
2013-08-06 00:29:54 -07:00
John-David Dalton
26f57141a1 Simplify package.json description.
Former-commit-id: 43470293d97b86435fd897edd34f910f7a435a8d
2013-08-05 22:12:52 -07:00
John-David Dalton
419aa9dcba Add find unit tests.
Former-commit-id: 1dff5e55c73f91b4b877ee8e0cd4ad38655c49fb
2013-08-05 22:11:38 -07:00
John-David Dalton
3f15456b9c Add build tests for findIndex, findKey, findLast, findLastIndex, findLastKey. forEachRight, forInRight, and forOwnRight.
Former-commit-id: c82a2f327efb180ab849794e777da18a4033045e
2013-08-04 13:50:25 -07:00
John-David Dalton
f67a2fa865 Simplify iteratorObject use for underscore builds and make _.mixin and _.template work better for modularize underscore builds.
Former-commit-id: f9fb33faacbcb3e1bc2ece0a3c70496b3fb3f251
2013-08-04 12:47:27 -07:00
John-David Dalton
0f6de542bf Fix _.forEachRight, _.forInRight, and _.findLastIndex and add related unit tests.
Former-commit-id: 5131ae4559cd71d8016745f85158bb6f96426d01
2013-08-04 12:46:27 -07:00
John-David Dalton
1a529841e0 Fix modularize mobile builds.
Former-commit-id: 5ffb5bd761c8e25c2a3bb9643cfa22b8c08bf2b1
2013-08-03 22:23:22 -07:00
John-David Dalton
a9bf6a0e3b Update vendor/benchmark.js and vendor/underscore tests.
Former-commit-id: 28d47ac7efb1af2d23a749ea50178c09edfe62bd
2013-08-03 21:33:58 -07:00
John-David Dalton
76dcd7d96e Fix modularize legacy builds.
Former-commit-id: 17b09cce67bdf0ec2fd7373beb5b58240b08877b
2013-08-03 21:33:29 -07:00
John-David Dalton
6aa1361b1a Add minified modern and underscore builds back to the package.json. [ci skip]
Former-commit-id: f814323f06bdcf8a3043699a1e9b607c81410c9f
2013-08-03 19:39:14 -07:00
John-David Dalton
f623a4ecef Update docs, dist builds, and fix build.
Former-commit-id: 95a2ae15735b2c98f24c20b8dc894c2832ac107b
2013-08-03 19:26:05 -07:00
John-David Dalton
aa465a12aa Cleanup support for a step of 0 in _.range and add unit tests.
Former-commit-id: 383719999d8f4a7e153784aea3b6f4174684dd9a
2013-08-03 15:59:36 -07:00
John-David Dalton
81ba623423 Merge branch 'master' of github.com:bestiejs/lodash
Former-commit-id: cd661a7d7fe08ec324a7dd7b2325e6e58a35b752
2013-08-03 13:32:40 -07:00
John-David Dalton
4f6f6cca0f Replace passed with provided in docs and test descriptions.
Former-commit-id: b47302b804a7e4f89a0dbacfb85d24d80dae81a9
2013-08-03 13:32:32 -07:00
John-David Dalton
56346f2a52 Make tests pass for modularized build and create a working lodash module.
Former-commit-id: 44cbac15f62e4f727ae0eec963cefd2498ee62ca
2013-08-03 13:31:54 -07:00
John-David Dalton
edcd3f5145 Merge pull request #327 from stereokai/master
Enable _.range() to accept a 0 for step.

Former-commit-id: 6a778327f216de6c606ba091312db9f1b8f85c4e
2013-08-03 10:56:29 -07:00
Stereokai
7acd3d5297 Enable _.range() to accept a 0 for step
Enable `_.range()` to accept a `0` for `step`, for initializing arrays such as `[0, 0, 0, 0, 0]`, `[-1, -1, -1, -1, -1]`, useful in many use cases with inconsistent/morphing object arrays.

Former-commit-id: 5a263ec17e454ba38dfa9b6deb913dddccaddfeb
2013-08-03 11:26:44 +03:00
John-David Dalton
1732c16778 Update builds and docs, replacing passed with provided.
Former-commit-id: 30114421fcb5853097c0992cd4125aa25ede6853
2013-08-02 09:01:58 -07:00
John-David Dalton
913d440c61 Rework how "chaining" methods are modularized.
Former-commit-id: 2986db5039ac031d1007c7376a60f41fc3eafece
2013-08-02 00:22:57 -07:00
John-David Dalton
8cdb4d48f2 Fix chain check in test/underscore.html.
Former-commit-id: 39ebd562e1fd08548f778c7f7ddfa3c0885a782e
2013-08-02 00:11:37 -07:00
John-David Dalton
907ac05c00 Fix issues preventing _.mixin from working as a module.
Former-commit-id: 57afac8d0901856aaf67688d46e2649532edeb61
2013-08-01 09:18:31 -07:00
John-David Dalton
067558529c Move more code to be removed before the call to buildModule.
Former-commit-id: 255ba4bf6e65d61378226ba1c13708619ca68941
2013-08-01 09:17:45 -07:00
John-David Dalton
c97e653ba1 Add baseCreateCallback to avoid circular deps add more varDeps to fix large array caching.
Former-commit-id: f8164bbff59a3ad294c5670693942dc56a1c88a5
2013-08-01 00:12:53 -07:00
John-David Dalton
9a935ba90c Avoid tests not relevant to modularized builds when its selected.
Former-commit-id: 3e0e4275cfa51fc12ea9583801459588658de702
2013-07-31 23:58:22 -07:00
John-David Dalton
134ed51517 Make modularized builds tested and avoid errors when running modularized tests.
Former-commit-id: 38aa57ec3d401cb3892093008d75d03545d63c6b
2013-07-31 09:06:29 -07:00
John-David Dalton
993dd84af9 Add dojo amd loader to the list of loaders supported in the readme.
Former-commit-id: 07504c1edeb540aa4103909a69ab83c47b9e7e18
2013-07-30 23:59:40 -07:00
John-David Dalton
28e3ab73fa Add _.remove, _.pull, and fix typos in build. [closes #281]
Former-commit-id: e771f3934c868d0d7093f1690d9c7d57fa75ae89
2013-07-30 23:46:43 -07:00
John-David Dalton
70a5efa1d6 Cleanup build and make legacy command work with modularize.
Former-commit-id: 89cfa2e693bd299096f9418f5cab7f41c37ddf2a
2013-07-30 08:53:56 -07:00
John-David Dalton
a51a355a53 Optimize build for creating modules.
Former-commit-id: 9e06f7c9ec1084bf901123d2ad7d1fd7da2e11fb
2013-07-30 00:02:06 -07:00
John-David Dalton
fdd0a33571 Rebuild docs and dist.
Former-commit-id: ae113f2c04eef7a34b1b49bca3e6dcb7402f723c
2013-07-29 00:26:38 -07:00
John-David Dalton
6547d03b91 Clarify doc example for _.compose.
Former-commit-id: bcd9337d0cc2f7b6a1ca77723f8d20d768cb0b91
2013-07-28 23:47:57 -07:00
John-David Dalton
cc0c2f1b3c Add explicit chaining support to Lo-Dash. [closes #325]
Former-commit-id: 58d01723ddc40f636af9954e5a9f6370e0c88aac
2013-07-28 13:23:04 -07:00
John-David Dalton
c80c59c692 Correct baseClone dependencies and ensure forEachRight isn't exposed in underscore builds.
Former-commit-id: 37bba697b3cdd80405519976a30014efb1336cec
2013-07-28 10:12:32 -07:00
John-David Dalton
10de191dd5 Adjust backbone test html, and adjust underscore html to work with Lo-Dash's tweaked chain behavior.
Former-commit-id: e5042e1c2811004989e57cc1a24f690c3bab1b25
2013-07-28 10:10:28 -07:00
John-David Dalton
1626cec089 Add @type to _.isArray, required for modern builds.
Former-commit-id: 1e1c9f4f47211a767aad873675063c5e2713c144
2013-07-28 10:09:35 -07:00
John-David Dalton
0404776d87 Add _.forEachRight, _.forInRight, _.forOwnRight, _.findLast, _.findLastIndex, and _.findLastKey methods. [closes #309]
Former-commit-id: 7097f79e278bf2dfacfed449ce5f64a2dc19a662
2013-07-27 00:30:54 -07:00
John-David Dalton
4398fca1bd Tweak _.createCallback and Node.js note in readme. [ci skip]
Former-commit-id: a56737d9afe65f8af83abc9c00687709068ad0e0
2013-07-26 19:47:01 -07:00
John-David Dalton
e94ca12f9f Add getObject and releaseObject to setBindData.
Former-commit-id: d4152ccc078bfa64d62640d89b673057cf9f6a19
2013-07-26 19:37:42 -07:00
John-David Dalton
036c2f6a1c Add unit tests for _.countBy, _.groupBy, _.indexBy, and _.sortBy for when a callback is not passed.
Former-commit-id: e3c1760607cb86fc6c3729409d217b4255fb695d
2013-07-26 19:14:13 -07:00
John-David Dalton
611304e257 Update vendor/underscore and add _.indexBy perf and unit tests.
Former-commit-id: 5fc6c853773385aa39d470429899a35f9f17cad8
2013-07-26 09:29:44 -07:00
John-David Dalton
cf26447f7c Add _.indexBy method and add a noop fallback for setBindData.
Former-commit-id: f8035b9a221ba7b625c21cb566c62931877da6ef
2013-07-26 09:12:04 -07:00
John-David Dalton
e5b8e04dde Move Node.js version compat warning note to the Node.js notes section of the readme. [ci skip]
Former-commit-id: 42acc77eb3ced990683e9d91a155e25486dd73c5
2013-07-25 09:26:55 -07:00
John-David Dalton
bb201e6ca4 Reduce npm package size.
Former-commit-id: 29d4eb4f90e2d215b65d04b8c8063804472de8fc
2013-07-25 09:13:57 -07:00
John-David Dalton
bb58d633c0 Fix _.createCallback perf regression.
Former-commit-id: a66821a2c4aa3bae626e19ef638a27689b96dc24
2013-07-25 09:05:43 -07:00
John-David Dalton
56ff8755d4 Update _.createCallback dependencies and fix typo in removeFromCreateIterator.
Former-commit-id: 8478aadcdcb3fbf30a481de1bc515510959a2396
2013-07-24 22:54:55 -07:00
John-David Dalton
57fc027f77 Avoid circular dependencies.
Former-commit-id: a45dd055f44f72797cb62ba040ecc2d45cc24634
2013-07-24 08:27:09 -07:00
John-David Dalton
bdb7c226f1 Update createBound and setBindData variable dependencies.
Former-commit-id: ff0c375fa334e1b54968208c7d311f65a766387f
2013-07-22 21:19:28 -07:00
John-David Dalton
17e32017a7 Allow argCount to be omitted an not default to 3, and cleanup createBound.
Former-commit-id: cbafeaa441aae1ef28268bc2614b1a6e038acfe1
2013-07-22 19:11:44 -07:00
John-David Dalton
2c772d0f4c Ensure build command csp cannot be combined with others like underscore.
Former-commit-id: 97b6bd973323e086f1b6fdf3e40a7732804e2669
2013-07-22 07:16:04 -07:00
John-David Dalton
769ff84a65 Fix typo in _.debounce unit test.
Former-commit-id: b8138dbae144836701e65f98de8981defaaa1a54
2013-07-22 07:12:22 -07:00
John-David Dalton
fd1fbd4843 Remove ES5 optimizations from the compat build.
Former-commit-id: c0d39af98c8b6474d051bcd16a7f5cee1c801477
2013-07-21 23:54:08 -07:00
John-David Dalton
eaa9430e26 Update docs and builds.
Former-commit-id: 27acae75d0412c0e94caa857d861522cbbc6b1a8
2013-07-21 23:50:34 -07:00
John-David Dalton
2e5de88445 Remove hasThis and add comments to createBound and createCallback.
Former-commit-id: cdc9a69dc60913d6c2383053a881453dd2b7b0d5
2013-07-21 23:46:59 -07:00
John-David Dalton
b4b9910203 Add unit tests for createBound and _.createCallback additions.
Former-commit-id: 68ad27523352a7e7b70f026588342fb70318454b
2013-07-21 23:44:38 -07:00
John-David Dalton
afeeadd665 Tweak times in _.debounce and _.throttle unit tests.
Former-commit-id: d079ee2258151e126fd1c40efb9c01ee888170aa
2013-07-21 15:50:50 -07:00
John-David Dalton
fcbeb10159 Cleanup createBound.
Former-commit-id: f16e6df18a036507edea4b64618ffb06f3823a78
2013-07-21 15:27:10 -07:00
John-David Dalton
65227f601e Rename basicXYZ functions to baseXYZ, extract _.clone, _.merge, _.isEqual functions into their own baseXYZ functions, and rework createBound to flatten multiple calls.
Former-commit-id: 8efa6004d747103e9ec6507755fa6ffceb01b16f
2013-07-21 15:24:44 -07:00
John-David Dalton
56ae4dcd12 Clarify _.where docs and cleanup other docs. [ci skip]
Former-commit-id: 1749f85df8c7b21603191e2a249ef31e6df08bd3
2013-07-19 23:56:35 -07:00
John-David Dalton
2b2c8e6b82 Ensure _.zipObject skips falsey elements in a given two dimensional array.
Former-commit-id: 31ce7e65aee98cbed477276ae9115b33fd10c6ea
2013-07-18 09:09:46 -07:00
John-David Dalton
49c032315c Add hasThis to avoid repeatedly checking for this.
Former-commit-id: 15ce8566364ddac60ac01f3a36343c33d9739b77
2013-07-18 08:58:40 -07:00
John-David Dalton
15109f801e Add _.mixin build test.
Former-commit-id: e6fc1d3384519c2678f875b083222c83519f7123
2013-07-18 08:33:59 -07:00
John-David Dalton
3de0a16a9d Add _.where fast path for the common use case or passing an object with one property.
Former-commit-id: dfb78f59ae22f3ccdd88d58cefdb8abcde58eda6
2013-07-18 08:30:05 -07:00
John-David Dalton
bb49b0c16a Allow _.mixin to accept a destination object as well as a source object.
Former-commit-id: 11ccb77653f017270c07579f59d75b847d4e6c65
2013-07-18 08:12:14 -07:00
John-David Dalton
9561414985 Ensure the build removes properties in expressions from createIterator.
Former-commit-id: 6e06397c6dd4e7c550667bc364faad565d0244cd
2013-07-17 08:34:33 -07:00
John-David Dalton
db7354ab72 Add imports option docs to _.template.
Former-commit-id: 4ac5d64b0dae3068d07474beabed7fd5702da9a2
2013-07-17 08:07:46 -07:00
John-David Dalton
34396dbbec Simplify type checks in _.isEqual.
Former-commit-id: a1aeb5aeab6ef30c6f9377f5498da4eb6d112bc3
2013-07-16 23:57:23 -07:00
John-David Dalton
d842a2f62e Allow /test and /perf to change dropdown values if the other dropdown has a custom entry.
Former-commit-id: d56880e7c588b14ae4c65cacc37f042352e5eee1
2013-07-16 23:48:29 -07:00
John-David Dalton
a17c32bed0 Update vendor/requirejs and fix AMD dependencies to avoid circular dependency issues.
Former-commit-id: 4af19b824f7018d7e3473ba7fe98584b5d6949c5
2013-07-16 23:01:52 -07:00
John-David Dalton
fab0b91a79 Update es5.github.com to es5.github.io.
Former-commit-id: 29bafb1c879512e25517524805b3537084d92896
2013-07-16 20:08:23 -07:00
John-David Dalton
88974d552d Add jsDelivr can link to the README.txt. [ci skip] [closes #318]
Former-commit-id: 8b2780fef7eb5a8e63fc0978b66771368663aba5
2013-07-16 19:53:49 -07:00
John-David Dalton
b90a38ce8b Rebuild dist/.
Former-commit-id: d71f105493e9931f95aff890e8efaf480a1ee827
2013-07-16 09:17:40 -07:00
John-David Dalton
b3df27c362 Add note about NaN to _.isNumber docs. [closes #320]
Former-commit-id: 0b6e99297934ef2e2d43eeff676d0d40832d8e67
2013-07-16 09:17:12 -07:00
John-David Dalton
854ea26ab7 Make matchFunction and matchProp ignore leading comments by default, make removeProp remove variable assignments too, and ensure inline require calls have the correct dependency paths.
Former-commit-id: 47e265e550ca863af5902c07df63809f47c1f96d
2013-07-16 09:07:42 -07:00
John-David Dalton
e385b3499b Remove dependencyObject.
Former-commit-id: 374611a2f1180402700fad5ba7f86e390150d37b
2013-07-15 08:20:16 -07:00
John-David Dalton
77d323b38c Fix build.
Former-commit-id: b894b652c8c566411bb47935b67d649a2e6461e7
2013-07-14 19:16:53 -07:00
John-David Dalton
64eeb091b8 Dynamically create absolute path in test runners.
Former-commit-id: b6b7daef445b3750e687b3559966def1f2b165d3
2013-07-14 19:04:40 -07:00
Blaine Bublitz
65f5f8e8e2 use absolute paths for test files
Former-commit-id: 383d797273b168233c5a5653e71c0788e7d7343c
2013-07-14 16:15:51 -07:00
John-David Dalton
6b3ee1aaaf Simplify AMD loader config options.
Former-commit-id: 69a89fe05e45f508fefe445f147da5aa4da8fc7b
2013-07-14 15:38:16 -07:00
Blaine Bublitz
27ca48c6bb use packages instead of path for modularize option
Former-commit-id: 9f8d3cc49fe3f8d21991e48b46845abd9101f171
2013-07-14 13:51:01 -07:00
Blaine Bublitz
2786c776e3 Merge branch 'master' of github.com:bestiejs/lodash
Former-commit-id: 699fbdc06c27cfec9d0f7b9809921f81884948f1
2013-07-14 13:40:43 -07:00
John-David Dalton
23cd5b906b Minify dependencyObject properties correctly.
Former-commit-id: a0d57812420a347938a438d9ecb13467401bcc96
2013-07-14 13:40:17 -07:00
John-David Dalton
0f9d20129d Ensure category modules reference dependencies with relative paths.
Former-commit-id: 5a12a4b2f4cd3a56456238303e7d941b06f76d9f
2013-07-14 13:39:13 -07:00
John-David Dalton
4649bd3906 Ensure category modules reference dependencies with relative paths.
Former-commit-id: 143360f03cc30f759ebd8e5e949b0dd8a1b937b5
2013-07-14 13:10:46 -07:00
John-David Dalton
3048ac2f6d Avoid circular dependency in createCallback and get Curl modularize tests working.
Former-commit-id: cf33217163f2c809fe8ddbb9debd7c95b002b8dc
2013-07-14 12:42:09 -07:00
John-David Dalton
8679377fcf Allow getDependencies and getDependants to be used with Array#map and cleanup expand in build.js.
Former-commit-id: b05ca0cdb9f9b8db4a0503a126e85d902f5bf7b1
2013-07-14 11:46:02 -07:00
John-David Dalton
db5264af3c Recursively add props and vars to include in the build in build.js.
Former-commit-id: fe7b8cad6ee6df1443424e05836e00a81f532af8
2013-07-14 11:25:21 -07:00
John-David Dalton
059fbb9e5d Remove _.unzip use from underscore build tests.
Former-commit-id: ea76623efddc58550f67ee3b40ba93d1b7b8770e
2013-07-14 11:25:21 -07:00
John-David Dalton
01303c1e31 Cleanup argument juggling comments.
Former-commit-id: e4c175791e514e7e8055f39c2156375c2da91bf2
2013-07-14 11:25:12 -07:00
John-David Dalton
a8aaa793a0 Remove unzip from underscore build.
Former-commit-id: 5c1ed2d73e678e3f63c5378e8318508207b01988
2013-07-14 08:05:54 -07:00
John-David Dalton
c5698e82da Track function dependencies of variables in build.js.
Former-commit-id: 127d9c849cb6a77ed2bb192573bc1f8f7f661838
2013-07-14 01:12:18 -07:00
Blaine Bublitz
ec12f7a5e7 Use curl's js! plugin to load test.js since it doesn't have a define in the file.
(cherry picked from commit 078d78a70e664bb92d129791d99b97f48c6ccafc)


Former-commit-id: b684cc6ffad049f32c0f6f9f16511f3242c913a2
2013-07-14 00:25:01 -07:00
John-David Dalton
b87fec554f Ensure underscore builds use basicFlatten.
Former-commit-id: 148f37a27467391e9719fb098acb75ebac256f1b
2013-07-13 23:24:57 -07:00
John-David Dalton
740981376d Fix asyncTests when using an AMD loader.
Former-commit-id: 2a1aa132c9a941205cf495f737f8f9ea2fdc574f
2013-07-13 23:19:25 -07:00
John-David Dalton
8694364aa3 Remove overloadWrapper and ensure Arrays methods work with arguments objects as secondary arguments.
Former-commit-id: 0b5f213947496622e79daea74e525e60ca53e8eb
2013-07-13 18:22:31 -07:00
John-David Dalton
f1b1fee6e4 Remove overloadWrapper and keep basicFlatten and basicUniq in various builds.
Former-commit-id: 3cb08e1232184a1a9737be4d520b15b725f7cedc
2013-07-13 18:21:20 -07:00
John-David Dalton
915596b23e Revert to QUnit v1.10.0 to avoid asyncTest issues.
Former-commit-id: 6127f8d2492eaef6f097d1ec5b25dadbf25e3af9
2013-07-13 18:06:27 -07:00
John-David Dalton
6d65cb77ec Make perf-ui.js and test-ui.js more aligned, remove unzip perf test, and handle comparing to files of the same name in perf.js.
Former-commit-id: 7a5353aab76d6667b6dd5d43e85f95695e5a9cba
2013-07-13 16:39:18 -07:00
John-David Dalton
51e2f8e49b Add unit tests to ensure methods accept falsey arguments and arguments objects.
Former-commit-id: 72dac914c33ad2270deeeffb01c94e5dd00662c6
2013-07-13 16:37:53 -07:00
John-David Dalton
0a7fc356b6 Ensure underscore build versions of _.where and _.findWhere align with Underscore 1.5.
Former-commit-id: 49653c65a29c5a9108630a38b80848b2e5596079
2013-07-13 10:37:28 -07:00
John-David Dalton
ff0f05a1c1 Ensure more Arrays methods accept arguments objects and allow falsey arguments.
Former-commit-id: 06dfbb25236c6daf3efc6b0c1d06d00cf17180b8
2013-07-13 10:35:05 -07:00
John-David Dalton
0ea9362d06 Update vendor/underscore to v1.5.1 and update copyrights and tested environments.
Former-commit-id: 3bdfb1de97d08d05199f5f97c9c3145d7068e7fd
2013-07-09 23:57:54 -07:00
John-David Dalton
9d3932bd82 Cleanup getVars, matchFunction, and matchVar.
Former-commit-id: b06d258373912d75bdfbbb31707fa17c160f75fe
2013-07-09 22:38:31 -07:00
John-David Dalton
8c787fa7f7 Fix failing build tests.
Former-commit-id: b3e1f62389f2406b07bb5db5551698ac58e5e8b9
2013-07-09 09:21:44 -07:00
John-David Dalton
2508e71324 Avoid maintaining the html escape/unescape regexes independently of the entity maps.
Former-commit-id: 847e58befee7641bc39af37bde12fc99da9edb28
2013-07-09 09:04:44 -07:00
John-David Dalton
b2f4f96ef9 Make split regexes in matchVar and matchFunction into multiples, correct typo in getDependants, and remove a lot of edge case build code.
Former-commit-id: 65917a2a0acd7c3502e04e583834f3f10efd15f7
2013-07-09 09:00:53 -07:00
John-David Dalton
fdae297fca Rename isLodashFunc to isLodash in build.js.
Former-commit-id: 4e7ae65eeba640e095aeaf92c2f36cc70ca783c2
2013-07-08 08:34:15 -07:00
John-David Dalton
36488fd836 Simplify _.zip for the underscore build.
Former-commit-id: 18560e78f052fad5c5d7af1ef6571dd31accf690
2013-07-08 08:29:18 -07:00
John-David Dalton
ee01c944b4 Move phantom checks in test.'s to the document variable assignment.
Former-commit-id: 04a4c99398401d1d69236daa5eb0290db23a07d2
2013-07-08 08:07:40 -07:00
John-David Dalton
d7f4f392d2 Fix avoid hang in web worker unit test for phantomjs.
Former-commit-id: 22b4e7c99f9b0eb3cf7c250144bb375aeb9352e8
2013-07-08 01:16:01 -07:00
John-David Dalton
1756093618 Fix minified builds.
Former-commit-id: 11f14c02cca1b5df2fbbce49f7ceff8cf25ffe65
2013-07-08 01:11:05 -07:00
John-David Dalton
1734c6e6bf Make test/underscore.html support the modularize option and cleanup test/index.html.
Former-commit-id: 98ab3a50a58f27508208655a983a9cd96d99f965
2013-07-08 00:05:00 -07:00
John-David Dalton
839f345fa3 Cleanup web worker unit test.
Former-commit-id: a6b2f450f26eba8cb233cceb5920e7ee69c665f1
2013-07-08 00:03:53 -07:00
John-David Dalton
d69b5385e4 Cleanup test/test-ui.js and perf/perf-ui.js.
Former-commit-id: b511f9f0732dffb2339f7284b913d699c11ce9c0
2013-07-08 00:03:13 -07:00
John-David Dalton
eb6b5755e7 Add web worker unit test. [closes #313]
Former-commit-id: 77d0b907a5ae58ff3f4da8b54196b12949a4efd4
2013-07-07 23:24:17 -07:00
John-David Dalton
9c65d9f957 Remove buggy Node .js v0.8 from .travis.yml.
Former-commit-id: 5937b84fdc0297c9a50c13e71948a76044319ec5
2013-07-07 18:37:22 -07:00
John-David Dalton
cfa187f7d9 Create a /lodash.js module when using modularize.
Former-commit-id: f2d1222fb9ccaed019a712448c2144c90327a4f0
2013-07-07 17:29:54 -07:00
John-David Dalton
30d0fbeae6 Make modularized builds work in the unit test.
Former-commit-id: 2d56960e70a2f8c16087cc88c66008e766ea8338
2013-07-07 17:09:47 -07:00
John-David Dalton
9b21656314 Allow switching the module loader in the unit tests.
Former-commit-id: 8521e92925cbca8ff73adf3f1a350caa662e27f7
2013-07-07 16:24:26 -07:00
John-David Dalton
b1b06a38af Rebuild docs and dist.
Former-commit-id: fdba90c6b602eef0c36190e889ebc3fb2ec6c622
2013-07-07 15:18:26 -07:00
John-David Dalton
d2fffe5b88 Make _.unzip and alias of _.zip.
Former-commit-id: fca00001ad850c250f9883572c4dce7b41dde88d
2013-07-07 15:11:19 -07:00
John-David Dalton
09d560888e Update tested browsers and add a note about the Node.js REPL to the README.md. [closes #312]
Former-commit-id: c04331d53aeb3af4d859ce7d4120871bfdd55b73
2013-07-07 14:12:58 -07:00
John-David Dalton
fa28326ed6 Fix build.
Former-commit-id: decaceb4a40033dcd02ed9018fccb2bea1332e79
2013-07-07 14:01:28 -07:00
John-David Dalton
9ea4a6b7b6 Ensure compiled templates work with exports=node.
Former-commit-id: bf235dfecf8599022b7332d4d010c6f3a52c5c26
2013-07-07 01:31:19 -07:00
John-David Dalton
ffa6fafcc1 Fix typo of matchProp to matchVar in build.js.
Former-commit-id: d42933a19b7c90dd7b007858ec73b8f7b2f64572
2013-07-06 20:17:48 -07:00
John-David Dalton
4be5b80ff6 Quote Node.js versions in travis.yml
Former-commit-id: 57127e5f9c476d7e174d56d2704ee09a90984c33
2013-07-06 20:10:46 -07:00
John-David Dalton
5028b07aaa Update builds and docs.
Former-commit-id: e66c5377ffb5c03191673004bb82781a0562535a
2013-07-06 20:08:41 -07:00
John-David Dalton
7ce5dcdead Cleanup matchProp and removeProp in build.js.
Former-commit-id: b30044f7c9ff0d87098d6404341a42d66f51173a
2013-07-06 20:06:14 -07:00
John-David Dalton
7d8571b0e1 Update vendor/underscore to v1.5.0.
Former-commit-id: 8f647bccfdd8fe81473ae7d1354056a928b6f28c
2013-07-06 18:33:44 -07:00
John-David Dalton
fca2fe2c8a Update dependencies and make the underscore build pass more Underscore v1.5.0 unit tests.
Former-commit-id: 31807c11024b44238fcca5ad1682790510371896
2013-07-06 18:33:02 -07:00
John-David Dalton
75576577e0 Update _.after to be in sync with Underscore v1.5.0.
Former-commit-id: d50446cb946a453c081cadff0b0a6245bc45eec4
2013-07-06 14:48:24 -07:00
John-David Dalton
eafc46f6c4 Update underscore build _.defaults and _.result to match Underscore v1.5.0.
Former-commit-id: 12f1ed2217b6d9c845a1be0acd7b8337be94f63f
2013-07-06 14:43:38 -07:00
John-David Dalton
c0c36d3338 Adjust method dependencies for _.flatten, _.uniq, and _.union.
Former-commit-id: f742abfbd9d0c63b16a4f7d3a903ae53d2b7a1fe
2013-07-06 14:40:14 -07:00
John-David Dalton
6a73b0820e Ensure _.flatten will flatten arguments objects.
Former-commit-id: 9ea8e40ff85b217a6497c9bbf91c9640211d9477
2013-07-06 13:48:27 -07:00
John-David Dalton
bcb5eda7d8 Optimize _.isArguments and cleanup _.isArray and _.isRegExp.
Former-commit-id: 2ce67cedca1e2b21e206c4822126b86304c8dd5f
2013-07-06 13:47:11 -07:00
John-David Dalton
2c833b5028 Bump tested Node.js version to 0.10.12 in README.md. [ci skip]
Former-commit-id: d272e4a61375f91a18531b4537be1be4ab06fc63
2013-07-04 01:56:00 -07:00
John-David Dalton
6821603980 Add vendor/curl and vendor/dojo to .npmignore.
Former-commit-id: 33ff633f4df0e4fa373820ac8e5ec3999000dfc2
2013-07-04 01:55:02 -07:00
John-David Dalton
8bec45cd58 Use QUnit v1.11.0 instead of v1.12.0 for non-browser support.
Former-commit-id: 5e554308840a9d29b6354421af73906c59d8f61d
2013-07-04 01:51:28 -07:00
John-David Dalton
ce0f44fb47 Add templateSettings to funcDependencyMap, add reNative to varDependencyMap, and simplify support property cleanup.
Former-commit-id: 0c55084b4479bb8213a3387fc246f36ca3f185dd
2013-07-04 01:18:05 -07:00
John-David Dalton
c740562dd8 Make modularized paths relative and always include a dependency array, even if it's empty.
Former-commit-id: 8f5edb85f01b472b6cc705da6e292d760d3ab12a
2013-07-03 23:53:16 -07:00
John-David Dalton
63a1c8b63e Update vendors, builds, and docs.
Former-commit-id: 08cad493d719ec3ebaa85e0ff279c49f1e2b3655
2013-07-03 23:14:06 -07:00
John-David Dalton
112cdb4842 Use # instead of @ for sourceURLs and sourceMappingURLs.
Former-commit-id: ba78f92591c0cf28dba4c7a93a49f6e0f7ebb305
2013-07-03 00:13:17 -07:00
John-David Dalton
2d5f045c29 Add build tests for build command checks.
Former-commit-id: 3f43b83f07ded116e0ae667f9c809bd1b7b4f30a
2013-07-02 23:40:35 -07:00
John-David Dalton
c43ff29f5d Make node path match in build.js and build/minify.js case-insensitive. [closes #310]
Former-commit-id: 38c00a319ec069efa56b5f22153f98cda09c857e
2013-07-02 22:06:37 -07:00
John-David Dalton
4c0e3c4db9 Remove trailing comma from varDependencyMap.
Former-commit-id: e4f622e116c217eb98fb417d7b1770b88a95cb0d
2013-07-02 08:24:01 -07:00
John-David Dalton
7995a57f77 Move support object cleanup after unused variable cleanup in build.js.
Former-commit-id: 5a334f66f6cb4b5f5fba77148ddc0406e1118f08
2013-07-01 23:17:17 -07:00
John-David Dalton
0a47378f7f Simplify dependency map modifications, and fix typos in getIndexOf replacements.
Former-commit-id: 4066c6950ac6d73b579d0f3f83dfc06f03cc98c9
2013-07-01 22:45:56 -07:00
John-David Dalton
8e9a244cdd Simplify createCache bailout.
Former-commit-id: 2d72da41abfd2bf83017534d841444d99b47776b
2013-07-01 22:44:21 -07:00
John-David Dalton
5f1a4ea08d Fix build.
Former-commit-id: e936444a8db7c16fd4cc456e5d8f9fbadf935ad1
2013-07-01 09:00:21 -07:00
John-David Dalton
034b19d85d Add .html and .md to .gitattributes.
Former-commit-id: 338788296b7b00ae00657bc4d2e522d5989d075c
2013-07-01 08:35:24 -07:00
John-David Dalton
68cb7ea471 Add createCallback to more method dependencies in build.js.
Former-commit-id: 133abccabac9f64bf3bde7e9340e5d2f11638f55
2013-07-01 00:58:43 -07:00
John-David Dalton
d9a3ba0dd1 Add objectTypes to varDependencyMap.defer in build.js.
Former-commit-id: 5f153ba0009ebcb2e0eb7e061228807a0dd3c2bd
2013-07-01 00:13:13 -07:00
John-David Dalton
663e1d8336 Add buildModule to build.js.
Former-commit-id: c301f38ab0aa2343baefed3206e2a9e4491baa60
2013-07-01 00:10:55 -07:00
John-David Dalton
31332f4f53 Add "modularize" to .ignore files.
Former-commit-id: de8d6e65e7aa0de9385c82c9132e03ce2efb7715
2013-06-30 23:56:44 -07:00
John-David Dalton
cb7163dd19 Move snippets and adjust code to make modularize work.
Former-commit-id: 9b0ebc2bca42777f8eab1026c93ece3fb2d8deb6
2013-06-30 22:12:08 -07:00
John-David Dalton
946029a3f7 Cleanup getCategory, add removeProp, remove removeTemplateSettings, rename getMethodsByCategory to getNamesByCategory.
Former-commit-id: 290525ce178f67235683efd70a779aec62a08c71
2013-06-30 21:58:01 -07:00
John-David Dalton
69cbb6e109 Add templateSettings to the Chaining category and cleanup _.difference use.
Former-commit-id: acccb5d3868cf6e38b9f6f87b6107cf4c7b1ec30
2013-06-30 21:39:50 -07:00
John-David Dalton
6054f6bfe1 Add includeProps and includeVars to build.js.
Former-commit-id: 6ea8c0ea3f072393cdba80662c580c489547a29d
2013-06-30 14:52:33 -07:00
John-David Dalton
ae7b9f5fcb Fix incorrectly changed methodName vars in build.js.
Former-commit-id: 73ca6e2241cda5051e752b238a74c75d9c2f8409
2013-06-30 14:51:57 -07:00
John-David Dalton
68dc6b9527 Make the build warn if attempting to combine template with other commands.
Former-commit-id: be47695b4f5315725b6e5520c6ccf3544c220d3a
2013-06-30 14:33:36 -07:00
John-David Dalton
292cdfd5a0 Rename addChainFuncs to addUnderscoreChaining in build.js.
Former-commit-id: a332651048424c6332a2d170435298a1772f9cb0
2013-06-30 14:32:46 -07:00
John-David Dalton
28e2dee605 Fix legacy build.
Former-commit-id: 66bb2736adf06ff03b747369e83c508d90cca60e
2013-06-30 14:31:27 -07:00
John-David Dalton
6d79ab2552 Correct use of function and method terms in build/tests.
Former-commit-id: be0ff50ce30925313716acf15470bd0fa480f6a4
2013-06-30 14:08:55 -07:00
John-David Dalton
da17e424ea Reduce nested code where possible in build.js.
Former-commit-id: 6604a798be84656158957cca0697a208f97ca4f4
2013-06-30 13:17:57 -07:00
John-David Dalton
028c25afd3 Ensure iteratorObject.keys is minified.
Former-commit-id: dcbd40ddcb54c6845fd5255f2ee8c4508091aafd
2013-06-30 11:03:26 -07:00
John-David Dalton
9c2151dc37 Update builds and docs.
Former-commit-id: a09de289c420b76f68efb9471e6e630d07663733
2013-06-30 11:03:07 -07:00
John-David Dalton
9e9bd16b18 Remove varMethodDependencyMap from build.js.
Former-commit-id: fa032025e6c3b6fed18f72bf3cc6ba8ff58cff43
2013-06-30 10:54:09 -07:00
John-David Dalton
3f138aec22 Add getTemplateSettings, removeTemplateSettings, and removeGetIndexOf to build.js.
Former-commit-id: c22a41e98a84b1739696776e40ba66a63f267159
2013-06-30 10:53:26 -07:00
John-David Dalton
e9f66e7c89 Remove getIteratorTemplate from build.js.
Former-commit-id: 1cb26327628839f11cc07ad1fa1f9420fde38209
2013-06-30 10:52:00 -07:00
John-David Dalton
6be64b363c Make getFunctionSource support number values for indent in build.js.
Former-commit-id: 5f977d8058f6773fdffa09f01a59135e9ea3337a
2013-06-30 10:49:55 -07:00
John-David Dalton
51230f21f5 Adjust varMethodDependencyMap when isModularize and remove lodash references when isNoDep.
Former-commit-id: ec7e8dcaec7ba6b09904f5d9a6039c8a572c1f76
2013-06-30 00:30:48 -07:00
John-David Dalton
e12540ba66 Allow the iife command to not have %output% specified.
Former-commit-id: c11cd1d33479e64a689a2412c764be15a807c9ae
2013-06-30 00:29:03 -07:00
John-David Dalton
a6b1bee2af Add includeVars and allow include=none in build.js.
Former-commit-id: 7a77e5ea2920c930eb4ca1fee18661819e366282
2013-06-30 00:27:45 -07:00
John-David Dalton
6187cdafe3 Remove exports comment when removing the _ exports via removeRunInContext in build.js
Former-commit-id: 90460080310f890b707eaa848146de8a26d6765b
2013-06-30 00:26:20 -07:00
John-David Dalton
880f785d04 Add removeAssignments and the snippet that removes methods in build.js.
Former-commit-id: 873a147f2fcb8a0ab19a7980644b1f542bab9b8b
2013-06-30 00:23:02 -07:00
John-David Dalton
5aedcfd6a7 Cleanup build.js.
Former-commit-id: 37a2961136788c9b50d26ed2ce38b208bbf1f40d
2013-06-30 00:20:40 -07:00
John-David Dalton
6ff1a2c236 Remove getCategoryDependencies, getSupport, removeSupport functions from build.js.
Former-commit-id: b55fb46631bb94ffbe986a031d09bf7aefc6ba99
2013-06-30 00:17:20 -07:00
John-David Dalton
317f888383 Make cleanupSource remove extra trailing whitespace.
Former-commit-id: 4b805471336e3259b45a51e1a5f1bea62d66bd94
2013-06-30 00:13:33 -07:00
John-David Dalton
33f1f9abde Update dependencies in build.js.
Former-commit-id: 0de152de0dba9b3349d9234b066a5eb8b7964693
2013-06-30 00:11:36 -07:00
John-David Dalton
913406b568 Make lodash work with modules by avoiding circular dependencies.
Former-commit-id: 57161fd81b837db22fcfe1d318e220f6ca4b1e21
2013-06-29 22:12:12 -07:00
John-David Dalton
6a74d102a4 Add matchVar to build.js.
Former-commit-id: a72f6fa81c9b7f862dc023efe8bd15ed3c2ba0ce
2013-06-28 23:27:43 -07:00
John-David Dalton
e9e36cebcb Add complexVars array, correct removeStrings, and cleanup isVarUsed in build.js.
Former-commit-id: 4d2c65fbad7659fe54c76127b9e9c0bb5731cf35
2013-06-28 09:06:29 -07:00
John-David Dalton
af6bf7a232 Add categoryMap and cleanup buildTemplate, getCategoryDependencies, getCategory, getMethodsByCategory in build.js.
Former-commit-id: e68269afcf6558aefa4a4bba3b75ebf5904714fd
2013-06-25 23:52:05 -07:00
John-David Dalton
5720a7a5e3 Add _.debounce maxWait doc example. [closes #298]
Former-commit-id: c9193ce30fa7c572594b80eeb0a068b73da0affa
2013-06-25 09:07:59 -07:00
John-David Dalton
449c946423 Fix how method names are resolved from categories in test/test-build.js.
Former-commit-id: bbb8a2ca376a64b2fd9c3e2fbe0d3911a7089a94
2013-06-24 08:01:19 -07:00
John-David Dalton
54a2a0da48 Use _.difference instead of _.without.apply(_, …) in test and build files.
Former-commit-id: 5646e8c3e895ea0662df81e7c77e70cdfe2c3a6d
2013-06-23 22:34:05 -07:00
John-David Dalton
e209fedb27 Fix typos in build.js and ensure build tests pass.
Former-commit-id: 4c82850ce314e5a7072f90267c755d991f893442
2013-06-23 19:33:45 -07:00
John-David Dalton
12494f3008 Fix typo in build.js.
Former-commit-id: 6722b5f9905108bdc25b12c857d1f0e4f47c2f7a
2013-06-23 17:23:22 -07:00
John-David Dalton
7f60b46488 Cleanup and fix typos in build tests.
Former-commit-id: cee0620f7cc624bad85c020a39108111bcb16ac2
2013-06-23 17:12:55 -07:00
John-David Dalton
1c9ecd96d4 Correct how categories are parsed in build commands.
Former-commit-id: 93dfd04296f163be7e6099e54931f52ec1ad5391
2013-06-23 17:12:30 -07:00
John-David Dalton
1f84803b91 Fix typo in build.js.
Former-commit-id: d5710a62297b824465f29a43c28882865beec971
2013-06-23 13:36:47 -07:00
John-David Dalton
3f6116f28f Add underscore build test for lack of AMD support.
Former-commit-id: ac1412ff63160d94fa80b982652ba4e10ac894fb
2013-06-23 13:25:48 -07:00
John-David Dalton
4ea0eb94d4 Add warnings to build.js for passing invalid method names to include, minus, and plus.
Former-commit-id: 918ecc8818874b59a292e913a4b8c62d34824f4c
2013-06-23 13:24:49 -07:00
John-David Dalton
e222bc631a Fix failing build tests.
Former-commit-id: c4673ee77f6750500e0f0a1adaf359108db89932
2013-06-23 01:06:34 -07:00
John-David Dalton
9c07c7fe4f Track invalid arguments better in build.js. [closes #303]
Former-commit-id: 7f50c73c8235a5f501bd8292ef59b644f6264e23
2013-06-22 18:06:20 -07:00
John-David Dalton
35d74e18de Add removeNonEnumProps to build.js.
Former-commit-id: d8c544d06fb23d0188c9670b5c0b2cf34e854254
2013-06-22 14:51:04 -07:00
John-David Dalton
266be2c25f Add removeSpliceObjectsFix to build.js.
Former-commit-id: efa1a3882849d2eb2eb01adaf03a1edca201f76e
2013-06-22 09:20:46 -07:00
John-David Dalton
b7cb090144 Correct regexp in build/pre-compile.js that matches string literals.
Former-commit-id: 0ae905b74103df321f997e1d83ac5ce54a17e552
2013-06-22 00:05:37 -07:00
John-David Dalton
30e257bc2b Add removeStrings and remove methods after inlining in build.js.
Former-commit-id: 2b57c9477e08fa89dcc9f567fe8bc64ab4541c4d
2013-06-22 00:05:05 -07:00
John-David Dalton
fbd5679fb1 Better distinguish between \n and \\ in build\pre-compile.js.
Former-commit-id: 8e32e4824a0780dcdd97e81f553df37a701e8d5d
2013-06-21 23:33:18 -07:00
John-David Dalton
9db7234f24 Add propDependencyMapBackup, make getDependants recursive, allow getMethodAssignments to still match lodash.VERSION if all other assignments are removed, and reduce removeFunction calls.
Former-commit-id: d5f3315e2908bbb6a98caf658db0c28066916deb
2013-06-21 22:25:31 -07:00
John-David Dalton
220b2dc912 Update dependencies, rename removePseudoPrivate to removePseudoPrivates, and optimize how dead variables are removed in build.js.
Former-commit-id: e80616a6caa148c954dab611ddde0fc7f5b22cde
2013-06-21 20:24:24 -07:00
John-David Dalton
83c2420038 Add defaultBuildCallback to build.js.
Former-commit-id: a7823682374b90bef1ea4f34bed883318fe48ca2
2013-06-20 00:42:15 -07:00
John-David Dalton
73913f450b Make removeVar punt to removeSupport when removing the support variable.
Former-commit-id: 8a961673173f60669282a7ebb9ad142e13af078e
2013-06-20 00:08:45 -07:00
John-David Dalton
bb966e7e6f Rename useLodashMethod to isLodashMethod, add isExcluded and remove isRemoved from build.js.
Former-commit-id: 59c2756e728f45240db30997350e5bd6db592908
2013-06-19 09:05:42 -07:00
John-David Dalton
b4adc127a4 Simplify getMethodAssignments, add removeMethodAssignments, and avoid some cleanup when the --no-dep flag is passed in build.js.
Former-commit-id: aebfc41fdde98df243c4620ee729977775cba52b
2013-06-19 09:01:42 -07:00
John-David Dalton
2bc343b524 Add defer to the remove forks check in build.js.
Former-commit-id: 964ffc9af09e24b3a9fb3bdc84ff4495521bcd59
2013-06-18 09:04:45 -07:00
John-David Dalton
1f4d6eb0df Remove local clearTimeout and setTimeout vars from the underscore build.
Former-commit-id: d783c0a387ad96b14db718da04dec43056452042
2013-06-18 08:59:58 -07:00
John-David Dalton
ee936fe1a1 Add isShallow to getVars in build.js.
Former-commit-id: c863a26a1e43e4ab8b0d4d84ecea78653663660e
2013-06-18 08:33:42 -07:00
John-David Dalton
f6d9239b37 Rename fallback to fork in build.js.
Former-commit-id: f98efe8f0cc3c5440c05ff8fe31cacb742fdddf3
2013-06-18 08:26:46 -07:00
John-David Dalton
512e5b0240 Add removeComments, removePseudoPrivate, and track more private properties and other dependencies in build.js.
Former-commit-id: 66a9d849080d20549bbdfda7965db1b31ac5388c
2013-06-17 23:30:53 -07:00
John-David Dalton
600148f501 Track property dependencies in build.js.
Former-commit-id: 9ae72c4677f7340e53350702391aa46c328ab81c
2013-06-16 20:20:51 -07:00
John-David Dalton
8791a4f696 Fix build by not counting pseudo private props as part of the isVarUsed result and accounting for findWhere.
Former-commit-id: 974c3a31de0222b9239be0a5a9c4a7b5c5e41913
2013-06-16 19:09:50 -07:00
John-David Dalton
ef40a8a925 Reduce the snippet returned from getMethodAssignments and avoid a possible infinite loop when removing dead vars.
Former-commit-id: 06b49c9ecdf0b279f7d81274d82a813488e9dd26
2013-06-16 17:48:15 -07:00
John-David Dalton
2473e87947 Track less variables and optimize dead variable removal in build.js.
Former-commit-id: 926dae3b46fd491634559391c888fca8a83c84ac
2013-06-16 14:32:52 -07:00
John-David Dalton
bbe1dfb53d Update builds with more dead code removed.
Former-commit-id: 4e1932fcfc89725071a107dcd1aeec2d025b580a
2013-06-16 10:25:35 -07:00
John-David Dalton
3bc27b1a02 Allow findWhere to be included as a lodash method in test-build.js.
Former-commit-id: b69a12bac6a1a91716e4665dad39cafbaa8f88c8
2013-06-16 10:24:12 -07:00
John-David Dalton
ec4c6e140b Correct getVars filter in build.js
Former-commit-id: 4be03b389d54ec360e56918c4d4ca2ad26f46f8a
2013-06-16 10:23:39 -07:00
John-David Dalton
545cc1074c Exclude Lo-Dash methods from getVars results and correct varMap check.
Former-commit-id: 793bc5294ada8f765928aa9e78e83bc535eb44df
2013-06-16 00:59:04 -07:00
John-David Dalton
9c0f4822bc Make build allow iife with newlines and remove isNode from builds that don't need it.
Former-commit-id: 2c0f123d80ea63fb6072d1c02762edd56892d056
2013-06-16 00:05:21 -07:00
John-David Dalton
5040ec109b Make build.js automatically remove unused variables from builds.
Former-commit-id: 03c9e77498263da0f5dc10bc9076a74d471d93f9
2013-06-16 00:04:02 -07:00
John-David Dalton
25b216d7ef Add note about Node.js bug #5688. [closes #301]
Former-commit-id: e2f178fed72f4932ee7b20d3b81974180683a334
2013-06-15 17:17:59 -07:00
John-David Dalton
e475c847d7 Update docdown.
Former-commit-id: 425bcffea78c4c0f1b2004415a0c01f20bcc52c2
2013-06-15 17:02:43 -07:00
John-David Dalton
e7c55c1ad6 Minor whitespace nits.
Former-commit-id: 53a50cbb83cd638f42c0b943c8c2eb354403c787
2013-06-15 17:02:30 -07:00
John-David Dalton
cd8fcadd29 Add *.min.* to ignore files.
Former-commit-id: 6dfd90814ef66ff6a81ff039c5650e7befb735f9
2013-06-15 16:56:15 -07:00
John-David Dalton
f78b6b30d9 Remove testing Node 0.9 in .travis.yml.
Former-commit-id: dcb53274a2d671b3645b1b740533cfc5e0c3cb14
2013-06-14 07:50:57 -07:00
John-David Dalton
cc6a991464 Add changelog note about --output. [ci skip]
Former-commit-id: 7ea8bf69eea43fc489a6f6fe1f18eba206a735de
2013-06-12 23:10:53 -07:00
John-David Dalton
81d487dd89 Update package.json to more closely follow npm docs. [ci skip]
Former-commit-id: 8f5687e779626502da3edcbbe092f4ca93b0cffd
2013-06-12 22:52:22 -07:00
John-David Dalton
af2795c07f Add Dojo builder check to test/test-build.js.
Former-commit-id: 20385525751c6be545d33e46fd650731eebb5246
2013-06-12 08:54:46 -07:00
John-David Dalton
178d9fb8d5 Cleanup _.random unit test.
Former-commit-id: adc32aa17c4375446f180cf6f9daff2eb13b841e
2013-06-12 08:00:33 -07:00
John-David Dalton
9bd12eb782 Bump to v1.3.1.
Former-commit-id: 2d7b1adacb8d2dd6fbee4b9b623b73aa8582e487
2013-06-12 07:54:39 -07:00
John-David Dalton
ef66650997 Ensure maxWait tests pass in Ringo.
Former-commit-id: 57f4142caab308b2df0c0403cfac15cd240c0538
2013-06-12 07:47:53 -07:00
John-David Dalton
fcffcdde1b Increase maxPoolSize limit, add missing cache property to the object returned by getObject, and optimize releaseArray and releaseObject.
Former-commit-id: 41c356fb0d03339bc450de8d69f8002aa4613628
2013-06-12 07:20:58 -07:00
John-David Dalton
7de892ccac Correct typo in _.indexOf perf test.
Former-commit-id: 96d717dbf50ea5b9c8098ec39f2572cccb72ab18
2013-06-12 00:15:14 -07:00
John-David Dalton
f90f2e051a Bump to v1.3.0.
Former-commit-id: 4b8a4e90b97d2960445073cd4288af19dadc9266
2013-06-11 08:33:35 -07:00
John-David Dalton
24f49c8d83 Ensure _.throttle passes underscore unit tests in all environments.
Former-commit-id: 5867875313995ed02a94cd879d537c295b8a5c5f
2013-06-11 08:19:54 -07:00
John-David Dalton
a4ebaf15ab Remove lodash.js from .npmignore.
Former-commit-id: 437fe2fa2e19d4de8f83e2f760cf9da854ded128
2013-06-10 23:55:13 -07:00
John-David Dalton
54a46dccc3 Correct _.throttle method dependencies.
Former-commit-id: 2118e1789803a042675fcc8acb19f1904a102578
2013-06-10 12:37:24 -07:00
John-David Dalton
9747d5057d Update builds and docs.
Former-commit-id: 413e8a906dee3407baf848c4607d9887f57fac85
2013-06-10 11:55:51 -07:00
John-David Dalton
7f5c97d0be Avoid Array.prototype issues in Narwhal.
Former-commit-id: 47627a187d59fb83f4a5b84b03158432d5216395
2013-06-10 11:54:09 -07:00
John-David Dalton
1933a76631 Add maxWait option to _.debounce and implement _.throttle by way of _.debounce. [closes #285]
Former-commit-id: 63b41aac298e5fa89f7922e84b2ed0d5c6545bd3
2013-06-10 11:16:14 -07:00
John-David Dalton
c20d7f9754 Tweak free variable module detection so it will work with Component's polyfill. [closes #296]
Former-commit-id: bda6c962dc5e8299689e4c5cf003f6a6c9a4369d
2013-06-10 09:32:33 -07:00
John-David Dalton
6b46dc7e89 Ensure more private properties are minified correctly.
Former-commit-id: dbebbb088768f04a8252029ad709bad9f01c88bb
2013-06-09 17:21:50 -07:00
John-David Dalton
0c1a26170c Remove build source ./lodash.js from components.
Former-commit-id: 4d7f56385b288b396182020aed07eec285c37815
2013-06-08 09:23:20 -07:00
John-David Dalton
244ee08d7d Remove ./ path prefix to avoid issues with Component's build. [closes #294]
Former-commit-id: 93ba9214538b0f30fde75bff96b75c83f3b96f1f
2013-06-07 18:44:15 -07:00
John-David Dalton
a3acbca24b Rename typod test/run-test.sh.
Former-commit-id: bb982a51c5ceb123e83d98c3201e969607f990b8
2013-06-07 13:33:12 -07:00
John-David Dalton
d77e4ed581 Rebuild files and docs.
Former-commit-id: 1e3b1e236e15e4248247a4b20288ab2e153ce753
2013-06-07 08:39:08 -07:00
John-David Dalton
b928abb956 Tweak _.intersection to still hit fast paths in engines.
Former-commit-id: e8cb944bd6223bb30d58da343c4b5a3f296a4956
2013-06-07 08:24:30 -07:00
John-David Dalton
a46ef8d1a6 When chaining, _.max and _.min should resolve the correct value when passed an array containing only one value. [closes #292]
Former-commit-id: 79c71c1851a73c23919a28aadd56490ded91166c
2013-06-06 09:07:14 -07:00
John-David Dalton
a5d459749f Update dependency maps and remove properties in pre-compile.js that no longer exist.
Former-commit-id: d24f0ac4575ab1c2d12f3e8b4bc5f089424407ca
2013-06-06 08:44:20 -07:00
John-David Dalton
7dfa383968 Move some functions out of runInContext and cleanup _.intersection.
Former-commit-id: dfefa6e202b3cd5a7925ddef6ac73dcab5bef8d1
2013-06-06 08:43:24 -07:00
John-David Dalton
036483d195 Simplify the object pool and large array cache.
Former-commit-id: d15df51efe575cd6fa773622f135ccfb6f675545
2013-06-05 08:06:05 -07:00
John-David Dalton
2c950f74bc Remove props related to _.sortBy if the method isn't included in a given build.
Former-commit-id: b3da4dab8257b9001b7458263a28bf22b0a2c831
2013-06-04 09:12:11 -07:00
John-David Dalton
2c59dcd929 Rebuild docs and files.
Former-commit-id: 94d3e29ccf0ba47599a9d662e5d4068713009c9b
2013-06-04 08:37:12 -07:00
John-David Dalton
658d14f31d Cleanup var names and properties.
Former-commit-id: a3455f40184b61a7abe3f5749ea1c0a141c0e574
2013-06-04 08:36:45 -07:00
John-David Dalton
819f4d2151 Add maxPoolSize to limit array and object pools.
Former-commit-id: 677cdb053c7ef60274d71d9ecf4d6f866ef6a8eb
2013-06-03 08:43:04 -07:00
John-David Dalton
9b214d75df Update DocDown.
Former-commit-id: ecb4c7428007bfb6b721000c81254a03c826b1ff
2013-06-03 08:00:46 -07:00
John-David Dalton
e0891a2d71 Clarify lodash underscore test name in test-build.js.
Former-commit-id: 4723604102d38ea252f867aeab16ce167b1d1a49
2013-06-03 08:00:29 -07:00
John-David Dalton
34a4876761 Cleanup .travis and .ignore files.
Former-commit-id: 268e1eb34f30581ed1a36236970673f389f94bb3
2013-06-03 07:59:44 -07:00
John-David Dalton
13ead0085d Add array and object pools to lodash.
Former-commit-id: f038284d6a544e146dc271ed0fbea0d7401593d4
2013-06-03 07:09:04 -07:00
John-David Dalton
9e63270fc5 Add Volo ignore entry to package.json.
Former-commit-id: 9fe60cf0dcfeb4f688f53ffb1995a619d420d586
2013-06-02 17:29:57 -07:00
John-David Dalton
eccab3cd57 Fix build test for older Node versions w/o setImmediate.
Former-commit-id: 9f21f174626cd86eefd0a26cf0b36a60858ba501
2013-05-30 09:37:09 -04:00
John-David Dalton
6446daf1a6 Remove Instanbul note from README and devDependency from package.json.
Former-commit-id: 891c387534df492f9e4d836daac7adc930205fb3
2013-05-30 08:23:08 -04:00
Mathias Bynens
821602ef1c package.json: Remove Grunt devDependencies
Follow-up commit to dc3512de9f [formerly 6d38406eafbfc880c0b5aabf853c987c65f03482].


Former-commit-id: f8c310cad3fe165b6005312bad74a9abc5148a47
2013-05-30 10:44:08 +02:00
John-David Dalton
dc3512de9f Move istanbul to travis.yml.
Former-commit-id: 6d38406eafbfc880c0b5aabf853c987c65f03482
2013-05-30 03:38:55 -04:00
John-David Dalton
36e9cb7108 Merge branch 'master' of github.com:bestiejs/lodash
Former-commit-id: 629fdb25b4727f8dbf870457196af9a4c43b562d
2013-05-29 17:25:09 -04:00
John-David Dalton
42f4531720 Remove unneeded method from the backbone build and fix build tests.
Former-commit-id: ee463a4af4d458a556f5be666b71b464bae32e6b
2013-05-29 17:06:01 -04:00
Mathias Bynens
d1fb379a40 Enable code coverage
Former-commit-id: 9b52247b6e880f15895842e4ff34c15fc99fd1eb
2013-05-29 17:51:57 +02:00
John-David Dalton
e27bdb965c Add a note about the exposed cache to _.memoize docs.
Former-commit-id: 75939e3ed38fe8447c2f9e45b965a837901bcc4c
2013-05-29 10:30:58 -05:00
John-David Dalton
54fc6df3da Update _.transform docs.
Former-commit-id: ff26ef26e906410787a8819b9c653f20bbdeff38
2013-05-29 09:21:45 -05:00
John-David Dalton
9dd8f62c8a Make Error.prototype unit tests pass in Firefox.
Former-commit-id: 1ff097e7947ba206bc58fe0c319bf36bb64b5387
2013-05-29 09:05:21 -05:00
John-David Dalton
1db19148e7 Update vendors.
Former-commit-id: 6be90c53f9b69d500485492ea2a0ebd288b92abe
2013-05-29 08:56:53 -05:00
John-David Dalton
93a01506e4 Add/fix build tests for mixed method builds.
Former-commit-id: 2b97810ca6960670ea646c6eda962bd4585fda04
2013-05-29 08:30:13 -05:00
John-David Dalton
4767ed790c Add _.findWhere alias.
Former-commit-id: 2c70e59b71c22d902e499747444a196a85691554
2013-05-28 16:08:24 -05:00
John-David Dalton
e39211347c Fix build.
Former-commit-id: f8c32906f46a747b1d610c1c9ca8a8ee3b095d90
2013-05-27 23:54:16 -07:00
John-David Dalton
a8cdbb65fe Move code block to a more related part of build.js.
Former-commit-id: c138608bdff2937c51127e129955143ad7a3caec
2013-05-27 23:21:18 -07:00
John-David Dalton
ff74ff4149 Tweak _.transform docs.
Former-commit-id: dc7100411a403be4cce6b3784e1dd81cc9423b76
2013-05-27 22:31:41 -07:00
John-David Dalton
96e47f3d27 Avoid incorrectly converting local variables to boolean values.
Former-commit-id: 322f6dec4c669bdc1ef534f7786cf12aee580e53
2013-05-27 15:38:11 -07:00
John-David Dalton
be52c181ea Ensure converted !0 and !1 have leading whitespace if needed.
Former-commit-id: 930001f35111d47a51c011c47d6c2608b0bb7e2d
2013-05-27 13:47:01 -07:00
John-David Dalton
507f2ec544 Avoid minifier tricks for boolean literals in expressions.
Former-commit-id: a02445f97a81c330018247140784818be830595f
2013-05-27 13:04:26 -07:00
John-David Dalton
fe00c628f4 Fix build.
Former-commit-id: 8dfb12b5883e59111857360ee5392c62e5e9146f
2013-05-26 23:19:10 -07:00
John-David Dalton
e9387d322c Disable use of basicIndexOf optimization if _.indexOf is customized.
Former-commit-id: 5b2273b36934581e34c6f6042de95bf556c61ca2
2013-05-26 22:46:52 -07:00
John-David Dalton
2e3b135fe9 Rebuild docs and files.
Former-commit-id: 3f0dd7d8a07e2a3694619ce7277573ffb6f88ef6
2013-05-25 01:08:38 -07:00
John-David Dalton
d28cc15be2 Ensure _.isPlainObject returns true for empty objects in older browsers. [closes #283]
Former-commit-id: d01d32b1cbd87d08bc8014d07eaa1842e3118a40
2013-05-25 01:08:08 -07:00
John-David Dalton
d15bd23800 Add *.template.* to .ignore files.
Former-commit-id: d4c34dccb521890de2ced7482628f4796b55dcc1
2013-05-24 09:11:34 -07:00
John-David Dalton
90fe45c52d Tweak regexp in build/post-compile.js used to repair whitespace detection.
Former-commit-id: 7bfe6a6bc0b5e2258c56588d8aacad1e5176d8ba
2013-05-24 09:10:45 -07:00
John-David Dalton
8f7be71905 Avoid escaping existing non-ascii characters in templates. [closes #278]
Former-commit-id: a56581f3e323c0c47e4f26ef8dce13e90fb6c15c
2013-05-24 08:42:11 -07:00
John-David Dalton
5d583637c4 Clarify _.uniq doc example and rebuild files. [closes #282]
Former-commit-id: b3ab9ae81af219dfb75b3f4339555530a6301f6e
2013-05-24 07:53:03 -07:00
John-David Dalton
0efb4285c1 Make capitalize in test/test-build.js consistent with other areas.
Former-commit-id: 2a4b6a2f394e474af2c3ca9376ec0ac2580e9bb9
2013-05-23 20:23:48 -07:00
John-David Dalton
6dc543ca18 Rename internal each to basicEach and add internal overloadWrapper function.
Former-commit-id: b12ea9977ab7b6da877aca5925a9fc59019bec93
2013-05-23 20:23:10 -07:00
John-David Dalton
e93e1ddeb9 Add private function dependencies to help reduce dead code in non-minified builds and allow turning them into modules as part of the modularize build option.
Former-commit-id: e9118c47ae2b66e86332a02b4279999b99b8c429
2013-05-23 20:22:12 -07:00
John-David Dalton
d5459f5996 Reduce test/test-build.js travis-ci time limit.
Former-commit-id: c71f8dec6e7cbd81d8693bd52f1f2d0ef78149a7
2013-05-21 10:46:07 -07:00
John-David Dalton
c6420a910d Cleanup getJavaOptions in build/minify.js.
Former-commit-id: 74a6ddf40eadcfd66c0da243d2496b45bc89d8a1
2013-05-21 09:14:37 -07:00
John-David Dalton
f8e67b8e68 Remove the binding optimization from all but the modern build.
Former-commit-id: 1023ccc976e180425dabaa1b61e873e542aa3c2a
2013-05-21 08:42:13 -07:00
John-David Dalton
9ffcd382b4 Have build.js remove createCache if it's not called in the source.
Former-commit-id: 399d1e19b96b2084cc8cd459d297129db1bda071
2013-05-21 00:30:49 -07:00
John-David Dalton
725746badf Merge branch 'master' of github.com:bestiejs/lodash
Former-commit-id: f3bd8611110e0656b448fd5e7bd6fb88dc7a7213
2013-05-20 22:58:22 -07:00
John-David Dalton
9d5290de91 Rebuild docs and files.
Former-commit-id: 00c9d39304630bf650d7f1c80496c383cdac0ba7
2013-05-20 22:58:08 -07:00
John-David Dalton
1bb0b58cce Rename cachedContains reference in build.js to createCache.
Former-commit-id: 3b8cee53f3b7cadc5350c4261794cec72e704427
2013-05-20 22:57:31 -07:00
John-David Dalton
32f0ebbe61 Avoid issues with Titanium, clearTimeout, and an undefined timer id.
Former-commit-id: 18813fcebbab5185164c236a647b0b6436d495ff
2013-05-20 22:53:27 -07:00
John-David Dalton
25a1d74627 Update test/underscore.html and test/backbone.html to account for chain existing in Lo-Dash.
Former-commit-id: f815e7a3ac6e9cc6c048eab82acc32e462dbb021
2013-05-20 22:52:34 -07:00
John-David Dalton
355b2f09bf Make getDependants work with an array of method names.
Former-commit-id: 55f3721735d93e95da10bb3367f8478d861e683c
2013-05-20 22:10:11 -07:00
John-David Dalton
01621f75b6 Avoid binding functions in _.createCallback if they don't reference this.
Former-commit-id: d491414e7e1536d3241a607ba07120f629ff2410
2013-05-20 09:20:51 -07:00
John-David Dalton
242e8a3bd6 Fix typo left out of the "legacy include=defer" patch.
Former-commit-id: cf8f3e072534a925bdf6a0ebdee65d1280f7d29e
2013-05-20 08:44:12 -07:00
John-David Dalton
010c26e716 Replace cachedContains with createCache and further optimize linear array searches.
Former-commit-id: bfe905985c9125cbadfcf111ffd97b6f8ecdd58d
2013-05-19 19:21:11 -07:00
John-David Dalton
e7bad10663 Ensure mobile builds pass unit tests.
Former-commit-id: 31b4eb76c90f375069ef4a73aa7e3fdbcbda069d
2013-05-19 14:28:23 -07:00
John-David Dalton
16242f98ce Ensure each is converted to forEach when used in a ternary operation.
Former-commit-id: ff42e367f9987726fd561037337081c63c7a5100
2013-05-19 14:23:35 -07:00
Kit Cambridge
14a447b3d8 Ensure that the javaOptions are set correctly, as exec is asynchronous.
Previously, the `java` command would execute on the next tick and update the
`javaOptions` array, which could occur prior to the invocation of the Closure
Compiler on the current tick. This has now been refactored into a separate
`getJavaOptions` function, which passes the `javaOptions` array to a callback.

`getJavaOptions` is defined lazily; after the first invocation, the options
are cached and passed to all subsequent callbacks. The callbacks are invoked
on the next tick for compatibility with `exec`.


Former-commit-id: 89ca63c9edb3df3d4fcbbaa64e06075495febfd0
2013-05-19 14:16:35 -07:00
John-David Dalton
a2088fa500 Rebuild docs, files, and update minifiers.
Former-commit-id: 65b04c3efc7677c8ec5cc7ce6e5840fed23b3716
2013-05-19 13:11:57 -07:00
John-David Dalton
87af68c092 Add Java options for faster Closure Compiler minification to minify.js.
Former-commit-id: b493d461e78d0df80c80805a570220fdff93d487
2013-05-19 11:45:24 -07:00
John-David Dalton
06daad87ca Remove unnecessary semicolons from compiled strings.
Former-commit-id: d4f31dafd3335878469babc5daac45957c6d4e80
2013-05-19 11:36:04 -07:00
John-David Dalton
0b4b86f6c9 Remove ctorByClass from the minified vars list in pre-compile.js.
Former-commit-id: 5f5fe90d6a1a9726a07ee7b4c2c9b9b23b6700d3
2013-05-19 10:58:36 -07:00
John-David Dalton
10626904af Add _.transform unit tests.
Former-commit-id: 34e844950f5c003eeeaf2daea7a5ef6247fbfdab
2013-05-19 10:57:50 -07:00
John-David Dalton
90cca8a3eb Remove Error enum fixes/code from builds that don't need them.
Former-commit-id: db060ff3571ef656709447970b62f4af753ea0cb
2013-05-19 10:52:56 -07:00
John-David Dalton
8da0141cac Fix legacy include=defer build test.
Former-commit-id: 49d0598ad3a979796cd07b6819c0aa08642c93a1
2013-05-19 00:37:40 -07:00
John-David Dalton
39e123aaf4 Rebuild files.
Former-commit-id: ab61934d0b097036dc4cab968d92bfd1450fe8c7
2013-05-18 19:33:17 -07:00
John-David Dalton
24fd17f072 Replace _.isPlainObject with shimIsPlainObject.
Former-commit-id: c1c273a352387e25ae5a6a22dfda8871beac8400
2013-05-18 19:32:16 -07:00
John-David Dalton
9270cc47b5 Add _.transform.
Former-commit-id: 6c040fedd130e8436ff99b1d70892ac8cebbb996
2013-05-18 19:12:22 -07:00
John-David Dalton
3721db34ab Avoid writing a minified file when --stdout is used. [closes #273]
Former-commit-id: 75068b4a92f3a98d4c47ad049e88ef764154bcc1
2013-05-18 09:21:23 -07:00
John-David Dalton
e85ae351c7 Ensure --output paths containing build commands are processed w/o problems.
Former-commit-id: 4790e4e2ea2eba6af8c93e3576858d1f6ff45e70
2013-05-17 08:41:55 -07:00
John-David Dalton
a56ba245ea Fix _.support.enumErrorProps docs.
Former-commit-id: f7aa45537b1e4d173f966a78f89b183c444faaeb
2013-05-16 09:12:56 -07:00
John-David Dalton
d162eed4c7 Rebuild files.
Former-commit-id: dd3db7be0213bfada5ab7d8593e233a9af4a9dd0
2013-05-16 08:48:28 -07:00
John-David Dalton
43fea34f61 Ensure _.chain works as expected.
Former-commit-id: ed176702dc08deeb35d94bb7b40623ab06142848
2013-05-16 08:47:52 -07:00
John-David Dalton
f7c960fc0d Ensure Error is escaped for advanced Closure Compiler minification.
Former-commit-id: 7a9cfbe464afa9e52ec3ed23692965d07db51d32
2013-05-14 22:49:15 -07:00
John-David Dalton
ee1933389a Add _.chain tests and ensure they pass.
Former-commit-id: e365b65da8a740383c975c7b904ad2156d1cc8ab
2013-05-14 22:48:34 -07:00
John-David Dalton
fdc9d5f1fd Rebuild docs and files.
Former-commit-id: 59596707224acabb767b87078d69363c293eec2d
2013-05-14 09:15:48 -07:00
John-David Dalton
bad40b6125 Ensure snippet in iteratorTemplate is minifiable and remove unneeded references from iteratorTemplate.
Former-commit-id: f8c96f63f1a50644c0d2074e5419e68d1a247d46
2013-05-14 09:15:26 -07:00
John-David Dalton
d76ce85327 Add better _.forIn support for legacy browsers.
Former-commit-id: a03ce4662021d6ac8ca12c4885a9c4718c227a30
2013-05-14 09:04:15 -07:00
John-David Dalton
d3df072a22 Make build.js remove extraneous semicolons from inlined methods.
Former-commit-id: 061ed370a4c95a64669335c6b2a5da7ebc1015fd
2013-05-14 08:11:56 -07:00
John-David Dalton
4b3009a195 Ensure _.clone, _.flatten, and _.uniq can be used as a callback for methods like _.map. [closes #270]
Former-commit-id: fb62b5bbdad844cb04c3259c323e27fb81932809
2013-05-14 00:50:57 -07:00
John-David Dalton
b72b0d60cb Add support for floating point numbers to _.random. [closes #263]
Former-commit-id: ef356bb180b163fc936ef69ac2ef33186983eaa7
2013-05-12 15:48:01 -07:00
John-David Dalton
5841e62c66 Add _.chain alias of _. [closes #267]
Former-commit-id: 580e4346444096c7fa77cfc5cf2c68b6cf891fcf
2013-05-11 00:59:48 -07:00
John-David Dalton
9bd0c01702 Expose memoized function's cache. [closes #265]
Former-commit-id: fc44676386854ec9d5fd7a4fac8583508d63949f
2013-05-10 23:22:04 -07:00
John-David Dalton
6d86b3a950 Add _.has unit test.
Former-commit-id: 3334651f8d29e6aa006184846b128acd006157ef
2013-05-10 22:57:08 -07:00
John-David Dalton
5ff9b02c89 Rebuild files and docs.
Former-commit-id: 697fc5842bb6099f48e3731940c9e329452850d2
2013-05-08 01:05:03 -07:00
John-David Dalton
80934ea232 Fix build.
Former-commit-id: 114ddcfec3e9bd4bccf481e8ec943ffdead2bb24
2013-05-08 00:59:37 -07:00
John-David Dalton
5acfa2bf3a Remove _.unzip from the underscore build.
Former-commit-id: 6d0accb64f39b08b72e3165c49a8c844a7a99cd3
2013-05-07 23:49:30 -07:00
John-David Dalton
4fada52e04 Remove nonEnumProps from the modernish builds.
Former-commit-id: 38592e1ee24524b223b801ede8033d7b4ccb8a36
2013-05-07 23:34:17 -07:00
John-David Dalton
e1c8e95e11 Tweak whitespace in iteratorTemplate.
Former-commit-id: 2f9fdbd72d316a1668d34fa95a3f1ecb325d625b
2013-05-07 23:33:04 -07:00
John-David Dalton
1dfebad790 Add a space before define in the minified files so Dojo builder will detect it properly.
Former-commit-id: 3c656ba3b2dd4771eab97c259840c2f426e2454c
2013-05-07 22:14:47 -07:00
John-David Dalton
37ffe63d13 Rename arrayRef to arrayProto in build.js.
Former-commit-id: fec054f96a4972173cb638ee77a7a0d1813c9ad4
2013-05-07 09:24:12 -07:00
John-David Dalton
cc14c34dc2 Allow the underscore build to opt-in to more lodash build methods.
Former-commit-id: 3f685fe1ced25ba37ea9d09e2ed8fa59acb5b8b7
2013-05-07 09:22:31 -07:00
John-David Dalton
e0cf4e644b Add more _.forIn iteration tests and prep support for Error object iteration.
Former-commit-id: 3676681717d0648c9f96570a4952f7c35e6a9bec
2013-05-07 01:38:13 -07:00
John-David Dalton
aad55fc3db Fix trailing parenthesis typo.
Former-commit-id: a9b4fe7408aa9faa7079656c3cb31a4c655544e6
2013-05-06 07:02:53 -07:00
John-David Dalton
ba2b459220 Tweak wiki wording in README.md.
Former-commit-id: 86b1377b1e0eb09bf9e50ac66b988548b022cf96
2013-05-05 23:59:13 -07:00
John-David Dalton
086669fbe0 Ensure _.forIn works over objects with longer inheritance chains in IE < 9.
Former-commit-id: 226223454e71dd8cb6c38a543f1accd915eef3cb
2013-05-05 23:58:33 -07:00
John-David Dalton
4cc3fcb6e8 Ensure unknown objectTypes return false.
Former-commit-id: a60236ecd8908a91c0268d71d5710665986f1ceb
2013-05-05 23:49:37 -07:00
John-David Dalton
8781053dbe Simplify arrays iterator options.
Former-commit-id: 7ea81c03f791615bcfec24d8574162c190d49c7d
2013-05-03 08:51:10 -07:00
John-David Dalton
bdac8974d8 Realign _.assign and _.defaults with ES6 Object.assign. [closes #259]
Former-commit-id: e8c89e4a130ed286ce07e1a2e848f50b182effae
2013-05-03 08:33:51 -07:00
John-David Dalton
9ae24141a3 Cleanup _.debounce.
Former-commit-id: 0212c6b31222a8e215d6f60e906fbad074f424a9
2013-05-02 00:06:55 -07:00
John-David Dalton
e773efdc59 Ensure _.debounce with leading and trailing will call the func on the leading edge after a trailing call is performed. [closes #257]
Former-commit-id: 97afe842b2b4c3eb20c9557298e01ec268386ea2
2013-05-01 09:03:52 -07:00
John-David Dalton
8f94bd1fbd Reduce _.unzip and _.zip.
Former-commit-id: f388c50817910eee510f33b22fd4904fd648a6f0
2013-04-30 09:18:26 -07:00
John-David Dalton
d24d83d52a Ensure remove of the "exit early" feature is handled properly when mixing lodash methods into the underscore build.
Former-commit-id: 973c3e188076ca4403f59684b82bee3049370d5a
2013-04-30 09:12:57 -07:00
John-David Dalton
c938017baa Bump to v1.2.1.
Former-commit-id: ddffb32b2aa61001e81fccfa59b9e9bb38bf7883
2013-04-29 09:10:51 -07:00
John-David Dalton
728eea3ae1 Use zopfli to compress minifiers.
Former-commit-id: 0c68644b7602caf00b02a4977951508aceeb4156
2013-04-29 08:55:07 -07:00
John-David Dalton
88f9c1e539 Add modern build test.
Former-commit-id: 5f1addf774bd9d128095d477c227c4d8420ead5d
2013-04-29 08:54:46 -07:00
John-David Dalton
76540c20f3 Add .map to the ignore files. [ci skip]
Former-commit-id: 129c53ab38b4fbb178b4a832a7abdbf8b055d615
2013-04-29 08:54:15 -07:00
John-David Dalton
70761cf1d9 Avoid false test fails in isType unit tests.
Former-commit-id: b7311a8c3844000efab5d56d3632b99f0bf16ce8
2013-04-28 19:28:40 -07:00
John-David Dalton
ace913a97d Update avatars in READMEs. [ci skip]
Former-commit-id: a4ca090094770481959cd4d4e68ec49696c12f9d
2013-04-28 16:51:53 -07:00
John-David Dalton
d6e269c7f6 Avoid special characters in the whitespace unit test.
Former-commit-id: 5344bbdb0cd96a3a7d275facc7160c1afa1e971e
2013-04-28 16:48:54 -07:00
John-David Dalton
ec10550b3a Ensure the _.isRegExp is correct for various builds.
Former-commit-id: 38cf57053b89b1011bbfbd0b6a9cd31e91589c31
2013-04-28 16:48:13 -07:00
John-David Dalton
86e2374b48 Ensure _.isArray assignment is handled correctly for builds.
Former-commit-id: a844909ada5fbb394cbb91d06e6c76ccc6c40ff7
2013-04-28 15:53:36 -07:00
John-David Dalton
d156dacbb9 Add more .json files to the various ignore files. [ci skip]
Former-commit-id: ff1bce7c404799856f838aab301e60b654309c96
2013-04-28 15:23:53 -07:00
John-David Dalton
1af5517da0 Add component.json. [closes #58]
Former-commit-id: a7edbb3ee80687f3c74fdb2ae37cad553e009766
2013-04-28 00:18:37 -07:00
John-David Dalton
e5d34890a9 Cleanup whitespace characters in strings and fix a whitespace bug in Closure Compiler.
Former-commit-id: d1ab43648f3084b7bcfbd471728b71cea48aa9be
2013-04-27 02:24:25 -07:00
John-David Dalton
183b2548cf Document the radix argument of _.parseInt and ensure it ignores leading whitespace. [closes #254]
Former-commit-id: b1d0f7688402b3f41cfb030c63dcd097ba3f4e68
2013-04-26 22:48:14 -07:00
John-David Dalton
d2de489e3a Update vendors.
Former-commit-id: a36c775be95f95737129965826c2ffcab3fde4f3
2013-04-26 10:44:59 -07:00
Kit Cambridge
90f8dbd86e minify: Send a User-Agent header to avoid 403 responses from GitHub. [ci skip] [closes #255]
Former-commit-id: 1879b790b4ace543430edba6ae62d33c963f0344
2013-04-26 09:38:04 -07:00
John-David Dalton
3508ce19f3 Remove support.argsObject from the underscore build.
Former-commit-id: 4b25a64d662bde78ab6956109b072ed0a4755e53
2013-04-25 09:15:12 -07:00
John-David Dalton
00188c9818 Use -1 as the selectedIndex of the drop down lists when a custom url is used in the perf suite. [ci skip]
Former-commit-id: a3946b9a1d1e129b202606172803daf93afb1fbe
2013-04-24 23:40:41 -07:00
John-David Dalton
499232f0e6 Use lodash.reduce in getGeometricMean of perf.js. [ci skip]
Former-commit-id: 7c5af9afcd56958e03f96d3f13f396894cf95f4b
2013-04-24 21:48:04 -07:00
John-David Dalton
17471a12d2 Add legacy build to the perf suite and ensure belt is assigned the correct value.
Former-commit-id: 568bbd8157155d76d406ae0e33fe71418f4632f4
2013-04-24 12:53:18 -07:00
John-David Dalton
de4b5eeda7 Allow external scripts to be specified and run in the perf suite.
Former-commit-id: 474f0a24d54c800830e2bcec98f6536a17a12bfb
2013-04-24 09:08:46 -07:00
John-David Dalton
d0a0193707 Add missing backticks in the docs. [ci skip]
Former-commit-id: 77e7f0275b820e02d52dea90181fc48ae0f650fe
2013-04-23 20:28:52 -07:00
John-David Dalton
5269a26b69 Merge pull request #253 from ajoslin/master
Fix missing backtick in uniq docs

Former-commit-id: 37b7007e2f2bc8e30f09fb04dc1a2a69c84795e2
2013-04-23 20:14:24 -07:00
Andy Joslin
8dc6ad587f Fix missing backtick in uniq docs
Former-commit-id: f43321cad9391c1b6167cf1ba7a7814e5128948c
2013-04-23 23:07:55 -04:00
John-David Dalton
757339c52d Add more builds to the drop down lists of the perf and test suite.
Former-commit-id: ab565c850a553e70137b064383813812eee4acce
2013-04-23 00:05:37 -07:00
John-David Dalton
6e289339d7 Ensure _.isArray fallback returns a boolean value.
Former-commit-id: c96fb8e95c40d546099796f8337db6d4d3d33aea
2013-04-22 23:56:36 -07:00
John-David Dalton
3ff0a44a1c Tweak perf suite to use geometric mean and remove tests with high variability.
Former-commit-id: ce4ff88ee6be007b761bcf991c59f30f28880973
2013-04-22 08:33:01 -07:00
John-David Dalton
0562228e9a Ensure the modern build version of _.isPlainObject doesn't error when passed an object created via Object.create. [closes #248]
Former-commit-id: d24641ed2562925fbbd2b64653e8e93ab1aa02bc
2013-04-20 19:40:48 -07:00
John-David Dalton
0b6993bb7c Fix _.debounce doc typo.
Former-commit-id: e2659ca38818d15a4080aa8dd605fed99a9eaa43
2013-04-19 09:07:55 -07:00
John-David Dalton
4a19d90d48 Add _.isObject to the isType benchmark.
Former-commit-id: 4e2a61fab31b506bac1d5ce7ad47f7bb2d9e11b6
2013-04-19 01:03:09 -07:00
John-David Dalton
038b1bcf7b Update _.debounce and _.throttle doc examples and rebuild.
Former-commit-id: fc094e857aeae0ab9581ad56dca894cc96bc7b2e
2013-04-19 01:02:36 -07:00
John-David Dalton
a707c2fe8e Ensure isType methods return false for subclassed values.
Former-commit-id: e300d12eb506c6ae4949bd37cf8eb33c3a4be2e1
2013-04-19 00:12:22 -07:00
John-David Dalton
3bb119f578 Update _.debounce and _.throttled docs. [ci skip]
Former-commit-id: 5a94c9d35069952c72303541409b88656deaa6a7
2013-04-17 22:40:49 -07:00
John-David Dalton
2a92600fa7 Add _.throttle unit test to test lastCalled.
Former-commit-id: 528ebd3514aacafcde55fad989f955f1fe403811
2013-04-17 21:36:37 -07:00
John-David Dalton
e80e1dab4d Add lodash underscore build tests for isType methods.
Former-commit-id: 80898964d46abebb3acf1e5e3586f4df700cd85b
2013-04-17 19:53:14 -07:00
John-David Dalton
45d59d75ba Remove stray fs.writeFileSync in build.js.
Former-commit-id: ba94c84ac7e3d2fe9be8e578035132c86cd59790
2013-04-17 19:52:49 -07:00
John-David Dalton
28cd4c3ee9 Update docs & builds.
Former-commit-id: 84fbc06fe506451e70fb76cef16cbc072468df99
2013-04-17 09:04:07 -07:00
John-David Dalton
e7c44274b0 Ensure _.debounce performs a trailing call, when both leading and trailing are true, only after the throttled function is called more than once. [closes #243]
Former-commit-id: 59ac6bc4ece373623f2bd753b662b8cc974cabc8
2013-04-17 08:43:18 -07:00
John-David Dalton
3b2e0e34ef Tweak release notes in README.md. [ci skip]
Former-commit-id: 316e7610ad00ca0b9d6a80ec44d38e1e739dcfd8
2013-04-17 08:07:28 -07:00
John-David Dalton
2276df07bd Bump to v1.2.0.
Former-commit-id: bb045c043e8f1bbf6cf7fbf463952daa1c24c855
2013-04-16 09:00:33 -07:00
John-David Dalton
758ff03520 Exclude bower.json from Jam and NPM packages.
Former-commit-id: 93ce567c4cfd70bcba58fff27d0dc6c6cca12b7d
2013-04-16 08:58:57 -07:00
John-David Dalton
c3ac172960 Simplify _.debounce and _.throttle for the underscore build.
Former-commit-id: 56dc526cf71130084651d06b8caadce573471131
2013-04-16 01:52:47 -07:00
John-David Dalton
562b4eb531 Ensure unit tests pass in Narwhal.
Former-commit-id: a86ce088a72ea0be7b31e4bccc51ce1286b9418b
2013-04-16 01:04:47 -07:00
John-David Dalton
b1f8e845df Make _.isArray consistent with the other isType methods.
Former-commit-id: adcf242ba7692c96fb8f570118acd7fd0a4602da
2013-04-15 23:58:33 -07:00
John-David Dalton
bda869ea54 Add more to the .gitattributes and tweak template built tests.
Former-commit-id: 7f6c20de3981edb4afeb848ef7721f0075c51b54
2013-04-14 22:05:44 -07:00
John-David Dalton
19cfbf082a Fix corrupt vendor/closure-compiler.tar.gz.
Former-commit-id: 118cbaae80df4751552569211cd7b6436fb6b30f
2013-04-14 15:51:43 -07:00
John-David Dalton
07078bdd1f Tweak how the build handles support property cleanup and ensure the mobile build fixes some old WebKit bugs.
Former-commit-id: 34c3aeb2b58cf83a5a141ffc423245922082a714
2013-04-14 14:02:11 -07:00
John-David Dalton
03657a98e1 Fix typo in no-dep test title.
Former-commit-id: 30d904ab630012c4ba1f07b2762a33d25151486b
2013-04-14 10:19:34 -07:00
John-David Dalton
b3f64abfae Update vendors.
Former-commit-id: 43e57a1a75bdd66e95d3608f180514cfe5e0075c
2013-04-14 01:18:54 -07:00
John-David Dalton
5d73c8f002 Add -n/--no-dep build option.
Former-commit-id: 57571d0df4e17402b9055bae5ccfbc2b94f03613
2013-04-14 00:43:39 -07:00
John-David Dalton
ba0882762d Reorganize build tests.
Former-commit-id: 6f6aea86b84f8b4936785653fbfaa3a146af66a2
2013-04-13 23:47:51 -07:00
John-David Dalton
bb8855b628 Don't include tests that error in the total score of the perf.js suite. [ci skip]
Former-commit-id: ea71d436ecec9297b2d991e9f17e3665a9e53d23
2013-04-13 16:58:28 -07:00
John-David Dalton
883d5917f5 Fix build.
Former-commit-id: 99b283a2f26a9f5973799ad6757bfdc57d0a0404
2013-04-13 14:22:29 -07:00
John-David Dalton
0275e99fe2 Remove the lodash csp build as the default modern build no longer uses compilation.
Former-commit-id: 97f0722cae9190fd11aa9f458c9c7bc281fd82e4
2013-04-13 14:19:41 -07:00
John-David Dalton
5d109077e5 Use _.cloneDeep in build/util.js.
Former-commit-id: 06094c21fe084192933665982edc9a4212016406
2013-04-13 11:13:26 -07:00
John-David Dalton
540851ab6a Reorganize build.js modifications and remove compilation from the lodash modern build.
Former-commit-id: af5d0500be9e11d108bf941604ce2316cbd8c4b5
2013-04-13 11:12:01 -07:00
John-David Dalton
6b920fa5e6 Don't prefix paths with drive letters with dots in mkdirpSync. [closes #238]
Former-commit-id: dd0c8d7b1906210e5f26604d4149ba542727c78d
2013-04-12 13:15:44 -07:00
John-David Dalton
d1498bb9fb Tweak lodash, shimIsPlainObject, shimKeys, and reduce function docs. [ci skip]
Former-commit-id: f24dd4de2a5a6c8103f26d000f1f16b5be3d8165
2013-04-10 20:38:26 -07:00
John-David Dalton
54eeef173a Force lf in .gitattributes.
Former-commit-id: 075ae2c3b8655159095cd7ea5d1b4aae7792f39f
2013-04-10 08:38:35 -07:00
John-David Dalton
723ddf8cda Cleanup ignore files and package files, adding bower.json.
Former-commit-id: eb817fdaa786f35a7906d56dc1bd7e4af1bee33a
2013-04-09 20:49:42 -07:00
John-David Dalton
9f12552907 Add _.once unit tests.
Former-commit-id: cb79b4a5e73ec0cb7bae959693bb14599277ffe0
2013-04-09 20:23:58 -07:00
John-David Dalton
a8b6fa413e Cleanup build files and add build/util.js.
Former-commit-id: 67e5564a17ec4a438e3d0768e8963a1384d4ce98
2013-04-09 20:23:16 -07:00
John-David Dalton
76aae8ce42 Escape path separator when using it as part of a regexp. [closes #233]
Former-commit-id: 95d28187ee573ecc26e44f30cb5fb7457877dd06
2013-04-09 08:35:05 -07:00
John-David Dalton
ad0c287053 Ensure _.merge passes the right arguments to the callback when comparing objects. [closes #231]
Former-commit-id: 7c1ff861f753d3a2bdf62a753c94df2052d03d78
2013-04-08 21:01:57 -07:00
John-David Dalton
4a11a3559d Fix typo in iteratorTemplate and _.template docs. [ci skip] [closes #232]
Former-commit-id: b7870c00a2ab788c233696d3ca40f8306ee7bc3a
2013-04-08 20:01:19 -07:00
John-David Dalton
1faa5a80e4 Add unit tests to ensure non-underscore builds may include _.chain and _.findWhere methods.
Former-commit-id: 91a4ea5114a45bc5038a37d7ff4ea4b6212182ca
2013-04-07 22:55:52 -07:00
John-David Dalton
f1d3df1ec0 Update builds and docs.
Former-commit-id: 6409ea5dfeb50e5e69c844847b57b4853b7622c3
2013-04-07 20:15:23 -07:00
John-David Dalton
e7c94d3351 Cleanup _.union.
Former-commit-id: ed927c495c93121371d852f5239a068967ec6a6c
2013-04-07 20:06:09 -07:00
John-David Dalton
954f76dcf5 Reduce package size. [closes #230]
Former-commit-id: 91e7564f799866453783c9319af405a7aea65b2c
2013-04-07 20:00:44 -07:00
John-David Dalton
43037c0ff9 Ensure "Arrays" and "Objects" methods work with arguments objects and arrays respectively.
Former-commit-id: aebb7a0004d804b7fd43d73e24d1da28c67f4059
2013-04-07 15:53:52 -07:00
John-David Dalton
93df901b71 Switch to using useLodashMethod in build.js and allow non-underscore builds to include _.chain and _.findWhere.
Former-commit-id: 6c99623286059caf7a74dd4a19394da3562d7932
2013-04-07 08:56:43 -07:00
John-David Dalton
e97e645eda Use nativeSlice when possible and adjust largeArraySize to account for the recent cachedContains tweaks.
Former-commit-id: 9fe4dc10c74fb7a4b8e5cff434a4146d274f15d4
2013-04-06 01:26:21 -07:00
John-David Dalton
4a03ba3874 Add more _.debounce and _.throttle tests.
Former-commit-id: db3cb30a8eac82850a056f85d0c363e752d10027
2013-04-05 22:14:44 -07:00
John-David Dalton
7f637e4acc Update builds, vendors, and docs.
Former-commit-id: 67aec5a64de61ac2b8948b31315395a727c10071
2013-04-05 09:04:01 -07:00
John-David Dalton
8f3eeefafd Should ensure callback is a function in _.isEqual.
Former-commit-id: b53f8e0ab1bafff395ff19cd069940ba6c37eb5f
2013-04-05 08:59:09 -07:00
John-David Dalton
5dc550a0ce Cleanup doc examples for _.find and _.findKey.
Former-commit-id: 198149aa9caf277b2a819ee5c06c73e38fa6beae
2013-04-05 08:35:07 -07:00
John-David Dalton
6fe322da27 Add an options object argument to _.debounce and _.throttle. [closes #222]
Former-commit-id: d5eb3bc21d4a5c6d25314153f98d43a3d11eb4fa
2013-04-04 08:52:42 -07:00
John-David Dalton
3cfe7c9a56 Reduce --time-limit in .travis.yml.
Former-commit-id: 8fcd6b73eafbbb7c23e29cd60ee75fc83577673b
2013-04-03 23:04:47 -07:00
John-David Dalton
be7d5917cb Update vendor/underscore.
Former-commit-id: d1cca79a4f6732ee8cd48dd4574041b4ebe19edf
2013-04-02 22:38:48 -07:00
John-David Dalton
ca28aa6ebd Tweak argument names and docs.
Former-commit-id: 38d7f9cc7dea76e038ede22b6c6b4e779e28237b
2013-04-02 22:37:40 -07:00
John-David Dalton
e76360c1b5 Add _.unzip. [closes #225]
Former-commit-id: 4b2c7fc068fd430f3d78de850a5f7670fd0e1a4e
2013-04-02 22:34:15 -07:00
John-David Dalton
265ca8ba67 Update docs and builds.
Former-commit-id: 6bb15d3ad0d4d189ad5e27e1dd79d2a070a568b2
2013-04-02 00:37:19 -07:00
John-David Dalton
b0d942d0ec Ensure _.merge applies a given callback to nested properties. [closes #227]
Former-commit-id: 1a58c178e0ecb9c50512f221b4aed82762709066
2013-04-01 23:54:09 -07:00
John-David Dalton
6c25905ae4 Add keyPrefix to avoid issues with __proto__. [closes #226]
Former-commit-id: 55dee782acdd5e28229b1fcb7587424d3fdfd445
2013-04-01 22:32:50 -07:00
John-David Dalton
80a39393fe Use toString.bind instead of slice.bind in nativeBind assignment.
Former-commit-id: f08d16b1fa8eb98cf848daff96f7449c0dc51c90
2013-03-30 22:07:24 -07:00
John-David Dalton
d4aed71abf Make Lo-Dash work with Browserify. [closes #223]
Former-commit-id: 33b53dd075d6c4ed9682881af463bdd3c241ca44
2013-03-29 19:04:20 -07:00
John-David Dalton
ebb72bb992 Remove useUnderscoreClone check from the underscore build _.toArray replacement.
Former-commit-id: 62777dbc108689aa7bd0e258e64341aad8fa6cb3
2013-03-27 19:43:37 -07:00
John-David Dalton
8ffcd30b4d Simplify license in package.json. [ci skip]
Former-commit-id: 1915ba400e5f45713a018d26081bb6666fb6683a
2013-03-27 19:37:56 -07:00
John-David Dalton
06804c37e2 Remove travis-ci badge from README.md.
Former-commit-id: f978ab7e86a15b4f599c3f20afd8e1b8cfe1183a
2013-03-27 09:47:27 -07:00
John-David Dalton
1acca0278c Bump to v1.1.1.
Former-commit-id: 1eaebbcedcd925ef2994d8e9a2c9b00c6a23c4b3
2013-03-27 08:03:09 -07:00
John-David Dalton
639c8d4171 Add _.forEach thisArg unit test to test.js.
Former-commit-id: b3d16d90789e76df778ac3457f68fdcbc3f6f4ad
2013-03-27 07:55:19 -07:00
John-David Dalton
d77c9d3fca Ensure underscore build internal forOwn will accept a thisArg argument. [closes #220].
Former-commit-id: a7818db29e81b64556232bfe44b2e1275d3dada1
2013-03-27 07:29:27 -07:00
John-David Dalton
2c7cc2c191 Update vendor/tar for Node v0.10.0+. [closes #218]
Former-commit-id: 9b35d27127dbd85dd56808e50bf255bbd3413c62
2013-03-26 20:15:06 -07:00
John-David Dalton
d7c74b8004 Bump to v1.1.0.
Former-commit-id: 7d103159263b2ad339cd1e2dba90df0d6c42a61d
2013-03-26 00:18:12 -07:00
John-David Dalton
aaa8003418 Update Benchmark.js to work in PhantomJS.
Former-commit-id: 9145f027f58a3c9f0c8b57b6e340f500ba4c7131
2013-03-25 23:23:15 -07:00
John-David Dalton
86890b13c6 Ensure consistent unit test count depending on build.
Former-commit-id: 390020635374f6fb1165a6adef0648847ec9cb9e
2013-03-25 22:12:25 -07:00
John-David Dalton
39158b0eb6 Add missing semicolons. [ci skip]
Former-commit-id: 7c9c39e84600f41d1a4f94224dfe5b2be8791d20
2013-03-25 20:37:54 -07:00
John-David Dalton
87f1d55bc2 Update docs and builds.
Former-commit-id: 21791e052114af5907d76251c58c3ba2ca138873
2013-03-25 08:35:20 -07:00
John-David Dalton
14343b5410 Make object iteration that uses _.keys work correctly in IE < 9 and _.isPlainObject work correctly in IE < 8.
Former-commit-id: ad9a3c36acb38e36cd21fe82a29b7e65a767e049
2013-03-25 08:22:40 -07:00
John-David Dalton
ffdac30b3c Make _.toArray work in legacy build.
Former-commit-id: 36866e65670f563b587af51168db9f95f01ed248
2013-03-25 08:21:43 -07:00
John-David Dalton
244c8dc391 Add dist/lodash.backbone.js. [ci skip]
Former-commit-id: c9abf959bbc0e30dd5da728e3c7903905d4e751a
2013-03-24 00:11:57 -07:00
John-David Dalton
e593344461 Add copyright header to minified Underscore file. [ci skip]
Former-commit-id: dce520ee6e1e2a175e4671ddcf7c2408efdff69f
2013-03-23 23:51:42 -07:00
John-David Dalton
74c46f6e93 Reduce the lodash underscore build.
Former-commit-id: 2f928d053faf4b8e45d5ef26e2697c25426b7a90
2013-03-23 23:46:40 -07:00
John-David Dalton
bbfd8aa249 Update Backbone method dependencies.
Former-commit-id: 031a5f31c289ad32c8ef0d30272a02c756a341ce
2013-03-23 23:24:25 -07:00
John-David Dalton
2705a488ad Update vendors.
Former-commit-id: b1b94d80548df89b3ce0ddd71b1e938f31666052
2013-03-23 23:23:57 -07:00
John-David Dalton
850c253e08 Use _.contains instead of indexOf in build/test files.
Former-commit-id: b0947f4f24c23e011f3ac781d400ee3ebbc94609
2013-03-23 22:49:28 -07:00
John-David Dalton
80e0e3fcd7 Optimize _.pluck for modern environments.
Former-commit-id: 1a6bbb9866b8ac20faaa707be5f33814579e1df8
2013-03-23 12:21:43 -07:00
John-David Dalton
2cc2d696f1 _.bind should throw a TypeError if func is not a function. [closes #213]
Former-commit-id: b6035736d9cb042b7fa4a9d0b7b4d9c6cb0ea4f8
2013-03-23 09:00:24 -07:00
John-David Dalton
8a83a6b5be Add AMD exports to the dist/lodash.underscore.js builds. [closes #214]
Former-commit-id: 4635d0c4f1ff315b08fb459ab64ef2b9ac6cbaa8
2013-03-23 00:40:06 -07:00
John-David Dalton
002d5338a0 Correct build.
Former-commit-id: 360983e61c6c6460f344d53dbda5c68e21530e32
2013-03-23 00:36:12 -07:00
John-David Dalton
743aa472f0 Ensure _.keys use in createIterator is consistent per build.
Former-commit-id: a4e0aef177d4d1c26ed5ce088574b591a6666d0d
2013-03-19 23:50:56 -07:00
John-David Dalton
ba85d5d351 Remove the _.isEqual dependency from createCallback in the underscore build and avoid potentially unnecessary string coercion in the underscore build _.isEqual method.
Former-commit-id: 1e8ce4fd9a35ad36c2b24457e519cb587c49c93b
2013-03-18 03:08:12 -06:00
John-David Dalton
4e2ef908dc Limit the category build option to adding only those methods available for specific builds (i.e. underscore and backbone builds).
Former-commit-id: 63a5509cd953b20376723335d42fb5a136eb3a5c
2013-03-18 02:43:02 -06:00
John-David Dalton
f5dd05ba8e Fix _.findIndex and _.findKey doc typos.
Former-commit-id: 7d4ae05db116e324b4b143e77bca67787476030f
2013-03-18 01:49:36 -06:00
John-David Dalton
17eda2a4cc Rebuild files and docs.
Former-commit-id: a3948db17af507d28d568d07d3e1a2afbd2c70ad
2013-03-17 19:43:23 -05:00
John-David Dalton
d219c6e019 Avoid creating intermediate strings when not needed.
Former-commit-id: 1e7457ff131f867adbf799e20af11cf714f5da7e
2013-03-17 19:31:37 -05:00
John-David Dalton
2dc539747b Add _.findIndex and _.findKey. [closes #199]
Former-commit-id: 5ac98b559e074082d4019cd30c27bface063f9c9
2013-03-17 19:28:46 -05:00
John-David Dalton
e941de50e8 Add fast path for callback back to _.forEach and ensure createCallback is called from lodash.
Former-commit-id: 5d589344897878d529d59ebba987a163b9704b37
2013-03-15 06:34:13 -07:00
John-David Dalton
63052257a2 Adjust large array size for _.difference and cleanup large array optimization code.
Former-commit-id: c3623ce2e0639a9e98d77e36e4dae51063c76e92
2013-03-14 14:38:48 -07:00
John-David Dalton
ac5d2a714e Make modern build pass unit tests again.
Former-commit-id: 6269bdbaa7cd96217568504921da097c2352cef8
2013-03-13 10:13:59 -07:00
John-David Dalton
59f78c16b1 Remove internal each for modern and underscore builds.
Former-commit-id: d090f9d0a21f8086d9e34d1171dc046a93327bb8
2013-03-13 07:56:15 -07:00
John-David Dalton
3f7f8133df Make pref.'s work for various lodash builds.
Former-commit-id: cdde1730e7b402c1f6475fc796af683faf6a8e88
2013-03-13 07:54:46 -07:00
John-David Dalton
fef5e1ce2c Simplify "Collections" methods for the modern and underscore builds.
Former-commit-id: 4ee5052537f7aed6816a886bee6da4e75c17099c
2013-03-12 07:32:02 -07:00
John-David Dalton
0b97b3864f Add isHostType to perf.js.
Former-commit-id: 36a1818a5272966ac9bd7f2394f2bd466fe6a4d4
2013-03-11 01:10:31 -07:00
John-David Dalton
3d1330c85d Remove assignment to undeclared variable in perf.js.
Former-commit-id: 6c8c6bd2db9a3ab137f6a705e2dabb2c07ccdc34
2013-03-10 23:51:17 -07:00
John-David Dalton
041c0cc322 Make pref.js work in Rhino, Narwhal, and Ringo again.
Former-commit-id: 1969153262cbc3ac134018aa021de92a86d6d7ef
2013-03-10 23:40:33 -07:00
John-David Dalton
e72712640c Allow lodash underscore plus=cloneDeep without also needing to include clone.
Former-commit-id: 90f89296ab47eff635c3c30ed34466e347ea13d3
2013-03-10 22:32:57 -07:00
John-David Dalton
6830195127 Cleanup build and docs.
Former-commit-id: 7e0719bb11e3f22ab09d51b52ab930699cbecf17
2013-03-10 11:05:07 -07:00
John-David Dalton
f9b5d6644d Ensure _.isPlainObject returns false for objects without a [[Class]] of "Object".
Former-commit-id: ce034f55733cd1929f09bf80e4a461c6e1502d1b
2013-03-10 04:27:45 -07:00
John-David Dalton
40f9eeda36 Remove reLeadingZeros from lodash underscore build.
Former-commit-id: 289d53be5b6af17ace4118ea0e6d9784667d09d3
2013-03-10 03:28:59 -07:00
John-David Dalton
0fa0b0b1ea Remove Closure Compiler escape from eachIteratorOptions.
Former-commit-id: 532e73f570bed2bc5941d0a6d1cb13618da0441b
2013-03-10 00:55:50 -08:00
John-David Dalton
ff0b23f200 Update vendor/platform.js again.
Former-commit-id: 39d31dcc7ef75a2bc62d9147f39c7adab2f2369f
2013-03-10 00:43:31 -08:00
John-David Dalton
5456d4081b Move regexp used in _.parseInt to outside the method.
Former-commit-id: 5b93dcdff39089ed5467ba52040f2e352716c49e
2013-03-10 00:30:58 -08:00
John-David Dalton
8948fae780 Update vendor/platform.js but remove it from test.'s.
Former-commit-id: 4f72d2b4454e7de42754c98c7b17f47f1f30718c
2013-03-09 23:52:20 -08:00
John-David Dalton
ee4542a699 Optimize lodash function to avoid slow path for arrays.
Former-commit-id: 24e2c4ac2525ae38e214fdb0ea8e3ab664d784b7
2013-03-09 18:24:29 -08:00
John-David Dalton
31e4e631f9 Cleanup test.js and perf.js and add _(array) benchmark.
Former-commit-id: bcd120c9ee332db39c7b637894751f2861bac069
2013-03-09 18:15:32 -08:00
John-David Dalton
cbf20b3271 Update vendors.
Former-commit-id: 7b8fe528a3e3887321505cf68b61cc3d774ef60b
2013-03-09 17:15:35 -08:00
John-David Dalton
a65fd50723 Add note to _.createCallback docs.
Former-commit-id: 0e5dfa9b4dc9aeea1c821b47d2f3d755678ea1aa
2013-03-09 13:32:15 -08:00
John-David Dalton
63a6aac2d8 Expanded _.createCallback and _.after docs and ensure _.times calls lodash.createCallback.
Former-commit-id: 2d6a480a5ee449295ec40acd5e8bbef6fe955473
2013-03-09 12:22:19 -08:00
John-David Dalton
afde4804c9 Fix build test and add extra "Arrays" and "Functions" method category tests.
Former-commit-id: 924e034ec6ec8d05d573dff969f064f1bb32ea33
2013-03-09 01:30:45 -08:00
John-David Dalton
bc8ec9cd3e Make _.times use _.createCallback and rebuild docs and dist/builds.
Former-commit-id: 62393b4833b64cea226abdbb6f1488369de46677
2013-03-09 01:29:42 -08:00
John-David Dalton
b63ab18e29 Rebuild docs and custom builds.
Former-commit-id: 6fea0c6b4c7bb28ee3d55b4af27874e40cd9813f
2013-03-08 22:57:20 -08:00
John-David Dalton
e7325f58c3 Correct unit test for rhino -require support.
Former-commit-id: 83c076f881daccd18d7e11006e3fab75ecea27ea
2013-03-08 09:00:20 -08:00
John-David Dalton
7b35bb8c96 Correct support.nonEnumArgs.
Former-commit-id: 69b09827404bae997846daa681d96d8c9264af78
2013-03-08 08:56:30 -08:00
John-David Dalton
e84671ce5d Correct _.result docs and cleanup _.support docs.
Former-commit-id: 6edb1956885d61408188d2809eeacd3aa975f283
2013-03-08 08:32:50 -08:00
John-David Dalton
b01d50fe05 Add _.support unit tests and remove _.support from the lodash underscore build.
Former-commit-id: 986c02d5363329f16cde720430b26edb6bc865f0
2013-03-08 00:53:27 -08:00
John-David Dalton
3f163051b1 Avoid hardcoded indents in build.js.
Former-commit-id: ece1e6a32f5d308e4674774f8875ee34c06b4d43
2013-03-08 00:20:07 -08:00
John-David Dalton
4f1d03e1d4 Cleanup the inlined iteratorTemplate.
Former-commit-id: 0964f0fda4a21a2009ebfd022e9d9c33bd78bbee
2013-03-08 00:03:57 -08:00
John-David Dalton
fc39e4a225 Fix build.
Former-commit-id: 17c97c9e2cad21ea6eb0af3d7b93ebb5caa89720
2013-03-07 23:20:25 -08:00
John-David Dalton
bf88ad7fc8 Update builds and docs.
Former-commit-id: 104839a253a7f3711dad357899128ccf839b01cf
2013-03-07 23:09:35 -08:00
John-David Dalton
11ba02067e Ensure _.times doesn't error when passed negative numbers.
Former-commit-id: 5d694743fbda0f477250fe3c90cf29168834ac6f
2013-03-07 09:05:27 -08:00
John-David Dalton
952afa05ce Add the _.support object.
Former-commit-id: b81ec9e5dbd41c729b3ad71187cb5e77e0755b9f
2013-03-07 09:02:44 -08:00
John-David Dalton
3131cc3160 Replace createWrapper references with new lodashWrapper references and refine Closure Compiler fix.
Former-commit-id: 552b98a4e9ccd42a00a980dd850e3b154cb7cd32
2013-03-05 02:05:44 -08:00
John-David Dalton
792f768479 Update vendor/requirejs.
Former-commit-id: 90bd5bc12f9159b65d485c540474404a61cad7ef
2013-03-05 00:22:03 -08:00
John-David Dalton
ff312a15dd Update minifiers, fix new Closure Compiler issue, and re-minify builds.
Former-commit-id: fb9993cb39c5c43d430e038253ab717ceb4c705f
2013-03-05 00:21:41 -08:00
John-David Dalton
36207c9a98 Modify the Lo-Dash description.
Former-commit-id: 910b51eb69b12df04345f8e97d7c288aee1525f7
2013-03-04 22:15:29 -08:00
John-David Dalton
b92105e888 Simplify the lodash wrapper.
Former-commit-id: 389c9ca8aa8414b04f7f99caf955862a1925d42e
2013-03-04 22:03:34 -08:00
John-David Dalton
35bd7c55d0 Move lodash instance check up in lodash function and tweak chaining benchmark.
Former-commit-id: 799ae05e5180ee87bb2a5249be3e442ed0425ef7
2013-03-04 01:40:55 -08:00
John-David Dalton
9f19c302d8 Cleanup _.bind benchmarks and add chaining benchmarks. [ci skip]
Former-commit-id: 9198c34679709610a440f71856a3869eaa83090e
2013-03-04 00:43:02 -08:00
John-David Dalton
87b1ac776f Remove extraneous spaces from non-minified builds.
Former-commit-id: ec8e18d00884cab96031c061ed32002f41edc0e5
2013-03-03 23:29:54 -08:00
John-David Dalton
41e401b05e Add callback and thisArg arguments to _.flatten. [closes #204]
Former-commit-id: 166d6af35c3905c87498ee74abd143f6fdba451d
2013-03-03 23:26:28 -08:00
John-David Dalton
d88da3589d Update docs and builds.
Former-commit-id: 1f7bfb21276f1c871f4e6ce8a6bf168784509994
2013-03-03 20:12:06 -08:00
John-David Dalton
9638c393bb Expose createCallback.
Former-commit-id: d0c0b02a68e33a2bf220a1605a6fe62eb4a11a83
2013-03-03 19:46:27 -08:00
John-David Dalton
9961ddc2a8 Ensure callback shorthands work with _.uniq. [\ht @jden, @motowilliams]
Former-commit-id: d9a0e688414edc4167b5f8e9ca123bab587f8264
2013-03-03 14:40:15 -08:00
John-David Dalton
2d40dfd8d4 Merge branch 'master' of github.com:bestiejs/lodash
Former-commit-id: e3d0b12d132d3eee4490575e5b18beb8faaf69c6
2013-03-03 13:46:57 -08:00
John-David Dalton
99c9bdf71d Fix misspellings in the docs.
Former-commit-id: 5c318a9fd6b624dbd9befb314644cb7967dc4fe9
2013-03-03 13:46:45 -08:00
John-David Dalton
4fcd25ec88 Merge pull request #202 from drewish/master
Fixing some misspellings.

Former-commit-id: 5315bcc098e909972d93312cf8c14889d17efef0
2013-03-03 13:44:10 -08:00
John-David Dalton
440218da67 Fix build.
Former-commit-id: 9d57351081959276735f8f3df81ecde71c4b9344
2013-03-03 13:36:10 -08:00
andrew morton
fefdb9fc8d Fix some misspellings in the docs.
Former-commit-id: 38ec1d19f1e5ea1fbb05306e5b5cfc9fac550562
2013-03-03 13:08:01 -08:00
John-David Dalton
21a0eff593 Fix build, and rebuild files & docs.
Former-commit-id: af57dd1de6b20e93caa79f05cb9b43647a1de578
2013-03-03 01:37:33 -08:00
John-David Dalton
8825a094ae Use native Object.create when available, optimize the creation of lodash instances, and ensure methods like forEach return the existing wrapper object when chaining, instead of creating a new one.
Former-commit-id: fa9ec371ba23ce8c35c15a66dd9b1f09f183b3a9
2013-03-03 01:21:19 -08:00
John-David Dalton
aa49ce5c56 Tweak platform placement in test.js and runner.
Former-commit-id: a261884dfda6f046431007bef6d9fe109fb1d887
2013-03-02 20:48:42 -08:00
John-David Dalton
1522d3385d Rename _.object to _.zipObject and make _.object an alias of _.zipObject.
Former-commit-id: 7ae3c9d8be32b1430945ffeafc20c740f1d7f409
2013-03-02 20:48:04 -08:00
John-David Dalton
510c41440a Rebuild docs and files.
Former-commit-id: ae6f8f4117b7baab2a47e7c8302edc1fa8dfdb07
2013-03-01 00:39:02 -08:00
John-David Dalton
aa0c34ba1c If _.cloneDeep callback result is not undefined then return the result instead of going deeper.
Former-commit-id: 6a0588dbe158211061ec88badf4d4e3b89b02aa5
2013-03-01 00:36:19 -08:00
John-David Dalton
af87e6ef62 Correct _.cloneDeep docs.
Former-commit-id: 93849f67b49fbba0d91ea8693a4d0b324f55352c
2013-03-01 00:24:48 -08:00
John-David Dalton
30291ce6e6 Make setting context work in older ES3 environments that will use values, named after built-in constructors, for the creation of literals.
Former-commit-id: 981139db2a30f9c69d3e616021f697b8403dee26
2013-02-28 20:34:14 -08:00
John-David Dalton
890c2eb564 Remove unneeded contextProp value.
Former-commit-id: f73bf05faece643fea8b1b67edfa240ba47beec5
2013-02-28 03:26:02 -08:00
John-David Dalton
67a269b89c Update builds and docs.
Former-commit-id: 57709d874ed5b6855daf536c2a0977738665c3c1
2013-02-28 02:53:09 -08:00
John-David Dalton
4b9ee81a78 Adjust build for renamed variables and _.runInContext dependencies, and cleanup build.js and build/pre-compile.js.
Former-commit-id: 0d813bc111617e9b8cd922b505ec8c90ce09063b
2013-02-28 02:51:43 -08:00
John-David Dalton
4343f4d229 Tweak _.parseInt docs.
Former-commit-id: 960256bab36fbecb8aa06679c10d8033e2013de2
2013-02-28 02:49:54 -08:00
John-David Dalton
2162baa6c0 Add contextProps to make _.runInContext work in older IEs.
Former-commit-id: 208f25296d35ed29a283fb1598de0052a5a2703d
2013-02-28 02:49:26 -08:00
John-David Dalton
7e7f792710 Add _.parseInt and _.runInContext to the underscore build tests.
Former-commit-id: a5f8d936e912d0bd53f689d23c3393731fe97f47
2013-02-28 02:48:11 -08:00
John-David Dalton
1bbd9e24b0 Fix and cleanup [[DontEnum]] unit test.
Former-commit-id: 9e47eeb03c88a52d2e1d6dd2c0373c2df2f576fe
2013-02-28 02:47:14 -08:00
John-David Dalton
6435aaa64f Ensure the exports object is not a DOM element. [closes #197]
Former-commit-id: 3adb679f7f4d7a64e0bc37ed80a443c211a17510
2013-02-27 09:10:13 -08:00
John-David Dalton
999aae0a33 Add _.parseInt.
Former-commit-id: 0c0f10af3dc50a4d1b684523f19d02e423d738f5
2013-02-27 08:54:15 -08:00
John-David Dalton
ba795639b4 Fix iife build tests.
Former-commit-id: 0fa103c21297672c018d66fba16ef376d3599b41
2013-02-27 02:17:19 -08:00
John-David Dalton
4c4b205721 Use setImmediate reference of the context object.
Former-commit-id: 28c11df25ceb1a414caaa61eaee54fae27a2ff03
2013-02-27 01:15:59 -08:00
John-David Dalton
b3c550b7c0 Make _.runInContext not require a fully populated context object.
Former-commit-id: 11bf3cad2bfd3e922e7701eb7b0f48028f522ba6
2013-02-27 01:03:45 -08:00
John-David Dalton
eb8953e784 Remove isJSC in mobile and underscore builds. [closes #196]
Former-commit-id: 77ddbbcfcf17b5074a7fba137dc426f20a6ab5dd
2013-02-26 21:08:35 -08:00
John-David Dalton
b88b292d5d Fix lodash.underscore usage example in README.md. [ci skip] [closes #194]
Former-commit-id: 5df59e98d58dc13eeff1ff9a4a76c7ef6811a0a7
2013-02-25 21:59:05 -08:00
John-David Dalton
5f42c3b319 Add rhino -require to the run-test.sh.
Former-commit-id: 105f76b6058b8a1493d1a56716df7f22391e4bdd
2013-02-24 22:51:11 -08:00
John-David Dalton
5b27ae0371 Cleanup comments in various source files.
Former-commit-id: 02e8223692e4678e78a0eadc4ffaed3e27b5a49f
2013-02-24 22:50:10 -08:00
John-David Dalton
f26b1da1b5 Simplify build/mkdirp-sync.js.
Former-commit-id: b49bbea9e565dbf1d23f601af74443b33fe9fc7d
2013-02-24 17:49:47 -08:00
John-David Dalton
7a853e2dcb Update vendors.
Former-commit-id: 92fe8e8ceacd0993fadd35c5feffddcbe319d6c7
2013-02-24 15:35:56 -08:00
John-David Dalton
9b22748bd0 Cleanup perf/perf.js and test/test.js.
Former-commit-id: fba43c75aa25227e771a3cdd0cce0ee8ee9cdba6
2013-02-24 15:25:56 -08:00
John-David Dalton
c1e9dd3373 Ensure relative paths work with --output and template=… build options.
Former-commit-id: 2447466a006dc8d968969bba70a0e44f91610154
2013-02-24 11:40:56 -08:00
John-David Dalton
8cbbc47043 Ensure all temp folders made during the --output build tests are removed.
Former-commit-id: d5c98deebd879f594aac73d4b835c97516ee4e89
2013-02-24 09:48:33 -08:00
John-David Dalton
81b3567133 Add path.sep for older versions of Node.js.
Former-commit-id: 1a058681fc5c6aae426902a7d6dd76b3a5849837
2013-02-24 09:29:23 -08:00
John-David Dalton
fc6568f390 Cleanup build tests and inline _.mixin when it's removed to preserve chaining behavior.
Former-commit-id: ed24a9acfabb70fb7093479a5c3484d966cbc5bb
2013-02-24 03:05:49 -08:00
John-David Dalton
8e30fe2946 Fix build.
Former-commit-id: 41b9584b63962a71f146c61fda056d15a2be4e14
2013-02-24 01:54:35 -08:00
John-David Dalton
6c811a3261 Move mkdir -p functionality to its own module and cleanup --output build tests.
Former-commit-id: b7ea2a41c60357e780e10bd3d665db3d50e7f044
2013-02-24 01:24:47 -08:00
John-David Dalton
afbe5aa540 Merge pull request #192 from phated/master
Implement `mkdir -p` for `--output` build option.

Former-commit-id: cb7a6753d15f495a1ab8b0016edd34d5626727de
2013-02-23 22:55:18 -08:00
John-David Dalton
324afd2d6c Add doc not for chaining support in custom builds and tweak support rules in build.js. [closes #193]
Former-commit-id: c87f6bfe28f00d9228f4112463635d555e138a41
2013-02-23 22:52:21 -08:00
John-David Dalton
58d94ef61e Clarify docs for callback use in _.first, _.initial, _.last, and _.rest. [ci skip] [closes #189]
Former-commit-id: 12ee5f957fa67e93e40630e627d90b9aaa7eff37
2013-02-23 21:49:02 -08:00
John-David Dalton
39974b0982 Make optionsToArray remove falsey values.
Former-commit-id: 5c82f8ab92f67bd35030320fae06811dbb8f442b
2013-02-23 20:30:14 -08:00
John-David Dalton
323d7306e2 Add QUnit.config.noglobals to build tests.
Former-commit-id: 4519f5322a51632ce23dc4c574365472338a18e0
2013-02-23 20:29:23 -08:00
John-David Dalton
251e228ce4 Remove isFunction fallback from modern builds
Former-commit-id: 21f51b3041b60136bb07ca775abfe91df7687639
2013-02-23 19:07:19 -08:00
Blaine Bublitz
a99f3f217a really basic version of mkdir -p for -o option
Former-commit-id: 0fb635efd2043ee901c4f4eae7c6670d5b44a068
2013-02-23 19:37:46 -07:00
John-David Dalton
e2acbee113 Adjust iife build test and add strict build tests.
Former-commit-id: 1422311e7c7106e7def75b7b75800975c59127ff
2013-02-23 16:19:52 -08:00
John-David Dalton
37b69eddf2 Tweak detection of the Node.js executable in command-line arguments.
Former-commit-id: 74047748237f8defe36aea2a27e54ac72a648c93
2013-02-23 15:58:43 -08:00
John-David Dalton
f0322e6f2c Rebuild files, adding lodash.legacy and lodash.mobile builds, and update docs. [closes #190]
Former-commit-id: 6167b81d8baf1e491b8cbb3e3c68c01ae6ddd865
2013-02-23 14:56:50 -08:00
John-David Dalton
756587d080 Remove undefined from the IIFE to allow easier customizations with the iife build option.
Former-commit-id: a496b1fba74fdab3b2819d27b769371f73364684
2013-02-23 14:08:48 -08:00
John-David Dalton
1ad2c92324 Fix lodash underscore build.
Former-commit-id: 017208b28865b10b068ba4ae5e4a7baa9c01a80f
2013-02-22 03:33:15 -08:00
John-David Dalton
e5433adf78 Rebuild files and docs.
Former-commit-id: 1a834e5811525e9fb99def149cb4c455b3d4367d
2013-02-22 02:02:51 -08:00
John-David Dalton
ed765f75d8 Fix alais -> alias typo in README.md.
Former-commit-id: 7c919c834f729d03d26c0b3eb14203585099333b
2013-02-22 02:01:36 -08:00
John-David Dalton
4136f1b377 Fix build indenting.
Former-commit-id: 87a7793799ee3ed28fe67cb894aa2876be103c50
2013-02-22 02:00:42 -08:00
John-David Dalton
860339b90e Fix failing tests in Narwhal.
Former-commit-id: 986262a14784d94f616663724e52d11a0e11a56d
2013-02-21 23:33:23 -08:00
John-David Dalton
03254a0c0f Make isKeysFast true for Firefox too.
Former-commit-id: cf14455782375eccc4c32c5bfca41c3f918db2e8
2013-02-21 23:19:26 -08:00
John-David Dalton
a76081c979 Add require call to compiled templates.
Former-commit-id: 3d97f6cc71a3c7e6ac9b12cc876ace4790efbae8
2013-02-21 22:08:09 -08:00
John-David Dalton
71a207079f Update vendors.
Former-commit-id: 25cce48fee2dfb010eb6a9c2e4235890f20b19aa
2013-02-21 08:40:09 -08:00
John-David Dalton
f6e724c4c5 Update build to work with _.runInContext.
Former-commit-id: da4a9da0e2c74bbcbd142c077794486d0ac45835
2013-02-21 08:39:25 -08:00
John-David Dalton
4251b36b25 Add _.runInContext.
Former-commit-id: f427f7d4704fb1b6af578b095e417ee25ca029e7
2013-02-21 00:47:19 -08:00
John-David Dalton
b8f39cbfdf Cleanup _.template comments.
Former-commit-id: cff1c86d3a7e9c5ee32e00762ce522690726ef09
2013-02-19 08:08:31 -08:00
John-David Dalton
088c621862 Tweak _.defer and _.delay docs. [ci skip]
Former-commit-id: 921eec8f2e8e7701f14095d221a5e72a2c45f470
2013-02-19 01:53:21 -08:00
John-David Dalton
2459a53350 Bump to v1.0.1.
Former-commit-id: b2536f9a226c7418ad3aaa7b5fb88282b77d20e5
2013-02-18 02:13:39 -08:00
John-David Dalton
7093e9c0d4 Add PhantomJS not to CONTRIBUTING.md.
Former-commit-id: e7c81af0fb6e1ede8f89d50ffdc5ec671e124252
2013-02-17 23:54:19 -08:00
John-David Dalton
4bc49978d1 Avoid using setImmediate in IE because it cannot be cleared with clearTimeout.
Former-commit-id: 836d49c6440b2313f1885456645ed4a00ab82ae6
2013-02-17 23:45:26 -08:00
John-David Dalton
96bac9c149 Add legacy underscore build test.
Former-commit-id: f56e254f7c2fb4c4adeac16b56c789dd8af8a986
2013-02-17 20:44:28 -08:00
John-David Dalton
8dcc15f4d3 Ensure setImmediate is not minified by the Closure Compiler.
Former-commit-id: 74c121d45854dba2aaaa65558c3e1ca8effd3096
2013-02-17 18:15:41 -08:00
John-David Dalton
8183740c04 Update vendors.
Former-commit-id: 6ab66f9ea6fd881e8c5ed18e84b9a24656496e10
2013-02-17 16:38:23 -08:00
John-David Dalton
25e4231d7b Update _.defer build dependencies.
Former-commit-id: 159f541373b01f259c9509e16c3fc0c2018e6d51
2013-02-17 16:13:42 -08:00
John-David Dalton
3ed9e0e905 Add support for specifying a source map URL in the to the -p/--source-map build options.
Former-commit-id: 2098da69d7902497e2e67210d778b8f99a5ff8f0
2013-02-17 16:02:53 -08:00
John-David Dalton
45bec0c440 Remove setImmediate use in the lodash legacy build and cleanup patterns.
Former-commit-id: a3c942e3545c278b7cac2112ed1a5417212048d9
2013-02-17 14:30:22 -08:00
John-David Dalton
5133e39d45 Make _.defer use setImmediate if available.
Former-commit-id: b3898d78725a4b203856916b1b071ab9c6f40b83
2013-02-17 14:29:40 -08:00
John-David Dalton
cb3b4e446e Ensure _.isEqual returns boolean values even if callback doesn't.
Former-commit-id: b2c31ee1711a436e5400c8e80c9f54a9680301b7
2013-02-17 10:41:05 -08:00
John-David Dalton
9829a2f3b4 Rebuild files.
Former-commit-id: c381088f55093f25067d0284319975c868e6e3bf
2013-02-16 23:18:05 -08:00
John-David Dalton
7eadf11145 Optimize the ES6 template delimiter regexp and regexp to detect strings.
Former-commit-id: 6177f2b32f27515cf8edcac6036d0adb58ebfcd0
2013-02-16 23:17:17 -08:00
John-David Dalton
2a2bc44f43 Make _.where search arrays for values.
Former-commit-id: b942c6a44680c78fae1a41f2cf994be09ffcfbb9
2013-02-16 00:39:45 -08:00
John-David Dalton
9ccfa5cec9 Convert map files via JSON.parse instead of using string manipulation in minify.js.
Former-commit-id: 185b77d45995f17c586f35d6ad447074d677a6ae
2013-02-15 08:58:20 -08:00
John-David Dalton
02687f3c78 Ensure the second argument passed to _.assign is not treated as a callback. [closes #184]
Former-commit-id: 1254e11ab02d1d5055c08400cd0a4786ed71aef2
2013-02-15 08:11:19 -08:00
John-David Dalton
7ea7a6cbb1 Automatically set a source map's "sources" key based on the build performed.
Former-commit-id: c02c88dfd1db097a3f98113ee57c3da850da5abb
2013-02-15 00:23:03 -08:00
John-David Dalton
a15a28fe5b Add -p and --source-map unit tests.
Former-commit-id: c7416ca507ce9376adb31e91a294e2e40073788c
2013-02-14 20:47:23 -08:00
Kit Cambridge
265dedfae1 Fix typo that caused sourceMappingURL to be undefined in source map builds.
Former-commit-id: ff3b22a7965c15a1ae072f8e9d51009e095ec443
2013-02-14 17:36:43 -08:00
John-David Dalton
5ddbb8bc56 Remove unneeded __d variable from _.template.
Former-commit-id: 4ff32444d7e96f8b9cc39e61c1ce17fb34fa357c
2013-02-14 09:21:06 -08:00
John-David Dalton
4101b8e937 Remove reInsertVariable cleanup in build/pre-compile.js.
Former-commit-id: 1fa75107e8c43362b57021292e26397145e62e39
2013-02-14 09:03:47 -08:00
John-David Dalton
56b6d50479 Tweak _.at docs.
Former-commit-id: 505e34b0a151287d78da73a1140d4aefdf45b43b
2013-02-14 09:03:06 -08:00
John-David Dalton
506f585d78 Bump to v1.0.0.
Former-commit-id: 623103d8c34c2e3c260c481da83cb94c888402d3
2013-02-14 08:58:11 -08:00
John-David Dalton
577dfb7220 Make Jam package use the compat build by default.
Former-commit-id: 8c371e59bd4796cfe42d0e0d9d07b85372b6d5b1
2013-02-13 23:48:13 -08:00
John-David Dalton
7e4286adde Add another unit test for precompiled templates with AMD support.
Former-commit-id: 68d1b7b0aa8cd8b1d4b27a9374095b8cebbfb386
2013-02-13 20:06:34 -08:00
John-David Dalton
1090228628 Add _.groupBy test for passing numbers for the callback argument.
Former-commit-id: 6ce29f81f8688495a8a756e464b32e9e825c7857
2013-02-13 19:54:39 -08:00
John-David Dalton
aeea861b73 Tweak docs for "_.pluck" and "_.where" style callbacks.
Former-commit-id: 8ee7906ac1839c2675a5e82749c9a2c86cf6f49a
2013-02-13 19:50:59 -08:00
John-David Dalton
997c43bbdd Add _.extend and _.defaults underscore build tests.
Former-commit-id: f9244ddd7c81f65d2f0a01a18fa6e821e8f2705b
2013-02-13 02:49:12 -08:00
John-David Dalton
958d4dbd2e Remove more unused variables in debug builds.
Former-commit-id: dd50d5d0b855a85ca8099d92288f2ca621a532fa
2013-02-13 01:52:12 -08:00
John-David Dalton
f2b350eb62 Change _.defaults to not overwrite null values.
Former-commit-id: 4a85aefc3eaf2180fb0e8cd0f6efb1524a9d7caa
2013-02-13 01:51:15 -08:00
John-David Dalton
a3464780a1 Add "customization callback" support to _.assign.
Former-commit-id: 5f0c7b72942ba0c40960072b11936f0683909043
2013-02-13 01:17:51 -08:00
John-David Dalton
fe1eb92196 Ensure _.first, _.initial, _.last, and _.rest work with string and objects for callback.
Former-commit-id: f587a5d11164c1c6fa050feccfb05956fd82a0d0
2013-02-12 08:45:10 -08:00
John-David Dalton
0b2d26ec92 Simplify AMD checks in test/test.js.
Former-commit-id: db2f72020e6171f30770c7ecc7caf1619b78ac88
2013-02-12 00:33:09 -08:00
John-David Dalton
8024a25f2b Update vendors.
Former-commit-id: aff34ccd5d3c6e3e78aeb5832e694171fca35412
2013-02-12 00:24:55 -08:00
John-David Dalton
d287ecbb34 Remove unused snippet from pre-compile.js.
Former-commit-id: d52c35eed1ccd611f728febfca5b5154440e9fb0
2013-02-12 00:24:37 -08:00
John-David Dalton
d9c95e7730 Escape } in regexes used in lodash.js. [closes #179]
Former-commit-id: 7b4687f3967079e19025fccc3f54b7fc5fcc4ff9
2013-02-12 00:24:08 -08:00
John-David Dalton
c3b1af31ce Add PhantomJS to .travis.yml.
Former-commit-id: 82ea6081046ee285538876572e5a42547ffffa61
2013-02-11 08:51:58 -08:00
John-David Dalton
465576b5cb Update vendors.
Former-commit-id: 4ffc3f5b267f8fdf1ac074f9f9ab44b0a7c4c3dd
2013-02-10 23:51:46 -08:00
John-David Dalton
9ecbcd0075 Update vendor/qunit-clib and tests to work with Ringo 0.9 and PhantomJS.
Former-commit-id: e6906e4b9f6afdee598902d6939356bf33302909
2013-02-10 23:42:09 -08:00
John-David Dalton
c1f62d72ae Ensure the csp build is an alias of the mobile.
Former-commit-id: defb0a7d28cb3ff9d799dcbaceef3175f78531e9
2013-02-10 01:14:49 -08:00
John-David Dalton
1b27834c41 Move _.isArguments fallback noArgsClass work into removeNoArgsClass in build.js.
Former-commit-id: 3627e59c65b67a61fc5ee04166004e400d816d13
2013-02-09 19:36:10 -08:00
John-David Dalton
77804907b6 Make whereIndicator check strict and make the _.where deep object comparison unit test deeper.
Former-commit-id: b9c59ff56b3ab7acd519888407de5dd02d6475cf
2013-02-09 10:10:36 -08:00
John-David Dalton
9dfa2609be Cleanup _.isEqual.
Former-commit-id: 83dd17b62fc86b870ca44aa4a54387343fd14cb2
2013-02-08 22:47:43 -08:00
John-David Dalton
8ffb3ab3c4 Simplify _.unescape unit test.
Former-commit-id: 113ee8e94a5a6a7d72b4e39672c60d67342def49
2013-02-08 19:04:02 -08:00
John-David Dalton
65e1da34fa Add custom build header comment to builds when only using --output.
Former-commit-id: adef2798bd590c0dc0c14b253f0d450ec5bb5394
2013-02-08 16:57:46 -08:00
John-David Dalton
282110807c Merge pull request #175 from timmywil/single_quote
_.escape("'") => &#x27; hex escaped not recognized by some html parsers

Former-commit-id: 0e55d8994a1919f5d5dd5806732cbe4711dae22a
2013-02-08 12:46:49 -08:00
Timmy Willison
25e5f43d1c Add lodash.compat builds
Former-commit-id: 5edfef23bb5d55c8efaf21a1cb345dc2b0d9488b
2013-02-08 15:45:08 -05:00
Timmy Willison
ce0441694d Escape single quote with numerical html character code rather than hex.
Former-commit-id: aef76d2662a065affc21ff735de526a177b50546
2013-02-08 14:54:12 -05:00
John-David Dalton
db29699927 Reduced _.pluck.
Former-commit-id: e413c1a6d0df383cb1ca51ab2203d3e380f71177
2013-02-08 08:42:04 -08:00
John-David Dalton
9a4e2d7617 Reduce the travis-ci time limit by 5 seconds.
Former-commit-id: 9653f4fee2bbfd8d77a228504795f3ef13df92dc
2013-02-08 08:13:57 -08:00
John-David Dalton
fbf64585b7 Fix --output build unit test.
Former-commit-id: fafafe88dfec9d777418c9eb95a7643c0061ee23
2013-02-08 07:18:55 -08:00
John-David Dalton
6d1c6dfd16 Update test and perf scripts.
Former-commit-id: 434935e332ec03dfd370efcd191b3f9aff5a9387
2013-02-08 00:58:26 -08:00
John-David Dalton
e78df4d981 Create a debug build if --output is passed.
Former-commit-id: 7571d238cf00fd9a7c72f65313e3807483067ace
2013-02-07 23:36:09 -08:00
John-David Dalton
a757b4d5dc Tweak docs for _.cloneDeep, _.bindAll, _.reduce, and _.sortBy.
Former-commit-id: a5d73e6ef174a743e05c0ef85414b899deea7815
2013-02-07 23:35:34 -08:00
John-David Dalton
d28036ee91 Add another _.size string value unit test.
Former-commit-id: 01c3bc51259c04a04f07d0e60398a0b2aa781641
2013-02-06 08:42:22 -08:00
John-David Dalton
d2ba0d4e7a Ensure _.merge doesn't iterate over a passed callback arg.
Former-commit-id: 2ed55922c2f5b4e47ac7e9763f3d76b4bec142da
2013-02-06 00:38:28 -08:00
John-David Dalton
5787436177 Don't remove nonEnumArgs fixes for mobile builds and cleanup debug builds.
Former-commit-id: b1fbb7ed362d0c94a92e4b12e0385c77973654b3
2013-02-05 22:54:18 -08:00
John-David Dalton
f5ab24b8d2 Fix legacy build.
Former-commit-id: 27bbe3ec6e025185daf73f9589e034e82097c313
2013-02-05 01:05:45 -08:00
John-David Dalton
05c0f32a24 Rebuild docs and files.
Former-commit-id: daf0b29cbcca43d7fa975e1ddb52f8c8b58cb31f
2013-02-04 23:56:57 -08:00
John-David Dalton
7b918f77a9 Clarify browsers affected by nonEnumArgs and reduce code around hasEnumPrototype.
Former-commit-id: 587f755332accbca26dc1eb357a66d4f898aad88
2013-02-04 23:55:52 -08:00
John-David Dalton
d87929d61c Remove "use strict" directive from the "modern" builds.
Former-commit-id: 7d1d5dd8cb91deb51fbdf7cfda04f3e49c96c204
2013-02-04 23:55:38 -08:00
John-David Dalton
a926829c33 Add _.bindAll unit test for passing just object.
Former-commit-id: 62f90c1dc7429610fb4bfaec3c5bb64d5a63dc9e
2013-02-04 08:36:15 -08:00
John-David Dalton
d58e366c40 Update docs and rebuild files.
Former-commit-id: 6265fed04ac7d6da6c6ded82095c22c1a60d9193
2013-02-04 01:21:22 -08:00
John-David Dalton
0fb4f7e1c4 Simplify _.where but don't make it an official alias of _.filter.
Former-commit-id: 794ab4eb814e8872443e282beb32cc636dedc43a
2013-02-04 00:55:12 -08:00
John-David Dalton
6ee606e3e2 Fix failing unit test in older IE.
Former-commit-id: 2de10b6bc3b9720a14fba86d9fe2638b30a7d0ef
2013-02-03 21:43:17 -08:00
John-David Dalton
22d4a7690f Make Closure Compiler bug fix to work with !1.
Former-commit-id: 2d82a0a8d71d8fc3907bf5f71b5ab41ed4142c04
2013-02-03 21:42:06 -08:00
John-David Dalton
f3a2f5018a Update vendor/uglifyjs.
Former-commit-id: 36cfce5048198ccb9f0a24a9021742afe60316b5
2013-02-03 01:48:11 -08:00
John-David Dalton
d2a7589f7c Fix failing build test and add another build test.
Former-commit-id: dccae3f43f55dda764750880e37c5e0682f32095
2013-02-03 01:23:40 -08:00
John-David Dalton
f87b4e04f1 Update test configs and move builds.
Former-commit-id: dc14112821f14101f107f90e9aeb5abec55b18a6
2013-02-02 19:33:29 -08:00
John-David Dalton
b5aa4c1f0c Add modern build option.
Former-commit-id: 4d8c791f8024eefec40c17b6efb708d989e78f34
2013-02-02 19:22:40 -08:00
John-David Dalton
0c1eb6d288 Update npm test. [ci skip]
Former-commit-id: f28a9229e700648926b933e3bc9d9ce371b9c556
2013-02-02 01:18:57 -08:00
John-David Dalton
8a03c5f998 Make travis-ci tests go right up to the max run time.
Former-commit-id: 15124a63d530c416ad1974898b7c1e3ee53c58a6
2013-02-02 01:14:06 -08:00
John-David Dalton
60aa50ae45 Add env and script to .travis.yml.
Former-commit-id: 700479d45f2c0683a877bddc15cd33d804aec00a
2013-02-02 00:16:11 -08:00
John-David Dalton
aae6bbbb66 Ensure build tests pass the correct exit code when their time limit is hit.
Former-commit-id: ead1bcc0448a639d5310ceb63e2efcf81e64a0c3
2013-02-01 23:41:44 -08:00
John-David Dalton
5ca903c428 Remove unnecessary _.template benchmarks.
Former-commit-id: ba9af8212673c7dfa109cb1e3f33bafec068dcdf
2013-02-01 23:20:16 -08:00
John-David Dalton
e86b07f760 Add node_js 0.8 back to .travis.yml now that they've fixed their issues.
Former-commit-id: 480cb02695ca5e3290bc9bf95f61e098b79ce988
2013-02-01 09:30:34 -08:00
John-David Dalton
d7fea5dc78 Update lodash underscore build _.findWhere to follow v1.4.4 null behavior.
Former-commit-id: 7b6ce7e9d7cf032171f43835bbf907cf3ffeb908
2013-02-01 09:29:56 -08:00
John-David Dalton
c1eff5aebb Cleanup comment blocks explaining old browser bugs.
Former-commit-id: e420cc9237565da01f60ed204fb6767bbe2cb9b4
2013-02-01 01:36:16 -08:00
John-David Dalton
f2dc490d6f Cleanup docs for _.omit, _.every, and _.template.
Former-commit-id: a2810a5db94ef1de4bb530a56b0f9f121688de05
2013-02-01 01:31:08 -08:00
John-David Dalton
b296e1b340 Add _.isNumber unit test for Firefox [xpconnect wrapped native prototype] issues.
Former-commit-id: d81b0bb7807139d14796c2a952294d1fd581f73a
2013-02-01 01:25:10 -08:00
John-David Dalton
8adb060edb Add hasEnumPrototype to avoid including the fix if not needed.
Former-commit-id: f826b725180a95d41b66612919c8b3fddfe568a0
2013-02-01 01:24:34 -08:00
John-David Dalton
c3b984fea7 Make callback behavior consistent for _.clone, _.cloneDeep, _.isEqual, and _.merge and add more doc examples.
Former-commit-id: 7a53ea18e4512dfcab5649c937db0f90d7649373
2013-01-31 00:28:47 -08:00
John-David Dalton
afbb2c338b Add _.findWhere benchmark and removenew bound benchmark.
Former-commit-id: baef485421cf6419450e3bc2a14f36e7e7c437c3
2013-01-30 08:58:55 -08:00
John-David Dalton
6632241ab5 Ensure the lodash underscore version of _.result matches v1.4.4 behavior.
Former-commit-id: c4c1946e49f12ddc4ba2f0f65a9ef7c9727d79ca
2013-01-30 08:57:28 -08:00
John-David Dalton
be50df81db Update builds and docs.
Former-commit-id: c0e38666fb1aee210c3dbd6401b040d8a2bee23d
2013-01-30 01:27:10 -08:00
John-David Dalton
9763b6e2cf Update build to add _.findWhere as an alias of _.find for the underscore build.
Former-commit-id: 0b772c30749c9af6ddc20b7b786f282ea93b63ce
2013-01-30 00:39:33 -08:00
John-David Dalton
812b848daf Update tests to work with QUnit v1.11.0.
Former-commit-id: ce6d6fb1756eb606e8106ac7e93816dffb48624e
2013-01-30 00:38:31 -08:00
John-David Dalton
4907a7389f Fix test.js for browsers.
Former-commit-id: e334ab595fa78a59b8371b755ce8dc54706a6630
2013-01-29 22:59:09 -08:00
John-David Dalton
17dff36b65 Update vendors.
Former-commit-id: 55a30b9cbfe7c513dd13d709aa4552fe715c262b
2013-01-29 22:43:56 -08:00
John-David Dalton
904921d8c4 Add a --time-limit option to test-build.js so travis-ci can complete its test runs.
Former-commit-id: 742b17208d6c9316efea33c106e7689b9290f48d
2013-01-28 23:34:27 -08:00
John-David Dalton
ac4c075d32 Add support for loading different Lo-Dash builds in test.js for Narwhal, Rhino, and Ringo.
Former-commit-id: 936b2f246540b2456c78a6087266ba9d39f48f91
2013-01-28 23:31:52 -08:00
John-David Dalton
ddde64ece9 Add lodash.min.js support to test.js.
Former-commit-id: c5c6cc47631752862c8f7b3b0f3d7b004493c01b
2013-01-28 21:12:06 -08:00
John-David Dalton
91c097e88d Cleanup unit tests and tests for _.clone, _.cloneDeep, and _.isEqual support of callback and thisArg arguments.
Former-commit-id: a53b5f4295cfc3e2f06ebed878c7c876acd64e6a
2013-01-27 23:34:18 -08:00
John-David Dalton
894658a3f5 Add underscore build replacement for _.isEqual and ensure legacy cannot be used with backbone or underscore commands.
Former-commit-id: 09340411bf3c4a0e4432d9b134b0aefb1f19183e
2013-01-27 23:32:21 -08:00
John-David Dalton
a4454ea5f9 Simplify regexp that escapes special regexp characters for reNative, and add callback and thisArg arguments to _.clone, _.cloneDeep, and _.isEqual.
Former-commit-id: 86715543147d2965a562016cf0b08f945fa38fe6
2013-01-27 23:29:38 -08:00
John-David Dalton
8ea8fa3a8a Add deep comparison note to the _.where docs. [ci skip]
Former-commit-id: 223d3a45832238b9ce39d4321636b971abde9b46
2013-01-27 15:12:20 -08:00
John-David Dalton
7480603295 Simplify regexp that escapes regexp special characters.
Former-commit-id: dde89b0f7d9cd31768eecd4ef92c0ae9d1b5d581
2013-01-27 14:57:32 -08:00
John-David Dalton
079b749d5d Add more _.isEqual benchmarks.
Former-commit-id: e0eee615e593eb9be627da52be158bf7b590fd2a
2013-01-27 11:24:55 -08:00
John-David Dalton
4815600e85 Continue dependency map tweaking, and simplify how _.isArguments is handled in the underscore build.
Former-commit-id: 568887e067d6463f102b3b866195f3a173fc6d4f
2013-01-27 11:23:02 -08:00
John-David Dalton
1c63e2d295 Update method dependencies and add more mobile and underscore build tests.
Former-commit-id: fa10d8c7bef9700ec59e4e38e730e0ad4963d812
2013-01-27 03:06:24 -08:00
John-David Dalton
cf13eca58c Cleanup deep _.clone and _.where unit tests.
Former-commit-id: b7106461640259ca3bf60c1fabb91b59b241e35f
2013-01-27 02:39:18 -08:00
John-David Dalton
3cf4607870 Add support for deep clone via _.clone(object, true) back.
Former-commit-id: cc9b6bb81848b6a98d6f413485845e2e0407e3ac
2013-01-27 02:38:43 -08:00
John-David Dalton
23c3ba6ad7 Ensure _.where works correctly for nested properties and give indicator arguments more meaningful names.
Former-commit-id: c35e2817125cd852a66066ccdef44bcc40c93e61
2013-01-26 23:47:47 -08:00
John-David Dalton
17fc3c2317 Reduce doc examples, simplify iteratorTemplate, remove deep argument support from _.clone, and ensure _.merge and _.pick exit early for non-objects.
Former-commit-id: d3fbd9a8ff9cd0c8201beb7180e3e7190e2a7cf8
2013-01-26 20:37:26 -08:00
John-David Dalton
af234cbe54 Finish renaming iteratee to iterable. [closes #170]
Former-commit-id: 0ac6cecaec0a779cb29c21b5fc3caa90c84479eb
2013-01-25 20:10:53 -08:00
John-David Dalton
c8517c0ec9 Merge pull request #170 from paulmillr/topics/iteratee
Fix naming: use “iterable” instead of “iteratee”.

Former-commit-id: 199757631f0c941898e1dcb8f5ae9f9d8c517337
2013-01-25 19:40:13 -08:00
Paul Miller
20b226454b Use “iterable” instead of “iteratee”.
Iteratee is a monad that provides functional way of handling I/O,
when iterable is a representation of series of elements that can be iterated over.


Former-commit-id: 94e58614ba9c2ebdd2aad1848a8b4d0ceef55023
2013-01-26 03:21:41 +02:00
John-David Dalton
98eccf223a Simplify null/undefined check in _.isEqual and edit _.cloneDeep docs.
Former-commit-id: 62455ba83df04318856fbc889743f44101b24fe3
2013-01-25 00:20:55 -08:00
John-David Dalton
0fc2ab4d41 Fix lodash settings=… documentation example. [ci skip]
Former-commit-id: 671683d4e77b8fa27903e30d938f665548311b3f
2013-01-25 00:07:21 -08:00
John-David Dalton
641b6efe7f Remove auto with statement removal optimization from _.template. [closes #166]
Former-commit-id: da27942b109844d44327914631b7c5681489b04b
2013-01-24 01:14:07 -08:00
John-David Dalton
4c83435b4b Clarify the -d and -m build options. [closes #167]
Former-commit-id: d3ee420b982291632785d6583a6f2981ab07a635
2013-01-24 00:08:52 -08:00
John-David Dalton
9f7319cff4 Revert to compiling _.assign and _.defaults, using isKeysFast, and tweak large array size in _.without.
Former-commit-id: 275d453f49e762ac499a9328ddb8e156b8c9c22d
2013-01-23 23:59:41 -08:00
John-David Dalton
dd9baa1502 Add doc note about wrapper Array methods. [closes #162] [ci skip]
Former-commit-id: 9d83e9b4c0298469d926325b35dee5566071f48c
2013-01-23 00:23:57 -08:00
John-David Dalton
41b4d0daa1 Update method dependencies in build.js.
Former-commit-id: 6cb368b6f440faa31c8f06cba347dcb755c95179
2013-01-22 23:54:52 -08:00
John-David Dalton
e41b181163 Ensure _.where deep compares properties values.
Former-commit-id: f3f29abf024f87a947fef6df1e3db9d9d1de99bf
2013-01-22 23:54:09 -08:00
John-David Dalton
288ac115d0 Avoid buggy Travis-CI Node version in travis.yml. [ci skip]
Former-commit-id: be10d0a5144628a98aafdc974febd08592cad30b
2013-01-22 23:08:09 -08:00
John-David Dalton
6774d46a6f Simplify sourceURL code and ensure source maps work avoid compat issues.
Former-commit-id: 5b64703eaebc65c443d6b9d3699d448c253e70c1
2013-01-22 21:51:10 -08:00
John-David Dalton
607abf89f7 Move generic Closure Compiler fixes into build/minify.js.
Former-commit-id: 8492f60a67cbf7a2d7d3118f9653e6997ab1d15b
2013-01-21 01:13:51 -08:00
John-David Dalton
27f1e5e2f2 Fix _.partialRight doc typo. [ci skip]
Former-commit-id: 871aa8f8c89a226e89988995926f8a6946757321
2013-01-20 12:21:57 -08:00
John-David Dalton
a457675ce1 Move deep _.defaults implementation unit test to _.partialRight.
Former-commit-id: 7e5c6184d24b47170ef148122ef5c7428f8b2da9
2013-01-20 12:09:44 -08:00
John-David Dalton
82049096e6 More build fixes.
Former-commit-id: 8b97cd56c4b5530d03ba89d192be7df989e96655
2013-01-20 12:02:47 -08:00
John-David Dalton
6c965e0223 Cleanup strict build.
Former-commit-id: c34b2e7e2810e8bc35bde3e0f962d925b3f5ba1b
2013-01-20 03:56:35 -08:00
John-David Dalton
8b4d952929 Fix build.
Former-commit-id: e930621f522aae7c15502ac56fe9983943d2dc80
2013-01-20 03:40:44 -08:00
John-David Dalton
873cc63f94 Add _.partialRight and make _.assign and _.defaults work with arrays.
Former-commit-id: 6d9fea855de53e9ccb5ac6f58db68239ef08e9de
2013-01-19 22:17:14 -08:00
John-David Dalton
39fc839ff2 Fix test/test-build.js to work with build.js modifications.
Former-commit-id: 9df41ae02627557a21f282f70a73a447497b8984
2013-01-19 16:42:16 -08:00
John-David Dalton
4edef4c959 Update license and copyright.
Former-commit-id: 16ded758d08c66dcc9585e75848dec5420ddbbf2
2013-01-19 16:07:15 -08:00
John-David Dalton
1d9ced8037 Remove resolved Underscore issues from README.md.
Former-commit-id: 16f60867355adc5f528274838d3526ab7821b553
2013-01-19 01:00:15 -08:00
John-David Dalton
4cb77d1429 Avoid extreme &nbsp; use in the README.md.
Former-commit-id: 3ff1aca436ed040a6ffb0335f92b8b44f80137be
2013-01-19 00:36:22 -08:00
John-David Dalton
b52d9d1bdd Add --source-map build option. [closes #161]
Former-commit-id: e0cac11fda86671d944de5c157d3df3146d6def1
2013-01-18 02:37:22 -08:00
John-David Dalton
5fe7ca5e70 Update vendor/backbone.
Former-commit-id: faf9ed71356e1ae8b5c4f65e7084243571cb7d82
2013-01-17 00:40:49 -08:00
John-David Dalton
62fb440de2 Update closure compiler.
Former-commit-id: 20934c3606c88b0c108f89a01bcc7703dfbe2179
2013-01-17 00:18:41 -08:00
John-David Dalton
96fbd7c7ba Fix closure compiler bug.
Former-commit-id: 6b61f095fa26d2dee0d70b666e630e4ca0fa7be6
2013-01-16 23:59:24 -08:00
John-David Dalton
c9bec8e636 Fix typo in _.merge unit test.
Former-commit-id: 15b2389bca12cb1655a07a51525624f7af9caa6c
2013-01-16 23:22:07 -08:00
John-David Dalton
769e03e7f2 Update Closure Compiler and UglifyJS.
Former-commit-id: 8e20f30f84b01ed6df593136c2d081e9d05acbca
2013-01-16 23:21:08 -08:00
John-David Dalton
ab83f2d5e2 Ensure _.first and _.last have the correct chaining behavior when passing a callback and thisArg.
Former-commit-id: 4d54fd677fa48bf8de033696c58ee66babd77a81
2013-01-16 01:39:58 -08:00
John-David Dalton
b60d0cdb17 Added support for _.merge to accept callback and thisArg arguments. [closes #154]
Former-commit-id: 5d641ae4ba1d120d776a895f8bc9b8c1a7def0b6
2013-01-16 01:11:39 -08:00
John-David Dalton
677503dbf1 Remove Travis-CI build status until they resolve their issues.
Former-commit-id: 2d5607771e148b3010906452a9dc86f25f18ed3f
2013-01-15 21:28:14 -08:00
John-David Dalton
25efa29470 Remove metadata from tar.gz files.
Former-commit-id: 2cd702d72e9f2ff441fc7f8c8e22bef3f2784cbe
2013-01-15 21:16:18 -08:00
John-David Dalton
21a90f8f8f Avoid travis-ci downloading the included minifiers.
Former-commit-id: d8558ea8295a9c7e7d28c1a1740edf63daa81933
2013-01-15 20:50:25 -08:00
John-David Dalton
64e8d6ae99 Update .travis.yml with git and branch options.
Former-commit-id: 51abc02eb378332b15d525fdab62d82f8d70b62b
2013-01-15 02:18:40 -08:00
John-David Dalton
16a204335e Ensure _.merge produces dense arrays and revert accepting arrays of arguments for _.compose, _.defaults, _.extend, and _.merge.
Former-commit-id: a02772f8be04e187cbbfeb324cd4fb4318098162
2013-01-15 01:32:21 -08:00
John-David Dalton
0a53f762fe Update tested environments in README.md.
Former-commit-id: 9ce4d74e664acdd3acee27b7a127a6d7d4577ac4
2013-01-14 01:28:39 -08:00
John-David Dalton
6ba4778c1b Make methods capable of accepting unlimited arguments consistently accept either individual arguments or arrays of arguments.
Former-commit-id: b9f0c744f79e74889323f4fd7f737d10acd32ada
2013-01-14 01:11:46 -08:00
John-David Dalton
0404c2266c Use strictEqual when the expected result is 0 or 1.
Former-commit-id: ff439b0e7252351663b754267056ad09e0f89838
2013-01-13 15:12:02 -08:00
John-David Dalton
e5e914282f Allow _.first, _.last, _.initial, and _.rest to accept callback and thisArg arguments. [closes #155]
Former-commit-id: b921ae0ccc188c5544480f397216ce3b2479989e
2013-01-13 14:58:53 -08:00
John-David Dalton
9867d4bdc3 Add unit test for passing an object as callback to _.find.
Former-commit-id: 36da6e95473e85ac799180618e1a546d87f0686f
2013-01-12 20:42:54 -08:00
John-David Dalton
e4cb7112cf Update vendors, minified builds, and rebuild docs.
Former-commit-id: 9be99ca3c78a1a35fd13138398c48ab4a4b35f11
2013-01-12 20:12:38 -08:00
John-David Dalton
2d202e90b7 Add unofficial _.where like support for methods like _.find. [closes #159]
Former-commit-id: c6106035af3f3d676cbd3f0a5c785b2c00ad1e9d
2013-01-12 19:02:06 -08:00
John-David Dalton
016391e442 Add capitalize and getCategoryDependencies method to build.js
Former-commit-id: d939fbb482926a1673c5841f0c08b280ddca18e5
2013-01-12 16:46:52 -08:00
John-David Dalton
1eff48a429 Ensure iterator options are minified correctly.
Former-commit-id: ae7b617051d91d99bad899d82df195d3c41bf76a
2013-01-12 16:18:17 -08:00
John-David Dalton
ce33af6bb5 Cleanup _.merge.
Former-commit-id: 4227c403f89a1085ce88ca992106b7ed0a3c210c
2013-01-12 13:47:13 -08:00
John-David Dalton
fb9d4303f1 Correct _#tap doc example. [closes #156]
Former-commit-id: d1f6982e824a97db73546b8594c074b735580f8e
2013-01-08 22:21:46 -08:00
John-David Dalton
4e631c9e8f Flip noNodeClass check to avoid breaking when Firebug's "break on all errors" option is enabled. [closes #85]
Former-commit-id: f98c3af700279cb688c5df6c696b141bf626e26b
2013-01-05 22:11:14 -08:00
John-David Dalton
766d67d80d Remove isKeysFast guard.
Former-commit-id: 38a63ed31d652fd198ebf30dbb0f1546160c30c1
2013-01-05 12:07:29 -08:00
John-David Dalton
e2c2a37221 Make _.merge assign null values. [closes #151]
Former-commit-id: 5a839996db9475182d5957d2f8cb4b3c265b0d9f
2013-01-05 00:12:33 -08:00
John-David Dalton
2b23020695 Merge branch 'master' of github.com:bestiejs/lodash
Former-commit-id: fe8531c316e040e71dd8f58d509dcee9c137d985
2013-01-04 06:20:36 -08:00
John-David Dalton
8d43c6b1a8 Merge pull request #152 from terinjokes/docs
Fix typo in `_.range` docs.

Former-commit-id: 1fd6134d1809dcd59119740f0a115f0b5e819734
2013-01-04 06:15:27 -08:00
Terin Stock
7362dd1a7c Update _.range docs to consistently reference 'end'
Former-commit-id: a8ee760eb86e67eb898715ee9719fa8981eeda17
2013-01-04 02:20:06 -08:00
John-David Dalton
316caf7e8c Tweak UglifyJS "comments" option and update vendor/benchmark.js.
Former-commit-id: 6f09f27936f9453c58138e216399a51732a00173
2013-01-02 23:35:38 -08:00
John-David Dalton
87dc6631ee Cleanup "imports" template option.
Former-commit-id: f9f52b1f63908bcb7db7837a9bda067f2855acbb
2012-12-31 14:52:16 -06:00
John-David Dalton
62246d7d43 Update platform.js.
Former-commit-id: 5e5170b0c29175469d4b80010297d31afa14b5c8
2012-12-31 14:45:53 -06:00
John-David Dalton
a14be3a42c Add "imports" option to _.templateSettings. [closes #148]
Former-commit-id: 16a019d27aea2e7a72665f62adf4c4c35e29b4bf
2012-12-30 12:23:51 -06:00
John-David Dalton
7fdf00d5e9 Workaround UglifyJS comments option bug.
Former-commit-id: 705510311c4eee0739e85054c6d8edded427efe3
2012-12-30 11:14:10 -06:00
John-David Dalton
99e02f30fb Simplify createIterator. and remove whitespace between else { in template text.
Former-commit-id: a673f0edbe9b8655cbe1e91d9063e58130172495
2012-12-30 00:41:00 -06:00
John-David Dalton
716a5b9b5a Update _.random docs and add unit tests.
Former-commit-id: d4a033bf83ad5fce7bb3b09467305730a89adc01
2012-12-28 20:22:04 -06:00
John-David Dalton
87f880ca52 Update vendors.
Former-commit-id: baf89d2c3bd7077462995bffa7f8bff1e1cf28f9
2012-12-28 19:47:44 -06:00
John-David Dalton
8ec7b84a78 Remove unneeded default ran value from _.once.
Former-commit-id: 4d4fc057c0cf9108183e7e7158f305214eed4323
2012-12-27 14:17:09 -06:00
John-David Dalton
05cf5bc8db Defer downloading required minifies until the lodash command-line executable is used for the first time.
Former-commit-id: 83df0ac5875e8647168fffb7043a4cc197d27d79
2012-12-27 14:17:01 -06:00
John-David Dalton
ac25e21a0c Avoid minifying typeof x == 'undefined' checks into x === void 0.
Former-commit-id: 23c998b48a1d2e1bca19dad6bf16fa94aeebed31
2012-12-27 00:44:57 -06:00
John-David Dalton
cc1e0daaa4 Update vendor/underscore.
Former-commit-id: 9a00fa6c531e8cf0990526b7034cbde67ef335b3
2012-12-27 00:08:19 -06:00
John-David Dalton
f4120a9c8c Consistently coerce keys to strings before passing them to hasOwnProperty and init Array lengths when possible.
Former-commit-id: 5bd397eafbae888c7e6c76e62a7021b85796e65a
2012-12-25 23:12:19 -06:00
John-David Dalton
e3b80a5e09 Simplify _.toArray and wrapper methods.
Former-commit-id: b0440d401bd58cfa2d7aaf213549a824963474c3
2012-12-25 17:06:51 -06:00
John-David Dalton
ef7cb26b01 Update vendor/underscore and continue to tweak _.throttle unit tests to avoid false fails.
Former-commit-id: b5ba7b53e3bbebb3fa42da7e197f746515c8efb0
2012-12-24 09:49:46 -06:00
John-David Dalton
408a5c168f Optimize _.max and _.min for gzip.
Former-commit-id: e4d6eb949824718aa967208203b7c487df7e02f5
2012-12-23 16:49:00 -06:00
John-David Dalton
0ad6ac95b2 Avoid setTimeout inconsistencies in the unit tests.
Former-commit-id: fdbe08fcb381bf7771a1a7e474882d82e5bdbdf2
2012-12-23 10:10:28 -06:00
John-David Dalton
bda4747e9c Use @license in the copyright/license header. [closes #138]
Former-commit-id: 3b924dad24d56e0fd33e4df1341b09c6165521a1
2012-12-22 15:18:14 -06:00
John-David Dalton
bd8f882c94 Tweak _.reduce documentation.
Former-commit-id: 58d8a724dbf53594420e355c3d29ae28b53a7886
2012-12-22 11:57:14 -06:00
John-David Dalton
32b5b5b1c4 Catch module load errors in build/post-install.js.
Former-commit-id: 6671d4925749d8b4d6da9ddd732bc7f436b6740d
2012-12-22 11:56:52 -06:00
John-David Dalton
c1e543c9fe Cleanup .npmignore. [ci skip]
Former-commit-id: bca4d773ba803c28a128ec162b41e033998b5d0a
2012-12-21 20:08:16 -06:00
John-David Dalton
3908fa5c57 Simplify build/post-install.js.
Former-commit-id: a3f657f9721b18cef3c43b36a64e83b77d63eeea
2012-12-21 19:29:46 -06:00
John-David Dalton
1b347fc185 Tweak _.uniqueId to avoid problems with buggy minifiers.
Former-commit-id: e940c336b227ce89661cd6ada5f3e722a0204318
2012-12-21 12:38:55 -06:00
John-David Dalton
282a5e0b01 Correct href value in post-install.js.
Former-commit-id: 63b220d6dfecad7c1ebb5079efef603145e97392
2012-12-20 02:43:16 -05:00
John-David Dalton
e9d23cc1ea Use child_process.execFile instead of child_process.exec in post-install.js.
Former-commit-id: 2f6b0827641ceb1c6b418af9de87ef3c70243d5f
2012-12-20 02:29:21 -05:00
John-David Dalton
34173fd60f Upgrade to UglifyJS2.
Former-commit-id: dd326a5f401d8359f92f46552e2f59c1accf7cc1
2012-12-20 02:17:38 -05:00
John-David Dalton
d0d3c8ef57 Remove unused variable, index, in _.isEqual.
Former-commit-id: 21f364b6fa0505f9ccb579660f1bda4e38cbe3d3
2012-12-18 23:28:28 -08:00
John-David Dalton
11912008dd Account for at in an underscore build test.
Former-commit-id: 7222681ef1e5ec17e940789efc38e99be97c0116
2012-12-18 22:41:50 -08:00
John-David Dalton
c122007e17 Rebuild minified files and docs. [ci skip]
Former-commit-id: 161ba27aa3bd38c48d8f15057343944dc6a674c2
2012-12-18 21:53:30 -08:00
John-David Dalton
69dfa1a175 Clarify _.merge documentation. [closes #143] [ci skip]
Former-commit-id: efcec739bf2682da9b3dde27a43ff3b76aa4d6e8
2012-12-18 21:35:43 -08:00
John-David Dalton
bfea443e55 Cleanup _.at and add build tests.
Former-commit-id: 7648376e1ef447ae83d621b449b73acec355bb67
2012-12-18 21:16:10 -08:00
John-David Dalton
680798c28f Merge branch 'master' of github.com:bestiejs/lodash
Former-commit-id: 4241085b99e4df0991946a18f66990209e05ee31
2012-12-18 19:14:15 -08:00
John-David Dalton
9f0cc45c45 Merge pull request #142 from danheberden/pluckByArray
Add `at` method to get elements from a collection.

Former-commit-id: 99e4d651afe760f952398e5119d03c6caff0fc44
2012-12-18 19:14:00 -08:00
John-David Dalton
0ac97f467f Merge branch 'master' of github.com:bestiejs/lodash
Former-commit-id: 53ef1ba726cff56a98b739190957565c27bd253f
2012-12-18 19:09:33 -08:00
John-David Dalton
647746ea72 Update vendors, builds, and docs.
Former-commit-id: 8e6ca9a1334c73671aba1b4c974d738dbd7d72e1
2012-12-18 19:07:39 -08:00
John-David Dalton
7bea30b2e6 Optimize _.invert, _.pairs, and _.values.
Former-commit-id: d2725dc8c75254784d450f2a7e997e079b8c3183
2012-12-18 19:07:38 -08:00
John-David Dalton
12bc852c89 Update Chrome extension sandboxing link in README.md. [ci skip]
Former-commit-id: 17363260102ec1e874309eeea62bb077e2479303
2012-12-18 19:07:38 -08:00
John-David Dalton
0d42e84045 Add a benchmark for _.some with thisArg and avoid corrupting the aggregate score if a single benchmark errors. [ci skip]
Former-commit-id: 2042fdaab870ad2de2fb4938f5033d21f3dd1ae3
2012-12-18 19:07:38 -08:00
John-David Dalton
897b85b607 Merge branch 'master' of github.com:bestiejs/lodash
Former-commit-id: b5d52b6bbb4b5312fdf5d9da82fc15a4abef2b84
2012-12-18 19:05:59 -08:00
John-David Dalton
5c55cf0efb Make path convention consistent in package.json.
Former-commit-id: bf1bde8a2e78a520dca92ddd7b95f9fce12eb446
2012-12-18 19:05:39 -08:00
Dan Heberden
eccd6463f6 update dependency for at method
Former-commit-id: 600a1079d3591880654df0b861810b7c070047e9
2012-12-18 15:30:38 -08:00
Dan Heberden
4a0897c734 build in functionality to at, add string support, optimize, and add more tests
Former-commit-id: 951ef27e55fff5a70d09916b55b85f9e725f751a
2012-12-18 15:10:10 -08:00
Dan Heberden
c86a16df7f change .grab to .at, add unlimited args or numbers or arrays and simplify function call to use values and pick
Former-commit-id: 3deb82ad9f55cd7261453a40bb0f046a5340790d
2012-12-18 12:52:44 -08:00
Dan Heberden
2ae0e9d902 add grab method to get elements in a collection that match the indexes in the provided list array
Former-commit-id: 18df81c229cab4acde8f8157df9bb1001a51e9db
2012-12-18 10:00:24 -08:00
John-David Dalton
bba18cd56b Update vendors, builds, and docs.
Former-commit-id: 488762bd908dca5538767e4b4210ca0079560520
2012-12-18 07:41:34 -08:00
John-David Dalton
2f20781e16 Optimize _.invert, _.pairs, and _.values.
Former-commit-id: 7df68977c0a99b48e8989101228432c3db55c460
2012-12-18 02:45:56 -08:00
John-David Dalton
3bee212876 Update Chrome extension sandboxing link in README.md. [ci skip]
Former-commit-id: c093d1d8356b5ef4129e91b820478c25c5224798
2012-12-18 01:49:50 -08:00
John-David Dalton
6c8893a550 Add a benchmark for _.some with thisArg and avoid corrupting the aggregate score if a single benchmark errors. [ci skip]
Former-commit-id: 10dae73eb07e610a7752fc3f9035e71e696ce93d
2012-12-18 01:08:55 -08:00
167 changed files with 47424 additions and 24943 deletions

4
.gitattributes vendored
View File

@@ -1 +1,5 @@
* text=auto
*.html text eol=lf
*.js text eol=lf
*.md text eol=lf
*.sh text eol=lf

12
.gitignore vendored
View File

@@ -1,5 +1,11 @@
.coveralls.yml
.DS_Store
*.custom.*
node_modules/
vendor/closure-compiler/
vendor/uglifyjs/
*.template.*
*.map
/*.min.*
modularize
node_modules
dist/*.backbone.*
dist/*.legacy.*
dist/*.mobile.*

View File

@@ -1,12 +0,0 @@
.*
*.custom.*
*.md
*.txt
build.js
index.js
build/
doc/
node_modules/
perf/
test/
vendor/

View File

@@ -1,25 +0,0 @@
.*
*.custom.*
*.d.ts
doc/*.php
node_modules/
perf/*.html
perf/*-ui.js
perf/*.sh
test/*.html
test/*-ui.js
test/*.sh
vendor/*.gz
vendor/backbone/
vendor/benchmark.js/*.jar
vendor/closure-compiler
vendor/docdown
vendor/firebug-lite/
vendor/json3/
vendor/jquery/
vendor/qunit/qunit/*.css
vendor/qunit/qunit/*-1.8.0.js
vendor/requirejs/
vendor/underscore/*-min.js
vendor/uglifyjs
vendor/underscore/test/

View File

@@ -1,7 +1,79 @@
language: node_js
node_js:
- 0.6
- 0.8
before_script:
- "curl -H 'Accept: application/vnd.github.v3.raw' https://api.github.com/repos/bestiejs/lodash/git/blobs/a2787b470c577cee2404d186c562dd9835f779f5 | tar xvz -C vendor"
- "curl -H 'Accept: application/vnd.github.v3.raw' https://api.github.com/repos/bestiejs/lodash/git/blobs/7ecae09d413eb48dd5785fe877f24e60ac3bbcef | tar xvz -C vendor"
- "0.6"
- "0.8"
- "0.10"
env:
global:
- BIN="node" BUILD=false COMPAT=false MAKE=false OPTION="" SAUCE_LABS=false SAUCE_USERNAME="lodash"
- secure: "tg1JFsIFnxzLaTboFPOnm+aJCuMm5+JdhLlESlqg9x3fwro++7KCnwHKLNovhchaPe4otC43ZMB/nfWhDnDm11dKbm/V6HlTkED+dadTsaLxVDg6J+7yK41QhokBPJOxLV78iDaNaAQVYEirAgZ0yn8kFubxmNKV+bpCGQNc9yU="
matrix:
- BUILD="compat"
- BUILD="modern"
- BUILD="legacy"
- BUILD="mobile"
- BIN="phantomjs" BUILD="compat"
- BIN="phantomjs" BUILD="legacy"
- BIN="phantomjs" BUILD="mobile"
matrix:
include:
- node_js: "0.10"
env: BIN="istanbul"
- node_js: "0.10"
env: BIN="narwhal" BUILD="compat"
- node_js: "0.10"
env: BIN="narwhal" BUILD="legacy"
- node_js: "0.10"
env: BIN="rhino" BUILD="compat"
- node_js: "0.10"
env: BIN="rhino" BUILD="legacy"
- node_js: "0.10"
env: BIN="rhino" BUILD="compat" OPTION="-require"
- node_js: "0.10"
env: BIN="rhino" BUILD="legacy" OPTION="-require"
- node_js: "0.10"
env: BIN="ringo" BUILD="compat"
- node_js: "0.10"
env: BIN="ringo" BUILD="legacy"
- node_js: "0.8"
env: SAUCE_LABS=true BUILD="compat"
- node_js: "0.8"
env: SAUCE_LABS=true BUILD="modern"
- node_js: "0.8"
env: SAUCE_LABS=true BUILD="legacy"
- node_js: "0.8"
env: SAUCE_LABS=true BUILD="mobile"
- node_js: "0.8"
env: SAUCE_LABS=true BUILD="underscore"
git:
depth: 10
branches:
only:
- master
before_install:
- "([ $BUILD == 'legacy' ] || [ $BUILD == 'mobile' ] || [ $BUILD == 'modern' ]) && MAKE=true || true"
- "([ $BUILD == 'compat' ] || [ $BUILD == 'legacy' ]) && COMPAT=true || true"
- "[ $SAUCE_LABS != false ] && npm i ecstatic@\"~0.4.0\" request@\"~2.27.0\" sauce-tunnel@\"~1.1.0\" || true"
- "[ $BIN == 'istanbul' ] && npm i -g coveralls@\"~2.5.0\" istanbul@\"~0.1.0\" || true"
- "[ $BIN == 'narwhal' ] && wget https://github.com/280north/narwhal/archive/v0.3.2.zip && sudo unzip v0.3.2 -d /opt/ && rm v0.3.2.zip || true"
- "[ $BIN == 'narwhal' ] && sudo ln -s /opt/narwhal-0.3.2/bin/narwhal /usr/local/bin/narwhal && sudo chmod +x /usr/local/bin/narwhal || true"
- "[ $BIN == 'rhino' ] && sudo mkdir /opt/rhino-1.7R5 && sudo wget -O /opt/rhino-1.7R5/js.jar https://oss.sonatype.org/content/repositories/snapshots/org/mozilla/rhino/1.7R5-SNAPSHOT/rhino-1.7R5-20120629.144839-4.jar || true"
- "[ $BIN == 'rhino' ] && echo -e '#!/bin/sh\\njava -jar /opt/rhino-1.7R5/js.jar $@' | sudo tee /usr/local/bin/rhino && sudo chmod +x /usr/local/bin/rhino || true"
- "[ $BIN == 'ringo' ] && wget http://ringojs.org/downloads/ringojs-0.9.zip && sudo unzip ringojs-0.9 -d /opt && rm ringojs-0.9.zip || true"
- "[ $BIN == 'ringo' ] && sudo ln -s /opt/ringojs-0.9/bin/ringo /usr/local/bin/ringo && sudo chmod +x /usr/local/bin/ringo || true"
- "[ $MAKE != false ] && git clone --depth=10 --branch=master git://github.com/lodash/lodash-cli.git ./node_modules/lodash-cli || true"
- "[ $MAKE != false ] && mkdir ./node_modules/lodash-cli/node_modules && cd ./node_modules/lodash-cli/node_modules/ && ln -s ../../../ ./lodash && cd ../ && npm i . && cd ../../ || true"
- "[ $MAKE != false ] && node ./node_modules/lodash-cli/bin/lodash $BUILD -o ./dist/lodash.$BUILD.js || true"
script:
- "[ $BIN == 'istanbul' ] && $BIN cover -x \"**/vendor/**\" --report lcovonly ./test/test.js -- ./dist/lodash.js && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage || true"
- "([ $SAUCE_LABS != false ] || [ $BUILD == false ]) && true || cd ./test"
- "([ $SAUCE_LABS != false ] || [ $BUILD == false ]) && true || $BIN $OPTION ./test.js ../dist/lodash.$BUILD.js"
- "([ $SAUCE_LABS != false ] || [ $BUILD == false ]) && true || $BIN $OPTION ./test.js ../dist/lodash.$BUILD.min.js"
- "([ $SAUCE_LABS == false ] || [ $BUILD == 'underscore' ]) && true || node ./test/saucelabs.js runner=\"test/index.html?build=lodash-$BUILD\" tags=\"$BUILD,production\""
- "([ $SAUCE_LABS == false ] || [ $COMPAT == false ]) && true || node ./test/saucelabs.js runner=\"test/index.html?build=lodash-$BUILD\" tags=\"$BUILD,production,ie-compat\" compatMode=7"
- "([ $SAUCE_LABS == false ] || [ $BUILD == 'underscore' ]) && true || node ./test/saucelabs.js runner=\"test/index.html?build=../dist/lodash.$BUILD.js\" tags=\"$BUILD,development\""
- "([ $SAUCE_LABS == false ] || [ $COMPAT == false ]) && true || node ./test/saucelabs.js runner=\"test/index.html?build=../dist/lodash.$BUILD.js\" tags=\"$BUILD,development,ie-compat\" compatMode=7"
- "[ $SAUCE_LABS == false ] && true || node ./test/saucelabs.js name=\"backbone tests\" runner=\"test/backbone.html?build=lodash-$BUILD\" tags=\"$BUILD,production,backbone\""
- "[ $SAUCE_LABS == false ] && true || node ./test/saucelabs.js name=\"backbone tests\" runner=\"test/backbone.html?build=../dist/lodash.$BUILD.js\" tags=\"$BUILD,development,backbone\""
- "[ $SAUCE_LABS == false ] && true || node ./test/saucelabs.js name=\"underscore tests\" runner=\"test/underscore.html?build=lodash-$BUILD\" tags=\"$BUILD,production,underscore\""
- "[ $SAUCE_LABS == false ] && true || node ./test/saucelabs.js name=\"underscore tests\" runner=\"test/underscore.html?build=../dist/lodash.$BUILD.js\" tags=\"$BUILD,development,underscore\""

View File

@@ -1,21 +1,21 @@
# Contributing to Lo-Dash
If youd like to contribute a feature or bug fix, you can [fork](https://help.github.com/articles/fork-a-repo) Lo-Dash, commit your changes, and [send a pull request](https://help.github.com/articles/using-pull-requests).
Please make sure to [search the issue tracker](https://github.com/bestiejs/lodash/issues) first; your issue may have already been discussed or fixed in `master`.
Please make sure to [search the issue tracker](https://github.com/lodash/lodash/issues) first; your issue may have already been discussed or fixed in `master`.
## Tests
Include updated unit tests in the `test` directory as part of your pull request.
You can run the tests from the command line via `npm test`, or open `test/index.html` in a web browser.
The `test/run-test.sh` script attempts to run the tests in [Rhino](http://www.mozilla.org/rhino/), [RingoJS](http://ringojs.org/), [Narwhal](https://github.com/280north/narwhal), and [Node](http://nodejs.org/), before running them in your default browser.
You can run the tests from the command line via `node test/test`, or open `test/index.html` in a web browser.
The `test/run-test.sh` script attempts to run the tests in [Rhino](https://developer.mozilla.org/en-US/docs/Rhino), [Narwhal](https://github.com/280north/narwhal), [RingoJS](http://ringojs.org/), [PhantomJS](http://phantomjs.org/), and [Node](http://nodejs.org/), before running them in your default browser.
The [Backbone](http://backbonejs.org/) and [Underscore](http://http://underscorejs.org/) test suites are included as well.
## Contributor License Agreement
Lo-Dash is preparing to join [Dojo Foundation](http://dojofoundation.org/).
Lo-Dash is a member of the [Dojo Foundation](http://dojofoundation.org/).
As such, we request that all contributors sign the Dojo Foundation [contributor license agreement](http://dojofoundation.org/about/claForm).
For more information about CLAs, please check out Alex Russells excellent post, ["Why Do I Need to Sign This?"](http://infrequently.org/2008/06/why-do-i-need-to-sign-this/).
For more information about CLAs, please check out Alex Russells excellent post, [Why Do I Need to Sign This?](http://infrequently.org/2008/06/why-do-i-need-to-sign-this/).
## Coding Guidelines

View File

@@ -1,6 +1,6 @@
Copyright 2012 John-David Dalton <http://allyoucanleet.com/>
Based on Underscore.js 1.4.3, copyright 2009-2012 Jeremy Ashkenas,
DocumentCloud Inc. <http://documentcloud.github.com/underscore>
Copyright 2012-2013 The Dojo Foundation <http://dojofoundation.org/>
Based on Underscore.js 1.5.2, copyright 2009-2013 Jeremy Ashkenas,
DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the

340
README.md
View File

@@ -1,171 +1,35 @@
# Lo-Dash <sup>v1.0.0-rc.3</sup>
[![build status](https://secure.travis-ci.org/bestiejs/lodash.png)](http://travis-ci.org/bestiejs/lodash)
An alternative to Underscore.js, delivering [consistency](https://github.com/bestiejs/lodash#resolved-underscorejs-issues), [customization](https://github.com/bestiejs/lodash#custom-builds), [performance](http://lodash.com/benchmarks), and [extra features](https://github.com/bestiejs/lodash#features).
# Lo-Dash v2.4.2
A utility library delivering consistency, [customization](https://lodash.com/custom-builds), [performance](https://lodash.com/benchmarks), & [extras](https://lodash.com/#features).
## Download
* Lo-Dash builds:<br>
[Development](https://raw.github.com/bestiejs/lodash/v1.0.0-rc.3/lodash.js) and
[Production](https://raw.github.com/bestiejs/lodash/v1.0.0-rc.3/lodash.min.js)
Check out our [wiki]([https://github.com/lodash/lodash/wiki/build-differences]) for details over the differences between builds.
* Underscore compatibility builds:<br>
[Development](https://raw.github.com/bestiejs/lodash/v1.0.0-rc.3/lodash.underscore.js) and
[Production](https://raw.github.com/bestiejs/lodash/v1.0.0-rc.3/lodash.underscore.min.js)
* Modern builds perfect for newer browsers/environments:<br>
[Development](https://raw.github.com/lodash/lodash/2.4.2/dist/lodash.js) &
[Production](https://raw.github.com/lodash/lodash/2.4.2/dist/lodash.min.js)
* CDN copies of ≤ v1.0.0-rc.3s builds are available on [cdnjs](http://cdnjs.com/) thanks to [CloudFlare](http://www.cloudflare.com/):<br>
[Lo-Dash dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.0-rc.3/lodash.js),
[Lo-Dash prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.0-rc.3/lodash.min.js),
[Underscore compat-dev](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.0-rc.3/lodash.underscore.js), and
[Underscore compat-prod](http://cdnjs.cloudflare.com/ajax/libs/lodash.js/1.0.0-rc.3/lodash.underscore.min.js)
* Compatibility builds for older environment support too:<br>
[Development](https://raw.github.com/lodash/lodash/2.4.2/dist/lodash.compat.js) &
[Production](https://raw.github.com/lodash/lodash/2.4.2/dist/lodash.compat.min.js)
* For optimal file size, [create a custom build](https://github.com/bestiejs/lodash#custom-builds) with only the features you need
* Underscore builds to use as a drop-in replacement:<br>
[Development](https://raw.github.com/lodash/lodash/2.4.2/dist/lodash.underscore.js) &
[Production](https://raw.github.com/lodash/lodash/2.4.2/dist/lodash.underscore.min.js)
CDN copies are available on [cdnjs](http://cdnjs.com/libraries/lodash.js/) & [jsDelivr](http://www.jsdelivr.com/#!lodash). For smaller file sizes, create [custom builds](https://lodash.com/custom-builds) with only the features needed.
Love modules? Weve got you covered with [lodash-amd](https://npmjs.org/package/lodash-amd), [lodash-es6](https://github.com/lodash/lodash-es6), [lodash-node](https://npmjs.org/package/lodash-node), & [npm packages](https://npmjs.org/browse/keyword/lodash-modularized) per method.
## Dive in
Weve got [API docs](http://lodash.com/docs), [benchmarks](http://lodash.com/benchmarks), and [unit tests](http://lodash.com/tests).
Theres plenty of **[documentation](https://lodash.com/docs)**, [unit tests](https://lodash.com/tests), & [benchmarks](https://lodash.com/benchmarks).<br>
Check out <a href="http://devdocs.io/lodash/">DevDocs</a> as a fast, organized, & searchable interface for our documentation.
For a list of upcoming features, check out our [roadmap](https://github.com/bestiejs/lodash/wiki/Roadmap).
The full changelog for this release is available on our [wiki](https://github.com/lodash/lodash/wiki/Changelog).<br>
A list of upcoming features is available on our [roadmap](https://github.com/lodash/lodash/wiki/Roadmap).
## Screencasts
For more information check out these screencasts over Lo-Dash:
* [Introducing Lo-Dash](https://vimeo.com/44154599)
* [Lo-Dash optimizations and custom builds](https://vimeo.com/44154601)
* [Lo-Dashs origin and why its a better utility belt](https://vimeo.com/44154600)
* [Unit testing in Lo-Dash](https://vimeo.com/45865290)
* [Lo-Dashs approach to native method use](https://vimeo.com/48576012)
* [CascadiaJS: Lo-Dash for a better utility belt](http://www.youtube.com/watch?v=dpPy4f_SeEk)
## Features
* AMD loader support ([RequireJS](http://requirejs.org/), [curl.js](https://github.com/cujojs/curl), etc.)
* [_(…)](http://lodash.com/docs#_) supports intuitive chaining
* [_.bindKey](http://lodash.com/docs#bindKey) for binding [*“lazy”* defined](http://michaux.ca/articles/lazy-function-definition-pattern) methods
* [_.cloneDeep](http://lodash.com/docs#cloneDeep) for *“deep”* cloning arrays and objects
* [_.contains](http://lodash.com/docs#contains) accepts a `fromIndex` argument
* [_.forEach](http://lodash.com/docs#forEach) is chainable and supports exiting iteration early
* [_.forIn](http://lodash.com/docs#forIn) for iterating over an objects own and inherited properties
* [_.forOwn](http://lodash.com/docs#forOwn) for iterating over an objects own properties
* [_.isPlainObject](http://lodash.com/docs#isPlainObject) checks if values are created by the `Object` constructor
* [_.merge](http://lodash.com/docs#merge) for a *“deep”* [_.extend](http://lodash.com/docs#extend)
* [_.partial](http://lodash.com/docs#partial) for partial application without `this` binding
* [_.pick](http://lodash.com/docs#pick) and [_.omit](http://lodash.com/docs#omit) accepts `callback` and `thisArg` arguments
* [_.template](http://lodash.com/docs#template) supports [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-7.8.6) and utilizes [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) for easier debugging
* [_.contains](http://lodash.com/docs#contains), [_.size](http://lodash.com/docs#size), [_.toArray](http://lodash.com/docs#toArray),
[and more…](http://lodash.com/docs "_.countBy, _.every, _.filter, _.find, _.forEach, _.groupBy, _.invoke, _.map, _.max, _.min, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.some, _.sortBy, _.where") accept strings
## Support
Lo-Dash has been tested in at least Chrome 5~23, Firefox 1~17, IE 6-10, Opera 9.25-12, Safari 3-6, Node.js 0.4.8-0.8.16, Narwhal 0.3.2, RingoJS 0.8, and Rhino 1.7RC5.
## Custom builds
Custom builds make it easy to create lightweight versions of Lo-Dash containing only the methods you need.
To top it off, we handle all method dependency and alias mapping for you.
* Backbone builds, with only methods required by Backbone, may be created using the `backbone` modifier argument.
```bash
lodash backbone
```
* CSP builds, supporting default [Content Security Policy](http://dvcs.w3.org/hg/content-security-policy/raw-file/tip/csp-specification.dev.html) restrictions, may be created using the `csp` modifier argument.
The `csp` modifier is an alais of the `mobile` modifier. Chrome extensions will require [sandboxing](http://developer.chrome.com/trunk/extensions/sandboxingEval.html) or the use of either the `csp`, `mobile`, or `underscore` build.
```bash
lodash csp
```
* Legacy builds, tailored for older browsers without [ES5 support](http://es5.github.com/), may be created using the `legacy` modifier argument.
```bash
lodash legacy
```
* Mobile builds, with IE < 9 bug fixes and method compilation removed, may be created using the `mobile` modifier argument.
```bash
lodash mobile
```
* Strict builds, with `_.bindAll`, `_.defaults`, and `_.extend` in [strict mode](http://es5.github.com/#C), may be created using the `strict` modifier argument.
```bash
lodash strict
```
* Underscore builds, tailored for projects already using Underscore, may be created using the `underscore` modifier argument.
```bash
lodash underscore
```
Custom builds may be created using the following commands:
* Use the `category` argument to pass comma separated categories of methods to include in the build.<br>
Valid categories (case-insensitive) are *“arrays”*, *“chaining”*, *“collections”*, *“functions”*, *“objects”*, and *“utilities”*.
```bash
lodash category=collections,functions
lodash category="collections, functions"
```
* Use the `exports` argument to pass comma separated names of ways to export the `LoDash` function.<br>
Valid exports are *“amd”*, *“commonjs”*, *“global”*, *“node”*, and *“none”*.
```bash
lodash exports=amd,commonjs,node
lodash exports="amd, commonjs, node"
```
* Use the `iife` argument to specify code to replace the immediately-invoked function expression that wraps Lo-Dash.
```bash
lodash iife="!function(window,undefined){%output%}(this)"
```
* Use the `include` argument to pass comma separated method/category names to include in the build.
```bash
lodash include=each,filter,map
lodash include="each, filter, map"
```
* Use the `minus` argument to pass comma separated method/category names to remove from those included in the build.
```bash
lodash underscore minus=result,shuffle
lodash underscore minus="result, shuffle"
```
* Use the `plus` argument to pass comma separated method/category names to add to those included in the build.
```bash
lodash backbone plus=random,template
lodash backbone plus="random, template"
```
* Use the `template` argument to pass the file path pattern used to match template files to precompile.
```bash
lodash template="./*.jst"
```
* Use the `settings` argument to pass the template settings used when precompiling templates.
```bash
lodash settings="{interpolate:/\\{\\{([\\s\\S]+?)\\}\\}/g}"
```
* Use the `moduleId` argument to specify the AMD module ID of Lo-Dash, which defaults to “lodash”, used by precompiled templates.
```bash
lodash moduleId="underscore"
```
All arguments, except `legacy` with `csp` or `mobile`, may be combined.<br>
Unless specified by `-o` or `--output`, all files created are saved to the current working directory.
The following options are also supported:
* `-c`, `--stdout`&nbsp;&nbsp;&nbsp;&nbsp; Write output to standard output
* `-d`, `--debug`&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Write only the debug output
* `-h`, `--help`&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Display help information
* `-m`, `--minify`&nbsp;&nbsp;&nbsp;&nbsp; Write only the minified output
* `-o`, `--output`&nbsp;&nbsp;&nbsp;&nbsp; Write output to a given path/filename
* `-s`, `--silent`&nbsp;&nbsp;&nbsp;&nbsp; Skip status updates normally logged to the console
* `-V`, `--version`&nbsp;&nbsp; Output current version of Lo-Dash
The `lodash` command-line utility is available when Lo-Dash is installed as a global package (i.e. `npm install -g lodash`).
## Installation and usage
## Installation & usage
In browsers:
@@ -176,34 +40,23 @@ In browsers:
Using [`npm`](http://npmjs.org/):
```bash
npm install lodash
npm i --save lodash
npm install -g lodash
npm link lodash
{sudo} npm i -g lodash
npm ln lodash
```
To avoid potential issues, update `npm` before installing Lo-Dash:
```bash
npm install npm -g
```
In [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/):
In [Node.js](http://nodejs.org/) & [Ringo](http://ringojs.org/):
```js
var _ = require('lodash');
// or as a drop-in replacement for Underscore
var _ = require('lodash/lodash.underscore');
// or as Underscore
var _ = require('lodash/dist/lodash.underscore');
```
**Note:** If Lo-Dash is installed globally, run [`npm link lodash`](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/) in your projects root directory before requiring it.
In [RingoJS v0.7.0-](http://ringojs.org/):
```js
var _ = require('lodash')._;
```
**Notes:**
* Dont assign values to [special variable](http://nodejs.org/api/repl.html#repl_repl_features) `_` when in the REPL
* If Lo-Dash is installed globally, run [`npm ln lodash`](http://blog.nodejs.org/2011/03/23/npm-1-0-global-vs-local-installation/) in your projects root directory *before* requiring it
In [Rhino](http://www.mozilla.org/rhino/):
@@ -211,89 +64,82 @@ In [Rhino](http://www.mozilla.org/rhino/):
load('lodash.js');
```
In an AMD loader like [RequireJS](http://requirejs.org/):
In an AMD loader:
```js
require({
'paths': {
'underscore': 'path/to/lodash'
}
'packages': [
{ 'name': 'lodash', 'location': 'path/to/lodash', 'main': 'lodash' }
]
},
['underscore'], function(_) {
['lodash'], function(_) {
console.log(_.VERSION);
});
```
## Resolved Underscore.js issues
## Resources
* Allow iteration of objects with a `length` property [[#799](https://github.com/documentcloud/underscore/pull/799), [test](https://github.com/bestiejs/lodash/blob/v1.0.0-rc.3/test/test.js#L605-L611)]
* Fix cross-browser object iteration bugs [[#60](https://github.com/documentcloud/underscore/issues/60), [#376](https://github.com/documentcloud/underscore/issues/376), [test](https://github.com/bestiejs/lodash/blob/v1.0.0-rc.3/test/test.js#L618-L642)]
* Methods should work on pages with incorrectly shimmed native methods [[#7](https://github.com/documentcloud/underscore/issues/7), [#742](https://github.com/documentcloud/underscore/issues/742), [test](https://github.com/bestiejs/lodash/blob/v1.0.0-rc.3/test/test.js#L140-L146)]
* `_.isEmpty` should support jQuery/MooTools DOM query collections [[#690](https://github.com/documentcloud/underscore/pull/690), [test](https://github.com/bestiejs/lodash/blob/v1.0.0-rc.3/test/test.js#L807-L812)]
* `_.isObject` should avoid V8 bug [#2291](http://code.google.com/p/v8/issues/detail?id=2291) [[#605](https://github.com/documentcloud/underscore/issues/605), [test](https://github.com/bestiejs/lodash/blob/v1.0.0-rc.3/test/test.js#L888-L900)]
* `_.keys` should work with `arguments` objects cross-browser [[#396](https://github.com/documentcloud/underscore/issues/396), [test](https://github.com/bestiejs/lodash/blob/v1.0.0-rc.3/test/test.js#L982-L984)]
* `_.range` should coerce arguments to numbers [[#634](https://github.com/documentcloud/underscore/issues/634), [#683](https://github.com/documentcloud/underscore/issues/683), [test](https://github.com/bestiejs/lodash/blob/v1.0.0-rc.3/test/test.js#L1383-L1386)]
* Podcasts
- [JavaScript Jabber](http://javascriptjabber.com/079-jsj-lo-dash-with-john-david-dalton/)
## Release Notes
* Posts
- [Say “Hello” to Lo-Dash](http://kitcambridge.be/blog/say-hello-to-lo-dash/)
- [Custom builds in Lo-Dash 2.0](http://kitcambridge.be/blog/custom-builds-in-lo-dash-2-dot-0/)
### <sup>v1.0.0-rc.3</sup>
* Videos
- [Introduction](https://vimeo.com/44154599)
- [Origins](https://vimeo.com/44154600)
- [Optimizations & builds](https://vimeo.com/44154601)
- [Native method use](https://vimeo.com/48576012)
- [Testing](https://vimeo.com/45865290)
- [CascadiaJS 12](http://www.youtube.com/watch?v=dpPy4f_SeEk)
#### Compatibility Warnings
A list of other community created podcasts, posts, & videos is available on our [wiki](https://github.com/lodash/lodash/wiki/Resources).
* Made `_#join`, `_#pop`, and `_#shift` wrapper methods return unwrapped values
* Made *“Functions”* methods wrapper counterparts return wrapped values
* Removed `_.chain` and `_#chain` methods
## Features
#### Changes
* AMD loader support ([curl](https://github.com/cujojs/curl), [dojo](http://dojotoolkit.org/), [requirejs](http://requirejs.org/), etc.)
* [_(…)](https://lodash.com/docs#_) supports intuitive chaining
* [_.at](https://lodash.com/docs#at) for cherry-picking collection values
* [_.bindKey](https://lodash.com/docs#bindKey) for binding [*“lazy”*](http://michaux.ca/articles/lazy-function-definition-pattern) defined methods
* [_.clone](https://lodash.com/docs#clone) supports shallow cloning of `Date` & `RegExp` objects
* [_.cloneDeep](https://lodash.com/docs#cloneDeep) for deep cloning arrays & objects
* [_.constant](https://lodash.com/docs#constant) & [_.property](https://lodash.com/docs#property) function generators for composing functions
* [_.contains](https://lodash.com/docs#contains) accepts a `fromIndex`
* [_.create](https://lodash.com/docs#create) for easier object inheritance
* [_.createCallback](https://lodash.com/docs#createCallback) for extending callbacks in methods & mixins
* [_.curry](https://lodash.com/docs#curry) for creating [curried](http://hughfdjackson.com/javascript/2013/07/06/why-curry-helps/) functions
* [_.debounce](https://lodash.com/docs#debounce) & [_.throttle](https://lodash.com/docs#throttle) accept additional `options` for more control
* [_.findIndex](https://lodash.com/docs#findIndex) & [_.findKey](https://lodash.com/docs#findKey) for finding indexes & keys
* [_.forEach](https://lodash.com/docs#forEach) is chainable & supports exiting early
* [_.forIn](https://lodash.com/docs#forIn) for iterating own & inherited properties
* [_.forOwn](https://lodash.com/docs#forOwn) for iterating own properties
* [_.isPlainObject](https://lodash.com/docs#isPlainObject) for checking if values are created by `Object`
* [_.mapValues](https://lodash.com/docs#mapValues) for [mapping](https://lodash.com/docs#map) values to an object
* [_.memoize](https://lodash.com/docs#memoize) exposes the `cache` of memoized functions
* [_.merge](https://lodash.com/docs#merge) for a deep [_.extend](https://lodash.com/docs#extend)
* [_.noop](https://lodash.com/docs#noop) for function placeholders
* [_.now](https://lodash.com/docs#now) as a cross-browser `Date.now` alternative
* [_.parseInt](https://lodash.com/docs#parseInt) for consistent behavior
* [_.pull](https://lodash.com/docs#pull) & [_.remove](https://lodash.com/docs#remove) for mutating arrays
* [_.random](https://lodash.com/docs#random) supports returning floating-point numbers
* [_.runInContext](https://lodash.com/docs#runInContext) for easier mocking
* [_.sortBy](https://lodash.com/docs#sortBy) supports sorting by multiple properties
* [_.support](https://lodash.com/docs#support) for flagging environment features
* [_.template](https://lodash.com/docs#template) supports [*“imports”*](https://lodash.com/docs#templateSettings_imports) options & [ES6 template delimiters](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-literals-string-literals)
* [_.transform](https://lodash.com/docs#transform) as a powerful alternative to [_.reduce](https://lodash.com/docs#reduce) for transforming objects
* [_.where](https://lodash.com/docs#where) supports deep object comparisons
* [_.xor](https://lodash.com/docs#xor) as a companion to [_.difference](https://lodash.com/docs#difference), [_.intersection](https://lodash.com/docs#intersection), & [_.union](https://lodash.com/docs#union)
* [_.zip](https://lodash.com/docs#zip) is capable of unzipping values
* [_.omit](https://lodash.com/docs#omit), [_.pick](https://lodash.com/docs#pick), &
[more](https://lodash.com/docs "_.assign, _.clone, _.cloneDeep, _.first, _.initial, _.isEqual, _.last, _.merge, _.rest") accept callbacks
* [_.contains](https://lodash.com/docs#contains), [_.toArray](https://lodash.com/docs#toArray), &
[more](https://lodash.com/docs "_.at, _.countBy, _.every, _.filter, _.find, _.forEach, _.forEachRight, _.groupBy, _.invoke, _.map, _.max, _.min, _.pluck, _.reduce, _.reduceRight, _.reject, _.shuffle, _.size, _.some, _.sortBy, _.where") accept strings
* [_.filter](https://lodash.com/docs#filter), [_.map](https://lodash.com/docs#map), &
[more](https://lodash.com/docs "_.countBy, _.every, _.find, _.findKey, _.findLast, _.findLastIndex, _.findLastKey, _.first, _.groupBy, _.initial, _.last, _.max, _.min, _.reject, _.rest, _.some, _.sortBy, _.sortedIndex, _.uniq") support *“_.pluck”* & *“_.where”* shorthands
* [_.findLast](https://lodash.com/docs#findLast), [_.findLastIndex](https://lodash.com/docs#findLastIndex), &
[more](https://lodash.com/docs "_.findLastKey, _.forEachRight, _.forInRight, _.forOwnRight, _.partialRight") right-associative methods
* Added [_.cloneDeep](http://lodash.com/docs#cloneDeep) alias of `_.clone(…, true)`
* Added `_.once` to the `backbone` build method dependencies
* Ensured `backbone` builds implement Underscores chaining behavior
* Ensured the `settings=…` build option doesnt clobber the default `moduleId`
* Ensured Lo-Dashs `npm` package installation avoids erroring when no other modules have been globally installed
* Made compiled templates loaded via AMD use the Lo-Dash module for their `_` references
* Removed the *“Collections”* method `_.forEach` dependency from *“Arrays”* method `_.intersection`
* Optimized `_.isArray` and `_.isFunction` fallbacks as well as<br>
`_.intersection`, `_.isDate`, `_.isRegExp`, `_.reduce`, `_.reduceRight`, `_.union`, and `_.uniq`
## Support
### <sup>v1.0.0-rc.2</sup>
* Specified more method chaining behaviors
* Updated `underscore` build compatibility to v1.4.3
### <sup>v1.0.0-rc.1</sup>
#### Compatibility Warnings
* Made `_(…)` intuitively chain without needing to call `_#chain`
* Made `_.isEqual` equate `arguments` objects to similar `Object` objects
* Made `_.clone` copy the enumerable properties of `arguments` objects and objects<br>
created by constructors other than `Object` are cloned to plain `Object` objects
#### Changes
* Ensure Lo-Dash runs in the JS engine embedded in Adobe products
* Ensured `_.reduce` and `_.reduceRight` pass the correct number of `callback` arguments
* Ensured `_.throttle` nulls the `timeoutId`
* Made deep `_.clone` more closely follow the structured clone algorithm and copy array properties assigned by `RegExp#exec`
* Optimized compiled templates in Firefox
* Optimized `_.forEach`, `_.forOwn`, `_.isNumber`, and `_.isString`
* Simplified `iteratorTemplate`
The full changelog is available [here](https://github.com/bestiejs/lodash/wiki/Changelog).
## BestieJS
Lo-Dash is part of the BestieJS *“Best in Class”* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation.
## Author
* [John-David Dalton](http://allyoucanleet.com/)
[![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter")
## Contributors
* [Kit Cambridge](http://kitcambridge.github.com/)
[![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter")
* [Mathias Bynens](http://mathiasbynens.be/)
[![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter")
Tested in Chrome 5~31, Firefox 2~25, IE 6-11, Opera 9.25-17, Safari 3-7, Node.js 0.6.21-0.10.22, Narwhal 0.3.2, PhantomJS 1.9.2, RingoJS 0.9, & Rhino 1.7RC5.

23
bower.json Normal file
View File

@@ -0,0 +1,23 @@
{
"name": "lodash",
"version": "2.4.2",
"main": "dist/lodash.compat.js",
"ignore": [
".*",
"*.custom.*",
"*.template.*",
"*.map",
"*.md",
"/*.min.*",
"/lodash.js",
"index.js",
"component.json",
"package.json",
"doc",
"modularize",
"node_modules",
"perf",
"test",
"vendor"
]
}

2121
build.js

File diff suppressed because it is too large Load Diff

View File

@@ -1,438 +0,0 @@
#!/usr/bin/env node
;(function() {
'use strict';
/** The Node filesystem, path, `zlib`, and child process modules */
var fs = require('fs'),
gzip = require('zlib').gzip,
path = require('path'),
spawn = require('child_process').spawn;
/** The path of the directory that is the base of the repository */
var basePath = fs.realpathSync(path.join(__dirname, '..'));
/** The path of the directory where the Closure Compiler is located */
var closurePath = path.join(basePath, 'vendor', 'closure-compiler', 'compiler.jar');
/** Load other modules */
var preprocess = require('./pre-compile.js'),
postprocess = require('./post-compile.js'),
uglifyJS = require('../vendor/uglifyjs/uglify-js.js');
/** The Closure Compiler command-line options */
var closureOptions = ['--warning_level=QUIET'];
/** The Closure Compiler optimization modes */
var optimizationModes = {
'simple': 'SIMPLE_OPTIMIZATIONS',
'advanced': 'ADVANCED_OPTIMIZATIONS'
};
/** Reassign `existsSync` for older versions of Node */
fs.existsSync || (fs.existsSync = path.existsSync);
/*--------------------------------------------------------------------------*/
/**
* Minifies a given Lo-Dash `source` and invokes the `options.onComplete`
* callback when finished. The `onComplete` callback is invoked with one
* argument; (outputSource).
*
* @param {Array|String} [source=''] The source to minify or array of commands.
* -o, --output - Write output to a given path/filename.
* -s, --silent - Skip status updates normally logged to the console.
* -t, --template - Applies template specific minifier options.
*
* @param {Object} [options={}] The options object.
* outputPath - Write output to a given path/filename.
* isSilent - Skip status updates normally logged to the console.
* isTemplate - Applies template specific minifier options.
* onComplete - The function called once minification has finished.
*/
function minify(source, options) {
source || (source = '');
options || (options = {});
// juggle arguments
if (Array.isArray(source)) {
// convert commands to an options object
options = source;
var filePath = options[options.length - 1],
isSilent = options.indexOf('-s') > -1 || options.indexOf('--silent') > -1,
isTemplate = options.indexOf('-t') > -1 || options.indexOf('--template') > -1,
outputPath = path.join(path.dirname(filePath), path.basename(filePath, '.js') + '.min.js');
outputPath = options.reduce(function(result, value, index) {
if (/-o|--output/.test(value)) {
result = options[index + 1];
result = path.join(fs.realpathSync(path.dirname(result)), path.basename(result));
}
return result;
}, outputPath);
options = {
'isSilent': isSilent,
'isTemplate': isTemplate,
'outputPath': outputPath
};
source = fs.readFileSync(filePath, 'utf8');
}
new Minify(source, options);
}
/**
* The Minify constructor used to keep state of each `minify` invocation.
*
* @private
* @constructor
* @param {String} source The source to minify.
* @param {Object} options The options object.
* outputPath - Write output to a given path/filename.
* isSilent - Skip status updates normally logged to the console.
* isTemplate - Applies template specific minifier options.
* onComplete - The function called once minification has finished.
*/
function Minify(source, options) {
// juggle arguments
if (typeof source == 'object' && source) {
options = source || options;
source = options.source || '';
}
this.compiled = { 'simple': {}, 'advanced': {} };
this.hybrid = { 'simple': {}, 'advanced': {} };
this.uglified = {};
this.isSilent = !!options.isSilent;
this.isTemplate = !!options.isTemplate;
this.outputPath = options.outputPath;
source = preprocess(source, options);
this.source = source;
this.onComplete = options.onComplete || function(source) {
fs.writeFileSync(this.outputPath, source, 'utf8');
};
// begin the minification process
closureCompile.call(this, source, 'simple', onClosureSimpleCompile.bind(this));
}
/*--------------------------------------------------------------------------*/
/**
* Compresses a `source` string using the Closure Compiler. Yields the
* minified result, and any exceptions encountered, to a `callback` function.
*
* @private
* @param {String} source The JavaScript source to minify.
* @param {String} mode The optimization mode.
* @param {Function} callback The function called once the process has completed.
*/
function closureCompile(source, mode, callback) {
// use simple optimizations when minifying template files
var options = closureOptions.slice();
options.push('--compilation_level=' + optimizationModes[this.isTemplate ? 'simple' : mode]);
// the standard error stream, standard output stream, and the Closure Compiler process
var error = '',
output = '',
compiler = spawn('java', ['-jar', closurePath].concat(options));
if (!this.isSilent) {
console.log('Compressing ' + path.basename(this.outputPath, '.js') + ' using the Closure Compiler (' + mode + ')...');
}
compiler.stdout.on('data', function(data) {
// append the data to the output stream
output += data;
});
compiler.stderr.on('data', function(data) {
// append the error message to the error stream
error += data;
});
compiler.on('exit', function(status) {
// `status` contains the process exit code
var exception = null;
if (status) {
exception = new Error(error);
exception.status = status;
}
callback(exception, output);
});
// proxy the standard input to the Closure Compiler
compiler.stdin.end(source);
}
/**
* Compresses a `source` string using UglifyJS. Yields the result to a
* `callback` function. This function is synchronous; the `callback` is used
* for symmetry.
*
* @private
* @param {String} source The JavaScript source to minify.
* @param {String} label The label to log.
* @param {Function} callback The function called once the process has completed.
*/
function uglify(source, label, callback) {
var exception,
result,
ugly = uglifyJS.uglify;
if (!this.isSilent) {
console.log('Compressing ' + path.basename(this.outputPath, '.js') + ' using ' + label + '...');
}
try {
result = ugly.gen_code(
// enable unsafe transformations
ugly.ast_squeeze_more(
ugly.ast_squeeze(
// munge variable and function names, excluding the special `define`
// function exposed by AMD loaders
ugly.ast_mangle(uglifyJS.parser.parse(source), {
'except': ['define']
}
))), {
'ascii_only': true
});
} catch(e) {
exception = e;
}
// lines are restricted to 500 characters for consistency with the Closure Compiler
callback(exception, result && ugly.split_lines(result, 500));
}
/*--------------------------------------------------------------------------*/
/**
* The Closure Compiler callback for simple optimizations.
*
* @private
* @param {Object|Undefined} exception The error object.
* @param {String} result The resulting minified source.
*/
function onClosureSimpleCompile(exception, result) {
if (exception) {
throw exception;
}
result = postprocess(result);
this.compiled.simple.source = result;
gzip(result, onClosureSimpleGzip.bind(this));
}
/**
* The Closure Compiler `gzip` callback for simple optimizations.
*
* @private
* @param {Object|Undefined} exception The error object.
* @param {Buffer} result The resulting gzipped source.
*/
function onClosureSimpleGzip(exception, result) {
if (exception) {
throw exception;
}
if (!this.isSilent) {
console.log('Done. Size: %d bytes.', result.length);
}
this.compiled.simple.gzip = result;
// next, compile the source using advanced optimizations
closureCompile.call(this, this.source, 'advanced', onClosureAdvancedCompile.bind(this));
}
/**
* The Closure Compiler callback for advanced optimizations.
*
* @private
* @param {Object|Undefined} exception The error object.
* @param {String} result The resulting minified source.
*/
function onClosureAdvancedCompile(exception, result) {
if (exception) {
throw exception;
}
result = postprocess(result);
this.compiled.advanced.source = result;
gzip(result, onClosureAdvancedGzip.bind(this));
}
/**
* The Closure Compiler `gzip` callback for advanced optimizations.
*
* @private
* @param {Object|Undefined} exception The error object.
* @param {Buffer} result The resulting gzipped source.
*/
function onClosureAdvancedGzip(exception, result) {
if (exception) {
throw exception;
}
if (!this.isSilent) {
console.log('Done. Size: %d bytes.', result.length);
}
this.compiled.advanced.gzip = result;
// next, minify the source using only UglifyJS
uglify.call(this, this.source, 'UglifyJS', onUglify.bind(this));
}
/**
* The UglifyJS callback.
*
* @private
* @param {Object|Undefined} exception The error object.
* @param {String} result The resulting minified source.
*/
function onUglify(exception, result) {
if (exception) {
throw exception;
}
result = postprocess(result);
this.uglified.source = result;
gzip(result, onUglifyGzip.bind(this));
}
/**
* The UglifyJS `gzip` callback.
*
* @private
* @param {Object|Undefined} exception The error object.
* @param {Buffer} result The resulting gzipped source.
*/
function onUglifyGzip(exception, result) {
if (exception) {
throw exception;
}
if (!this.isSilent) {
console.log('Done. Size: %d bytes.', result.length);
}
this.uglified.gzip = result;
// next, minify the already Closure Compiler simple optimized source using UglifyJS
uglify.call(this, this.compiled.simple.source, 'hybrid (simple)', onSimpleHybrid.bind(this));
}
/**
* The hybrid callback for simple optimizations.
*
* @private
* @param {Object|Undefined} exception The error object.
* @param {String} result The resulting minified source.
*/
function onSimpleHybrid(exception, result) {
if (exception) {
throw exception;
}
result = postprocess(result);
this.hybrid.simple.source = result;
gzip(result, onSimpleHybridGzip.bind(this));
}
/**
* The hybrid `gzip` callback for simple optimizations.
*
* @private
* @param {Object|Undefined} exception The error object.
* @param {Buffer} result The resulting gzipped source.
*/
function onSimpleHybridGzip(exception, result) {
if (exception) {
throw exception;
}
if (!this.isSilent) {
console.log('Done. Size: %d bytes.', result.length);
}
this.hybrid.simple.gzip = result;
// next, minify the already Closure Compiler advance optimized source using UglifyJS
uglify.call(this, this.compiled.advanced.source, 'hybrid (advanced)', onAdvancedHybrid.bind(this));
}
/**
* The hybrid callback for advanced optimizations.
*
* @private
* @param {Object|Undefined} exception The error object.
* @param {String} result The resulting minified source.
*/
function onAdvancedHybrid(exception, result) {
if (exception) {
throw exception;
}
result = postprocess(result);
this.hybrid.advanced.source = result;
gzip(result, onAdvancedHybridGzip.bind(this));
}
/**
* The hybrid `gzip` callback for advanced optimizations.
*
* @private
* @param {Object|Undefined} exception The error object.
* @param {Buffer} result The resulting gzipped source.
*/
function onAdvancedHybridGzip(exception, result) {
if (exception) {
throw exception;
}
if (!this.isSilent) {
console.log('Done. Size: %d bytes.', result.length);
}
this.hybrid.advanced.gzip = result;
// finish by choosing the smallest compressed file
onComplete.call(this);
}
/**
* The callback executed after the source is minified and gzipped.
*
* @private
*/
function onComplete() {
var compiledSimple = this.compiled.simple,
compiledAdvanced = this.compiled.advanced,
uglified = this.uglified,
hybridSimple = this.hybrid.simple,
hybridAdvanced = this.hybrid.advanced;
// select the smallest gzipped file and use its minified counterpart as the
// official minified release (ties go to the Closure Compiler)
var min = Math.min(
compiledSimple.gzip.length,
compiledAdvanced.gzip.length,
uglified.gzip.length,
hybridSimple.gzip.length,
hybridAdvanced.gzip.length
);
// pass the minified source to the "onComplete" callback
[compiledSimple, compiledAdvanced, uglified, hybridSimple, hybridAdvanced].some(function(data) {
if (data.gzip.length == min) {
this.onComplete(data.source);
}
}, this);
}
/*--------------------------------------------------------------------------*/
// expose `minify`
if (module != require.main) {
module.exports = minify;
}
else {
// read the Lo-Dash source file from the first argument if the script
// was invoked directly (e.g. `node minify.js source.js`) and write to
// `<filename>.min.js`
(function() {
var options = process.argv;
if (options.length < 3) {
return;
}
minify(options);
}());
}
}());

View File

@@ -1,82 +0,0 @@
#!/usr/bin/env node
;(function() {
'use strict';
/** The Node filesystem module */
var fs = require('fs');
/** The minimal license/copyright template */
var licenseTemplate = {
'lodash':
'/*!\n' +
' Lo-Dash <%= VERSION %> lodash.com/license\n' +
' Underscore.js 1.4.3 underscorejs.org/LICENSE\n' +
'*/',
'underscore':
'/*! Underscore.js <%= VERSION %> underscorejs.org/LICENSE */'
};
/*--------------------------------------------------------------------------*/
/**
* Post-process a given minified Lo-Dash `source`, preparing it for
* deployment.
*
* @param {String} source The source to process.
* @returns {String} Returns the processed source.
*/
function postprocess(source) {
// move vars exposed by the Closure Compiler into the IIFE
source = source.replace(/^((?:(['"])use strict\2;)?(?:var (?:[a-z]+=(?:!0|!1|null)[,;])+)?)([\s\S]*?function[^)]+\){)/, '$3$1');
// correct overly aggressive Closure Compiler advanced optimizations
source = source.replace(/prototype\s*=\s*{\s*valueOf\s*:\s*1\s*}/, 'prototype={valueOf:1,y:1}');
// unescape properties (e.g. foo["bar"] => foo.bar)
source = source.replace(/(\w)\["([^."]+)"\]/g, function(match, left, right) {
return /\W/.test(right) ? match : (left + '.' + right);
});
// flip `typeof` expressions to help optimize Safari and
// correct the AMD module definition for AMD build optimizers
// (e.g. from `"number" == typeof x` to `typeof x == "number")
source = source.replace(/(return)?("[^"]+")\s*([!=]=)\s*(typeof(?:\s*\([^)]+\)|\s+[\w.]+))/g, function(match, ret, type, equality, expression) {
return (ret ? ret + ' ' : '') + expression + equality + type;
});
// add trailing semicolon
if (source) {
source = source.replace(/[\s;]*$/, ';');
}
// exit early if version snippet isn't found
var snippet = /VERSION\s*[=:]\s*([\'"])(.*?)\1/.exec(source);
if (!snippet) {
return source;
}
// add copyright/license header
return licenseTemplate[/call\(this\);?$/.test(source) ? 'underscore' : 'lodash']
.replace('<%= VERSION %>', snippet[2]) + '\n;' + source;
}
/*--------------------------------------------------------------------------*/
// expose `postprocess`
if (module != require.main) {
module.exports = postprocess;
}
else {
// read the Lo-Dash source file from the first argument if the script
// was invoked directly (e.g. `node post-compile.js source.js`) and write to
// the same file
(function() {
var options = process.argv;
if (options.length < 3) {
return;
}
var filePath = options[options.length - 1],
source = fs.readFileSync(filePath, 'utf8');
fs.writeFileSync(filePath, postprocess(source), 'utf8');
}());
}
}());

View File

@@ -1,148 +0,0 @@
#!/usr/bin/env node
;(function() {
'use strict';
/** Load Node modules */
var exec = require('child_process').exec,
fs = require('fs'),
https = require('https'),
path = require('path'),
tar = require('../vendor/tar/tar.js'),
zlib = require('zlib');
/** The path of the directory that is the base of the repository */
var basePath = fs.realpathSync(path.join(__dirname, '..'));
/** The path of the `vendor` directory */
var vendorPath = path.join(basePath, 'vendor');
/** The Git object ID of `closure-compiler.tar.gz` */
var closureId = 'a2787b470c577cee2404d186c562dd9835f779f5';
/** The Git object ID of `uglifyjs.tar.gz` */
var uglifyId = '7ecae09d413eb48dd5785fe877f24e60ac3bbcef';
/** The media type for raw blob data */
var mediaType = 'application/vnd.github.v3.raw';
/** Reassign `existsSync` for older versions of Node */
fs.existsSync || (fs.existsSync = path.existsSync);
/** Used to reference parts of the blob href */
var location = (function() {
var host = 'api.github.com',
origin = 'https://api.github.com',
pathname = '/repos/bestiejs/lodash/git/blobs';
return {
'host': host,
'href': host + origin + pathname,
'origin': origin,
'pathname': pathname
};
}());
/*--------------------------------------------------------------------------*/
/**
* Fetches a required `.tar.gz` dependency with the given Git object ID from
* the Lo-Dash repo on GitHub. The object ID may be obtained by running
* `git hash-object path/to/dependency.tar.gz`.
*
* @private
* @param {Object} options The options object.
* id - The Git object ID of the `.tar.gz` file.
* onComplete - The function, invoked with one argument (exception),
* called once the extraction has finished.
* path - The path of the extraction directory.
* title - The dependency's title used in status updates logged to the console.
*/
function getDependency(options) {
options || (options = {});
var id = options.id,
onComplete = options.onComplete,
path = options.path,
title = options.title;
function callback(exception) {
if (exception) {
console.error([
'There was a problem installing ' + title + '. To manually install, run:',
'',
"curl -H 'Accept: " + mediaType + "' " + location.href + '/' + id + " | tar xvz -C '" + path + "'"
].join('\n'));
}
onComplete(exception);
}
console.log('Downloading ' + title + '...');
https.get({
'host': location.host,
'path': location.pathname + '/' + id,
'headers': {
// By default, all GitHub blob API endpoints return a JSON document
// containing Base64-encoded blob data. Overriding the `Accept` header
// with the GitHub raw media type returns the blob data directly.
// See http://developer.github.com/v3/media/.
'Accept': mediaType
}
}, function(response) {
var decompressor = zlib.createUnzip(),
parser = new tar.Extract({ 'path': path });
decompressor.on('error', callback)
parser.on('end', callback).on('error', callback);
response.pipe(decompressor).pipe(parser);
})
.on('error', callback);
}
/*--------------------------------------------------------------------------*/
exec('npm -g root', function(exception, stdout) {
if (!exception) {
try {
var root = stdout.trim(),
isGlobal = fs.existsSync(root) && path.resolve(basePath, '..') == fs.realpathSync(root);
} catch(e) {
exception = e;
}
}
if (exception) {
console.error([
'Oops! There was a problem detecting the install mode. If youre installing the',
'Lo-Dash command-line executable (via `npm install -g lodash`), youll need to',
'manually install UglifyJS and the Closure Compiler by running:',
'',
"curl -H 'Accept: " + mediaType + "' " + location.href + '/' + closureId + " | tar xvz -C '" + vendorPath + "'",
"curl -H 'Accept: " + mediaType + "' " + location.href + '/' + uglifyId + " | tar xvz -C '" + vendorPath + "'",
'',
'Please submit an issue on the GitHub issue tracker: ' + process.env.npm_package_bugs_url
].join('\n'));
console.error(exception);
}
if (!isGlobal) {
return;
}
// download the Closure Compiler
getDependency({
'title': 'the Closure Compiler',
'id': closureId,
'path': vendorPath,
'onComplete': function() {
// download UglifyJS
getDependency({
'title': 'UglifyJS',
'id': uglifyId,
'path': vendorPath,
'onComplete': function() {
process.exit();
}
});
}
});
});
}());

View File

@@ -1,398 +0,0 @@
#!/usr/bin/env node
;(function() {
'use strict';
/** The Node filesystem module */
var fs = require('fs');
/** Used to minify variables embedded in compiled strings */
var compiledVars = [
'argsIndex',
'argsLength',
'callback',
'collection',
'createCallback',
'ctor',
'guard',
'hasOwnProperty',
'index',
'isArguments',
'isString',
'iteratee',
'length',
'nativeKeys',
'object',
'objectTypes',
'ownIndex',
'ownProps',
'propertyIsEnumerable',
'result',
'skipProto',
'source',
'thisArg'
];
/** Used to minify `compileIterator` option properties */
var iteratorOptions = [
'args',
'arrayLoop',
'bottom',
'firstArg',
'hasDontEnumBug',
'isKeysFast',
'objectLoop',
'nonEnumArgs',
'noCharByIndex',
'shadowed',
'top',
'useHas',
'useStrict'
];
/** Used to minify variables and string values to a single character */
var minNames = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.split('');
minNames.push.apply(minNames, minNames.map(function(value) {
return value + value;
}));
/** Used to protect the specified properties from getting minified */
var propWhitelist = [
'_',
'__wrapped__',
'after',
'all',
'amd',
'any',
'assign',
'attachEvent',
'bind',
'bindAll',
'bindKey',
'clone',
'cloneDeep',
'collect',
'compact',
'compose',
'contains',
'countBy',
'criteria',
'debounce',
'defaults',
'defer',
'delay',
'detect',
'difference',
'drop',
'each',
'environment',
'escape',
'evaluate',
'every',
'exports',
'extend',
'filter',
'find',
'first',
'flatten',
'foldl',
'foldr',
'forEach',
'forIn',
'forOwn',
'functions',
'global',
'groupBy',
'has',
'head',
'identity',
'include',
'index',
'indexOf',
'initial',
'inject',
'interpolate',
'intersection',
'invert',
'invoke',
'isArguments',
'isArray',
'isBoolean',
'isDate',
'isElement',
'isEmpty',
'isEqual',
'isEqual',
'isFinite',
'isFinite',
'isFunction',
'isNaN',
'isNull',
'isNumber',
'isObject',
'isPlainObject',
'isRegExp',
'isString',
'isUndefined',
'keys',
'last',
'lastIndexOf',
'map',
'max',
'memoize',
'merge',
'methods',
'min',
'mixin',
'noConflict',
'object',
'omit',
'once',
'opera',
'pairs',
'partial',
'pick',
'pluck',
'random',
'range',
'reduce',
'reduceRight',
'reject',
'rest',
'result',
'select',
'shuffle',
'size',
'some',
'sortBy',
'sortedIndex',
'source',
'tail',
'take',
'tap',
'template',
'templateSettings',
'throttle',
'times',
'toArray',
'unescape',
'union',
'uniq',
'unique',
'uniqueId',
'value',
'values',
'variable',
'VERSION',
'where',
'without',
'wrap',
'zip',
// properties used by the `backbone` and `underscore` builds
'__chain__',
'chain',
// properties used by underscore.js
'_chain',
'_wrapped'
];
/*--------------------------------------------------------------------------*/
/**
* Pre-process a given Lo-Dash `source`, preparing it for minification.
*
* @param {String} [source=''] The source to process.
* @param {Object} [options={}] The options object.
* @returns {String} Returns the processed source.
*/
function preprocess(source, options) {
source || (source = '');
options || (options = {});
// remove unrecognized JSDoc tags so the Closure Compiler won't complain
source = source.replace(/@(?:alias|category)\b.*/g, '');
if (options.isTemplate) {
return source;
}
// remove copyright/license header to add later in post-compile.js
source = source.replace(/\/\*![\s\S]+?\*\//, '');
// add brackets to whitelisted properties so the Closure Compiler won't mung them
// http://code.google.com/closure/compiler/docs/api-tutorial3.html#export
source = source.replace(RegExp('\\.(' + propWhitelist.join('|') + ')\\b', 'g'), function(match, prop) {
return "['" + prop.replace(/['\n\r\t]/g, '\\$&') + "']";
});
// remove brackets from `_.escape()` in `_.template`
source = source.replace(/__e *= *_\['escape']/g, '__e=_.escape');
// remove brackets from `_.escape()` in underscore.js `_.template`
source = source.replace(/_\['escape'\]\(__t'/g, '_.escape(__t');
// remove brackets from `collection.indexOf` in `_.contains`
source = source.replace("collection['indexOf'](target)", 'collection.indexOf(target)');
// remove brackets from `result[length].value` in `_.sortBy`
source = source.replace("result[length]['value']", 'result[length].value');
// remove whitespace from string literals
source = source.replace(/^([ "'\w]+:)? *"(?:(?=(\\?))\2.)*?"|'(?:(?=(\\?))\3.)*?'/gm, function(string, captured) {
// remove object literal property name
if (/:$/.test(captured)) {
string = string.slice(captured.length);
}
// avoids removing the '\n' of the `stringEscapes` object
string = string.replace(/\[object |delete |else |function | in |return\s+[\w"']|throw |typeof |use strict|var |@ |(["'])\\n\1|\\\\n|\\n|\s+/g, function(match) {
return match == false || match == '\\n' ? '' : match;
});
// prepend object literal property name
return (captured || '') + string;
});
// add newline to `+"__p+='"` in underscore.js `_.template`
source = source.replace(/\+"__p\+='"/g, '+"\\n__p+=\'"');
// add newline to `body + '}'` in `createFunction`
source = source.replace(/body *\+ *'}'/, 'body+"\\n}"');
// remove whitespace from `_.template` related regexes
source = source.replace(/(?:reEmptyString\w+|reInsertVariable) *=.+/g, function(match) {
return match.replace(/ |\\n/g, '');
});
// remove newline from double-quoted strings in `_.template`
source = source
.replace('"__p += \'"', '"__p+=\'"')
.replace('"\';\n"', '"\';"')
// remove `useSourceURL` variable
source = source.replace(/(?:\n +\/\*[^*]*\*+(?:[^\/][^*]*\*+)*\/)?\n *try *\{(?:\s*\/\/.*)*\n *var useSourceURL[\s\S]+?catch[^}]+}\n/, '');
// remove debug sourceURL use in `_.template`
source = source.replace(/(?:\s*\/\/.*\n)* *var sourceURL[^;]+;|\+ *sourceURL/g, '');
// minify internal properties used by 'compareAscending' and `_.sortBy`
(function() {
var properties = ['criteria', 'index', 'value'],
snippets = source.match(/( +)function (?:compareAscending|sortBy)\b[\s\S]+?\n\1}/g);
if (!snippets) {
return;
}
snippets.forEach(function(snippet) {
var modified = snippet;
// minify properties
properties.forEach(function(property, index) {
var reBracketProp = RegExp("\\['(" + property + ")'\\]", 'g'),
reDotProp = RegExp('\\.' + property + '\\b', 'g'),
rePropColon = RegExp("([^?\\s])\\s*([\"'])?\\b" + property + "\\2 *:", 'g');
modified = modified
.replace(reBracketProp, "['" + minNames[index] + "']")
.replace(reDotProp, "['" + minNames[index] + "']")
.replace(rePropColon, "$1'" + minNames[index] + "':");
});
// replace with modified snippet
source = source.replace(snippet, modified);
});
}());
// minify all compilable snippets
var snippets = source.match(
RegExp([
// match the `iteratorTemplate`
'( +)var iteratorTemplate\\b[\\s\\S]+?\\n\\1}',
// match methods created by `createIterator` calls
'createIterator\\((?:{|[a-zA-Z]+)[\\s\\S]+?\\);\\n',
// match variables storing `createIterator` options
'( +)var [a-zA-Z]+IteratorOptions\\b[\\s\\S]+?\\n\\2}',
// match the the `createIterator` function
'( +)function createIterator\\b[\\s\\S]+?\\n\\3}'
].join('|'), 'g')
);
// exit early if no compilable snippets
if (!snippets) {
return source;
}
snippets.forEach(function(snippet, index) {
var isCreateIterator = /function createIterator\b/.test(snippet),
isIteratorTemplate = /var iteratorTemplate\b/.test(snippet),
modified = snippet;
// add brackets to iterator option properties so the Closure Compiler won't mung them
modified = modified.replace(RegExp('\\.(' + iteratorOptions.join('|') + ')\\b', 'g'), function(match, prop) {
return "['" + prop.replace(/['\n\r\t]/g, '\\$&') + "']";
});
if (isCreateIterator) {
// replace with modified snippet early and clip snippet to the `factory`
// call so other arguments aren't minified
source = source.replace(snippet, modified);
snippet = modified = modified.replace(/factory\([\s\S]+$/, '');
}
// minify snippet variables / arguments
compiledVars.forEach(function(variable, index) {
// ensure properties in compiled strings aren't minified
modified = modified.replace(RegExp('([^.]\\b)' + variable + '\\b(?!\' *[\\]:])', 'g'), '$1' + minNames[index]);
// correct `typeof` values
if (/^(?:boolean|function|object|number|string|undefined)$/.test(variable)) {
modified = modified.replace(RegExp("(typeof [^']+')" + minNames[index] + "'", 'g'), '$1' + variable + "'");
}
});
// minify `createIterator` option property names
iteratorOptions.forEach(function(property, index) {
if (isIteratorTemplate) {
// minify property names as interpolated template variables
modified = modified.replace(RegExp('\\b' + property + '\\b', 'g'), minNames[index]);
}
else {
// minify property name strings
modified = modified.replace(RegExp("'" + property + "'", 'g'), "'" + minNames[index] + "'");
// minify property names in accessors
if (isCreateIterator) {
modified = modified.replace(RegExp('\\.' + property + '\\b' , 'g'), '.' + minNames[index]);
}
}
});
// replace with modified snippet
source = source.replace(snippet, modified);
});
return source;
}
/*--------------------------------------------------------------------------*/
// expose `preprocess`
if (module != require.main) {
module.exports = preprocess;
}
else {
// read the Lo-Dash source file from the first argument if the script
// was invoked directly (e.g. `node pre-compile.js source.js`) and write to
// the same file
(function() {
var options = process.argv;
if (options.length < 3) {
return;
}
var filePath = options[options.length - 1],
isTemplate = options.indexOf('-t') > -1 || options.indexOf('--template') > -1,
source = fs.readFileSync(filePath, 'utf8');
fs.writeFileSync(filePath, preprocess(source, {
'isTemplate': isTemplate
}), 'utf8');
}());
}
}());

12
component.json Normal file
View File

@@ -0,0 +1,12 @@
{
"name": "lodash",
"repo": "lodash/lodash",
"version": "2.4.2",
"description": "A utility library delivering consistency, customization, performance, & extras.",
"license": "MIT",
"keywords": ["amd", "browser", "client", "functional", "server", "util"],
"scripts": [
"index.js",
"dist/lodash.compat.js"
]
}

7158
dist/lodash.compat.js vendored Normal file

File diff suppressed because it is too large Load Diff

92
dist/lodash.compat.min.js vendored Normal file
View File

@@ -0,0 +1,92 @@
/**
* @license
* Lo-Dash 2.4.2 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE
* Build: `lodash -o ./dist/lodash.compat.js`
*/
;(function(){function n(n,r,e){for(var t=(e||0)-1,o=n?n.length:0;++t<o;)if(n[t]===r)return t;return-1}function r(r,e){var t=typeof e;if(r=r.cache,"boolean"==t||null==e)return r[e]?0:-1;"number"!=t&&"string"!=t&&(t="object");var o="number"==t?e:m+e;return r=(r=r[t])&&r[o],"object"==t?r&&n(r,e)>-1?0:-1:r?0:-1}function e(n){var r=this.cache,e=typeof n;if("boolean"==e||null==n)r[n]=!0;else{"number"!=e&&"string"!=e&&(e="object");var t="number"==e?n:m+n,o=r[e]||(r[e]={});"object"==e?(o[t]||(o[t]=[])).push(n):o[t]=!0;
}}function t(n){return n.charCodeAt(0)}function o(n,r){for(var e=n.criteria,t=r.criteria,o=-1,u=e.length;++o<u;){var a=e[o],i=t[o];if(a!==i){if(a>i||"undefined"==typeof a)return 1;if(a<i||"undefined"==typeof i)return-1}}return n.index-r.index}function u(n){var r=-1,t=n.length,o=n[0],u=n[t/2|0],a=n[t-1];if(o&&"object"==typeof o&&u&&"object"==typeof u&&a&&"object"==typeof a)return!1;var i=l();i["false"]=i["null"]=i["true"]=i.undefined=!1;var c=l();for(c.array=n,c.cache=i,c.push=e;++r<t;)c.push(n[r]);
return c}function a(n){return"\\"+Z[n]}function i(){return v.pop()||[]}function l(){return y.pop()||{array:null,cache:null,criteria:null,"false":!1,index:0,"null":!1,number:null,object:null,push:null,string:null,"true":!1,undefined:!1,value:null}}function c(n){return"function"!=typeof n.toString&&"string"==typeof(n+"")}function f(n){n.length=0,v.length<w&&v.push(n)}function s(n){var r=n.cache;r&&s(r),n.array=n.cache=n.criteria=n.object=n.number=n.string=n.value=null,y.length<w&&y.push(n)}function p(n,r,e){
r||(r=0),"undefined"==typeof e&&(e=n?n.length:0);for(var t=-1,o=e-r||0,u=Array(o<0?0:o);++t<o;)u[t]=n[r+t];return u}function g(e){function v(n){return n&&"object"==typeof n&&!st(n)&&Ke.call(n,"__wrapped__")?n:new y(n)}function y(n,r){this.__chain__=!!r,this.__wrapped__=n}function w(n){function r(){if(t){var n=p(t);Ue.apply(n,arguments)}if(this instanceof r){var u=rn(e.prototype),a=e.apply(u,n||arguments);return Fn(a)?a:u}return e.apply(o,n||arguments)}var e=n[0],t=n[2],o=n[4];return ft(r,n),r}function Z(n,r,e,t,o){
if(e){var u=e(n);if("undefined"!=typeof u)return u}var a=Fn(n);if(!a)return n;var l=$e.call(n);if(!G[l]||!lt.nodeClass&&c(n))return n;var s=at[l];switch(l){case H:case W:return new s(+n);case K:case V:return new s(n);case M:return u=s(n.source,O.exec(n)),u.lastIndex=n.lastIndex,u}var g=st(n);if(r){var h=!t;t||(t=i()),o||(o=i());for(var v=t.length;v--;)if(t[v]==n)return o[v];u=g?s(n.length):{}}else u=g?p(n):xt({},n);return g&&(Ke.call(n,"index")&&(u.index=n.index),Ke.call(n,"input")&&(u.input=n.input)),
r?(t.push(n),o.push(u),(g?wt:Ct)(n,function(n,a){u[a]=Z(n,r,e,t,o)}),h&&(f(t),f(o)),u):u}function rn(n,r){return Fn(n)?Xe(n):{}}function en(n,r,e){if("function"!=typeof n)return ue;if("undefined"==typeof r||!("prototype"in n))return n;var t=n.__bindData__;if("undefined"==typeof t&&(lt.funcNames&&(t=!n.name),t=t||!lt.funcDecomp,!t)){var o=qe.call(n);lt.funcNames||(t=!S.test(o)),t||(t=N.test(o),ft(n,t))}if(t===!1||t!==!0&&1&t[1])return n;switch(e){case 1:return function(e){return n.call(r,e)};case 2:
return function(e,t){return n.call(r,e,t)};case 3:return function(e,t,o){return n.call(r,e,t,o)};case 4:return function(e,t,o,u){return n.call(r,e,t,o,u)}}return qr(n,r)}function tn(n){function r(){var n=l?a:this;if(o){var h=p(o);Ue.apply(h,arguments)}if((u||f)&&(h||(h=p(arguments)),u&&Ue.apply(h,u),f&&h.length<i))return t|=16,tn([e,s?t:-4&t,h,null,a,i]);if(h||(h=arguments),c&&(e=n[g]),this instanceof r){n=rn(e.prototype);var v=e.apply(n,h);return Fn(v)?v:n}return e.apply(n,h)}var e=n[0],t=n[1],o=n[2],u=n[3],a=n[4],i=n[5],l=1&t,c=2&t,f=4&t,s=8&t,g=e;
return ft(r,n),r}function on(e,t){var o=-1,a=yn(),i=e?e.length:0,l=i>=_&&a===n,c=[];if(l){var f=u(t);f?(a=r,t=f):l=!1}for(;++o<i;){var p=e[o];a(t,p)<0&&c.push(p)}return l&&s(t),c}function an(n,r,e,t){for(var o=(t||0)-1,u=n?n.length:0,a=[];++o<u;){var i=n[o];if(i&&"object"==typeof i&&"number"==typeof i.length&&(st(i)||_n(i))){r||(i=an(i,r,e));var l=-1,c=i.length,f=a.length;for(a.length+=c;++l<c;)a[f++]=i[l]}else e||a.push(i)}return a}function ln(n,r,e,t,o,u){if(e){var a=e(n,r);if("undefined"!=typeof a)return!!a;
}if(n===r)return 0!==n||1/n==1/r;var l=typeof n,s=typeof r;if(n===n&&(!n||!Y[l])&&(!r||!Y[s]))return!1;if(null==n||null==r)return n===r;var p=$e.call(n),g=$e.call(r);if(p==F&&(p=U),g==F&&(g=U),p!=g)return!1;switch(p){case H:case W:return+n==+r;case K:return n!=+n?r!=+r:0==n?1/n==1/r:n==+r;case M:case V:return n==Ae(r)}var v=p==B;if(!v){var y=Ke.call(n,"__wrapped__"),b=Ke.call(r,"__wrapped__");if(y||b)return ln(y?n.__wrapped__:n,b?r.__wrapped__:r,e,t,o,u);if(p!=U||!lt.nodeClass&&(c(n)||c(r)))return!1;
var d=!lt.argsObject&&_n(n)?Oe:n.constructor,m=!lt.argsObject&&_n(r)?Oe:r.constructor;if(d!=m&&!($n(d)&&d instanceof d&&$n(m)&&m instanceof m)&&"constructor"in n&&"constructor"in r)return!1}var _=!o;o||(o=i()),u||(u=i());for(var w=o.length;w--;)if(o[w]==n)return u[w]==r;var x=0;if(a=!0,o.push(n),u.push(r),v){if(w=n.length,x=r.length,a=x==w,a||t)for(;x--;){var j=w,k=r[x];if(t)for(;j--&&!(a=ln(n[j],k,e,t,o,u)););else if(!(a=ln(n[x],k,e,t,o,u)))break}}else kt(r,function(r,i,l){return Ke.call(l,i)?(x++,
a=Ke.call(n,i)&&ln(n[i],r,e,t,o,u)):h}),a&&!t&&kt(n,function(n,r,e){return Ke.call(e,r)?a=--x>-1:h});return o.pop(),u.pop(),_&&(f(o),f(u)),a}function cn(n,r,e,t,o){(st(r)?or:Ct)(r,function(r,u){var a,i,l=r,c=n[u];if(r&&((i=st(r))||Pt(r))){for(var f=t.length;f--;)if(a=t[f]==r){c=o[f];break}if(!a){var s;e&&(l=e(c,r),(s="undefined"!=typeof l)&&(c=l)),s||(c=i?st(c)?c:[]:Pt(c)?c:{}),t.push(r),o.push(c),s||cn(c,r,e,t,o)}}else e&&(l=e(c,r),"undefined"==typeof l&&(l=r)),"undefined"!=typeof l&&(c=l);n[u]=c;
})}function fn(n,r){return n+We(ut()*(r-n+1))}function sn(e,t,o){var a=-1,l=yn(),c=e?e.length:0,p=[],g=!t&&c>=_&&l===n,h=o||g?i():p;if(g){var v=u(h);l=r,h=v}for(;++a<c;){var y=e[a],b=o?o(y,a,e):y;(t?!a||h[h.length-1]!==b:l(h,b)<0)&&((o||g)&&h.push(b),p.push(y))}return g?(f(h.array),s(h)):o&&f(h),p}function pn(n){return function(r,e,t){var o={};if(e=v.createCallback(e,t,3),st(r))for(var u=-1,a=r.length;++u<a;){var i=r[u];n(o,i,e(i,u,r),r)}else wt(r,function(r,t,u){n(o,r,e(r,t,u),u)});return o}}function gn(n,r,e,t,o,u){
var a=1&r,i=2&r,l=4&r,c=16&r,f=32&r;if(!i&&!$n(n))throw new Ie;c&&!e.length&&(r&=-17,c=e=!1),f&&!t.length&&(r&=-33,f=t=!1);var s=n&&n.__bindData__;if(s&&s!==!0)return s=p(s),s[2]&&(s[2]=p(s[2])),s[3]&&(s[3]=p(s[3])),!a||1&s[1]||(s[4]=o),!a&&1&s[1]&&(r|=8),!l||4&s[1]||(s[5]=u),c&&Ue.apply(s[2]||(s[2]=[]),e),f&&Je.apply(s[3]||(s[3]=[]),t),s[1]|=r,gn.apply(null,s);var g=1==r||17===r?w:tn;return g([n,r,e,t,o,u])}function hn(){X.shadowedProps=D,X.array=X.bottom=X.loop=X.top="",X.init="iterable",X.useHas=!0;
for(var n,r=0;n=arguments[r];r++)for(var e in n)X[e]=n[e];var t=X.args;X.firstArg=/^[^,]+/.exec(t)[0];var o=Ce("baseCreateCallback, errorClass, errorProto, hasOwnProperty, indicatorObject, isArguments, isArray, isString, keys, objectProto, objectTypes, nonEnumProps, stringClass, stringProto, toString","return function("+t+") {\n"+ct(X)+"\n}");return o(en,q,Ne,Ke,d,_n,st,zn,X.keys,Re,Y,it,V,Te,$e)}function vn(n){return bt[n]}function yn(){var r=(r=v.indexOf)===Cr?n:r;return r}function bn(n){return"function"==typeof n&&Fe.test(n);
}function dn(n){var r,e;return!n||$e.call(n)!=U||(r=n.constructor,$n(r)&&!(r instanceof r))||!lt.argsClass&&_n(n)||!lt.nodeClass&&c(n)?!1:lt.ownLast?(kt(n,function(n,r,t){return e=Ke.call(t,r),!1}),e!==!1):(kt(n,function(n,r){e=r}),"undefined"==typeof e||Ke.call(n,e))}function mn(n){return dt[n]}function _n(n){return n&&"object"==typeof n&&"number"==typeof n.length&&$e.call(n)==F||!1}function wn(n,r,e,t){return"boolean"!=typeof r&&null!=r&&(t=e,e=r,r=!1),Z(n,r,"function"==typeof e&&en(e,t,1))}function xn(n,r,e){
return Z(n,!0,"function"==typeof r&&en(r,e,1))}function jn(n,r){var e=rn(n);return r?xt(e,r):e}function kn(n,r,e){var t;return r=v.createCallback(r,e,3),Ct(n,function(n,e,o){return r(n,e,o)?(t=e,!1):h}),t}function Cn(n,r,e){var t;return r=v.createCallback(r,e,3),En(n,function(n,e,o){return r(n,e,o)?(t=e,!1):h}),t}function Pn(n,r,e){var t=[];kt(n,function(n,r){t.push(r,n)});var o=t.length;for(r=en(r,e,3);o--&&r(t[o--],t[o],n)!==!1;);return n}function En(n,r,e){var t=gt(n),o=t.length;for(r=en(r,e,3);o--;){
var u=t[o];if(r(n[u],u,n)===!1)break}return n}function On(n){var r=[];return kt(n,function(n,e){$n(n)&&r.push(e)}),r.sort()}function Sn(n,r){return n?Ke.call(n,r):!1}function An(n){for(var r=-1,e=gt(n),t=e.length,o={};++r<t;){var u=e[r];o[n[u]]=u}return o}function In(n){return n===!0||n===!1||n&&"object"==typeof n&&$e.call(n)==H||!1}function Ln(n){return n&&"object"==typeof n&&$e.call(n)==W||!1}function Nn(n){return n&&1===n.nodeType||!1}function Rn(n){var r=!0;if(!n)return r;var e=$e.call(n),t=n.length;
return e==B||e==V||(lt.argsClass?e==F:_n(n))||e==U&&"number"==typeof t&&$n(n.splice)?!t:(Ct(n,function(){return r=!1}),r)}function Tn(n,r,e,t){return ln(n,r,"function"==typeof e&&en(e,t,2))}function Dn(n){return Ze(n)&&!nt(parseFloat(n))}function $n(n){return"function"==typeof n}function Fn(n){return!(!n||!Y[typeof n])}function Bn(n){return Wn(n)&&n!=+n}function Hn(n){return null===n}function Wn(n){return"number"==typeof n||n&&"object"==typeof n&&$e.call(n)==K||!1}function qn(n){return n&&Y[typeof n]&&$e.call(n)==M||!1;
}function zn(n){return"string"==typeof n||n&&"object"==typeof n&&$e.call(n)==V||!1}function Kn(n){return"undefined"==typeof n}function Un(n,r,e){var t={};return r=v.createCallback(r,e,3),Ct(n,function(n,e,o){t[e]=r(n,e,o)}),t}function Mn(n){var r=arguments,e=2;if(!Fn(n))return n;if("number"!=typeof r[2]&&(e=r.length),e>3&&"function"==typeof r[e-2])var t=en(r[--e-1],r[e--],2);else e>2&&"function"==typeof r[e-1]&&(t=r[--e]);for(var o=p(arguments,1,e),u=-1,a=i(),l=i();++u<e;)cn(n,o[u],t,a,l);return f(a),
f(l),n}function Vn(n,r,e){var t={};if("function"!=typeof r){var o=[];kt(n,function(n,r){o.push(r)}),o=on(o,an(arguments,!0,!1,1));for(var u=-1,a=o.length;++u<a;){var i=o[u];t[i]=n[i]}}else r=v.createCallback(r,e,3),kt(n,function(n,e,o){r(n,e,o)||(t[e]=n)});return t}function Gn(n){for(var r=-1,e=gt(n),t=e.length,o=we(t);++r<t;){var u=e[r];o[r]=[u,n[u]]}return o}function Jn(n,r,e){var t={};if("function"!=typeof r)for(var o=-1,u=an(arguments,!0,!1,1),a=Fn(n)?u.length:0;++o<a;){var i=u[o];i in n&&(t[i]=n[i]);
}else r=v.createCallback(r,e,3),kt(n,function(n,e,o){r(n,e,o)&&(t[e]=n)});return t}function Qn(n,r,e,t){var o=st(n);if(null==e)if(o)e=[];else{var u=n&&n.constructor,a=u&&u.prototype;e=rn(a)}return r&&(r=v.createCallback(r,t,4),(o?wt:Ct)(n,function(n,t,o){return r(e,n,t,o)})),e}function Xn(n){for(var r=-1,e=gt(n),t=e.length,o=we(t);++r<t;)o[r]=n[e[r]];return o}function Yn(n){var r=arguments,e=-1,t=an(r,!0,!1,1),o=r[2]&&r[2][r[1]]===n?1:t.length,u=we(o);for(lt.unindexedChars&&zn(n)&&(n=n.split(""));++e<o;)u[e]=n[t[e]];
return u}function Zn(n,r,e){var t=-1,o=yn(),u=n?n.length:0,a=!1;return e=(e<0?et(0,u+e):e)||0,st(n)?a=o(n,r,e)>-1:"number"==typeof u?a=(zn(n)?n.indexOf(r,e):o(n,r,e))>-1:wt(n,function(n){return++t<e?h:!(a=n===r)}),a}function nr(n,r,e){var t=!0;if(r=v.createCallback(r,e,3),st(n))for(var o=-1,u=n.length;++o<u&&(t=!!r(n[o],o,n)););else wt(n,function(n,e,o){return t=!!r(n,e,o)});return t}function rr(n,r,e){var t=[];if(r=v.createCallback(r,e,3),st(n))for(var o=-1,u=n.length;++o<u;){var a=n[o];r(a,o,n)&&t.push(a);
}else wt(n,function(n,e,o){r(n,e,o)&&t.push(n)});return t}function er(n,r,e){if(r=v.createCallback(r,e,3),!st(n)){var t;return wt(n,function(n,e,o){return r(n,e,o)?(t=n,!1):h}),t}for(var o=-1,u=n.length;++o<u;){var a=n[o];if(r(a,o,n))return a}}function tr(n,r,e){var t;return r=v.createCallback(r,e,3),ur(n,function(n,e,o){return r(n,e,o)?(t=n,!1):h}),t}function or(n,r,e){if(r&&"undefined"==typeof e&&st(n))for(var t=-1,o=n.length;++t<o&&r(n[t],t,n)!==!1;);else wt(n,r,e);return n}function ur(n,r,e){
var t=n,o=n?n.length:0;if(r=r&&"undefined"==typeof e?r:en(r,e,3),st(n))for(;o--&&r(n[o],o,n)!==!1;);else{if("number"!=typeof o){var u=gt(n);o=u.length}else lt.unindexedChars&&zn(n)&&(t=n.split(""));wt(n,function(n,e,a){return e=u?u[--o]:--o,r(t[e],e,a)})}return n}function ar(n,r){var e=p(arguments,2),t=-1,o="function"==typeof r,u=n?n.length:0,a=we("number"==typeof u?u:0);return or(n,function(n){a[++t]=(o?r:n[r]).apply(n,e)}),a}function ir(n,r,e){var t=-1,o=n?n.length:0,u=we("number"==typeof o?o:0);
if(r=v.createCallback(r,e,3),st(n))for(;++t<o;)u[t]=r(n[t],t,n);else wt(n,function(n,e,o){u[++t]=r(n,e,o)});return u}function lr(n,r,e){var o=-(1/0),u=o;if("function"!=typeof r&&e&&e[r]===n&&(r=null),null==r&&st(n))for(var a=-1,i=n.length;++a<i;){var l=n[a];l>u&&(u=l)}else r=null==r&&zn(n)?t:v.createCallback(r,e,3),wt(n,function(n,e,t){var a=r(n,e,t);a>o&&(o=a,u=n)});return u}function cr(n,r,e){var o=1/0,u=o;if("function"!=typeof r&&e&&e[r]===n&&(r=null),null==r&&st(n))for(var a=-1,i=n.length;++a<i;){
var l=n[a];l<u&&(u=l)}else r=null==r&&zn(n)?t:v.createCallback(r,e,3),wt(n,function(n,e,t){var a=r(n,e,t);a<o&&(o=a,u=n)});return u}function fr(n,r,e,t){var o=arguments.length<3;if(r=v.createCallback(r,t,4),st(n)){var u=-1,a=n.length;for(o&&(e=n[++u]);++u<a;)e=r(e,n[u],u,n)}else wt(n,function(n,t,u){e=o?(o=!1,n):r(e,n,t,u)});return e}function sr(n,r,e,t){var o=arguments.length<3;return r=v.createCallback(r,t,4),ur(n,function(n,t,u){e=o?(o=!1,n):r(e,n,t,u)}),e}function pr(n,r,e){return r=v.createCallback(r,e,3),
rr(n,function(n,e,t){return!r(n,e,t)})}function gr(n,r,e){if(n&&"number"!=typeof n.length?n=Xn(n):lt.unindexedChars&&zn(n)&&(n=n.split("")),null==r||e)return n?n[fn(0,n.length-1)]:h;var t=hr(n);return t.length=tt(et(0,r),t.length),t}function hr(n){var r=-1,e=n?n.length:0,t=we("number"==typeof e?e:0);return or(n,function(n){var e=fn(0,++r);t[r]=t[e],t[e]=n}),t}function vr(n){var r=n?n.length:0;return"number"==typeof r?r:gt(n).length}function yr(n,r,e){var t;if(r=v.createCallback(r,e,3),st(n))for(var o=-1,u=n.length;++o<u&&!(t=r(n[o],o,n)););else wt(n,function(n,e,o){
return!(t=r(n,e,o))});return!!t}function br(n,r,e){var t=-1,u=st(r),a=n?n.length:0,c=we("number"==typeof a?a:0);for(u||(r=v.createCallback(r,e,3)),or(n,function(n,e,o){var a=c[++t]=l();u?a.criteria=ir(r,function(r){return n[r]}):(a.criteria=i())[0]=r(n,e,o),a.index=t,a.value=n}),a=c.length,c.sort(o);a--;){var p=c[a];c[a]=p.value,u||f(p.criteria),s(p)}return c}function dr(n){return n&&"number"==typeof n.length?lt.unindexedChars&&zn(n)?n.split(""):p(n):Xn(n)}function mr(n){for(var r=-1,e=n?n.length:0,t=[];++r<e;){
var o=n[r];o&&t.push(o)}return t}function _r(n){return on(n,an(arguments,!0,!0,1))}function wr(n,r,e){var t=-1,o=n?n.length:0;for(r=v.createCallback(r,e,3);++t<o;)if(r(n[t],t,n))return t;return-1}function xr(n,r,e){var t=n?n.length:0;for(r=v.createCallback(r,e,3);t--;)if(r(n[t],t,n))return t;return-1}function jr(n,r,e){var t=0,o=n?n.length:0;if("number"!=typeof r&&null!=r){var u=-1;for(r=v.createCallback(r,e,3);++u<o&&r(n[u],u,n);)t++}else if(t=r,null==t||e)return n?n[0]:h;return p(n,0,tt(et(0,t),o));
}function kr(n,r,e,t){return"boolean"!=typeof r&&null!=r&&(t=e,e="function"!=typeof r&&t&&t[r]===n?null:r,r=!1),null!=e&&(n=ir(n,e,t)),an(n,r)}function Cr(r,e,t){if("number"==typeof t){var o=r?r.length:0;t=t<0?et(0,o+t):t||0}else if(t){var u=Rr(r,e);return r[u]===e?u:-1}return n(r,e,t)}function Pr(n,r,e){var t=0,o=n?n.length:0;if("number"!=typeof r&&null!=r){var u=o;for(r=v.createCallback(r,e,3);u--&&r(n[u],u,n);)t++}else t=null==r||e?1:r||t;return p(n,0,tt(et(0,o-t),o))}function Er(){for(var e=[],t=-1,o=arguments.length,a=i(),l=yn(),c=l===n,p=i();++t<o;){
var g=arguments[t];(st(g)||_n(g))&&(e.push(g),a.push(c&&g.length>=_&&u(t?e[t]:p)))}var h=e[0],v=-1,y=h?h.length:0,b=[];n:for(;++v<y;){var d=a[0];if(g=h[v],(d?r(d,g):l(p,g))<0){for(t=o,(d||p).push(g);--t;)if(d=a[t],(d?r(d,g):l(e[t],g))<0)continue n;b.push(g)}}for(;o--;)d=a[o],d&&s(d);return f(a),f(p),b}function Or(n,r,e){var t=0,o=n?n.length:0;if("number"!=typeof r&&null!=r){var u=o;for(r=v.createCallback(r,e,3);u--&&r(n[u],u,n);)t++}else if(t=r,null==t||e)return n?n[o-1]:h;return p(n,et(0,o-t))}function Sr(n,r,e){
var t=n?n.length:0;for("number"==typeof e&&(t=(e<0?et(0,t+e):tt(e,t-1))+1);t--;)if(n[t]===r)return t;return-1}function Ar(n){for(var r=arguments,e=0,t=r.length,o=n?n.length:0;++e<t;)for(var u=-1,a=r[e];++u<o;)n[u]===a&&(Ge.call(n,u--,1),o--);return n}function Ir(n,r,e){n=+n||0,e="number"==typeof e?e:+e||1,null==r&&(r=n,n=0);for(var t=-1,o=et(0,Be((r-n)/(e||1))),u=we(o);++t<o;)u[t]=n,n+=e;return u}function Lr(n,r,e){var t=-1,o=n?n.length:0,u=[];for(r=v.createCallback(r,e,3);++t<o;){var a=n[t];r(a,t,n)&&(u.push(a),
Ge.call(n,t--,1),o--)}return u}function Nr(n,r,e){if("number"!=typeof r&&null!=r){var t=0,o=-1,u=n?n.length:0;for(r=v.createCallback(r,e,3);++o<u&&r(n[o],o,n);)t++}else t=null==r||e?1:et(0,r);return p(n,t)}function Rr(n,r,e,t){var o=0,u=n?n.length:o;for(e=e?v.createCallback(e,t,1):ue,r=e(r);o<u;){var a=o+u>>>1;e(n[a])<r?o=a+1:u=a}return o}function Tr(){return sn(an(arguments,!0,!0))}function Dr(n,r,e,t){return"boolean"!=typeof r&&null!=r&&(t=e,e="function"!=typeof r&&t&&t[r]===n?null:r,r=!1),null!=e&&(e=v.createCallback(e,t,3)),
sn(n,r,e)}function $r(n){return on(n,p(arguments,1))}function Fr(){for(var n=-1,r=arguments.length;++n<r;){var e=arguments[n];if(st(e)||_n(e))var t=t?sn(on(t,e).concat(on(e,t))):e}return t||[]}function Br(){for(var n=arguments.length>1?arguments:arguments[0],r=-1,e=n?lr(At(n,"length")):0,t=we(e<0?0:e);++r<e;)t[r]=At(n,r);return t}function Hr(n,r){var e=-1,t=n?n.length:0,o={};for(r||!t||st(n[0])||(r=[]);++e<t;){var u=n[e];r?o[u]=r[e]:u&&(o[u[0]]=u[1])}return o}function Wr(n,r){if(!$n(r))throw new Ie;
return function(){return--n<1?r.apply(this,arguments):h}}function qr(n,r){return arguments.length>2?gn(n,17,p(arguments,2),null,r):gn(n,1,null,null,r)}function zr(n){for(var r=arguments.length>1?an(arguments,!0,!1,1):On(n),e=-1,t=r.length;++e<t;){var o=r[e];n[o]=gn(n[o],1,null,null,n)}return n}function Kr(n,r){return arguments.length>2?gn(r,19,p(arguments,2),null,n):gn(r,3,null,null,n)}function Ur(){for(var n=arguments,r=n.length;r--;)if(!$n(n[r]))throw new Ie;return function(){for(var r=arguments,e=n.length;e--;)r=[n[e].apply(this,r)];
return r[0]}}function Mr(n,r){return r="number"==typeof r?r:+r||n.length,gn(n,4,null,null,null,r)}function Vr(n,r,e){var t,o,u,a,i,l,c,f=0,s=!1,p=!0;if(!$n(n))throw new Ie;if(r=et(0,r)||0,e===!0){var g=!0;p=!1}else Fn(e)&&(g=e.leading,s="maxWait"in e&&(et(r,e.maxWait)||0),p="trailing"in e?e.trailing:p);var v=function(){var e=r-(Lt()-a);if(e>0)l=Ve(v,e);else{o&&He(o);var s=c;o=l=c=h,s&&(f=Lt(),u=n.apply(i,t),l||o||(t=i=null))}},y=function(){l&&He(l),o=l=c=h,(p||s!==r)&&(f=Lt(),u=n.apply(i,t),l||o||(t=i=null));
};return function(){if(t=arguments,a=Lt(),i=this,c=p&&(l||!g),s===!1)var e=g&&!l;else{o||g||(f=a);var h=s-(a-f),b=h<=0;b?(o&&(o=He(o)),f=a,u=n.apply(i,t)):o||(o=Ve(y,h))}return b&&l?l=He(l):l||r===s||(l=Ve(v,r)),e&&(b=!0,u=n.apply(i,t)),!b||l||o||(t=i=null),u}}function Gr(n){if(!$n(n))throw new Ie;var r=p(arguments,1);return Ve(function(){n.apply(h,r)},1)}function Jr(n,r){if(!$n(n))throw new Ie;var e=p(arguments,2);return Ve(function(){n.apply(h,e)},r)}function Qr(n,r){if(!$n(n))throw new Ie;var e=function(){
var t=e.cache,o=r?r.apply(this,arguments):m+arguments[0];return Ke.call(t,o)?t[o]:t[o]=n.apply(this,arguments)};return e.cache={},e}function Xr(n){var r,e;if(!$n(n))throw new Ie;return function(){return r?e:(r=!0,e=n.apply(this,arguments),n=null,e)}}function Yr(n){return gn(n,16,p(arguments,1))}function Zr(n){return gn(n,32,null,p(arguments,1))}function ne(n,r,e){var t=!0,o=!0;if(!$n(n))throw new Ie;return e===!1?t=!1:Fn(e)&&(t="leading"in e?e.leading:t,o="trailing"in e?e.trailing:o),J.leading=t,
J.maxWait=r,J.trailing=o,Vr(n,r,J)}function re(n,r){return gn(r,16,[n])}function ee(n){return function(){return n}}function te(n,r,e){var t=typeof n;if(null==n||"function"==t)return en(n,r,e);if("object"!=t)return ce(n);var o=gt(n),u=o[0],a=n[u];return 1!=o.length||a!==a||Fn(a)?function(r){for(var e=o.length,t=!1;e--&&(t=ln(r[o[e]],n[o[e]],null,!0)););return t}:function(n){var r=n[u];return a===r&&(0!==a||1/a==1/r)}}function oe(n){return null==n?"":Ae(n).replace(_t,vn)}function ue(n){return n}function ae(n,r,e){
var t=!0,o=r&&On(r);r&&(e||o.length)||(null==e&&(e=r),u=y,r=n,n=v,o=On(r)),e===!1?t=!1:Fn(e)&&"chain"in e&&(t=e.chain);var u=n,a=$n(u);or(o,function(e){var o=n[e]=r[e];a&&(u.prototype[e]=function(){var r=this.__chain__,e=this.__wrapped__,a=[e];Ue.apply(a,arguments);var i=o.apply(n,a);if(t||r){if(e===i&&Fn(i))return this;i=new u(i),i.__chain__=r}return i})})}function ie(){return e._=De,this}function le(){}function ce(n){return function(r){return r[n]}}function fe(n,r,e){var t=null==n,o=null==r;if(null==e&&("boolean"==typeof n&&o?(e=n,
n=1):o||"boolean"!=typeof r||(e=r,o=!0)),t&&o&&(r=1),n=+n||0,o?(r=n,n=0):r=+r||0,e||n%1||r%1){var u=ut();return tt(n+u*(r-n+parseFloat("1e-"+((u+"").length-1))),r)}return fn(n,r)}function se(n,r){if(n){var e=n[r];return $n(e)?n[r]():e}}function pe(n,r,e){var t=v.templateSettings;n=Ae(n||""),e=jt({},e,t);var o,u=jt({},e.imports,t.imports),i=gt(u),l=Xn(u),c=0,f=e.interpolate||L,s="__p += '",p=Se((e.escape||L).source+"|"+f.source+"|"+(f===A?E:L).source+"|"+(e.evaluate||L).source+"|$","g");n.replace(p,function(r,e,t,u,i,l){
return t||(t=u),s+=n.slice(c,l).replace(R,a),e&&(s+="' +\n__e("+e+") +\n'"),i&&(o=!0,s+="';\n"+i+";\n__p += '"),t&&(s+="' +\n((__t = ("+t+")) == null ? '' : __t) +\n'"),c=l+r.length,r}),s+="';\n";var g=e.variable,y=g;y||(g="obj",s="with ("+g+") {\n"+s+"\n}\n"),s=(o?s.replace(j,""):s).replace(C,"$1").replace(P,"$1;"),s="function("+g+") {\n"+(y?"":g+" || ("+g+" = {});\n")+"var __t, __p = '', __e = _.escape"+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+s+"return __p\n}";
var b="\n/*\n//# sourceURL="+(e.sourceURL||"/lodash/template/source["+$++ +"]")+"\n*/";try{var d=Ce(i,"return "+s+b).apply(h,l)}catch(m){throw m.source=s,m}return r?d(r):(d.source=s,d)}function ge(n,r,e){n=(n=+n)>-1?n:0;var t=-1,o=we(n);for(r=en(r,e,1);++t<n;)o[t]=r(t);return o}function he(n){return null==n?"":Ae(n).replace(mt,mn)}function ve(n){var r=++b;return Ae(null==n?"":n)+r}function ye(n){return n=new y(n),n.__chain__=!0,n}function be(n,r){return r(n),n}function de(){return this.__chain__=!0,
this}function me(){return Ae(this.__wrapped__)}function _e(){return this.__wrapped__}e=e?un.defaults(nn.Object(),e,un.pick(nn,T)):nn;var we=e.Array,xe=e.Boolean,je=e.Date,ke=e.Error,Ce=e.Function,Pe=e.Math,Ee=e.Number,Oe=e.Object,Se=e.RegExp,Ae=e.String,Ie=e.TypeError,Le=[],Ne=ke.prototype,Re=Oe.prototype,Te=Ae.prototype,De=e._,$e=Re.toString,Fe=Se("^"+Ae($e).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),Be=Pe.ceil,He=e.clearTimeout,We=Pe.floor,qe=Ce.prototype.toString,ze=bn(ze=Oe.getPrototypeOf)&&ze,Ke=Re.hasOwnProperty,Ue=Le.push,Me=Re.propertyIsEnumerable,Ve=e.setTimeout,Ge=Le.splice,Je=Le.unshift,Qe=function(){
try{var n={},r=bn(r=Oe.defineProperty)&&r,e=r(n,n,n)&&r}catch(t){}return e}(),Xe=bn(Xe=Oe.create)&&Xe,Ye=bn(Ye=we.isArray)&&Ye,Ze=e.isFinite,nt=e.isNaN,rt=bn(rt=Oe.keys)&&rt,et=Pe.max,tt=Pe.min,ot=e.parseInt,ut=Pe.random,at={};at[B]=we,at[H]=xe,at[W]=je,at[z]=Ce,at[U]=Oe,at[K]=Ee,at[M]=Se,at[V]=Ae;var it={};it[B]=it[W]=it[K]={constructor:!0,toLocaleString:!0,toString:!0,valueOf:!0},it[H]=it[V]={constructor:!0,toString:!0,valueOf:!0},it[q]=it[z]=it[M]={constructor:!0,toString:!0},it[U]={constructor:!0
},function(){for(var n=D.length;n--;){var r=D[n];for(var e in it)Ke.call(it,e)&&!Ke.call(it[e],r)&&(it[e][r]=!1)}}(),y.prototype=v.prototype;var lt=v.support={};!function(){var n=function(){this.x=1},r={0:1,length:1},t=[];n.prototype={valueOf:1,y:1};for(var o in new n)t.push(o);for(o in arguments);lt.argsClass=$e.call(arguments)==F,lt.argsObject=arguments.constructor==Oe&&!(arguments instanceof we),lt.enumErrorProps=Me.call(Ne,"message")||Me.call(Ne,"name"),lt.enumPrototypes=Me.call(n,"prototype"),
lt.funcDecomp=!bn(e.WinRTError)&&N.test(g),lt.funcNames="string"==typeof Ce.name,lt.nonEnumArgs=0!=o,lt.nonEnumShadows=!/valueOf/.test(t),lt.ownLast="x"!=t[0],lt.spliceObjects=(Le.splice.call(r,0,1),!r[0]),lt.unindexedChars="x"[0]+Oe("x")[0]!="xx";try{lt.nodeClass=!($e.call(document)==U&&!({toString:0}+""))}catch(u){lt.nodeClass=!0}}(1),v.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:A,variable:"",imports:{_:v}};var ct=function(n){var r="var index, iterable = "+n.firstArg+", result = "+n.init+";\nif (!iterable) return result;\n"+n.top+";";
n.array?(r+="\nvar length = iterable.length; index = -1;\nif ("+n.array+") { ",lt.unindexedChars&&(r+="\n if (isString(iterable)) {\n iterable = iterable.split('')\n } "),r+="\n while (++index < length) {\n "+n.loop+";\n }\n}\nelse { "):lt.nonEnumArgs&&(r+="\n var length = iterable.length; index = -1;\n if (length && isArguments(iterable)) {\n while (++index < length) {\n index += '';\n "+n.loop+";\n }\n } else { "),lt.enumPrototypes&&(r+="\n var skipProto = typeof iterable == 'function';\n "),
lt.enumErrorProps&&(r+="\n var skipErrorProps = iterable === errorProto || iterable instanceof Error;\n ");var e=[];if(lt.enumPrototypes&&e.push('!(skipProto && index == "prototype")'),lt.enumErrorProps&&e.push('!(skipErrorProps && (index == "message" || index == "name"))'),n.useHas&&n.keys)r+="\n var ownIndex = -1,\n ownProps = objectTypes[typeof iterable] && keys(iterable),\n length = ownProps ? ownProps.length : 0;\n\n while (++ownIndex < length) {\n index = ownProps[ownIndex];\n",
e.length&&(r+=" if ("+e.join(" && ")+") {\n "),r+=n.loop+"; ",e.length&&(r+="\n }"),r+="\n } ";else if(r+="\n for (index in iterable) {\n",n.useHas&&e.push("hasOwnProperty.call(iterable, index)"),e.length&&(r+=" if ("+e.join(" && ")+") {\n "),r+=n.loop+"; ",e.length&&(r+="\n }"),r+="\n } ",lt.nonEnumShadows){for(r+="\n\n if (iterable !== objectProto) {\n var ctor = iterable.constructor,\n isProto = iterable === (ctor && ctor.prototype),\n className = iterable === stringProto ? stringClass : iterable === errorProto ? errorClass : toString.call(iterable),\n nonEnum = nonEnumProps[className];\n ",
k=0;k<7;k++)r+="\n index = '"+n.shadowedProps[k]+"';\n if ((!(isProto && nonEnum[index]) && hasOwnProperty.call(iterable, index))",n.useHas||(r+=" || (!nonEnum[index] && iterable[index] !== objectProto[index])"),r+=") {\n "+n.loop+";\n } ";r+="\n } "}return(n.array||lt.nonEnumArgs)&&(r+="\n}"),r+=n.bottom+";\nreturn result"};Xe||(rn=function(){function n(){}return function(r){if(Fn(r)){n.prototype=r;var t=new n;n.prototype=null}return t||e.Object()}}());var ft=Qe?function(n,r){
Q.value=r,Qe(n,"__bindData__",Q),Q.value=null}:le;lt.argsClass||(_n=function(n){return n&&"object"==typeof n&&"number"==typeof n.length&&Ke.call(n,"callee")&&!Me.call(n,"callee")||!1});var st=Ye||function(n){return n&&"object"==typeof n&&"number"==typeof n.length&&$e.call(n)==B||!1},pt=hn({args:"object",init:"[]",top:"if (!(objectTypes[typeof object])) return result",loop:"result.push(index)"}),gt=rt?function(n){return Fn(n)?lt.enumPrototypes&&"function"==typeof n||lt.nonEnumArgs&&n.length&&_n(n)?pt(n):rt(n):[];
}:pt,ht={args:"collection, callback, thisArg",top:"callback = callback && typeof thisArg == 'undefined' ? callback : baseCreateCallback(callback, thisArg, 3)",array:"typeof length == 'number'",keys:gt,loop:"if (callback(iterable[index], index, collection) === false) return result"},vt={args:"object, source, guard",top:"var args = arguments,\n argsIndex = 0,\n argsLength = typeof guard == 'number' ? 2 : args.length;\nwhile (++argsIndex < argsLength) {\n iterable = args[argsIndex];\n if (iterable && objectTypes[typeof iterable]) {",
keys:gt,loop:"if (typeof result[index] == 'undefined') result[index] = iterable[index]",bottom:" }\n}"},yt={top:"if (!objectTypes[typeof iterable]) return result;\n"+ht.top,array:!1},bt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},dt=An(bt),mt=Se("("+gt(dt).join("|")+")","g"),_t=Se("["+gt(bt).join("")+"]","g"),wt=hn(ht),xt=hn(vt,{top:vt.top.replace(";",";\nif (argsLength > 3 && typeof args[argsLength - 2] == 'function') {\n var callback = baseCreateCallback(args[--argsLength - 1], args[argsLength--], 2);\n} else if (argsLength > 2 && typeof args[argsLength - 1] == 'function') {\n callback = args[--argsLength];\n}"),
loop:"result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]"}),jt=hn(vt),kt=hn(ht,yt,{useHas:!1}),Ct=hn(ht,yt);$n(/x/)&&($n=function(n){return"function"==typeof n&&$e.call(n)==z});var Pt=ze?function(n){if(!n||$e.call(n)!=U||!lt.argsClass&&_n(n))return!1;var r=n.valueOf,e=bn(r)&&(e=ze(r))&&ze(e);return e?n==e||ze(n)==e:dn(n)}:dn,Et=pn(function(n,r,e){Ke.call(n,e)?n[e]++:n[e]=1}),Ot=pn(function(n,r,e){(Ke.call(n,e)?n[e]:n[e]=[]).push(r)}),St=pn(function(n,r,e){n[e]=r;
}),At=ir,It=rr,Lt=bn(Lt=je.now)&&Lt||function(){return(new je).getTime()},Nt=8==ot(x+"08")?ot:function(n,r){return ot(zn(n)?n.replace(I,""):n,r||0)};return v.after=Wr,v.assign=xt,v.at=Yn,v.bind=qr,v.bindAll=zr,v.bindKey=Kr,v.chain=ye,v.compact=mr,v.compose=Ur,v.constant=ee,v.countBy=Et,v.create=jn,v.createCallback=te,v.curry=Mr,v.debounce=Vr,v.defaults=jt,v.defer=Gr,v.delay=Jr,v.difference=_r,v.filter=rr,v.flatten=kr,v.forEach=or,v.forEachRight=ur,v.forIn=kt,v.forInRight=Pn,v.forOwn=Ct,v.forOwnRight=En,
v.functions=On,v.groupBy=Ot,v.indexBy=St,v.initial=Pr,v.intersection=Er,v.invert=An,v.invoke=ar,v.keys=gt,v.map=ir,v.mapValues=Un,v.max=lr,v.memoize=Qr,v.merge=Mn,v.min=cr,v.omit=Vn,v.once=Xr,v.pairs=Gn,v.partial=Yr,v.partialRight=Zr,v.pick=Jn,v.pluck=At,v.property=ce,v.pull=Ar,v.range=Ir,v.reject=pr,v.remove=Lr,v.rest=Nr,v.shuffle=hr,v.sortBy=br,v.tap=be,v.throttle=ne,v.times=ge,v.toArray=dr,v.transform=Qn,v.union=Tr,v.uniq=Dr,v.values=Xn,v.where=It,v.without=$r,v.wrap=re,v.xor=Fr,v.zip=Br,v.zipObject=Hr,
v.collect=ir,v.drop=Nr,v.each=or,v.eachRight=ur,v.extend=xt,v.methods=On,v.object=Hr,v.select=rr,v.tail=Nr,v.unique=Dr,v.unzip=Br,ae(v),v.clone=wn,v.cloneDeep=xn,v.contains=Zn,v.escape=oe,v.every=nr,v.find=er,v.findIndex=wr,v.findKey=kn,v.findLast=tr,v.findLastIndex=xr,v.findLastKey=Cn,v.has=Sn,v.identity=ue,v.indexOf=Cr,v.isArguments=_n,v.isArray=st,v.isBoolean=In,v.isDate=Ln,v.isElement=Nn,v.isEmpty=Rn,v.isEqual=Tn,v.isFinite=Dn,v.isFunction=$n,v.isNaN=Bn,v.isNull=Hn,v.isNumber=Wn,v.isObject=Fn,
v.isPlainObject=Pt,v.isRegExp=qn,v.isString=zn,v.isUndefined=Kn,v.lastIndexOf=Sr,v.mixin=ae,v.noConflict=ie,v.noop=le,v.now=Lt,v.parseInt=Nt,v.random=fe,v.reduce=fr,v.reduceRight=sr,v.result=se,v.runInContext=g,v.size=vr,v.some=yr,v.sortedIndex=Rr,v.template=pe,v.unescape=he,v.uniqueId=ve,v.all=nr,v.any=yr,v.detect=er,v.findWhere=er,v.foldl=fr,v.foldr=sr,v.include=Zn,v.inject=fr,ae(function(){var n={};return Ct(v,function(r,e){v.prototype[e]||(n[e]=r)}),n}(),!1),v.first=jr,v.last=Or,v.sample=gr,v.take=jr,
v.head=jr,Ct(v,function(n,r){var e="sample"!==r;v.prototype[r]||(v.prototype[r]=function(r,t){var o=this.__chain__,u=n(this.__wrapped__,r,t);return o||null!=r&&(!t||e&&"function"==typeof r)?new y(u,o):u})}),v.VERSION="2.4.2",v.prototype.chain=de,v.prototype.toString=me,v.prototype.value=_e,v.prototype.valueOf=_e,wt(["join","pop","shift"],function(n){var r=Le[n];v.prototype[n]=function(){var n=this.__chain__,e=r.apply(this.__wrapped__,arguments);return n?new y(e,n):e}}),wt(["push","reverse","sort","unshift"],function(n){
var r=Le[n];v.prototype[n]=function(){return r.apply(this.__wrapped__,arguments),this}}),wt(["concat","slice","splice"],function(n){var r=Le[n];v.prototype[n]=function(){return new y(r.apply(this.__wrapped__,arguments),this.__chain__)}}),lt.spliceObjects||wt(["pop","shift","splice"],function(n){var r=Le[n],e="splice"==n;v.prototype[n]=function(){var n=this.__chain__,t=this.__wrapped__,o=r.apply(t,arguments);return 0===t.length&&delete t[0],n||e?new y(o,n):o}}),v}var h,v=[],y=[],b=0,d={},m=+new Date+"",_=75,w=40,x=" \f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",j=/\b__p \+= '';/g,C=/\b(__p \+=) '' \+/g,P=/(__e\(.*?\)|\b__t\)) \+\n'';/g,E=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,O=/\w*$/,S=/^\s*function[ \n\r\t]+\w/,A=/<%=([\s\S]+?)%>/g,I=RegExp("^["+x+"]*0+(?=.$)"),L=/($^)/,N=/\bthis\b/,R=/['\n\r\t\u2028\u2029\\]/g,T=["Array","Boolean","Date","Error","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"],D=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],$=0,F="[object Arguments]",B="[object Array]",H="[object Boolean]",W="[object Date]",q="[object Error]",z="[object Function]",K="[object Number]",U="[object Object]",M="[object RegExp]",V="[object String]",G={};
G[z]=!1,G[F]=G[B]=G[H]=G[W]=G[K]=G[U]=G[M]=G[V]=!0;var J={leading:!1,maxWait:0,trailing:!1},Q={configurable:!1,enumerable:!1,value:null,writable:!1},X={args:"",array:null,bottom:"",firstArg:"",init:"",keys:null,loop:"",shadowedProps:null,support:null,top:"",useHas:!1},Y={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},Z={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},nn=Y[typeof window]&&window||this,rn=Y[typeof exports]&&exports&&!exports.nodeType&&exports,en=Y[typeof module]&&module&&!module.nodeType&&module,tn=en&&en.exports===rn&&rn,on=Y[typeof global]&&global;
!on||on.global!==on&&on.window!==on||(nn=on);var un=g();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(nn._=un,define(function(){return un})):rn&&en?tn?(en.exports=un)._=un:rn._=un:nn._=un}).call(this);

6786
dist/lodash.js vendored Normal file

File diff suppressed because it is too large Load Diff

87
dist/lodash.min.js vendored Normal file
View File

@@ -0,0 +1,87 @@
/**
* @license
* Lo-Dash 2.4.2 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE
* Build: `lodash modern -o ./dist/lodash.js`
*/
;(function(){function n(n,r,t){for(var e=(t||0)-1,u=n?n.length:0;++e<u;)if(n[e]===r)return e;return-1}function r(r,t){var e=typeof t;if(r=r.cache,"boolean"==e||null==t)return r[t]?0:-1;"number"!=e&&"string"!=e&&(e="object");var u="number"==e?t:m+t;return r=(r=r[e])&&r[u],"object"==e?r&&n(r,t)>-1?0:-1:r?0:-1}function t(n){var r=this.cache,t=typeof n;if("boolean"==t||null==n)r[n]=!0;else{"number"!=t&&"string"!=t&&(t="object");var e="number"==t?n:m+n,u=r[t]||(r[t]={});"object"==t?(u[e]||(u[e]=[])).push(n):u[e]=!0;
}}function e(n){return n.charCodeAt(0)}function u(n,r){for(var t=n.criteria,e=r.criteria,u=-1,o=t.length;++u<o;){var a=t[u],i=e[u];if(a!==i){if(a>i||"undefined"==typeof a)return 1;if(a<i||"undefined"==typeof i)return-1}}return n.index-r.index}function o(n){var r=-1,e=n.length,u=n[0],o=n[e/2|0],a=n[e-1];if(u&&"object"==typeof u&&o&&"object"==typeof o&&a&&"object"==typeof a)return!1;var i=f();i["false"]=i["null"]=i["true"]=i.undefined=!1;var l=f();for(l.array=n,l.cache=i,l.push=t;++r<e;)l.push(n[r]);
return l}function a(n){return"\\"+G[n]}function i(){return h.pop()||[]}function f(){return g.pop()||{array:null,cache:null,criteria:null,"false":!1,index:0,"null":!1,number:null,object:null,push:null,string:null,"true":!1,undefined:!1,value:null}}function l(n){n.length=0,h.length<_&&h.push(n)}function c(n){var r=n.cache;r&&c(r),n.array=n.cache=n.criteria=n.object=n.number=n.string=n.value=null,g.length<_&&g.push(n)}function p(n,r,t){r||(r=0),"undefined"==typeof t&&(t=n?n.length:0);for(var e=-1,u=t-r||0,o=Array(u<0?0:u);++e<u;)o[e]=n[r+e];
return o}function s(t){function h(n){return n&&"object"==typeof n&&!Yt(n)&&Tt.call(n,"__wrapped__")?n:new g(n)}function g(n,r){this.__chain__=!!r,this.__wrapped__=n}function _(n){function r(){if(e){var n=p(e);$t.apply(n,arguments)}if(this instanceof r){var o=J(t.prototype),a=t.apply(o,n||arguments);return Sn(a)?a:o}return t.apply(u,n||arguments)}var t=n[0],e=n[2],u=n[4];return Xt(r,n),r}function G(n,r,t,e,u){if(t){var o=t(n);if("undefined"!=typeof o)return o}var a=Sn(n);if(!a)return n;var f=Nt.call(n);
if(!K[f])return n;var c=Jt[f];switch(f){case F:case B:return new c(+n);case q:case P:return new c(n);case L:return o=c(n.source,C.exec(n)),o.lastIndex=n.lastIndex,o}var s=Yt(n);if(r){var v=!e;e||(e=i()),u||(u=i());for(var h=e.length;h--;)if(e[h]==n)return u[h];o=s?c(n.length):{}}else o=s?p(n):oe({},n);return s&&(Tt.call(n,"index")&&(o.index=n.index),Tt.call(n,"input")&&(o.input=n.input)),r?(e.push(n),u.push(o),(s?Xn:fe)(n,function(n,a){o[a]=G(n,r,t,e,u)}),v&&(l(e),l(u)),o):o}function J(n,r){return Sn(n)?zt(n):{};
}function Q(n,r,t){if("function"!=typeof n)return Yr;if("undefined"==typeof r||!("prototype"in n))return n;var e=n.__bindData__;if("undefined"==typeof e&&(Qt.funcNames&&(e=!n.name),e=e||!Qt.funcDecomp,!e)){var u=At.call(n);Qt.funcNames||(e=!O.test(u)),e||(e=I.test(u),Xt(n,e))}if(e===!1||e!==!0&&1&e[1])return n;switch(t){case 1:return function(t){return n.call(r,t)};case 2:return function(t,e){return n.call(r,t,e)};case 3:return function(t,e,u){return n.call(r,t,e,u)};case 4:return function(t,e,u,o){
return n.call(r,t,e,u,o)}}return $r(n,r)}function X(n){function r(){var n=f?a:this;if(u){var h=p(u);$t.apply(h,arguments)}if((o||c)&&(h||(h=p(arguments)),o&&$t.apply(h,o),c&&h.length<i))return e|=16,X([t,s?e:-4&e,h,null,a,i]);if(h||(h=arguments),l&&(t=n[v]),this instanceof r){n=J(t.prototype);var g=t.apply(n,h);return Sn(g)?g:n}return t.apply(n,h)}var t=n[0],e=n[1],u=n[2],o=n[3],a=n[4],i=n[5],f=1&e,l=2&e,c=4&e,s=8&e,v=t;return Xt(r,n),r}function Y(t,e){var u=-1,a=ln(),i=t?t.length:0,f=i>=b&&a===n,l=[];
if(f){var p=o(e);p?(a=r,e=p):f=!1}for(;++u<i;){var s=t[u];a(e,s)<0&&l.push(s)}return f&&c(e),l}function nn(n,r,t,e){for(var u=(e||0)-1,o=n?n.length:0,a=[];++u<o;){var i=n[u];if(i&&"object"==typeof i&&"number"==typeof i.length&&(Yt(i)||vn(i))){r||(i=nn(i,r,t));var f=-1,l=i.length,c=a.length;for(a.length+=l;++f<l;)a[c++]=i[f]}else t||a.push(i)}return a}function rn(n,r,t,e,u,o){if(t){var a=t(n,r);if("undefined"!=typeof a)return!!a}if(n===r)return 0!==n||1/n==1/r;var f=typeof n,c=typeof r;if(n===n&&(!n||!V[f])&&(!r||!V[c]))return!1;
if(null==n||null==r)return n===r;var p=Nt.call(n),s=Nt.call(r);if(p==T&&(p=z),s==T&&(s=z),p!=s)return!1;switch(p){case F:case B:return+n==+r;case q:return n!=+n?r!=+r:0==n?1/n==1/r:n==+r;case L:case P:return n==jt(r)}var h=p==$;if(!h){var g=Tt.call(n,"__wrapped__"),y=Tt.call(r,"__wrapped__");if(g||y)return rn(g?n.__wrapped__:n,y?r.__wrapped__:r,t,e,u,o);if(p!=z)return!1;var m=n.constructor,b=r.constructor;if(m!=b&&!(In(m)&&m instanceof m&&In(b)&&b instanceof b)&&"constructor"in n&&"constructor"in r)return!1;
}var _=!u;u||(u=i()),o||(o=i());for(var d=u.length;d--;)if(u[d]==n)return o[d]==r;var w=0;if(a=!0,u.push(n),o.push(r),h){if(d=n.length,w=r.length,a=w==d,a||e)for(;w--;){var j=d,k=r[w];if(e)for(;j--&&!(a=rn(n[j],k,t,e,u,o)););else if(!(a=rn(n[w],k,t,e,u,o)))break}}else ie(r,function(r,i,f){return Tt.call(f,i)?(w++,a=Tt.call(n,i)&&rn(n[i],r,t,e,u,o)):v}),a&&!e&&ie(n,function(n,r,t){return Tt.call(t,r)?a=--w>-1:v});return u.pop(),o.pop(),_&&(l(u),l(o)),a}function tn(n,r,t,e,u){(Yt(r)?Xn:fe)(r,function(r,o){
var a,i,f=r,l=n[o];if(r&&((i=Yt(r))||le(r))){for(var c=e.length;c--;)if(a=e[c]==r){l=u[c];break}if(!a){var p;t&&(f=t(l,r),(p="undefined"!=typeof f)&&(l=f)),p||(l=i?Yt(l)?l:[]:le(l)?l:{}),e.push(r),u.push(l),p||tn(l,r,t,e,u)}}else t&&(f=t(l,r),"undefined"==typeof f&&(f=r)),"undefined"!=typeof f&&(l=f);n[o]=l})}function en(n,r){return n+St(Ht()*(r-n+1))}function un(t,e,u){var a=-1,f=ln(),p=t?t.length:0,s=[],v=!e&&p>=b&&f===n,h=u||v?i():s;if(v){var g=o(h);f=r,h=g}for(;++a<p;){var y=t[a],m=u?u(y,a,t):y;
(e?!a||h[h.length-1]!==m:f(h,m)<0)&&((u||v)&&h.push(m),s.push(y))}return v?(l(h.array),c(h)):u&&l(h),s}function on(n){return function(r,t,e){var u={};t=h.createCallback(t,e,3);var o=-1,a=r?r.length:0;if("number"==typeof a)for(;++o<a;){var i=r[o];n(u,i,t(i,o,r),r)}else fe(r,function(r,e,o){n(u,r,t(r,e,o),o)});return u}}function an(n,r,t,e,u,o){var a=1&r,i=2&r,f=4&r,l=16&r,c=32&r;if(!i&&!In(n))throw new kt;l&&!t.length&&(r&=-17,l=t=!1),c&&!e.length&&(r&=-33,c=e=!1);var s=n&&n.__bindData__;if(s&&s!==!0)return s=p(s),
s[2]&&(s[2]=p(s[2])),s[3]&&(s[3]=p(s[3])),!a||1&s[1]||(s[4]=u),!a&&1&s[1]&&(r|=8),!f||4&s[1]||(s[5]=o),l&&$t.apply(s[2]||(s[2]=[]),t),c&&Wt.apply(s[3]||(s[3]=[]),e),s[1]|=r,an.apply(null,s);var v=1==r||17===r?_:X;return v([n,r,t,e,u,o])}function fn(n){return re[n]}function ln(){var r=(r=h.indexOf)===br?n:r;return r}function cn(n){return"function"==typeof n&&Rt.test(n)}function pn(n){var r,t;return n&&Nt.call(n)==z&&(r=n.constructor,!In(r)||r instanceof r)?(ie(n,function(n,r){t=r}),"undefined"==typeof t||Tt.call(n,t)):!1;
}function sn(n){return te[n]}function vn(n){return n&&"object"==typeof n&&"number"==typeof n.length&&Nt.call(n)==T||!1}function hn(n,r,t,e){return"boolean"!=typeof r&&null!=r&&(e=t,t=r,r=!1),G(n,r,"function"==typeof t&&Q(t,e,1))}function gn(n,r,t){return G(n,!0,"function"==typeof r&&Q(r,t,1))}function yn(n,r){var t=J(n);return r?oe(t,r):t}function mn(n,r,t){var e;return r=h.createCallback(r,t,3),fe(n,function(n,t,u){return r(n,t,u)?(e=t,!1):v}),e}function bn(n,r,t){var e;return r=h.createCallback(r,t,3),
dn(n,function(n,t,u){return r(n,t,u)?(e=t,!1):v}),e}function _n(n,r,t){var e=[];ie(n,function(n,r){e.push(r,n)});var u=e.length;for(r=Q(r,t,3);u--&&r(e[u--],e[u],n)!==!1;);return n}function dn(n,r,t){var e=ne(n),u=e.length;for(r=Q(r,t,3);u--;){var o=e[u];if(r(n[o],o,n)===!1)break}return n}function wn(n){var r=[];return ie(n,function(n,t){In(n)&&r.push(t)}),r.sort()}function jn(n,r){return n?Tt.call(n,r):!1}function kn(n){for(var r=-1,t=ne(n),e=t.length,u={};++r<e;){var o=t[r];u[n[o]]=o}return u}function xn(n){
return n===!0||n===!1||n&&"object"==typeof n&&Nt.call(n)==F||!1}function Cn(n){return n&&"object"==typeof n&&Nt.call(n)==B||!1}function On(n){return n&&1===n.nodeType||!1}function Nn(n){var r=!0;if(!n)return r;var t=Nt.call(n),e=n.length;return t==$||t==P||t==T||t==z&&"number"==typeof e&&In(n.splice)?!e:(fe(n,function(){return r=!1}),r)}function Rn(n,r,t,e){return rn(n,r,"function"==typeof t&&Q(t,e,2))}function En(n){return Pt(n)&&!Kt(parseFloat(n))}function In(n){return"function"==typeof n}function Sn(n){
return!(!n||!V[typeof n])}function An(n){return Tn(n)&&n!=+n}function Dn(n){return null===n}function Tn(n){return"number"==typeof n||n&&"object"==typeof n&&Nt.call(n)==q||!1}function $n(n){return n&&"object"==typeof n&&Nt.call(n)==L||!1}function Fn(n){return"string"==typeof n||n&&"object"==typeof n&&Nt.call(n)==P||!1}function Bn(n){return"undefined"==typeof n}function Wn(n,r,t){var e={};return r=h.createCallback(r,t,3),fe(n,function(n,t,u){e[t]=r(n,t,u)}),e}function qn(n){var r=arguments,t=2;if(!Sn(n))return n;
if("number"!=typeof r[2]&&(t=r.length),t>3&&"function"==typeof r[t-2])var e=Q(r[--t-1],r[t--],2);else t>2&&"function"==typeof r[t-1]&&(e=r[--t]);for(var u=p(arguments,1,t),o=-1,a=i(),f=i();++o<t;)tn(n,u[o],e,a,f);return l(a),l(f),n}function zn(n,r,t){var e={};if("function"!=typeof r){var u=[];ie(n,function(n,r){u.push(r)}),u=Y(u,nn(arguments,!0,!1,1));for(var o=-1,a=u.length;++o<a;){var i=u[o];e[i]=n[i]}}else r=h.createCallback(r,t,3),ie(n,function(n,t,u){r(n,t,u)||(e[t]=n)});return e}function Ln(n){
for(var r=-1,t=ne(n),e=t.length,u=ht(e);++r<e;){var o=t[r];u[r]=[o,n[o]]}return u}function Pn(n,r,t){var e={};if("function"!=typeof r)for(var u=-1,o=nn(arguments,!0,!1,1),a=Sn(n)?o.length:0;++u<a;){var i=o[u];i in n&&(e[i]=n[i])}else r=h.createCallback(r,t,3),ie(n,function(n,t,u){r(n,t,u)&&(e[t]=n)});return e}function Kn(n,r,t,e){var u=Yt(n);if(null==t)if(u)t=[];else{var o=n&&n.constructor,a=o&&o.prototype;t=J(a)}return r&&(r=h.createCallback(r,e,4),(u?Xn:fe)(n,function(n,e,u){return r(t,n,e,u)})),
t}function Un(n){for(var r=-1,t=ne(n),e=t.length,u=ht(e);++r<e;)u[r]=n[t[r]];return u}function Mn(n){for(var r=arguments,t=-1,e=nn(r,!0,!1,1),u=r[2]&&r[2][r[1]]===n?1:e.length,o=ht(u);++t<u;)o[t]=n[e[t]];return o}function Vn(n,r,t){var e=-1,u=ln(),o=n?n.length:0,a=!1;return t=(t<0?Mt(0,o+t):t)||0,Yt(n)?a=u(n,r,t)>-1:"number"==typeof o?a=(Fn(n)?n.indexOf(r,t):u(n,r,t))>-1:fe(n,function(n){return++e<t?v:!(a=n===r)}),a}function Gn(n,r,t){var e=!0;r=h.createCallback(r,t,3);var u=-1,o=n?n.length:0;if("number"==typeof o)for(;++u<o&&(e=!!r(n[u],u,n)););else fe(n,function(n,t,u){
return e=!!r(n,t,u)});return e}function Hn(n,r,t){var e=[];r=h.createCallback(r,t,3);var u=-1,o=n?n.length:0;if("number"==typeof o)for(;++u<o;){var a=n[u];r(a,u,n)&&e.push(a)}else fe(n,function(n,t,u){r(n,t,u)&&e.push(n)});return e}function Jn(n,r,t){r=h.createCallback(r,t,3);var e=-1,u=n?n.length:0;if("number"!=typeof u){var o;return fe(n,function(n,t,e){return r(n,t,e)?(o=n,!1):v}),o}for(;++e<u;){var a=n[e];if(r(a,e,n))return a}}function Qn(n,r,t){var e;return r=h.createCallback(r,t,3),Yn(n,function(n,t,u){
return r(n,t,u)?(e=n,!1):v}),e}function Xn(n,r,t){var e=-1,u=n?n.length:0;if(r=r&&"undefined"==typeof t?r:Q(r,t,3),"number"==typeof u)for(;++e<u&&r(n[e],e,n)!==!1;);else fe(n,r);return n}function Yn(n,r,t){var e=n?n.length:0;if(r=r&&"undefined"==typeof t?r:Q(r,t,3),"number"==typeof e)for(;e--&&r(n[e],e,n)!==!1;);else{var u=ne(n);e=u.length,fe(n,function(n,t,o){return t=u?u[--e]:--e,r(o[t],t,o)})}return n}function Zn(n,r){var t=p(arguments,2),e=-1,u="function"==typeof r,o=n?n.length:0,a=ht("number"==typeof o?o:0);
return Xn(n,function(n){a[++e]=(u?r:n[r]).apply(n,t)}),a}function nr(n,r,t){var e=-1,u=n?n.length:0;if(r=h.createCallback(r,t,3),"number"==typeof u)for(var o=ht(u);++e<u;)o[e]=r(n[e],e,n);else o=[],fe(n,function(n,t,u){o[++e]=r(n,t,u)});return o}function rr(n,r,t){var u=-(1/0),o=u;if("function"!=typeof r&&t&&t[r]===n&&(r=null),null==r&&Yt(n))for(var a=-1,i=n.length;++a<i;){var f=n[a];f>o&&(o=f)}else r=null==r&&Fn(n)?e:h.createCallback(r,t,3),Xn(n,function(n,t,e){var a=r(n,t,e);a>u&&(u=a,o=n)});return o;
}function tr(n,r,t){var u=1/0,o=u;if("function"!=typeof r&&t&&t[r]===n&&(r=null),null==r&&Yt(n))for(var a=-1,i=n.length;++a<i;){var f=n[a];f<o&&(o=f)}else r=null==r&&Fn(n)?e:h.createCallback(r,t,3),Xn(n,function(n,t,e){var a=r(n,t,e);a<u&&(u=a,o=n)});return o}function er(n,r,t,e){if(!n)return t;var u=arguments.length<3;r=h.createCallback(r,e,4);var o=-1,a=n.length;if("number"==typeof a)for(u&&(t=n[++o]);++o<a;)t=r(t,n[o],o,n);else fe(n,function(n,e,o){t=u?(u=!1,n):r(t,n,e,o)});return t}function ur(n,r,t,e){
var u=arguments.length<3;return r=h.createCallback(r,e,4),Yn(n,function(n,e,o){t=u?(u=!1,n):r(t,n,e,o)}),t}function or(n,r,t){return r=h.createCallback(r,t,3),Hn(n,function(n,t,e){return!r(n,t,e)})}function ar(n,r,t){if(n&&"number"!=typeof n.length&&(n=Un(n)),null==r||t)return n?n[en(0,n.length-1)]:v;var e=ir(n);return e.length=Vt(Mt(0,r),e.length),e}function ir(n){var r=-1,t=n?n.length:0,e=ht("number"==typeof t?t:0);return Xn(n,function(n){var t=en(0,++r);e[r]=e[t],e[t]=n}),e}function fr(n){var r=n?n.length:0;
return"number"==typeof r?r:ne(n).length}function lr(n,r,t){var e;r=h.createCallback(r,t,3);var u=-1,o=n?n.length:0;if("number"==typeof o)for(;++u<o&&!(e=r(n[u],u,n)););else fe(n,function(n,t,u){return!(e=r(n,t,u))});return!!e}function cr(n,r,t){var e=-1,o=Yt(r),a=n?n.length:0,p=ht("number"==typeof a?a:0);for(o||(r=h.createCallback(r,t,3)),Xn(n,function(n,t,u){var a=p[++e]=f();o?a.criteria=nr(r,function(r){return n[r]}):(a.criteria=i())[0]=r(n,t,u),a.index=e,a.value=n}),a=p.length,p.sort(u);a--;){
var s=p[a];p[a]=s.value,o||l(s.criteria),c(s)}return p}function pr(n){return n&&"number"==typeof n.length?p(n):Un(n)}function sr(n){for(var r=-1,t=n?n.length:0,e=[];++r<t;){var u=n[r];u&&e.push(u)}return e}function vr(n){return Y(n,nn(arguments,!0,!0,1))}function hr(n,r,t){var e=-1,u=n?n.length:0;for(r=h.createCallback(r,t,3);++e<u;)if(r(n[e],e,n))return e;return-1}function gr(n,r,t){var e=n?n.length:0;for(r=h.createCallback(r,t,3);e--;)if(r(n[e],e,n))return e;return-1}function yr(n,r,t){var e=0,u=n?n.length:0;
if("number"!=typeof r&&null!=r){var o=-1;for(r=h.createCallback(r,t,3);++o<u&&r(n[o],o,n);)e++}else if(e=r,null==e||t)return n?n[0]:v;return p(n,0,Vt(Mt(0,e),u))}function mr(n,r,t,e){return"boolean"!=typeof r&&null!=r&&(e=t,t="function"!=typeof r&&e&&e[r]===n?null:r,r=!1),null!=t&&(n=nr(n,t,e)),nn(n,r)}function br(r,t,e){if("number"==typeof e){var u=r?r.length:0;e=e<0?Mt(0,u+e):e||0}else if(e){var o=Nr(r,t);return r[o]===t?o:-1}return n(r,t,e)}function _r(n,r,t){var e=0,u=n?n.length:0;if("number"!=typeof r&&null!=r){
var o=u;for(r=h.createCallback(r,t,3);o--&&r(n[o],o,n);)e++}else e=null==r||t?1:r||e;return p(n,0,Vt(Mt(0,u-e),u))}function dr(){for(var t=[],e=-1,u=arguments.length,a=i(),f=ln(),p=f===n,s=i();++e<u;){var v=arguments[e];(Yt(v)||vn(v))&&(t.push(v),a.push(p&&v.length>=b&&o(e?t[e]:s)))}var h=t[0],g=-1,y=h?h.length:0,m=[];n:for(;++g<y;){var _=a[0];if(v=h[g],(_?r(_,v):f(s,v))<0){for(e=u,(_||s).push(v);--e;)if(_=a[e],(_?r(_,v):f(t[e],v))<0)continue n;m.push(v)}}for(;u--;)_=a[u],_&&c(_);return l(a),l(s),
m}function wr(n,r,t){var e=0,u=n?n.length:0;if("number"!=typeof r&&null!=r){var o=u;for(r=h.createCallback(r,t,3);o--&&r(n[o],o,n);)e++}else if(e=r,null==e||t)return n?n[u-1]:v;return p(n,Mt(0,u-e))}function jr(n,r,t){var e=n?n.length:0;for("number"==typeof t&&(e=(t<0?Mt(0,e+t):Vt(t,e-1))+1);e--;)if(n[e]===r)return e;return-1}function kr(n){for(var r=arguments,t=0,e=r.length,u=n?n.length:0;++t<e;)for(var o=-1,a=r[t];++o<u;)n[o]===a&&(Bt.call(n,o--,1),u--);return n}function xr(n,r,t){n=+n||0,t="number"==typeof t?t:+t||1,
null==r&&(r=n,n=0);for(var e=-1,u=Mt(0,Et((r-n)/(t||1))),o=ht(u);++e<u;)o[e]=n,n+=t;return o}function Cr(n,r,t){var e=-1,u=n?n.length:0,o=[];for(r=h.createCallback(r,t,3);++e<u;){var a=n[e];r(a,e,n)&&(o.push(a),Bt.call(n,e--,1),u--)}return o}function Or(n,r,t){if("number"!=typeof r&&null!=r){var e=0,u=-1,o=n?n.length:0;for(r=h.createCallback(r,t,3);++u<o&&r(n[u],u,n);)e++}else e=null==r||t?1:Mt(0,r);return p(n,e)}function Nr(n,r,t,e){var u=0,o=n?n.length:u;for(t=t?h.createCallback(t,e,1):Yr,r=t(r);u<o;){
var a=u+o>>>1;t(n[a])<r?u=a+1:o=a}return u}function Rr(){return un(nn(arguments,!0,!0))}function Er(n,r,t,e){return"boolean"!=typeof r&&null!=r&&(e=t,t="function"!=typeof r&&e&&e[r]===n?null:r,r=!1),null!=t&&(t=h.createCallback(t,e,3)),un(n,r,t)}function Ir(n){return Y(n,p(arguments,1))}function Sr(){for(var n=-1,r=arguments.length;++n<r;){var t=arguments[n];if(Yt(t)||vn(t))var e=e?un(Y(e,t).concat(Y(t,e))):t}return e||[]}function Ar(){for(var n=arguments.length>1?arguments:arguments[0],r=-1,t=n?rr(ve(n,"length")):0,e=ht(t<0?0:t);++r<t;)e[r]=ve(n,r);
return e}function Dr(n,r){var t=-1,e=n?n.length:0,u={};for(r||!e||Yt(n[0])||(r=[]);++t<e;){var o=n[t];r?u[o]=r[t]:o&&(u[o[0]]=o[1])}return u}function Tr(n,r){if(!In(r))throw new kt;return function(){return--n<1?r.apply(this,arguments):v}}function $r(n,r){return arguments.length>2?an(n,17,p(arguments,2),null,r):an(n,1,null,null,r)}function Fr(n){for(var r=arguments.length>1?nn(arguments,!0,!1,1):wn(n),t=-1,e=r.length;++t<e;){var u=r[t];n[u]=an(n[u],1,null,null,n)}return n}function Br(n,r){return arguments.length>2?an(r,19,p(arguments,2),null,n):an(r,3,null,null,n);
}function Wr(){for(var n=arguments,r=n.length;r--;)if(!In(n[r]))throw new kt;return function(){for(var r=arguments,t=n.length;t--;)r=[n[t].apply(this,r)];return r[0]}}function qr(n,r){return r="number"==typeof r?r:+r||n.length,an(n,4,null,null,null,r)}function zr(n,r,t){var e,u,o,a,i,f,l,c=0,p=!1,s=!0;if(!In(n))throw new kt;if(r=Mt(0,r)||0,t===!0){var h=!0;s=!1}else Sn(t)&&(h=t.leading,p="maxWait"in t&&(Mt(r,t.maxWait)||0),s="trailing"in t?t.trailing:s);var g=function(){var t=r-(ge()-a);if(t>0)f=Ft(g,t);
else{u&&It(u);var p=l;u=f=l=v,p&&(c=ge(),o=n.apply(i,e),f||u||(e=i=null))}},y=function(){f&&It(f),u=f=l=v,(s||p!==r)&&(c=ge(),o=n.apply(i,e),f||u||(e=i=null))};return function(){if(e=arguments,a=ge(),i=this,l=s&&(f||!h),p===!1)var t=h&&!f;else{u||h||(c=a);var v=p-(a-c),m=v<=0;m?(u&&(u=It(u)),c=a,o=n.apply(i,e)):u||(u=Ft(y,v))}return m&&f?f=It(f):f||r===p||(f=Ft(g,r)),t&&(m=!0,o=n.apply(i,e)),!m||f||u||(e=i=null),o}}function Lr(n){if(!In(n))throw new kt;var r=p(arguments,1);return Ft(function(){n.apply(v,r);
},1)}function Pr(n,r){if(!In(n))throw new kt;var t=p(arguments,2);return Ft(function(){n.apply(v,t)},r)}function Kr(n,r){if(!In(n))throw new kt;var t=function(){var e=t.cache,u=r?r.apply(this,arguments):m+arguments[0];return Tt.call(e,u)?e[u]:e[u]=n.apply(this,arguments)};return t.cache={},t}function Ur(n){var r,t;if(!In(n))throw new kt;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}}function Mr(n){return an(n,16,p(arguments,1))}function Vr(n){return an(n,32,null,p(arguments,1));
}function Gr(n,r,t){var e=!0,u=!0;if(!In(n))throw new kt;return t===!1?e=!1:Sn(t)&&(e="leading"in t?t.leading:e,u="trailing"in t?t.trailing:u),U.leading=e,U.maxWait=r,U.trailing=u,zr(n,r,U)}function Hr(n,r){return an(r,16,[n])}function Jr(n){return function(){return n}}function Qr(n,r,t){var e=typeof n;if(null==n||"function"==e)return Q(n,r,t);if("object"!=e)return tt(n);var u=ne(n),o=u[0],a=n[o];return 1!=u.length||a!==a||Sn(a)?function(r){for(var t=u.length,e=!1;t--&&(e=rn(r[u[t]],n[u[t]],null,!0)););
return e}:function(n){var r=n[o];return a===r&&(0!==a||1/a==1/r)}}function Xr(n){return null==n?"":jt(n).replace(ue,fn)}function Yr(n){return n}function Zr(n,r,t){var e=!0,u=r&&wn(r);r&&(t||u.length)||(null==t&&(t=r),o=g,r=n,n=h,u=wn(r)),t===!1?e=!1:Sn(t)&&"chain"in t&&(e=t.chain);var o=n,a=In(o);Xn(u,function(t){var u=n[t]=r[t];a&&(o.prototype[t]=function(){var r=this.__chain__,t=this.__wrapped__,a=[t];$t.apply(a,arguments);var i=u.apply(n,a);if(e||r){if(t===i&&Sn(i))return this;i=new o(i),i.__chain__=r;
}return i})})}function nt(){return t._=Ot,this}function rt(){}function tt(n){return function(r){return r[n]}}function et(n,r,t){var e=null==n,u=null==r;if(null==t&&("boolean"==typeof n&&u?(t=n,n=1):u||"boolean"!=typeof r||(t=r,u=!0)),e&&u&&(r=1),n=+n||0,u?(r=n,n=0):r=+r||0,t||n%1||r%1){var o=Ht();return Vt(n+o*(r-n+parseFloat("1e-"+((o+"").length-1))),r)}return en(n,r)}function ut(n,r){if(n){var t=n[r];return In(t)?n[r]():t}}function ot(n,r,t){var e=h.templateSettings;n=jt(n||""),t=ae({},t,e);var u,o=ae({},t.imports,e.imports),i=ne(o),f=Un(o),l=0,c=t.interpolate||E,p="__p += '",s=wt((t.escape||E).source+"|"+c.source+"|"+(c===N?x:E).source+"|"+(t.evaluate||E).source+"|$","g");
n.replace(s,function(r,t,e,o,i,f){return e||(e=o),p+=n.slice(l,f).replace(S,a),t&&(p+="' +\n__e("+t+") +\n'"),i&&(u=!0,p+="';\n"+i+";\n__p += '"),e&&(p+="' +\n((__t = ("+e+")) == null ? '' : __t) +\n'"),l=f+r.length,r}),p+="';\n";var g=t.variable,y=g;y||(g="obj",p="with ("+g+") {\n"+p+"\n}\n"),p=(u?p.replace(w,""):p).replace(j,"$1").replace(k,"$1;"),p="function("+g+") {\n"+(y?"":g+" || ("+g+" = {});\n")+"var __t, __p = '', __e = _.escape"+(u?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";
var m="\n/*\n//# sourceURL="+(t.sourceURL||"/lodash/template/source["+D++ +"]")+"\n*/";try{var b=mt(i,"return "+p+m).apply(v,f)}catch(_){throw _.source=p,_}return r?b(r):(b.source=p,b)}function at(n,r,t){n=(n=+n)>-1?n:0;var e=-1,u=ht(n);for(r=Q(r,t,1);++e<n;)u[e]=r(e);return u}function it(n){return null==n?"":jt(n).replace(ee,sn)}function ft(n){var r=++y;return jt(null==n?"":n)+r}function lt(n){return n=new g(n),n.__chain__=!0,n}function ct(n,r){return r(n),n}function pt(){return this.__chain__=!0,
this}function st(){return jt(this.__wrapped__)}function vt(){return this.__wrapped__}t=t?Z.defaults(H.Object(),t,Z.pick(H,A)):H;var ht=t.Array,gt=t.Boolean,yt=t.Date,mt=t.Function,bt=t.Math,_t=t.Number,dt=t.Object,wt=t.RegExp,jt=t.String,kt=t.TypeError,xt=[],Ct=dt.prototype,Ot=t._,Nt=Ct.toString,Rt=wt("^"+jt(Nt).replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),Et=bt.ceil,It=t.clearTimeout,St=bt.floor,At=mt.prototype.toString,Dt=cn(Dt=dt.getPrototypeOf)&&Dt,Tt=Ct.hasOwnProperty,$t=xt.push,Ft=t.setTimeout,Bt=xt.splice,Wt=xt.unshift,qt=function(){
try{var n={},r=cn(r=dt.defineProperty)&&r,t=r(n,n,n)&&r}catch(e){}return t}(),zt=cn(zt=dt.create)&&zt,Lt=cn(Lt=ht.isArray)&&Lt,Pt=t.isFinite,Kt=t.isNaN,Ut=cn(Ut=dt.keys)&&Ut,Mt=bt.max,Vt=bt.min,Gt=t.parseInt,Ht=bt.random,Jt={};Jt[$]=ht,Jt[F]=gt,Jt[B]=yt,Jt[W]=mt,Jt[z]=dt,Jt[q]=_t,Jt[L]=wt,Jt[P]=jt,g.prototype=h.prototype;var Qt=h.support={};Qt.funcDecomp=!cn(t.WinRTError)&&I.test(s),Qt.funcNames="string"==typeof mt.name,h.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:N,
variable:"",imports:{_:h}},zt||(J=function(){function n(){}return function(r){if(Sn(r)){n.prototype=r;var e=new n;n.prototype=null}return e||t.Object()}}());var Xt=qt?function(n,r){M.value=r,qt(n,"__bindData__",M),M.value=null}:rt,Yt=Lt||function(n){return n&&"object"==typeof n&&"number"==typeof n.length&&Nt.call(n)==$||!1},Zt=function(n){var r,t=n,e=[];if(!t)return e;if(!V[typeof n])return e;for(r in t)Tt.call(t,r)&&e.push(r);return e},ne=Ut?function(n){return Sn(n)?Ut(n):[]}:Zt,re={"&":"&amp;",
"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},te=kn(re),ee=wt("("+ne(te).join("|")+")","g"),ue=wt("["+ne(re).join("")+"]","g"),oe=function(n,r,t){var e,u=n,o=u;if(!u)return o;var a=arguments,i=0,f="number"==typeof t?2:a.length;if(f>3&&"function"==typeof a[f-2])var l=Q(a[--f-1],a[f--],2);else f>2&&"function"==typeof a[f-1]&&(l=a[--f]);for(;++i<f;)if(u=a[i],u&&V[typeof u])for(var c=-1,p=V[typeof u]&&ne(u),s=p?p.length:0;++c<s;)e=p[c],o[e]=l?l(o[e],u[e]):u[e];return o},ae=function(n,r,t){var e,u=n,o=u;
if(!u)return o;for(var a=arguments,i=0,f="number"==typeof t?2:a.length;++i<f;)if(u=a[i],u&&V[typeof u])for(var l=-1,c=V[typeof u]&&ne(u),p=c?c.length:0;++l<p;)e=c[l],"undefined"==typeof o[e]&&(o[e]=u[e]);return o},ie=function(n,r,t){var e,u=n,o=u;if(!u)return o;if(!V[typeof u])return o;r=r&&"undefined"==typeof t?r:Q(r,t,3);for(e in u)if(r(u[e],e,n)===!1)return o;return o},fe=function(n,r,t){var e,u=n,o=u;if(!u)return o;if(!V[typeof u])return o;r=r&&"undefined"==typeof t?r:Q(r,t,3);for(var a=-1,i=V[typeof u]&&ne(u),f=i?i.length:0;++a<f;)if(e=i[a],
r(u[e],e,n)===!1)return o;return o},le=Dt?function(n){if(!n||Nt.call(n)!=z)return!1;var r=n.valueOf,t=cn(r)&&(t=Dt(r))&&Dt(t);return t?n==t||Dt(n)==t:pn(n)}:pn,ce=on(function(n,r,t){Tt.call(n,t)?n[t]++:n[t]=1}),pe=on(function(n,r,t){(Tt.call(n,t)?n[t]:n[t]=[]).push(r)}),se=on(function(n,r,t){n[t]=r}),ve=nr,he=Hn,ge=cn(ge=yt.now)&&ge||function(){return(new yt).getTime()},ye=8==Gt(d+"08")?Gt:function(n,r){return Gt(Fn(n)?n.replace(R,""):n,r||0)};return h.after=Tr,h.assign=oe,h.at=Mn,h.bind=$r,h.bindAll=Fr,
h.bindKey=Br,h.chain=lt,h.compact=sr,h.compose=Wr,h.constant=Jr,h.countBy=ce,h.create=yn,h.createCallback=Qr,h.curry=qr,h.debounce=zr,h.defaults=ae,h.defer=Lr,h.delay=Pr,h.difference=vr,h.filter=Hn,h.flatten=mr,h.forEach=Xn,h.forEachRight=Yn,h.forIn=ie,h.forInRight=_n,h.forOwn=fe,h.forOwnRight=dn,h.functions=wn,h.groupBy=pe,h.indexBy=se,h.initial=_r,h.intersection=dr,h.invert=kn,h.invoke=Zn,h.keys=ne,h.map=nr,h.mapValues=Wn,h.max=rr,h.memoize=Kr,h.merge=qn,h.min=tr,h.omit=zn,h.once=Ur,h.pairs=Ln,
h.partial=Mr,h.partialRight=Vr,h.pick=Pn,h.pluck=ve,h.property=tt,h.pull=kr,h.range=xr,h.reject=or,h.remove=Cr,h.rest=Or,h.shuffle=ir,h.sortBy=cr,h.tap=ct,h.throttle=Gr,h.times=at,h.toArray=pr,h.transform=Kn,h.union=Rr,h.uniq=Er,h.values=Un,h.where=he,h.without=Ir,h.wrap=Hr,h.xor=Sr,h.zip=Ar,h.zipObject=Dr,h.collect=nr,h.drop=Or,h.each=Xn,h.eachRight=Yn,h.extend=oe,h.methods=wn,h.object=Dr,h.select=Hn,h.tail=Or,h.unique=Er,h.unzip=Ar,Zr(h),h.clone=hn,h.cloneDeep=gn,h.contains=Vn,h.escape=Xr,h.every=Gn,
h.find=Jn,h.findIndex=hr,h.findKey=mn,h.findLast=Qn,h.findLastIndex=gr,h.findLastKey=bn,h.has=jn,h.identity=Yr,h.indexOf=br,h.isArguments=vn,h.isArray=Yt,h.isBoolean=xn,h.isDate=Cn,h.isElement=On,h.isEmpty=Nn,h.isEqual=Rn,h.isFinite=En,h.isFunction=In,h.isNaN=An,h.isNull=Dn,h.isNumber=Tn,h.isObject=Sn,h.isPlainObject=le,h.isRegExp=$n,h.isString=Fn,h.isUndefined=Bn,h.lastIndexOf=jr,h.mixin=Zr,h.noConflict=nt,h.noop=rt,h.now=ge,h.parseInt=ye,h.random=et,h.reduce=er,h.reduceRight=ur,h.result=ut,h.runInContext=s,
h.size=fr,h.some=lr,h.sortedIndex=Nr,h.template=ot,h.unescape=it,h.uniqueId=ft,h.all=Gn,h.any=lr,h.detect=Jn,h.findWhere=Jn,h.foldl=er,h.foldr=ur,h.include=Vn,h.inject=er,Zr(function(){var n={};return fe(h,function(r,t){h.prototype[t]||(n[t]=r)}),n}(),!1),h.first=yr,h.last=wr,h.sample=ar,h.take=yr,h.head=yr,fe(h,function(n,r){var t="sample"!==r;h.prototype[r]||(h.prototype[r]=function(r,e){var u=this.__chain__,o=n(this.__wrapped__,r,e);return u||null!=r&&(!e||t&&"function"==typeof r)?new g(o,u):o;
})}),h.VERSION="2.4.2",h.prototype.chain=pt,h.prototype.toString=st,h.prototype.value=vt,h.prototype.valueOf=vt,Xn(["join","pop","shift"],function(n){var r=xt[n];h.prototype[n]=function(){var n=this.__chain__,t=r.apply(this.__wrapped__,arguments);return n?new g(t,n):t}}),Xn(["push","reverse","sort","unshift"],function(n){var r=xt[n];h.prototype[n]=function(){return r.apply(this.__wrapped__,arguments),this}}),Xn(["concat","slice","splice"],function(n){var r=xt[n];h.prototype[n]=function(){return new g(r.apply(this.__wrapped__,arguments),this.__chain__);
}}),h}var v,h=[],g=[],y=0,m=+new Date+"",b=75,_=40,d=" \f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000",w=/\b__p \+= '';/g,j=/\b(__p \+=) '' \+/g,k=/(__e\(.*?\)|\b__t\)) \+\n'';/g,x=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,C=/\w*$/,O=/^\s*function[ \n\r\t]+\w/,N=/<%=([\s\S]+?)%>/g,R=RegExp("^["+d+"]*0+(?=.$)"),E=/($^)/,I=/\bthis\b/,S=/['\n\r\t\u2028\u2029\\]/g,A=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"],D=0,T="[object Arguments]",$="[object Array]",F="[object Boolean]",B="[object Date]",W="[object Function]",q="[object Number]",z="[object Object]",L="[object RegExp]",P="[object String]",K={};
K[W]=!1,K[T]=K[$]=K[F]=K[B]=K[q]=K[z]=K[L]=K[P]=!0;var U={leading:!1,maxWait:0,trailing:!1},M={configurable:!1,enumerable:!1,value:null,writable:!1},V={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,undefined:!1},G={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"},H=V[typeof window]&&window||this,J=V[typeof exports]&&exports&&!exports.nodeType&&exports,Q=V[typeof module]&&module&&!module.nodeType&&module,X=Q&&Q.exports===J&&J,Y=V[typeof global]&&global;!Y||Y.global!==Y&&Y.window!==Y||(H=Y);
var Z=s();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(H._=Z,define(function(){return Z})):J&&Q?X?(Q.exports=Z)._=Z:J._=Z:H._=Z}).call(this);

4979
dist/lodash.underscore.js vendored Normal file

File diff suppressed because it is too large Load Diff

39
dist/lodash.underscore.min.js vendored Normal file
View File

@@ -0,0 +1,39 @@
/**
* @license
* Lo-Dash 2.4.2 (Custom Build) lodash.com/license | Underscore.js 1.5.2 underscorejs.org/LICENSE
* Build: `lodash underscore exports="amd,commonjs,global,node" -o ./dist/lodash.underscore.js`
*/
;(function(){function n(n,r,t){t=(t||0)-1;for(var e=n?n.length:0;++t<e;)if(n[t]===r)return t;return-1}function r(n,r){for(var t=n.m,e=r.m,u=-1,o=t.length;++u<o;){var i=t[u],f=e[u];if(i!==f){if(i>f||typeof i=="undefined")return 1;if(i<f||typeof f=="undefined")return-1}}return n.n-r.n}function t(n){return"\\"+yr[n]}function e(n,r,t){r||(r=0),typeof t=="undefined"&&(t=n?n.length:0);var e=-1;t=t-r||0;for(var u=Array(0>t?0:t);++e<t;)u[e]=n[r+e];return u}function u(n){return n instanceof u?n:new o(n)}function o(n,r){this.__chain__=!!r,this.__wrapped__=n
}function i(n){function r(){if(u){var n=e(u);Rr.apply(n,arguments)}if(this instanceof r){var i=f(t.prototype),n=t.apply(i,n||arguments);return O(n)?n:i}return t.apply(o,n||arguments)}var t=n[0],u=n[2],o=n[4];return r}function f(n){return O(n)?Br(n):{}}function a(n,r,t){if(typeof n!="function")return Y;if(typeof r=="undefined"||!("prototype"in n))return n;switch(t){case 1:return function(t){return n.call(r,t)};case 2:return function(t,e){return n.call(r,t,e)};case 3:return function(t,e,u){return n.call(r,t,e,u)
};case 4:return function(t,e,u,o){return n.call(r,t,e,u,o)}}return L(n,r)}function l(n){function r(){var n=p?a:this;if(o){var y=e(o);Rr.apply(y,arguments)}return(i||g)&&(y||(y=e(arguments)),i&&Rr.apply(y,i),g&&y.length<c)?(u|=16,l([t,h?u:-4&u,y,null,a,c])):(y||(y=arguments),s&&(t=n[v]),this instanceof r?(n=f(t.prototype),y=t.apply(n,y),O(y)?y:n):t.apply(n,y))}var t=n[0],u=n[1],o=n[2],i=n[3],a=n[4],c=n[5],p=1&u,s=2&u,g=4&u,h=8&u,v=t;return r}function c(n,r){for(var t=-1,e=m(),u=n?n.length:0,o=[];++t<u;){var i=n[t];
0>e(r,i)&&o.push(i)}return o}function p(n,r,t,e){e=(e||0)-1;for(var u=n?n.length:0,o=[];++e<u;){var i=n[e];if(i&&typeof i=="object"&&typeof i.length=="number"&&(Cr(i)||b(i))){r||(i=p(i,r,t));var f=-1,a=i.length,l=o.length;for(o.length+=a;++f<a;)o[l++]=i[f]}else t||o.push(i)}return o}function s(n,r,t,e){if(n===r)return 0!==n||1/n==1/r;if(n===n&&!(n&&vr[typeof n]||r&&vr[typeof r]))return false;if(null==n||null==r)return n===r;var o=Er.call(n),i=Er.call(r);if(o!=i)return false;switch(o){case lr:case cr:return+n==+r;
case pr:return n!=+n?r!=+r:0==n?1/n==1/r:n==+r;case gr:case hr:return n==r+""}if(i=o==ar,!i){var f=n instanceof u,a=r instanceof u;if(f||a)return s(f?n.__wrapped__:n,a?r.__wrapped__:r,t,e);if(o!=sr)return false;if(o=n.constructor,f=r.constructor,o!=f&&!(A(o)&&o instanceof o&&A(f)&&f instanceof f)&&"constructor"in n&&"constructor"in r)return false}for(t||(t=[]),e||(e=[]),o=t.length;o--;)if(t[o]==n)return e[o]==r;var l=true,c=0;if(t.push(n),e.push(r),i){if(c=r.length,l=c==n.length)for(;c--&&(l=s(n[c],r[c],t,e)););}else Kr(r,function(r,u,o){return Nr.call(o,u)?(c++,!(l=Nr.call(n,u)&&s(n[u],r,t,e))&&er):void 0
}),l&&Kr(n,function(n,r,t){return Nr.call(t,r)?!(l=-1<--c)&&er:void 0});return t.pop(),e.pop(),l}function g(n,r,t){for(var e=-1,u=m(),o=n?n.length:0,i=[],f=t?[]:i;++e<o;){var a=n[e],l=t?t(a,e,n):a;(r?!e||f[f.length-1]!==l:0>u(f,l))&&(t&&f.push(l),i.push(a))}return i}function h(n){return function(r,t,e){var u={};t=X(t,e,3),e=-1;var o=r?r.length:0;if(typeof o=="number")for(;++e<o;){var i=r[e];n(u,i,t(i,e,r),r)}else Lr(r,function(r,e,o){n(u,r,t(r,e,o),o)});return u}}function v(n,r,t,e,u,o){var f=16&r,a=32&r;
if(!(2&r||A(n)))throw new TypeError;return f&&!t.length&&(r&=-17,t=false),a&&!e.length&&(r&=-33,e=false),(1==r||17===r?i:l)([n,r,t,e,u,o])}function y(n){return Vr[n]}function m(){var r=(r=u.indexOf)===G?n:r;return r}function _(n){return typeof n=="function"&&Ar.test(n)}function d(n){return Gr[n]}function b(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Er.call(n)==fr||false}function w(n){if(!n)return n;for(var r=1,t=arguments.length;r<t;r++){var e=arguments[r];if(e)for(var u in e)n[u]=e[u]}return n
}function j(n){if(!n)return n;for(var r=1,t=arguments.length;r<t;r++){var e=arguments[r];if(e)for(var u in e)"undefined"==typeof n[u]&&(n[u]=e[u])}return n}function x(n){var r=[];return Kr(n,function(n,t){A(n)&&r.push(t)}),r.sort()}function T(n){for(var r=-1,t=Ur(n),e=t.length,u={};++r<e;){var o=t[r];u[n[o]]=o}return u}function E(n){if(!n)return true;if(Cr(n)||N(n))return!n.length;for(var r in n)if(Nr.call(n,r))return false;return true}function A(n){return typeof n=="function"}function O(n){return!(!n||!vr[typeof n])
}function S(n){return typeof n=="number"||n&&typeof n=="object"&&Er.call(n)==pr||false}function N(n){return typeof n=="string"||n&&typeof n=="object"&&Er.call(n)==hr||false}function R(n){for(var r=-1,t=Ur(n),e=t.length,u=Array(e);++r<e;)u[r]=n[t[r]];return u}function k(n,r){var t=m(),e=n?n.length:0,u=false;return e&&typeof e=="number"?u=-1<t(n,r):Lr(n,function(n){return(u=n===r)&&er}),u}function B(n,r,t){var e=true;r=X(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t<u&&(e=!!r(n[t],t,n)););else Lr(n,function(n,t,u){return!(e=!!r(n,t,u))&&er
});return e}function F(n,r,t){var e=[];r=X(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t<u;){var o=n[t];r(o,t,n)&&e.push(o)}else Lr(n,function(n,t,u){r(n,t,u)&&e.push(n)});return e}function q(n,r,t){r=X(r,t,3),t=-1;var e=n?n.length:0;if(typeof e!="number"){var u;return Lr(n,function(n,t,e){return r(n,t,e)?(u=n,er):void 0}),u}for(;++t<e;){var o=n[t];if(r(o,t,n))return o}}function D(n,r,t){var e=-1,u=n?n.length:0;if(r=r&&typeof t=="undefined"?r:a(r,t,3),typeof u=="number")for(;++e<u&&r(n[e],e,n)!==er;);else Lr(n,r)
}function I(n,r){var t=n?n.length:0;if(typeof t=="number")for(;t--&&false!==r(n[t],t,n););else{var e=Ur(n),t=e.length;Lr(n,function(n,u,o){return u=e?e[--t]:--t,false===r(o[u],u,o)&&er})}}function M(n,r,t){var e=-1,u=n?n.length:0;if(r=X(r,t,3),typeof u=="number")for(var o=Array(u);++e<u;)o[e]=r(n[e],e,n);else o=[],Lr(n,function(n,t,u){o[++e]=r(n,t,u)});return o}function $(n,r,t){var e=-1/0,u=e;typeof r!="function"&&t&&t[r]===n&&(r=null);var o=-1,i=n?n.length:0;if(null==r&&typeof i=="number")for(;++o<i;)t=n[o],t>u&&(u=t);
else r=X(r,t,3),D(n,function(n,t,o){t=r(n,t,o),t>e&&(e=t,u=n)});return u}function W(n,r,t,e){if(!n)return t;var u=3>arguments.length;r=X(r,e,4);var o=-1,i=n.length;if(typeof i=="number")for(u&&(t=n[++o]);++o<i;)t=r(t,n[o],o,n);else Lr(n,function(n,e,o){t=u?(u=false,n):r(t,n,e,o)});return t}function z(n,r,t,e){var u=3>arguments.length;return r=X(r,e,4),I(n,function(n,e,o){t=u?(u=false,n):r(t,n,e,o)}),t}function C(n){var r=-1,t=n?n.length:0,e=Array(typeof t=="number"?t:0);return D(n,function(n){var t;t=++r,t=0+Sr(Wr()*(t-0+1)),e[r]=e[t],e[t]=n
}),e}function P(n,r,t){var e;r=X(r,t,3),t=-1;var u=n?n.length:0;if(typeof u=="number")for(;++t<u&&!(e=r(n[t],t,n)););else Lr(n,function(n,t,u){return(e=r(n,t,u))&&er});return!!e}function U(n,r,t){return t&&E(r)?rr:(t?q:F)(n,r)}function V(n,r,t){var u=0,o=n?n.length:0;if(typeof r!="number"&&null!=r){var i=-1;for(r=X(r,t,3);++i<o&&r(n[i],i,n);)u++}else if(u=r,null==u||t)return n?n[0]:rr;return e(n,0,$r(Mr(0,u),o))}function G(r,t,e){if(typeof e=="number"){var u=r?r.length:0;e=0>e?Mr(0,u+e):e||0}else if(e)return e=J(r,t),r[e]===t?e:-1;
return n(r,t,e)}function H(n,r,t){if(typeof r!="number"&&null!=r){var u=0,o=-1,i=n?n.length:0;for(r=X(r,t,3);++o<i&&r(n[o],o,n);)u++}else u=null==r||t?1:Mr(0,r);return e(n,u)}function J(n,r,t,e){var u=0,o=n?n.length:u;for(t=t?X(t,e,1):Y,r=t(r);u<o;)e=u+o>>>1,t(n[e])<r?u=e+1:o=e;return u}function K(n,r,t,e){return typeof r!="boolean"&&null!=r&&(e=t,t=typeof r!="function"&&e&&e[r]===n?null:r,r=false),null!=t&&(t=X(t,e,3)),g(n,r,t)}function L(n,r){return 2<arguments.length?v(n,17,e(arguments,2),null,r):v(n,1,null,null,r)
}function Q(n,r,t){var e,u,o,i,f,a,l,c=0,p=false,s=true;if(!A(n))throw new TypeError;if(r=Mr(0,r)||0,true===t)var g=true,s=false;else O(t)&&(g=t.leading,p="maxWait"in t&&(Mr(r,t.maxWait)||0),s="trailing"in t?t.trailing:s);var h=function(){var t=r-(nt()-i);0<t?a=setTimeout(h,t):(u&&clearTimeout(u),t=l,u=a=l=rr,t&&(c=nt(),o=n.apply(f,e),a||u||(e=f=null)))},v=function(){a&&clearTimeout(a),u=a=l=rr,(s||p!==r)&&(c=nt(),o=n.apply(f,e),a||u||(e=f=null))};return function(){if(e=arguments,i=nt(),f=this,l=s&&(a||!g),false===p)var t=g&&!a;
else{u||g||(c=i);var y=p-(i-c),m=0>=y;m?(u&&(u=clearTimeout(u)),c=i,o=n.apply(f,e)):u||(u=setTimeout(v,y))}return m&&a?a=clearTimeout(a):a||r===p||(a=setTimeout(h,r)),t&&(m=true,o=n.apply(f,e)),!m||a||u||(e=f=null),o}}function X(n,r,t){var e=typeof n;if(null==n||"function"==e)return a(n,r,t);if("object"!=e)return nr(n);var u=Ur(n);return function(r){for(var t=u.length,e=false;t--&&(e=r[u[t]]===n[u[t]]););return e}}function Y(n){return n}function Z(n){D(x(n),function(r){var t=u[r]=n[r];u.prototype[r]=function(){var n=[this.__wrapped__];
return Rr.apply(n,arguments),n=t.apply(u,n),this.__chain__?new o(n,true):n}})}function nr(n){return function(r){return r[n]}}var rr,tr=0,er={},ur=+new Date+"",or=/($^)/,ir=/['\n\r\t\u2028\u2029\\]/g,fr="[object Arguments]",ar="[object Array]",lr="[object Boolean]",cr="[object Date]",pr="[object Number]",sr="[object Object]",gr="[object RegExp]",hr="[object String]",vr={"boolean":false,"function":true,object:true,number:false,string:false,undefined:false},yr={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},mr=vr[typeof window]&&window||this,_r=vr[typeof exports]&&exports&&!exports.nodeType&&exports,dr=vr[typeof module]&&module&&!module.nodeType&&module,br=dr&&dr.exports===_r&&_r,wr=vr[typeof global]&&global;
!wr||wr.global!==wr&&wr.window!==wr||(mr=wr);var jr=[],xr=Object.prototype,Tr=mr._,Er=xr.toString,Ar=RegExp("^"+(Er+"").replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/toString| for [^\]]+/g,".*?")+"$"),Or=Math.ceil,Sr=Math.floor,Nr=xr.hasOwnProperty,Rr=jr.push,kr=xr.propertyIsEnumerable,Br=_(Br=Object.create)&&Br,Fr=_(Fr=Array.isArray)&&Fr,qr=mr.isFinite,Dr=mr.isNaN,Ir=_(Ir=Object.keys)&&Ir,Mr=Math.max,$r=Math.min,Wr=Math.random;o.prototype=u.prototype;var zr={};!function(){var n={0:1,length:1};zr.spliceObjects=(jr.splice.call(n,0,1),!n[0])
}(1),u.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""},Br||(f=function(){function n(){}return function(r){if(O(r)){n.prototype=r;var t=new n;n.prototype=null}return t||mr.Object()}}()),b(arguments)||(b=function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Nr.call(n,"callee")&&!kr.call(n,"callee")||false});var Cr=Fr||function(n){return n&&typeof n=="object"&&typeof n.length=="number"&&Er.call(n)==ar||false},Pr=function(n){var r,t=[];
if(!n||!vr[typeof n])return t;for(r in n)Nr.call(n,r)&&t.push(r);return t},Ur=Ir?function(n){return O(n)?Ir(n):[]}:Pr,Vr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},Gr=T(Vr),Hr=RegExp("("+Ur(Gr).join("|")+")","g"),Jr=RegExp("["+Ur(Vr).join("")+"]","g"),Kr=function(n,r){var t;if(!n||!vr[typeof n])return n;for(t in n)if(r(n[t],t,n)===er)break;return n},Lr=function(n,r){var t;if(!n||!vr[typeof n])return n;for(t in n)if(Nr.call(n,t)&&r(n[t],t,n)===er)break;return n};A(/x/)&&(A=function(n){return typeof n=="function"&&"[object Function]"==Er.call(n)
});var Qr=h(function(n,r,t){Nr.call(n,t)?n[t]++:n[t]=1}),Xr=h(function(n,r,t){(Nr.call(n,t)?n[t]:n[t]=[]).push(r)}),Yr=h(function(n,r,t){n[t]=r}),Zr=M,nt=_(nt=Date.now)&&nt||function(){return(new Date).getTime()};u.after=function(n,r){if(!A(r))throw new TypeError;return function(){return 1>--n?r.apply(this,arguments):void 0}},u.bind=L,u.bindAll=function(n){for(var r=1<arguments.length?p(arguments,true,false,1):x(n),t=-1,e=r.length;++t<e;){var u=r[t];n[u]=v(n[u],1,null,null,n)}return n},u.chain=function(n){return n=new o(n),n.__chain__=true,n
},u.compact=function(n){for(var r=-1,t=n?n.length:0,e=[];++r<t;){var u=n[r];u&&e.push(u)}return e},u.compose=function(){for(var n=arguments,r=n.length;r--;)if(!A(n[r]))throw new TypeError;return function(){for(var r=arguments,t=n.length;t--;)r=[n[t].apply(this,r)];return r[0]}},u.countBy=Qr,u.debounce=Q,u.defaults=j,u.defer=function(n){if(!A(n))throw new TypeError;var r=e(arguments,1);return setTimeout(function(){n.apply(rr,r)},1)},u.delay=function(n,r){if(!A(n))throw new TypeError;var t=e(arguments,2);
return setTimeout(function(){n.apply(rr,t)},r)},u.difference=function(n){return c(n,p(arguments,true,true,1))},u.filter=F,u.flatten=function(n,r){return p(n,r)},u.forEach=D,u.functions=x,u.groupBy=Xr,u.indexBy=Yr,u.initial=function(n,r,t){var u=0,o=n?n.length:0;if(typeof r!="number"&&null!=r){var i=o;for(r=X(r,t,3);i--&&r(n[i],i,n);)u++}else u=null==r||t?1:r||u;return e(n,0,$r(Mr(0,o-u),o))},u.intersection=function(){for(var n=[],r=-1,t=arguments.length;++r<t;){var e=arguments[r];(Cr(e)||b(e))&&n.push(e)
}var u=n[0],o=-1,i=m(),f=u?u.length:0,a=[];n:for(;++o<f;)if(e=u[o],0>i(a,e)){for(r=t;--r;)if(0>i(n[r],e))continue n;a.push(e)}return a},u.invert=T,u.invoke=function(n,r){var t=e(arguments,2),u=-1,o=typeof r=="function",i=n?n.length:0,f=Array(typeof i=="number"?i:0);return D(n,function(n){f[++u]=(o?r:n[r]).apply(n,t)}),f},u.keys=Ur,u.map=M,u.max=$,u.memoize=function(n,r){var t={};return function(){var e=r?r.apply(this,arguments):ur+arguments[0];return Nr.call(t,e)?t[e]:t[e]=n.apply(this,arguments)
}},u.min=function(n,r,t){var e=1/0,u=e;typeof r!="function"&&t&&t[r]===n&&(r=null);var o=-1,i=n?n.length:0;if(null==r&&typeof i=="number")for(;++o<i;)t=n[o],t<u&&(u=t);else r=X(r,t,3),D(n,function(n,t,o){t=r(n,t,o),t<e&&(e=t,u=n)});return u},u.omit=function(n){var r=[];Kr(n,function(n,t){r.push(t)});for(var r=c(r,p(arguments,true,false,1)),t=-1,e=r.length,u={};++t<e;){var o=r[t];u[o]=n[o]}return u},u.once=function(n){var r,t;if(!A(n))throw new TypeError;return function(){return r?t:(r=true,t=n.apply(this,arguments),n=null,t)
}},u.pairs=function(n){for(var r=-1,t=Ur(n),e=t.length,u=Array(e);++r<e;){var o=t[r];u[r]=[o,n[o]]}return u},u.partial=function(n){return v(n,16,e(arguments,1))},u.pick=function(n){for(var r=-1,t=p(arguments,true,false,1),e=t.length,u={};++r<e;){var o=t[r];o in n&&(u[o]=n[o])}return u},u.pluck=Zr,u.range=function(n,r,t){n=+n||0,t=+t||1,null==r&&(r=n,n=0);var e=-1;r=Mr(0,Or((r-n)/t));for(var u=Array(r);++e<r;)u[e]=n,n+=t;return u},u.reject=function(n,r,t){return r=X(r,t,3),F(n,function(n,t,e){return!r(n,t,e)
})},u.rest=H,u.shuffle=C,u.sortBy=function(n,t,e){var u=-1,o=n?n.length:0,i=Array(typeof o=="number"?o:0);for(t=X(t,e,3),D(n,function(n,r,e){i[++u]={m:[t(n,r,e)],n:u,o:n}}),o=i.length,i.sort(r);o--;)i[o]=i[o].o;return i},u.tap=function(n,r){return r(n),n},u.throttle=function(n,r,t){var e=true,u=true;if(!A(n))throw new TypeError;return false===t?e=false:O(t)&&(e="leading"in t?t.leading:e,u="trailing"in t?t.trailing:u),t={},t.leading=e,t.maxWait=r,t.trailing=u,Q(n,r,t)},u.times=function(n,r,t){n=-1<(n=+n)?n:0;
var e=-1,u=Array(n);for(r=a(r,t,1);++e<n;)u[e]=r(e);return u},u.toArray=function(n){return Cr(n)?e(n):n&&typeof n.length=="number"?M(n):R(n)},u.union=function(){return g(p(arguments,true,true))},u.uniq=K,u.values=R,u.where=U,u.without=function(n){return c(n,e(arguments,1))},u.wrap=function(n,r){return v(r,16,[n])},u.zip=function(){for(var n=-1,r=$(Zr(arguments,"length")),t=Array(0>r?0:r);++n<r;)t[n]=Zr(arguments,n);return t},u.collect=M,u.drop=H,u.each=D,u.extend=w,u.methods=x,u.object=function(n,r){var t=-1,e=n?n.length:0,u={};
for(r||!e||Cr(n[0])||(r=[]);++t<e;){var o=n[t];r?u[o]=r[t]:o&&(u[o[0]]=o[1])}return u},u.select=F,u.tail=H,u.unique=K,u.clone=function(n){return O(n)?Cr(n)?e(n):w({},n):n},u.contains=k,u.escape=function(n){return null==n?"":(n+"").replace(Jr,y)},u.every=B,u.find=q,u.has=function(n,r){return n?Nr.call(n,r):false},u.identity=Y,u.indexOf=G,u.isArguments=b,u.isArray=Cr,u.isBoolean=function(n){return true===n||false===n||n&&typeof n=="object"&&Er.call(n)==lr||false},u.isDate=function(n){return n&&typeof n=="object"&&Er.call(n)==cr||false
},u.isElement=function(n){return n&&1===n.nodeType||false},u.isEmpty=E,u.isEqual=function(n,r){return s(n,r)},u.isFinite=function(n){return qr(n)&&!Dr(parseFloat(n))},u.isFunction=A,u.isNaN=function(n){return S(n)&&n!=+n},u.isNull=function(n){return null===n},u.isNumber=S,u.isObject=O,u.isRegExp=function(n){return n&&vr[typeof n]&&Er.call(n)==gr||false},u.isString=N,u.isUndefined=function(n){return typeof n=="undefined"},u.lastIndexOf=function(n,r,t){var e=n?n.length:0;for(typeof t=="number"&&(e=(0>t?Mr(0,e+t):$r(t,e-1))+1);e--;)if(n[e]===r)return e;
return-1},u.mixin=Z,u.noConflict=function(){return mr._=Tr,this},u.random=function(n,r){return null==n&&null==r&&(r=1),n=+n||0,null==r?(r=n,n=0):r=+r||0,n+Sr(Wr()*(r-n+1))},u.reduce=W,u.reduceRight=z,u.result=function(n,r){if(n){var t=n[r];return A(t)?n[r]():t}},u.size=function(n){var r=n?n.length:0;return typeof r=="number"?r:Ur(n).length},u.some=P,u.sortedIndex=J,u.template=function(n,r,e){var o=u,i=o.templateSettings;n=(n||"")+"",e=j({},e,i);var f=0,a="__p+='",i=e.variable;n.replace(RegExp((e.escape||or).source+"|"+(e.interpolate||or).source+"|"+(e.evaluate||or).source+"|$","g"),function(r,e,u,o,i){return a+=n.slice(f,i).replace(ir,t),e&&(a+="'+_.escape("+e+")+'"),o&&(a+="';"+o+";\n__p+='"),u&&(a+="'+((__t=("+u+"))==null?'':__t)+'"),f=i+r.length,r
}),a+="';",i||(i="obj",a="with("+i+"||{}){"+a+"}"),a="function("+i+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+a+"return __p}";try{var l=Function("_","return "+a)(o)}catch(c){throw c.source=a,c}return r?l(r):(l.source=a,l)},u.unescape=function(n){return null==n?"":(n+"").replace(Hr,d)},u.uniqueId=function(n){var r=++tr+"";return n?n+r:r},u.all=B,u.any=P,u.detect=q,u.findWhere=function(n,r){return U(n,r,true)},u.foldl=W,u.foldr=z,u.include=k,u.inject=W,u.first=V,u.last=function(n,r,t){var u=0,o=n?n.length:0;
if(typeof r!="number"&&null!=r){var i=o;for(r=X(r,t,3);i--&&r(n[i],i,n);)u++}else if(u=r,null==u||t)return n?n[o-1]:rr;return e(n,Mr(0,o-u))},u.sample=function(n,r,t){return n&&typeof n.length!="number"&&(n=R(n)),null==r||t?n?n[0+Sr(Wr()*(n.length-1-0+1))]:rr:(n=C(n),n.length=$r(Mr(0,r),n.length),n)},u.take=V,u.head=V,Z(u),u.VERSION="2.4.2",u.prototype.chain=function(){return this.__chain__=true,this},u.prototype.value=function(){return this.__wrapped__},D("pop push reverse shift sort splice unshift".split(" "),function(n){var r=jr[n];
u.prototype[n]=function(){var n=this.__wrapped__;return r.apply(n,arguments),zr.spliceObjects||0!==n.length||delete n[0],this}}),D(["concat","join","slice"],function(n){var r=jr[n];u.prototype[n]=function(){var n=r.apply(this.__wrapped__,arguments);return this.__chain__&&(n=new o(n),n.__chain__=true),n}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(mr._=u, define(function(){return u})):_r&&dr?br?(dr.exports=u)._=u:_r._=u:mr._=u}).call(this);

File diff suppressed because it is too large Load Diff

View File

@@ -1,36 +1,38 @@
<?php
// cleanup requested filepath
$file = isset($_GET['f']) ? $_GET['f'] : 'lodash';
$file = preg_replace('#(\.*[\/])+#', '', $file);
$file .= preg_match('/\.[a-z]+$/', $file) ? '' : '.js';
// cleanup requested file path
$filePath = isset($_GET['f']) ? $_GET['f'] : 'lodash';
$filePath = preg_replace('#(\.*[\/])+#', '', $filePath);
$filePath .= preg_match('/\.[a-z]+$/', $filePath) ? '' : '.js';
// output filename
if (isset($_GET['o'])) {
$output = $_GET['o'];
$outputName = $_GET['o'];
} else if (isset($_SERVER['argv'][1])) {
$output = $_SERVER['argv'][1];
$outputName = $_SERVER['argv'][1];
} else {
$output = basename($file);
$outputName = basename($filePath);
}
/*--------------------------------------------------------------------------*/
require('../vendor/docdown/docdown.php');
// get package version
$version = json_decode(file_get_contents('../package.json'))->version;
// generate Markdown
$markdown = docdown(array(
'path' => '../' . $file,
'title' => 'Lo-Dash <sup>v1.0.0-rc.3</sup>',
'path' => '../' . $filePath,
'title' => '<a href="http://lodash.com/">Lo-Dash</a> <span>v' . $version . '</span>',
'toc' => 'categories',
'url' => 'https://github.com/bestiejs/lodash/blob/master/lodash.js'
'url' => 'https://github.com/lodash/lodash/blob/' . $version . '/lodash.js'
));
// save to a .md file
file_put_contents($output . '.md', $markdown);
// save to a `.md` file
file_put_contents($outputName . '.md', $markdown);
// print
header('Content-Type: text/plain;charset=utf-8');
echo $markdown . PHP_EOL;
?>
?>

View File

@@ -1 +1 @@
module.exports = require('./lodash');
module.exports = require('./dist/lodash.compat.js');

10944
lodash.js

File diff suppressed because it is too large Load Diff

42
lodash.min.js vendored
View File

@@ -1,42 +0,0 @@
/*!
Lo-Dash 1.0.0-rc.3 lodash.com/license
Underscore.js 1.4.3 underscorejs.org/LICENSE
*/
;(function(e,t){function n(e){if(e&&typeof e=="object"&&e.__wrapped__)return e;if(!(this instanceof n))return new n(e);this.__wrapped__=e}function r(e,t,n){t||(t=0);var r=e.length,i=r-t>=(n||tt);if(i)for(var s={},n=t-1;++n<r;){var o=e[n]+"";(Et.call(s,o)?s[o]:s[o]=[]).push(e[n])}return function(n){if(i){var r=n+"";return Et.call(s,r)&&-1<R(s[r],n)}return-1<R(e,n,t)}}function i(e){return e.charCodeAt(0)}function s(e,t){var n=e.b,r=t.b,e=e.a,t=t.a;if(e!==t){if(e>t||typeof e=="undefined")return 1;if(
e<t||typeof t=="undefined")return-1}return n<r?-1:1}function o(e,t,n){function r(){var u=arguments,a=s?this:t;return i||(e=t[o]),n.length&&(u=u.length?n.concat(p(u)):n),this instanceof r?(h.prototype=e.prototype,a=new h,h.prototype=null,u=e.apply(a,u),x(u)?u:a):e.apply(a,u)}var i=S(e),s=!n,o=t;return s&&(n=t),i||(t=e),r}function u(e,t,n){return e?typeof e!="function"?function(t){return t[e]}:typeof t!="undefined"?n?function(n,r,i,s){return e.call(t,n,r,i,s)}:function(n,r,i){return e.call(t,n,r,i)
}:e:V}function a(){for(var e={b:"",c:"",e:Xt,f:Wt,g:"",h:Jt,i:Gt,j:mt,k:"",l:!0},t,n=0;t=arguments[n];n++)for(var r in t)e[r]=t[r];t=e.a,e.d=/^[^,]+/.exec(t)[0],n=Function,r="var i,l="+e.d+",t="+e.d+";if(!"+e.d+")return t;"+e.k+";",e.b?(r+="var m=l.length;i=-1;if(typeof m=='number'){",e.i&&(r+="if(k(l)){l=l.split('')}"),r+="while(++i<m){"+e.b+"}}else {"):e.h&&(r+="var m=l.length;i=-1;if(m&&j(l)){while(++i<m){i+='';"+e.g+"}}else {"),e.e||(r+="var u=typeof l=='function'&&s.call(l,'prototype');");if(
e.f&&e.l)r+="var q=-1,r=p[typeof l]?n(l):[],m=r.length;while(++q<m){i=r[q];",e.e||(r+="if(!(u&&i=='prototype')){"),r+=e.g+"",e.e||(r+="}");else{r+="for(i in l){";if(!e.e||e.l)r+="if(",e.e||(r+="!(u&&i=='prototype')"),!e.e&&e.l&&(r+="&&"),e.l&&(r+="h.call(l,i)"),r+="){";r+=e.g+";";if(!e.e||e.l)r+="}"}r+="}";if(e.e){r+="var f=l.constructor;";for(var i=0;7>i;i++)r+="i='"+e.j[i]+"';if(","constructor"==e.j[i]&&(r+="!(f&&f.prototype===l)&&"),r+="h.call(l,i)){"+e.g+"}"}if(e.b||e.h)r+="}";return r+=e.c+";return t"
,n("e,h,j,k,p,n,s","return function("+t+"){"+r+"}")(u,Et,v,N,nn,At,xt)}function f(e){return"\\"+rn[e]}function l(e){return hn[e]}function c(e){return typeof e.toString!="function"&&typeof (e+"")=="string"}function h(){}function p(e,t,n){t||(t=0),typeof n=="undefined"&&(n=e?e.length:0);for(var r=-1,n=n-t||0,i=Array(0>n?0:n);++r<n;)i[r]=e[t+r];return i}function d(e){return pn[e]}function v(e){return Tt.call(e)==Dt}function m(e){var t=!1;if(!e||typeof e!="object"||v(e))return t;var n=e.constructor;return!
S(n)&&(!Yt||!c(e))||n instanceof n?Vt?(ln(e,function(e,n,r){return t=!Et.call(r,n),!1}),!1===t):(ln(e,function(e,n){t=n}),!1===t||Et.call(e,t)):t}function g(e){var t=[];return cn(e,function(e,n){t.push(n)}),t}function y(e,t,n,r,i){if(null==e)return e;n&&(t=!1);if(n=x(e)){var s=Tt.call(e);if(!en[s]||Yt&&c(e))return e;var o=vn(e)}if(!n||!t)return n?o?p(e):fn({},e):e;n=tn[s];switch(s){case Ht:case Bt:return new n(+e);case jt:case qt:return new n(e);case It:return n(e.source,at.exec(e))}r||(r=[]),i||
(i=[]);for(s=r.length;s--;)if(r[s]==e)return i[s];var u=o?n(e.length):{};return r.push(e),i.push(u),(o?_:cn)(e,function(e,n){u[n]=y(e,t,null,r,i)}),o&&(Et.call(e,"index")&&(u.index=e.index),Et.call(e,"input")&&(u.input=e.input)),u}function b(e){var t=[];return ln(e,function(e,n){S(e)&&t.push(n)}),t.sort()}function w(e){var t={};return cn(e,function(e,n){t[e]=n}),t}function E(e,t,n,r){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return e===t;var i=Tt.call(e),s=Tt.call(t);i==Dt&&(i=Ft),s==Dt&&
(s=Ft);if(i!=s)return!1;switch(i){case Ht:case Bt:return+e==+t;case jt:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case It:case qt:return e==t+""}s=i==Pt;if(!s){if(e.__wrapped__||t.__wrapped__)return E(e.__wrapped__||e,t.__wrapped__||t);if(i!=Ft||Yt&&(c(e)||c(t)))return!1;var i=!Kt&&v(e)?Object:e.constructor,o=!Kt&&v(t)?Object:t.constructor;if(i!=o&&(!S(i)||!(i instanceof i&&S(o)&&o instanceof o)))return!1}n||(n=[]),r||(r=[]);for(i=n.length;i--;)if(n[i]==e)return r[i]==t;var u=!0,a=0;n.push(e),r.push(
t);if(s){a=e.length;if(u=a==t.length)for(;a--&&(u=E(e[a],t[a],n,r)););return u}return ln(e,function(e,i,s){if(Et.call(s,i))return a++,u=Et.call(t,i)&&E(e,t[i],n,r)}),u&&ln(t,function(e,t,n){if(Et.call(n,t))return u=-1<--a}),u}function S(e){return typeof e=="function"}function x(e){return e?nn[typeof e]:!1}function T(e){return typeof e=="number"||Tt.call(e)==jt}function N(e){return typeof e=="string"||Tt.call(e)==qt}function C(e,t,n){var r=arguments,i=0,s=2,o=r[3],u=r[4];n!==et&&(o=[],u=[],typeof
n!="number"&&(s=r.length));for(;++i<s;)cn(r[i],function(t,n){var r,i,s;if(t&&((i=vn(t))||mn(t))){for(var a=o.length;a--;)if(r=o[a]==t)break;r?e[n]=u[a]:(o.push(t),u.push(s=(s=e[n],i)?vn(s)?s:[]:mn(s)?s:{}),e[n]=C(s,t,et,o,u))}else t!=null&&(e[n]=t)});return e}function k(e){var t=[];return cn(e,function(e){t.push(e)}),t}function L(e,t,n){var r=-1,i=e?e.length:0,s=!1,n=(0>n?Ot(0,i+n):n)||0;return typeof i=="number"?s=-1<(N(e)?e.indexOf(t,n):R(e,t,n)):an(e,function(e){if(++r>=n)return!(s=e===t)}),s}
function A(e,t,n){var r=!0,t=u(t,n);if(vn(e))for(var n=-1,i=e.length;++n<i&&(r=!!t(e[n],n,e)););else an(e,function(e,n,i){return r=!!t(e,n,i)});return r}function O(e,t,n){var r=[],t=u(t,n);if(vn(e))for(var n=-1,i=e.length;++n<i;){var s=e[n];t(s,n,e)&&r.push(s)}else an(e,function(e,n,i){t(e,n,i)&&r.push(e)});return r}function M(e,t,n){var r,t=u(t,n);return _(e,function(e,n,i){if(t(e,n,i))return r=e,!1}),r}function _(e,t,n){if(t&&typeof n=="undefined"&&vn(e))for(var n=-1,r=e.length;++n<r&&!1!==t(e[
n],n,e););else an(e,t,n);return e}function D(e,t,n){var r=-1,i=e?e.length:0,s=Array(typeof i=="number"?i:0),t=u(t,n);if(vn(e))for(;++r<i;)s[r]=t(e[r],r,e);else an(e,function(e,n,i){s[++r]=t(e,n,i)});return s}function P(e,t,n){var r=-Infinity,s=-1,o=e?e.length:0,a=r;if(t||!vn(e))t=!t&&N(e)?i:u(t,n),an(e,function(e,n,i){n=t(e,n,i),n>r&&(r=n,a=e)});else for(;++s<o;)e[s]>a&&(a=e[s]);return a}function H(e,t){return D(e,t+"")}function B(e,t,n,r){var i=3>arguments.length,t=u(t,r,et);if(vn(e)){var s=-1,o=
e.length;for(i&&(n=e[++s]);++s<o;)n=t(n,e[s],s,e)}else an(e,function(e,r,s){n=i?(i=!1,e):t(n,e,r,s)});return n}function j(e,t,n,r){var i=e,s=e?e.length:0,o=3>arguments.length;if(typeof s!="number")var a=gn(e),s=a.length;else Gt&&N(e)&&(i=e.split(""));return t=u(t,r,et),_(e,function(e,r,u){r=a?a[--s]:--s,n=o?(o=!1,i[r]):t(n,i[r],r,u)}),n}function F(e,t,n){var r,t=u(t,n);if(vn(e))for(var n=-1,i=e.length;++n<i&&!(r=t(e[n],n,e)););else an(e,function(e,n,i){return!(r=t(e,n,i))});return!!r}function I(e
,t,n){if(e){var r=e.length;return null==t||n?e[0]:p(e,0,Mt(Ot(0,t),r))}}function q(e,t){for(var n=-1,r=e?e.length:0,i=[];++n<r;){var s=e[n];vn(s)?St.apply(i,t?s:q(s)):i.push(s)}return i}function R(e,t,n){var r=-1,i=e?e.length:0;if(typeof n=="number")r=(0>n?Ot(0,i+n):n||0)-1;else if(n)return r=z(e,t),e[r]===t?r:-1;for(;++r<i;)if(e[r]===t)return r;return-1}function U(e,t,n){return p(e,null==t||n?1:Ot(0,t))}function z(e,t,n,r){for(var i=0,s=e?e.length:i,n=n?u(n,r):V,t=n(t);i<s;)r=i+s>>>1,n(e[r])<t?i=
r+1:s=r;return i}function W(e,t,n,r){var i=-1,s=e?e.length:0,o=[],a=o;typeof t=="function"&&(r=n,n=t,t=!1);var f=!t&&75<=s;if(f)var l={};n&&(a=[],n=u(n,r));for(;++i<s;){var r=e[i],c=n?n(r,i,e):r;if(f)var h=c+"",h=Et.call(l,h)?!(a=l[h]):a=l[h]=[];if(t?!i||a[a.length-1]!==c:h||0>R(a,c))(n||f)&&a.push(c),o.push(r)}return o}function X(e,t){return zt||Nt&&2<arguments.length?Nt.call.apply(Nt,arguments):o(e,t,p(arguments,2))}function V(e){return e}function $(e){_(b(e),function(t){var r=n[t]=e[t];n.prototype
[t]=function(){var e=[this.__wrapped__];return St.apply(e,arguments),e=r.apply(n,e),new n(e)}})}function J(){return this.__wrapped__}var K=typeof exports=="object"&&exports,Q=typeof global=="object"&&global;Q.global===Q&&(e=Q);var G=[],Y=new function(){},Z=0,et=Y,tt=30,nt=e._,rt=/[-?+=!~*%&^<>|{(\/]|\[\D|\b(?:delete|in|instanceof|new|typeof|void)\b/,it=/&(?:amp|lt|gt|quot|#x27);/g,st=/\b__p\+='';/g,ot=/\b(__p\+=)''\+/g,ut=/(__e\(.*?\)|\b__t\))\+'';/g,at=/\w*$/,ft=/(?:__e|__t=)\(\s*(?![\d\s"']|this\.)/g
,lt=RegExp("^"+(Y.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),ct=/\$\{((?:(?=\\?)\\?[\s\S])*?)}/g,ht=/<%=([\s\S]+?)%>/g,pt=/($^)/,dt=/[&<>"']/g,vt=/['\n\r\t\u2028\u2029\\]/g,mt="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" "),gt=Math.ceil,yt=G.concat,bt=Math.floor,wt=lt.test(wt=Object.getPrototypeOf)&&wt,Et=Y.hasOwnProperty,St=G.push,xt=Y.propertyIsEnumerable,Tt=Y.toString,Nt=lt.test(Nt=
p.bind)&&Nt,Ct=lt.test(Ct=Array.isArray)&&Ct,kt=e.isFinite,Lt=e.isNaN,At=lt.test(At=Object.keys)&&At,Ot=Math.max,Mt=Math.min,_t=Math.random,Dt="[object Arguments]",Pt="[object Array]",Ht="[object Boolean]",Bt="[object Date]",jt="[object Number]",Ft="[object Object]",It="[object RegExp]",qt="[object String]",Rt=!!e.attachEvent,Ut=Nt&&!/\n|true/.test(Nt+Rt),zt=Nt&&!Ut,Wt=At&&(Rt||Ut),Xt,Vt,$t=($t={0:1,length:1},G.splice.call($t,0,1),$t[0]),Jt=!0;(function(){function e(){this.x=1}var t=[];e.prototype=
{valueOf:1,y:1};for(var n in new e)t.push(n);for(n in arguments)Jt=!n;Xt=!/valueOf/.test(t),Vt="x"!=t[0]})(1);var Kt=arguments.constructor==Object,Qt=!v(arguments),Gt="xx"!="x"[0]+Object("x")[0];try{var Yt=("[object Object]",Tt.call(document)==Ft)}catch(Zt){}var en={"[object Function]":!1};en[Dt]=en[Pt]=en[Ht]=en[Bt]=en[jt]=en[Ft]=en[It]=en[qt]=!0;var tn={};tn[Pt]=Array,tn[Ht]=Boolean,tn[Bt]=Date,tn[Ft]=Object,tn[jt]=Number,tn[It]=RegExp,tn[qt]=String;var nn={"boolean":!1,"function":!0,object:!0,
number:!1,string:!1,"undefined":!1},rn={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029":"u2029"};n.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:ht,variable:""};var sn={a:"o,v,g",k:"for(var a=1,b=typeof g=='number'?2:arguments.length;a<b;a++){if((l=arguments[a])){",g:"t[i]=l[i]",c:"}}"},on={a:"d,c,w",k:"c=c&&typeof w=='undefined'?c:e(c,w)",b:"if(c(l[i],i,d)===false)return t",g:"if(c(l[i],i,d)===false)return t"},un={b:null},an=a(on),fn=a(sn
);Qt&&(v=function(e){return e?Et.call(e,"callee"):!1});var ln=a(on,un,{l:!1}),cn=a(on,un),hn={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},pn=w(hn),dn=a(sn,{g:"if(t[i]==null)"+sn.g}),vn=Ct||function(e){return Kt&&e instanceof Array||Tt.call(e)==Pt};S(/x/)&&(S=function(e){return e instanceof Function||"[object Function]"==Tt.call(e)});var mn=wt?function(e){if(!e||typeof e!="object")return!1;var t=e.valueOf,n=typeof t=="function"&&(n=wt(t))&&wt(n);return n?e==n||wt(e)==n&&!v(e):m(e)
}:m,gn=At?function(e){return typeof e=="function"&&xt.call(e,"prototype")?g(e):x(e)?At(e):[]}:g;n.after=function(e,t){return 1>e?t():function(){if(1>--e)return t.apply(this,arguments)}},n.assign=fn,n.bind=X,n.bindAll=function(e){for(var t=arguments,n=1<t.length?0:(t=b(e),-1),r=t.length;++n<r;){var i=t[n];e[i]=X(e[i],e)}return e},n.bindKey=function(e,t){return o(e,t,p(arguments,2))},n.compact=function(e){for(var t=-1,n=e?e.length:0,r=[];++t<n;){var i=e[t];i&&r.push(i)}return r},n.compose=function(
){var e=arguments;return function(){for(var t=arguments,n=e.length;n--;)t=[e[n].apply(this,t)];return t[0]}},n.countBy=function(e,t,n){var r={},t=u(t,n);return _(e,function(e,n,i){n=t(e,n,i),Et.call(r,n)?r[n]++:r[n]=1}),r},n.debounce=function(e,t,n){function r(){u=null,n||(s=e.apply(o,i))}var i,s,o,u;return function(){var a=n&&!u;return i=arguments,o=this,clearTimeout(u),u=setTimeout(r,t),a&&(s=e.apply(o,i)),s}},n.defaults=dn,n.defer=function(e){var n=p(arguments,1);return setTimeout(function(){e
.apply(t,n)},1)},n.delay=function(e,n){var r=p(arguments,2);return setTimeout(function(){e.apply(t,r)},n)},n.difference=function(e){for(var t=-1,n=e?e.length:0,i=yt.apply(G,arguments),i=r(i,n),s=[];++t<n;){var o=e[t];i(o)||s.push(o)}return s},n.filter=O,n.flatten=q,n.forEach=_,n.forIn=ln,n.forOwn=cn,n.functions=b,n.groupBy=function(e,t,n){var r={},t=u(t,n);return _(e,function(e,n,i){n=t(e,n,i),(Et.call(r,n)?r[n]:r[n]=[]).push(e)}),r},n.initial=function(e,t,n){if(!e)return[];var r=e.length;return p
(e,0,Mt(Ot(0,r-(null==t||n?1:t||0)),r))},n.intersection=function(e){var t=arguments,n=t.length,i={0:{}},s=-1,o=e?e.length:0,u=100<=o,a=[],f=a;e:for(;++s<o;){var l=e[s];if(u)var c=l+"",c=Et.call(i[0],c)?!(f=i[0][c]):f=i[0][c]=[];if(c||0>R(f,l)){u&&f.push(l);for(var h=n;--h;)if(!(i[h]||(i[h]=r(t[h],0,100)))(l))continue e;a.push(l)}}return a},n.invert=w,n.invoke=function(e,t){var n=p(arguments,2),r=typeof t=="function",i=[];return _(e,function(e){i.push((r?t:e[t]).apply(e,n))}),i},n.keys=gn,n.map=D,
n.max=P,n.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return Et.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},n.merge=C,n.min=function(e,t,n){var r=Infinity,s=-1,o=e?e.length:0,a=r;if(t||!vn(e))t=!t&&N(e)?i:u(t,n),an(e,function(e,n,i){n=t(e,n,i),n<r&&(r=n,a=e)});else for(;++s<o;)e[s]<a&&(a=e[s]);return a},n.object=function(e,t){for(var n=-1,r=e?e.length:0,i={};++n<r;){var s=e[n];t?i[s]=t[n]:i[s[0]]=s[1]}return i},n.omit=function(e,t,n){var r=typeof
t=="function",i={};if(r)t=u(t,n);else var s=yt.apply(G,arguments);return ln(e,function(e,n,o){if(r?!t(e,n,o):0>R(s,n,1))i[n]=e}),i},n.once=function(e){var t,n=!1;return function(){return n?t:(n=!0,t=e.apply(this,arguments),e=null,t)}},n.pairs=function(e){var t=[];return cn(e,function(e,n){t.push([n,e])}),t},n.partial=function(e){return o(e,p(arguments,1))},n.pick=function(e,t,n){var r={};if(typeof t!="function")for(var i=0,s=yt.apply(G,arguments),o=s.length;++i<o;){var a=s[i];a in e&&(r[a]=e[a])}
else t=u(t,n),ln(e,function(e,n,i){t(e,n,i)&&(r[n]=e)});return r},n.pluck=H,n.range=function(e,t,n){e=+e||0,n=+n||1,null==t&&(t=e,e=0);for(var r=-1,t=Ot(0,gt((t-e)/n)),i=Array(t);++r<t;)i[r]=e,e+=n;return i},n.reject=function(e,t,n){return t=u(t,n),O(e,function(e,n,r){return!t(e,n,r)})},n.rest=U,n.shuffle=function(e){var t=-1,n=Array(e?e.length:0);return _(e,function(e){var r=bt(_t()*(++t+1));n[t]=n[r],n[r]=e}),n},n.sortBy=function(e,t,n){var r=[],t=u(t,n);_(e,function(e,n,i){r.push({a:t(e,n,i),b
:n,c:e})}),e=r.length;for(r.sort(s);e--;)r[e]=r[e].c;return r},n.tap=function(e,t){return t(e),e},n.throttle=function(e,t){function n(){u=new Date,o=null,i=e.apply(s,r)}var r,i,s,o,u=0;return function(){var a=new Date,f=t-(a-u);return r=arguments,s=this,0>=f?(clearTimeout(o),o=null,u=a,i=e.apply(s,r)):o||(o=setTimeout(n,f)),i}},n.times=function(e,t,n){for(var e=+e||0,r=-1,i=Array(e);++r<e;)i[r]=t.call(n,r);return i},n.toArray=function(e){return typeof (e?e.length:0)=="number"?Gt&&N(e)?e.split("")
:p(e):k(e)},n.union=function(){return W(yt.apply(G,arguments))},n.uniq=W,n.values=k,n.where=function(e,t){var n=gn(t);return O(e,function(e){for(var r=n.length;r--;){var i=e[n[r]]===t[n[r]];if(!i)break}return!!i})},n.without=function(e){for(var t=-1,n=e?e.length:0,i=r(arguments,1,20),s=[];++t<n;){var o=e[t];i(o)||s.push(o)}return s},n.wrap=function(e,t){return function(){var n=[e];return St.apply(n,arguments),t.apply(this,n)}},n.zip=function(e){for(var t=-1,n=e?P(H(arguments,"length")):0,r=Array(
n);++t<n;)r[t]=H(arguments,t);return r},n.collect=D,n.drop=U,n.each=_,n.extend=fn,n.methods=b,n.select=O,n.tail=U,n.unique=W,$(n),n.clone=y,n.cloneDeep=function(e){return y(e,!0)},n.contains=L,n.escape=function(e){return null==e?"":(e+"").replace(dt,l)},n.every=A,n.find=M,n.has=function(e,t){return e?Et.call(e,t):!1},n.identity=V,n.indexOf=R,n.isArguments=v,n.isArray=vn,n.isBoolean=function(e){return!0===e||!1===e||Tt.call(e)==Ht},n.isDate=function(e){return e instanceof Date||Tt.call(e)==Bt},n.isElement=
function(e){return e?1===e.nodeType:!1},n.isEmpty=function(e){var t=!0;if(!e)return t;var n=Tt.call(e),r=e.length;return n==Pt||n==qt||n==Dt||Qt&&v(e)||n==Ft&&typeof r=="number"&&S(e.splice)?!r:(cn(e,function(){return t=!1}),t)},n.isEqual=E,n.isFinite=function(e){return kt(e)&&!Lt(parseFloat(e))},n.isFunction=S,n.isNaN=function(e){return T(e)&&e!=+e},n.isNull=function(e){return null===e},n.isNumber=T,n.isObject=x,n.isPlainObject=mn,n.isRegExp=function(e){return e instanceof RegExp||Tt.call(e)==It
},n.isString=N,n.isUndefined=function(e){return typeof e=="undefined"},n.lastIndexOf=function(e,t,n){var r=e?e.length:0;for(typeof n=="number"&&(r=(0>n?Ot(0,r+n):Mt(n,r-1))+1);r--;)if(e[r]===t)return r;return-1},n.mixin=$,n.noConflict=function(){return e._=nt,this},n.random=function(e,t){return null==e&&null==t&&(t=1),e=+e||0,null==t&&(t=e,e=0),e+bt(_t()*((+t||0)-e+1))},n.reduce=B,n.reduceRight=j,n.result=function(e,t){var n=e?e[t]:null;return S(n)?e[t]():n},n.size=function(e){var t=e?e.length:0;
return typeof t=="number"?t:gn(e).length},n.some=F,n.sortedIndex=z,n.template=function(e,t,r){e||(e=""),r||(r={});var i,s,o=n.templateSettings,u=0,a=r.interpolate||o.interpolate||pt,l="__p+='",c=r.variable||o.variable,h=c;e.replace(RegExp((r.escape||o.escape||pt).source+"|"+a.source+"|"+(a===ht?ct:pt).source+"|"+(r.evaluate||o.evaluate||pt).source+"|$","g"),function(t,n,r,s,o,a){return r||(r=s),l+=e.slice(u,a).replace(vt,f),n&&(l+="'+__e("+n+")+'"),o&&(l+="';"+o+";__p+='"),r&&(l+="'+((__t=("+r+"))==null?'':__t)+'"
),i||(i=o||rt.test(n||r)),u=a+t.length,t}),l+="';\n",h||(c="obj",i?l="with("+c+"){"+l+"}":(r=RegExp("(\\(\\s*)"+c+"\\."+c+"\\b","g"),l=l.replace(ft,"$&"+c+".").replace(r,"$1__d"))),l=(i?l.replace(st,""):l).replace(ot,"$1").replace(ut,"$1;"),l="function("+c+"){"+(h?"":c+"||("+c+"={});")+"var __t,__p='',__e=_.escape"+(i?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":(h?"":",__d="+c+"."+c+"||"+c)+";")+l+"return __p}";try{s=Function("_","return "+l)(n)}catch(p){throw p.source=
l,p}return t?s(t):(s.source=l,s)},n.unescape=function(e){return null==e?"":(e+"").replace(it,d)},n.uniqueId=function(e){return(null==e?"":e+"")+ ++Z},n.all=A,n.any=F,n.detect=M,n.foldl=B,n.foldr=j,n.include=L,n.inject=B,cn(n,function(e,t){n.prototype[t]||(n.prototype[t]=function(){var t=[this.__wrapped__];return St.apply(t,arguments),e.apply(n,t)})}),n.first=I,n.last=function(e,t,n){if(e){var r=e.length;return null==t||n?e[r-1]:p(e,Ot(0,r-t))}},n.take=I,n.head=I,cn(n,function(e,t){n.prototype[t]||
(n.prototype[t]=function(t,r){var i=e(this.__wrapped__,t,r);return null==t||r?i:new n(i)})}),n.VERSION="1.0.0-rc.3",n.prototype.toString=function(){return this.__wrapped__+""},n.prototype.value=J,n.prototype.valueOf=J,an(["join","pop","shift"],function(e){var t=G[e];n.prototype[e]=function(){return t.apply(this.__wrapped__,arguments)}}),an(["push","reverse","sort","unshift"],function(e){var t=G[e];n.prototype[e]=function(){return t.apply(this.__wrapped__,arguments),this}}),an(["concat","slice","splice"
],function(e){var t=G[e];n.prototype[e]=function(){var e=t.apply(this.__wrapped__,arguments);return new n(e)}}),$t&&an(["pop","shift","splice"],function(e){var t=G[e],r="splice"==e;n.prototype[e]=function(){var e=this.__wrapped__,i=t.apply(e,arguments);return 0===e.length&&delete e[0],r?new n(i):i}}),typeof define=="function"&&typeof define.amd=="object"&&define.amd?(e._=n,define(function(){return n})):K?typeof module=="object"&&module&&module.exports==K?(module.exports=n)._=n:K._=n:e._=n})(this);

File diff suppressed because it is too large Load Diff

View File

@@ -1,33 +0,0 @@
/*!
Lo-Dash 1.0.0-rc.3 (Custom Build) lodash.com/license
Build: `lodash underscore -m -o ./lodash.underscore.min.js`
Underscore.js 1.4.3 underscorejs.org/LICENSE
*/
;(function(e,t){function n(e){if(e&&typeof e=="object"&&e.__wrapped__)return e;if(!(this instanceof n))return new n(e);this.__wrapped__=e}function r(e,t){var n=e.b,r=t.b,e=e.a,t=t.a;if(e!==t){if(e>t||typeof e=="undefined")return 1;if(e<t||typeof t=="undefined")return-1}return n<r?-1:1}function i(e,t,n){function r(){var i=arguments,s=t;return n.length&&(i=i.length?n.concat(f(i)):n),this instanceof r?(a.prototype=e.prototype,s=new a,a.prototype=null,i=e.apply(s,i),y(i)?i:s):e.apply(s,i)}return r}function s
(e,t,n){return e?typeof e!="function"?function(t){return t[e]}:typeof t!="undefined"?n?function(n,r,i,s){return e.call(t,n,r,i,s)}:function(n,r,i){return e.call(t,n,r,i)}:e:q}function o(e){return"\\"+Tt[e]}function u(e){return Lt[e]}function a(){}function f(e,t,n){t||(t=0),typeof n=="undefined"&&(n=e?e.length:0);for(var r=-1,n=n-t||0,i=Array(0>n?0:n);++r<n;)i[r]=e[t+r];return i}function l(e){return At[e]}function c(e){if(!e)return e;for(var t=1,n=arguments.length;t<n;t++){var r=arguments[t];if(r)
for(var i in r)e[i]=r[i]}return e}function h(e){var t=[];return kt(e,function(e,n){t.push(n)}),t}function p(e){if(!e)return e;for(var t=1,n=arguments.length;t<n;t++){var r=arguments[t];if(r)for(var i in r)null==e[i]&&(e[i]=r[i])}return e}function d(e){var t=[];return Ct(e,function(e,n){g(e)&&t.push(n)}),t.sort()}function v(e){var t={};return kt(e,function(e,n){t[e]=n}),t}function m(e,t,n,r){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return e===t;var i=it.call(e),s=it.call(t);if(i!=s)return!1
;switch(i){case dt:case vt:return+e==+t;case mt:return e!=+e?t!=+t:0==e?1/e==1/t:e==+t;case yt:case bt:return e==t+""}s=i==pt;if(!s){if(e.__wrapped__||t.__wrapped__)return m(e.__wrapped__||e,t.__wrapped__||t);if(i!=gt)return!1;var i=e.constructor,o=t.constructor;if(i!=o&&(!g(i)||!(i instanceof i&&g(o)&&o instanceof o)))return!1}n||(n=[]),r||(r=[]);for(i=n.length;i--;)if(n[i]==e)return r[i]==t;var u=!0,a=0;n.push(e),r.push(t);if(s){a=e.length;if(u=a==t.length)for(;a--&&(u=m(e[a],t[a],n,r)););return u
}return Ct(e,function(e,i,s){if(nt.call(s,i))return a++,!(u=nt.call(t,i)&&m(e,t[i],n,r))&&V}),u&&Ct(t,function(e,t,n){if(nt.call(n,t))return!(u=-1<--a)&&V}),u}function g(e){return typeof e=="function"}function y(e){return e?xt[typeof e]:!1}function b(e){return typeof e=="number"||it.call(e)==mt}function w(e){return typeof e=="string"||it.call(e)==bt}function E(e){var t=[];return kt(e,function(e){t.push(e)}),t}function S(e,t){var n=!1;return typeof (e?e.length:0)=="number"?n=-1<H(e,t):Nt(e,function(
e){return(n=e===t)&&V}),n}function x(e,t,n){var r=!0,t=s(t,n);if(Ot(e))for(var n=-1,i=e.length;++n<i&&(r=!!t(e[n],n,e)););else Nt(e,function(e,n,i){return!(r=!!t(e,n,i))&&V});return r}function T(e,t,n){var r=[],t=s(t,n);if(Ot(e))for(var n=-1,i=e.length;++n<i;){var o=e[n];t(o,n,e)&&r.push(o)}else Nt(e,function(e,n,i){t(e,n,i)&&r.push(e)});return r}function N(e,t,n){var r,t=s(t,n);return C(e,function(e,n,i){if(t(e,n,i))return r=e,V}),r}function C(e,t,n){if(t&&typeof n=="undefined"&&Ot(e))for(var n=-1
,r=e.length;++n<r&&t(e[n],n,e)!==V;);else Nt(e,t,n)}function k(e,t,n){var r=-1,i=e?e.length:0,o=Array(typeof i=="number"?i:0),t=s(t,n);if(Ot(e))for(;++r<i;)o[r]=t(e[r],r,e);else Nt(e,function(e,n,i){o[++r]=t(e,n,i)});return o}function L(e,t,n){var r=-Infinity,i=-1,o=e?e.length:0,u=r;if(t||!Ot(e))t=s(t,n),Nt(e,function(e,n,i){n=t(e,n,i),n>r&&(r=n,u=e)});else for(;++i<o;)e[i]>u&&(u=e[i]);return u}function A(e,t){return k(e,t+"")}function O(e,t,n,r){var i=3>arguments.length,t=s(t,r,V);if(Ot(e)){var o=-1
,u=e.length;for(i&&(n=e[++o]);++o<u;)n=t(n,e[o],o,e)}else Nt(e,function(e,r,s){n=i?(i=!1,e):t(n,e,r,s)});return n}function M(e,t,n,r){var i=e?e.length:0,o=3>arguments.length;if(typeof i!="number")var u=Mt(e),i=u.length;return t=s(t,r,V),C(e,function(r,s,a){s=u?u[--i]:--i,n=o?(o=!1,e[s]):t(n,e[s],s,a)}),n}function _(e,t,n){var r,t=s(t,n);if(Ot(e))for(var n=-1,i=e.length;++n<i&&!(r=t(e[n],n,e)););else Nt(e,function(e,n,i){return(r=t(e,n,i))&&V});return!!r}function D(e,t,n){if(e){var r=e.length;return null==
t||n?e[0]:f(e,0,ct(lt(0,t),r))}}function P(e,t){for(var n=-1,r=e?e.length:0,i=[];++n<r;){var s=e[n];Ot(s)?rt.apply(i,t?s:P(s)):i.push(s)}return i}function H(e,t,n){var r=-1,i=e?e.length:0;if(typeof n=="number")r=(0>n?lt(0,i+n):n||0)-1;else if(n)return r=j(e,t),e[r]===t?r:-1;for(;++r<i;)if(e[r]===t)return r;return-1}function B(e,t,n){return f(e,null==t||n?1:lt(0,t))}function j(e,t,n,r){for(var i=0,o=e?e.length:i,n=n?s(n,r):q,t=n(t);i<o;)r=i+o>>>1,n(e[r])<t?i=r+1:o=r;return i}function F(e,t,n,r){var i=-1
,o=e?e.length:0,u=[],a=u;typeof t=="function"&&(r=n,n=t,t=!1),n&&(a=[],n=s(n,r));for(;++i<o;){var r=e[i],f=n?n(r,i,e):r;if(t?!i||a[a.length-1]!==f:0>H(a,f))n&&a.push(f),u.push(r)}return u}function I(e,t){return wt||st&&2<arguments.length?st.call.apply(st,arguments):i(e,t,f(arguments,2))}function q(e){return e}function R(e){C(d(e),function(t){var r=n[t]=e[t];n.prototype[t]=function(){var e=[this.__wrapped__];return rt.apply(e,arguments),e=r.apply(n,e),this.__chain__&&(e=new n(e),e.__chain__=!0),e}
})}var U=typeof exports=="object"&&exports,z=typeof global=="object"&&global;z.global===z&&(e=z);var W=[],z=new function(){},X=0,V=z,$=e._,J=/&(?:amp|lt|gt|quot|#x27);/g,K=RegExp("^"+(z.valueOf+"").replace(/[.*+?^=!:${}()|[\]\/\\]/g,"\\$&").replace(/valueOf|for [^\]]+/g,".+?")+"$"),Q=/($^)/,G=/[&<>"']/g,Y=/['\n\r\t\u2028\u2029\\]/g,Z=Math.ceil,et=W.concat,tt=Math.floor,nt=z.hasOwnProperty,rt=W.push,it=z.toString,st=K.test(st=f.bind)&&st,ot=K.test(ot=Array.isArray)&&ot,ut=e.isFinite,at=e.isNaN,ft=
K.test(ft=Object.keys)&&ft,lt=Math.max,ct=Math.min,ht=Math.random,pt="[object Array]",dt="[object Boolean]",vt="[object Date]",mt="[object Number]",gt="[object Object]",yt="[object RegExp]",bt="[object String]",z=!!e.attachEvent,z=st&&!/\n|true/.test(st+z),wt=st&&!z,Et=(Et={0:1,length:1},W.splice.call(Et,0,1),Et[0]),St=arguments.constructor==Object,xt={"boolean":!1,"function":!0,object:!0,number:!1,string:!1,"undefined":!1},Tt={"\\":"\\","'":"'","\n":"n","\r":"r"," ":"t","\u2028":"u2028","\u2029"
:"u2029"};n.templateSettings={escape:/<%-([\s\S]+?)%>/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,variable:""};var Nt=function(e,t,n){if(!e)return e;var t=t&&typeof n=="undefined"?t:s(t,n),r=e.length,n=-1;if(typeof r=="number"){for(;++n<r;)if(t(e[n],n,e)===V)return e}else for(n in e)if(nt.call(e,n)&&t(e[n],n,e)===V)return e};n.isArguments=function(e){return"[object Arguments]"==it.call(e)},n.isArguments(arguments)||(n.isArguments=function(e){return e?nt.call(e,"callee"):!1});var Ct=
function(e,t){var n;if(!e)return e;t||(t=q);for(n in e)if(t(e[n],n,e)===V)break;return e},kt=function(e,t){var n;if(!e)return e;t||(t=q);for(n in e)if(nt.call(e,n)&&t(e[n],n,e)===V)break;return e},Lt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"},At=v(Lt),Ot=ot||function(e){return St&&e instanceof Array||it.call(e)==pt};g(/x/)&&(g=function(e){return e instanceof Function||"[object Function]"==it.call(e)});var Mt=ft?function(e){return y(e)?ft(e):[]}:h;n.after=function(e,t){return 1>
e?t():function(){if(1>--e)return t.apply(this,arguments)}},n.bind=I,n.bindAll=function(e){for(var t=arguments,n=1<t.length?0:(t=d(e),-1),r=t.length;++n<r;){var i=t[n];e[i]=I(e[i],e)}return e},n.compact=function(e){for(var t=-1,n=e?e.length:0,r=[];++t<n;){var i=e[t];i&&r.push(i)}return r},n.compose=function(){var e=arguments;return function(){for(var t=arguments,n=e.length;n--;)t=[e[n].apply(this,t)];return t[0]}},n.countBy=function(e,t,n){var r={},t=s(t,n);return C(e,function(e,n,i){n=t(e,n,i),nt
.call(r,n)?r[n]++:r[n]=1}),r},n.debounce=function(e,t,n){function r(){u=null,n||(s=e.apply(o,i))}var i,s,o,u;return function(){var a=n&&!u;return i=arguments,o=this,clearTimeout(u),u=setTimeout(r,t),a&&(s=e.apply(o,i)),s}},n.defaults=p,n.defer=function(e){var n=f(arguments,1);return setTimeout(function(){e.apply(t,n)},1)},n.delay=function(e,n){var r=f(arguments,2);return setTimeout(function(){e.apply(t,r)},n)},n.difference=function(e){for(var t=-1,n=e.length,r=et.apply(W,arguments),i=[];++t<n;){var s=
e[t];0>H(r,s,n)&&i.push(s)}return i},n.filter=T,n.flatten=P,n.forEach=C,n.functions=d,n.groupBy=function(e,t,n){var r={},t=s(t,n);return C(e,function(e,n,i){n=t(e,n,i),(nt.call(r,n)?r[n]:r[n]=[]).push(e)}),r},n.initial=function(e,t,n){if(!e)return[];var r=e.length;return f(e,0,ct(lt(0,r-(null==t||n?1:t||0)),r))},n.intersection=function(e){var t=arguments,n=t.length,r=-1,i=e?e.length:0,s=[];e:for(;++r<i;){var o=e[r];if(0>H(s,o)){for(var u=n;--u;)if(0>H(t[u],o))continue e;s.push(o)}}return s},n.invert=
v,n.invoke=function(e,t){var n=f(arguments,2),r=typeof t=="function",i=[];return C(e,function(e){i.push((r?t:e[t]).apply(e,n))}),i},n.keys=Mt,n.map=k,n.max=L,n.memoize=function(e,t){var n={};return function(){var r=t?t.apply(this,arguments):arguments[0];return nt.call(n,r)?n[r]:n[r]=e.apply(this,arguments)}},n.min=function(e,t,n){var r=Infinity,i=-1,o=e?e.length:0,u=r;if(t||!Ot(e))t=s(t,n),Nt(e,function(e,n,i){n=t(e,n,i),n<r&&(r=n,u=e)});else for(;++i<o;)e[i]<u&&(u=e[i]);return u},n.object=function(
e,t){for(var n=-1,r=e?e.length:0,i={};++n<r;){var s=e[n];t?i[s]=t[n]:i[s[0]]=s[1]}return i},n.omit=function(e){var t=et.apply(W,arguments),n={};return Ct(e,function(e,r){0>H(t,r,1)&&(n[r]=e)}),n},n.once=function(e){var t,n=!1;return function(){return n?t:(n=!0,t=e.apply(this,arguments),e=null,t)}},n.pairs=function(e){var t=[];return kt(e,function(e,n){t.push([n,e])}),t},n.pick=function(e){for(var t=0,n=et.apply(W,arguments),r=n.length,i={};++t<r;){var s=n[t];s in e&&(i[s]=e[s])}return i},n.pluck=
A,n.range=function(e,t,n){e=+e||0,n=+n||1,null==t&&(t=e,e=0);for(var r=-1,t=lt(0,Z((t-e)/n)),i=Array(t);++r<t;)i[r]=e,e+=n;return i},n.reject=function(e,t,n){return t=s(t,n),T(e,function(e,n,r){return!t(e,n,r)})},n.rest=B,n.shuffle=function(e){var t=-1,n=Array(e?e.length:0);return C(e,function(e){var r=tt(ht()*(++t+1));n[t]=n[r],n[r]=e}),n},n.sortBy=function(e,t,n){var i=[],t=s(t,n);C(e,function(e,n,r){i.push({a:t(e,n,r),b:n,c:e})}),e=i.length;for(i.sort(r);e--;)i[e]=i[e].c;return i},n.tap=function(
e,t){return t(e),e},n.throttle=function(e,t){function n(){u=new Date,o=null,i=e.apply(s,r)}var r,i,s,o,u=0;return function(){var a=new Date,f=t-(a-u);return r=arguments,s=this,0>=f?(clearTimeout(o),o=null,u=a,i=e.apply(s,r)):o||(o=setTimeout(n,f)),i}},n.times=function(e,t,n){for(var e=+e||0,r=-1,i=Array(e);++r<e;)i[r]=t.call(n,r);return i},n.toArray=function(e){return typeof (e?e.length:0)=="number"?f(e):E(e)},n.union=function(){return F(et.apply(W,arguments))},n.uniq=F,n.values=E,n.where=function(
e,t){var n=Mt(t);return T(e,function(e){for(var r=n.length;r--;){var i=e[n[r]]===t[n[r]];if(!i)break}return!!i})},n.without=function(e){for(var t=-1,n=e.length,r=[];++t<n;){var i=e[t];0>H(arguments,i,1)&&r.push(i)}return r},n.wrap=function(e,t){return function(){var n=[e];return rt.apply(n,arguments),t.apply(this,n)}},n.zip=function(e){for(var t=-1,n=e?L(A(arguments,"length")):0,r=Array(n);++t<n;)r[t]=A(arguments,t);return r},n.collect=k,n.drop=B,n.each=C,n.extend=c,n.methods=d,n.select=T,n.tail=
B,n.unique=F,n.clone=function(e){return e&&xt[typeof e]?Ot(e)?f(e):c({},e):e},n.contains=S,n.escape=function(e){return null==e?"":(e+"").replace(G,u)},n.every=x,n.find=N,n.has=function(e,t){return e?nt.call(e,t):!1},n.identity=q,n.indexOf=H,n.isArray=Ot,n.isBoolean=function(e){return!0===e||!1===e||it.call(e)==dt},n.isDate=function(e){return e instanceof Date||it.call(e)==vt},n.isElement=function(e){return e?1===e.nodeType:!1},n.isEmpty=function(e){if(!e)return!0;if(Ot(e)||w(e))return!e.length;for(
var t in e)if(nt.call(e,t))return!1;return!0},n.isEqual=m,n.isFinite=function(e){return ut(e)&&!at(parseFloat(e))},n.isFunction=g,n.isNaN=function(e){return b(e)&&e!=+e},n.isNull=function(e){return null===e},n.isNumber=b,n.isObject=y,n.isRegExp=function(e){return e instanceof RegExp||it.call(e)==yt},n.isString=w,n.isUndefined=function(e){return typeof e=="undefined"},n.lastIndexOf=function(e,t,n){var r=e?e.length:0;for(typeof n=="number"&&(r=(0>n?lt(0,r+n):ct(n,r-1))+1);r--;)if(e[r]===t)return r;
return-1},n.mixin=R,n.noConflict=function(){return e._=$,this},n.random=function(e,t){return null==e&&null==t&&(t=1),e=+e||0,null==t&&(t=e,e=0),e+tt(ht()*((+t||0)-e+1))},n.reduce=O,n.reduceRight=M,n.result=function(e,t){var n=e?e[t]:null;return g(n)?e[t]():n},n.size=function(e){var t=e?e.length:0;return typeof t=="number"?t:Mt(e).length},n.some=_,n.sortedIndex=j,n.template=function(e,t,r){e||(e="");var r=p({},r,n.templateSettings),i=0,s="__p+='",u=r.variable;e.replace(RegExp((r.escape||Q).source+"|"+
(r.interpolate||Q).source+"|"+(r.evaluate||Q).source+"|$","g"),function(t,n,r,u,a){s+=e.slice(i,a).replace(Y,o),s+=n?"'+_['escape']("+n+")+'":u?"';"+u+";__p+='":r?"'+((__t=("+r+"))==null?'':__t)+'":"",i=a+t.length}),s+="';\n",u||(u="obj",s="with("+u+"||{}){"+s+"}"),s="function("+u+"){var __t,__p='',__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}"+s+"return __p}";try{var a=Function("_","return "+s)(n)}catch(f){throw f.source=s,f}return t?a(t):(a.source=s,a)},n.unescape=function(
e){return null==e?"":(e+"").replace(J,l)},n.uniqueId=function(e){var t=++X+"";return e?e+t:t},n.all=x,n.any=_,n.detect=N,n.foldl=O,n.foldr=M,n.include=S,n.inject=O,n.first=D,n.last=function(e,t,n){if(e){var r=e.length;return null==t||n?e[r-1]:f(e,lt(0,r-t))}},n.take=D,n.head=D,n.chain=function(e){return e=new n(e),e.__chain__=!0,e},n.VERSION="1.0.0-rc.3",R(n),n.prototype.chain=function(){return this.__chain__=!0,this},n.prototype.value=function(){return this.__wrapped__},Nt("pop push reverse shift sort splice unshift"
.split(" "),function(e){var t=W[e];n.prototype[e]=function(){var e=this.__wrapped__;return t.apply(e,arguments),Et&&e.length===0&&delete e[0],this}}),Nt(["concat","join","slice"],function(e){var t=W[e];n.prototype[e]=function(){var e=t.apply(this.__wrapped__,arguments);return this.__chain__&&(e=new n(e),e.__chain__=!0),e}}),U?typeof module=="object"&&module&&module.exports==U?(module.exports=n)._=n:U._=n:e._=n})(this);

View File

@@ -1,53 +1,60 @@
{
"name": "lodash",
"version": "1.0.0-rc.3",
"description": "An alternative to Underscore.js, delivering consistency, customization, performance, and extra features.",
"homepage": "http://lodash.com",
"main": "./lodash",
"keywords": [
"browser",
"client",
"functional",
"performance",
"server",
"speed",
"util"
"version": "2.4.2",
"description": "A utility library delivering consistency, customization, performance, & extras.",
"homepage": "https://lodash.com/",
"license": "MIT",
"main": "dist/lodash.js",
"keywords": ["amd", "browser", "client", "customize", "functional", "server", "util"],
"author": "John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
"contributors": [
"John-David Dalton <john.david.dalton@gmail.com> (http://allyoucanleet.com/)",
"Blaine Bublitz <blaine@iceddev.com> (http://www.iceddev.com/)",
"Kit Cambridge <github@kitcambridge.be> (http://kitcambridge.be/)",
"Mathias Bynens <mathias@qiwi.be> (https://mathiasbynens.be/)"
],
"licenses": [
{
"type": "MIT",
"url": "http://lodash.com/license"
}
],
"author": {
"name": "John-David Dalton",
"email": "john.david.dalton@gmail.com",
"web": "http://allyoucanleet.com/"
},
"bugs": {
"url": "https://github.com/bestiejs/lodash/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/bestiejs/lodash.git"
},
"bin": {
"lodash": "./build.js"
},
"directories": {
"doc": "./doc",
"test": "./test"
},
"engines": [
"node",
"rhino"
"repository": "lodash/lodash",
"files": [
"LICENSE.txt",
"lodash.js",
"dist/lodash.js",
"dist/lodash.min.js",
"dist/lodash.compat.js",
"dist/lodash.compat.min.js",
"dist/lodash.underscore.js",
"dist/lodash.underscore.min.js"
],
"jam": {
"main": "./lodash.js"
"main": "dist/lodash.compat.js",
"include": [
"LICENSE.txt",
"dist/lodash.js",
"dist/lodash.min.js",
"dist/lodash.compat.js",
"dist/lodash.compat.min.js",
"dist/lodash.underscore.js",
"dist/lodash.underscore.min.js"
]
},
"scripts": {
"build": "node build",
"test": "node test/test && node test/test-build",
"install": "node build/post-install"
"volo": {
"type": "directory",
"ignore": [
".*",
"*.custom.*",
"*.min.*",
"*.template.*",
"*.map",
"*.md",
"lodash.js",
"index.js",
"bower.json",
"component.json",
"doc",
"modularize",
"node_modules",
"perf",
"test",
"vendor"
]
}
}

172
perf/asset/perf-ui.js Normal file
View File

@@ -0,0 +1,172 @@
;(function(window) {
'use strict';
/** The base path of the builds */
var basePath = '../';
/** The Lo-Dash build to load */
var build = (build = /build=([^&]+)/.exec(location.search)) && decodeURIComponent(build[1]);
/** The other library to load */
var other = (other = /other=([^&]+)/.exec(location.search)) && decodeURIComponent(other[1]);
/** The `ui` object */
var ui = {};
/*--------------------------------------------------------------------------*/
/**
* Registers an event listener on an element.
*
* @private
* @param {Element} element The element.
* @param {string} eventName The name of the event.
* @param {Function} handler The event handler.
* @returns {Element} The element.
*/
function addListener(element, eventName, handler) {
if (typeof element.addEventListener != 'undefined') {
element.addEventListener(eventName, handler, false);
} else if (typeof element.attachEvent != 'undefined') {
element.attachEvent('on' + eventName, handler);
}
}
/*--------------------------------------------------------------------------*/
// initialize controls
addListener(window, 'load', function() {
function eventHandler(event) {
var buildIndex = buildList.selectedIndex,
otherIndex = otherList.selectedIndex,
search = location.search.replace(/^\?|&?(?:build|other)=[^&]*&?/g, '');
if (event.stopPropagation) {
event.stopPropagation();
} else {
event.cancelBubble = true;
}
location.href =
location.href.split('?')[0] + '?' +
(search ? search + '&' : '') +
'build=' + (buildIndex < 0 ? build : buildList[buildIndex].value) + '&' +
'other=' + (otherIndex < 0 ? other : otherList[otherIndex].value);
}
var span1 = document.createElement('span');
span1.style.cssText = 'float:right';
span1.innerHTML =
'<label for="perf-build">Build: </label>' +
'<select id="perf-build">' +
'<option value="lodash-compat">Lo-Dash (compat)</option>' +
'<option value="lodash-legacy">Lo-Dash (legacy)</option>' +
'<option value="lodash-mobile">Lo-Dash (mobile)</option>' +
'<option value="lodash-modern">Lo-Dash (modern)</option>' +
'<option value="lodash-underscore">Lo-Dash (underscore)</option>' +
'<option value="lodash-custom-dev">Lo-Dash (custom development)</option>' +
'<option value="lodash-custom">Lo-Dash (custom production)</option>' +
'</select>';
var span2 = document.createElement('span');
span2.style.cssText = 'float:right';
span2.innerHTML =
'<label for="perf-other">Other Library: </label>' +
'<select id="perf-other">' +
'<option value="underscore-dev">Underscore (development)</option>' +
'<option value="underscore">Underscore (production)</option>' +
'<option value="lodash-compat">Lo-Dash (compat)</option>' +
'<option value="lodash-legacy">Lo-Dash (legacy)</option>' +
'<option value="lodash-mobile">Lo-Dash (mobile)</option>' +
'<option value="lodash-modern">Lo-Dash (modern)</option>' +
'<option value="lodash-underscore">Lo-Dash (underscore)</option>' +
'<option value="lodash-custom-dev">Lo-Dash (custom development)</option>' +
'<option value="lodash-custom">Lo-Dash (custom production)</option>' +
'</select>';
var buildList = span1.lastChild,
otherList = span2.lastChild,
toolbar = document.getElementById('perf-toolbar');
toolbar.appendChild(span2);
toolbar.appendChild(span1);
buildList.selectedIndex = (function() {
switch (build) {
case 'lodash-compat': return 0;
case 'lodash-legacy': return 1;
case 'lodash-mobile': return 2;
case 'lodash-underscore': return 4;
case 'lodash-custom-dev': return 5;
case 'lodash-custom': return 6;
case 'lodash-modern':
case null: return 3;
}
return -1;
}());
otherList.selectedIndex = (function() {
switch (other) {
case 'underscore-dev': return 0;
case 'lodash-compat': return 2;
case 'lodash-legacy': return 3;
case 'lodash-mobile': return 4;
case 'lodash-modern': return 5;
case 'lodash-underscore': return 6;
case 'lodash-custom-dev': return 7;
case 'lodash-custom': return 8;
case 'underscore':
case null: return 1;
}
return -1;
}());
addListener(buildList, 'change', eventHandler);
addListener(otherList, 'change', eventHandler);
});
// expose Lo-Dash build file path
ui.buildPath = (function() {
var result;
switch (build) {
case 'lodash-compat': result = 'dist/lodash.compat.min.js'; break;
case 'lodash-legacy': result = 'dist/lodash.legacy.min.js'; break;
case 'lodash-mobile': result = 'dist/lodash.mobile.min.js'; break;
case 'lodash-underscore': result = 'dist/lodash.underscore.min.js'; break;
case 'lodash-custom-dev': result = 'lodash.custom.js'; break;
case 'lodash-custom': result = 'lodash.custom.min.js'; break;
case null: build = 'lodash-modern';
case 'lodash-modern': result = 'dist/lodash.min.js'; break;
default: return build;
}
return basePath + result;
}());
// expose other library file path
ui.otherPath = (function() {
var result;
switch (other) {
case 'lodash-compat': result = 'dist/lodash.compat.min.js'; break;
case 'lodash-legacy': result = 'dist/lodash.legacy.min.js'; break;
case 'lodash-mobile': result = 'dist/lodash.mobile.min.js'; break;
case 'lodash-modern': result = 'dist/lodash.min.js'; break;
case 'lodash-underscore': result = 'dist/lodash.underscore.min.js'; break;
case 'lodash-custom-dev': result = 'lodash.custom.js'; break;
case 'lodash-custom': result = 'lodash.custom.min.js'; break;
case 'underscore-dev': result = 'vendor/underscore/underscore.js'; break;
case null: other = 'underscore';
case 'underscore': result = 'vendor/underscore/underscore-min.js'; break;
default: return other;
}
return basePath + result;
}());
// expose `ui.urlParams` properties
ui.urlParams = {
'build': build,
'other': other
};
// expose `ui`
window.ui = ui;
}(this));

View File

@@ -29,17 +29,18 @@
<body>
<div id="perf-toolbar"></div>
<script src="../vendor/platform.js/platform.js"></script>
<script src="../lodash.js"></script>
<script src="../vendor/benchmark.js/benchmark.js"></script>
<script src="../vendor/firebug-lite/src/firebug-lite-debug.js"></script>
<script src="perf-ui.js"></script>
<script src="./asset/perf-ui.js"></script>
<script>
document.write('<script src="../' + ui.buildPath + '"><\/script>');
document.write('<script src="' + ui.buildPath + '"><\/script>');
</script>
<script>
var lodash = _.noConflict();
</script>
<script>
document.write('<script src="../' + ui.otherPath + '"><\/script>');
document.write('<script src="' + ui.otherPath + '"><\/script>');
</script>
<script src="perf.js"></script>
<script>

View File

@@ -1,130 +0,0 @@
;(function(window) {
'use strict';
/** The Lo-Dash build to load */
var build = (/build=([^&]+)/.exec(location.search) || [])[1];
/** The other library to load */
var other = (/other=([^&]+)/.exec(location.search) || [])[1];
/** The `ui` object */
var ui = {};
/*--------------------------------------------------------------------------*/
/**
* Registers an event listener on an element.
*
* @private
* @param {Element} element The element.
* @param {String} eventName The name of the event.
* @param {Function} handler The event handler.
* @returns {Element} The element.
*/
function addListener(element, eventName, handler) {
if (typeof element.addEventListener != 'undefined') {
element.addEventListener(eventName, handler, false);
} else if (typeof element.attachEvent != 'undefined') {
element.attachEvent('on' + eventName, handler);
}
}
/*--------------------------------------------------------------------------*/
// expose Lo-Dash build file path
ui.buildPath = (function() {
switch (build) {
case 'lodash-dev': return 'lodash.js';
case 'lodash-underscore': return 'lodash.underscore.min.js';
case 'lodash-custom': return 'lodash.custom.min.js';
}
return 'lodash.min.js';
}());
// expose other library file path
ui.otherPath = (function() {
switch (other) {
case 'lodash-dev': return 'lodash.js';
case 'lodash-prod': return 'lodash.min.js';
case 'lodash-underscore': return 'lodash.underscore.min.js';
case 'lodash-custom': return 'lodash.custom.min.js';
case 'underscore-dev': return 'vendor/underscore/underscore.js';
}
return 'vendor/underscore/underscore-min.js';
}());
// initialize controls
addListener(window, 'load', function() {
function eventHandler(event) {
var search = location.search.replace(/^\?|&?(?:build|other)=[^&]*&?/g, '');
if (event.stopPropagation) {
event.stopPropagation();
} else {
event.cancelBubble = true;
}
location.href =
location.href.split('?')[0] + '?' +
(search ? search + '&' : '') +
'build=' + buildList[buildList.selectedIndex].value + '&' +
'other=' + otherList[otherList.selectedIndex].value;
}
var span1 = document.createElement('span');
span1.style.cssText = 'float:right';
span1.innerHTML =
'<label for="perf-build">Build: </label>' +
'<select id="perf-build">' +
'<option value="lodash-dev">Lo-Dash</option>' +
'<option value="lodash-prod">Lo-Dash (minified)</option>' +
'<option value="lodash-underscore">Lo-Dash (underscore)</option>' +
'<option value="lodash-custom">Lo-Dash (custom)</option>' +
'</select>';
var span2 = document.createElement('span');
span2.style.cssText = 'float:right';
span2.innerHTML =
'<label for="perf-other">Other Library: </label>' +
'<select id="perf-other">' +
'<option value="underscore-dev">Underscore</option>' +
'<option value="underscore-prod">Underscore (minified)</option>' +
'<option value="lodash-dev">Lo-Dash</option>' +
'<option value="lodash-prod">Lo-Dash (minified)</option>' +
'<option value="lodash-underscore">Lo-Dash (underscore)</option>' +
'<option value="lodash-custom">Lo-Dash (custom)</option>' +
'</select>';
var buildList = span1.lastChild,
otherList = span2.lastChild,
toolbar = document.getElementById('perf-toolbar');
toolbar.appendChild(span2);
toolbar.appendChild(span1);
buildList.selectedIndex = (function() {
switch (build) {
case 'lodash-dev': return 0;
case 'lodash-underscore': return 2;
case 'lodash-custom': return 3;
}
return 1;
}());
otherList.selectedIndex = (function() {
switch (other) {
case 'underscore-dev': return 0;
case 'lodash-dev': return 2;
case 'lodash-prod': return 3;
case 'lodash-underscore': return 4;
case 'lodash-custom': return 5;
}
return 1;
}());
addListener(buildList, 'change', eventHandler);
addListener(otherList, 'change', eventHandler);
});
// expose `ui`
window.ui = ui;
}(this));

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,14 @@
cd "$(dirname "$0")"
for cmd in node narwhal ringo rhino; do
echo ""
echo "Running performance suite in $cmd..."
$cmd perf.js
echo "Running performance suite in node..."
node perf.js ../dist/lodash.js && node perf.js ../dist/lodash.min.js
for cmd in rhino "rhino -require" narwhal ringo phantomjs; do
echo ""
echo "Running performance suite in $cmd..."
$cmd perf.js ../dist/lodash.compat.js && $cmd perf.js ../dist/lodash.compat.min.js
done
echo ""
echo "Running performance suite in a browser..."
open index.html
open index.html

174
test/asset/test-ui.js Normal file
View File

@@ -0,0 +1,174 @@
;(function(window) {
'use strict';
/** The base path of the builds */
var basePath = '../';
/** The Lo-Dash build to load */
var build = (build = /build=([^&]+)/.exec(location.search)) && decodeURIComponent(build[1]);
/** The module loader to use */
var loader = (loader = /loader=([^&]+)/.exec(location.search)) && decodeURIComponent(loader[1]);
/** The `ui` object */
var ui = {};
/*--------------------------------------------------------------------------*/
/**
* Registers an event listener on an element.
*
* @private
* @param {Element} element The element.
* @param {string} eventName The name of the event.
* @param {Function} handler The event handler.
* @returns {Element} The element.
*/
function addListener(element, eventName, handler) {
if (typeof element.addEventListener != 'undefined') {
element.addEventListener(eventName, handler, false);
} else if (typeof element.attachEvent != 'undefined') {
element.attachEvent('on' + eventName, handler);
}
}
/*--------------------------------------------------------------------------*/
// initialize controls
addListener(window, 'load', function() {
function eventHandler(event) {
var buildIndex = buildList.selectedIndex,
loaderIndex = loaderList.selectedIndex,
search = location.search.replace(/^\?|&?(?:build|loader)=[^&]*&?/g, '');
if (event.stopPropagation) {
event.stopPropagation();
} else {
event.cancelBubble = true;
}
location.href =
location.href.split('?')[0] + '?' +
(search ? search + '&' : '') +
'build=' + (buildIndex < 0 ? build : buildList[buildIndex].value) + '&' +
'loader=' + (loaderIndex < 0 ? loader : loaderList[loaderIndex].value);
}
function init() {
var toolbar = document.getElementById('qunit-testrunner-toolbar');
if (toolbar) {
toolbar.appendChild(span1);
toolbar.appendChild(span2);
buildList.selectedIndex = (function() {
switch (build) {
case 'lodash-compat': return 1;
case 'lodash-modern-dev': return 2;
case 'lodash-modern': return 3;
case 'lodash-legacy': return 4;
case 'lodash-mobile': return 5;
case 'lodash-underscore': return 6;
case 'lodash-custom-dev': return 7;
case 'lodash-custom': return 8;
case 'lodash-compat-dev':
case null: return 0;
}
return -1;
}());
loaderList.selectedIndex = (function() {
switch (loader) {
case 'curl': return 1;
case 'dojo': return 2;
case 'requirejs': return 3;
case 'none':
case null: return 0;
}
return -1;
}());
addListener(buildList, 'change', eventHandler);
addListener(loaderList, 'change', eventHandler);
}
else {
setTimeout(init, 15);
}
}
var span1 = document.createElement('span');
span1.style.cssText = 'float:right';
span1.innerHTML =
'<label for="qunit-build">Build: </label>' +
'<select id="qunit-build">' +
'<option value="lodash-compat-dev">Lo-Dash (compat development)</option>' +
'<option value="lodash-compat">Lo-Dash (compat production)</option>' +
'<option value="lodash-modern-dev">Lo-Dash (modern development)</option>' +
'<option value="lodash-modern">Lo-Dash (modern production)</option>' +
'<option value="lodash-legacy">Lo-Dash (legacy)</option>' +
'<option value="lodash-mobile">Lo-Dash (mobile)</option>' +
'<option value="lodash-underscore">Lo-Dash (underscore)</option>' +
'<option value="lodash-custom-dev">Lo-Dash (custom development)</option>' +
'<option value="lodash-custom">Lo-Dash (custom production)</option>' +
'</select>';
var span2 = document.createElement('span');
span2.style.cssText = 'float:right';
span2.innerHTML =
'<label for="qunit-loader">Loader: </label>' +
'<select id="qunit-loader">' +
'<option value="none">None</option>' +
'<option value="curl">Curl</option>' +
'<option value="dojo">Dojo</option>' +
'<option value="requirejs">RequireJS</option>' +
'</select>';
var buildList = span1.lastChild,
loaderList = span2.lastChild;
init();
});
// expose Lo-Dash build file path
ui.buildPath = (function() {
var result;
switch (build) {
case 'lodash-compat': result = 'dist/lodash.compat.min.js'; break;
case 'lodash-modern-dev': result = 'dist/lodash.js'; break;
case 'lodash-modern': result = 'dist/lodash.min.js'; break;
case 'lodash-legacy': result = 'dist/lodash.legacy.min.js'; break;
case 'lodash-mobile': result = 'dist/lodash.mobile.min.js'; break;
case 'lodash-underscore': result = 'dist/lodash.underscore.min.js'; break;
case 'lodash-custom-dev': result = 'lodash.custom.js'; break;
case 'lodash-custom': result = 'lodash.custom.min.js'; break;
case null: build = 'lodash-compat-dev';
case 'lodash-compat-dev': result = 'lodash.js'; break;
default: return build;
}
return basePath + result;
}());
// expose module loader file path
ui.loaderPath = (function() {
var result;
switch (loader) {
case 'curl': result = 'vendor/curl/dist/curl-kitchen-sink/curl.js'; break;
case 'dojo': result = 'vendor/dojo/dojo.js'; break;
case 'requirejs': result = 'vendor/requirejs/require.js'; break;
case null: loader = 'none'; return '';
default: return loader;
}
return basePath + result;
}());
// expose `ui.urlParams` properties
ui.urlParams = {
'build': build,
'loader': loader
};
// used to indicate testing a modularized build
ui.isModularize = /\b(?:commonjs|(index|main)\.js|lodash-(?:amd|node)|modularize|npm)\b/.test([location.pathname, location.search, ui.buildPath]);
// expose `ui`
window.ui = ui;
}(this));

6
test/asset/worker.js Normal file
View File

@@ -0,0 +1,6 @@
addEventListener('message', function(e) {
if (e.data) {
importScripts('../' + e.data);
postMessage(_.VERSION);
}
}, false);

View File

@@ -18,33 +18,50 @@
<h1>Test</h1>
</div>
</div>
<script src="../vendor/json3/lib/json3.js"></script>
<script src="../vendor/qunit/qunit/qunit.js"></script>
<script src="../vendor/qunit-extras/qunit-extras.js"></script>
<script src="../vendor/json-js/json2.js"></script>
<script src="../vendor/jquery/jquery.js"></script>
<script src="../vendor/platform.js/platform.js"></script>
<script>
// avoid syntax errors for `QUnit.throws` in older Firefoxes
document.write(platform.name == 'Firefox' && /^1\b/.test(platform.version)
? '<script src="../vendor/qunit/qunit/qunit-1.8.0.js"><\/script>'
: '<script src="../vendor/qunit/qunit/qunit.js"><\/script>'
);
</script>
<script src="test-ui.js"></script>
<script src="./asset/test-ui.js"></script>
<script src="../lodash.js"></script>
<script>
var lodash = _.noConflict();
document.write('<script src="../' + ui.buildPath + '"><\/script>');
QUnit.config.asyncRetries = 5;
QUnit.config.hidepassed = true;
// excuse tests we intentionally fail or those with problems
QUnit.config.excused = {
'Backbone.Collection': {
'set with many models does not overflow the stack': true
},
'Backbone.Router': {
'#2656 - No trailing slash on root.': true,
'#2765 - Fragment matching sans query/hash.': true
}
};
// only excuse `Backbone.Router` tests in IE < 8
if (!(document.attachEvent && (document.documentMode || 0) < 8)) {
delete QUnit.config.excused['Backbone.Router'];
}
// assign results to `global_test_results` for Sauce Labs
var global_test_results;
QUnit.done(function(results) {
global_test_results = results;
});
// load the build of Lo-Dash
document.write('<script src="' + ui.buildPath + '"><\/script>');
</script>
<script>
_.mixin({
'debounce': lodash.debounce
'debounce': _.debounce || lodash.debounce,
'defer': _.defer || lodash.defer,
'pluck': _.pluck || lodash.pluck
});
if (!_.chain) {
_.mixin({
'chain': function(value) {
return new _(value);
}
});
}
</script>
<script src="../vendor/backbone/backbone.js"></script>
<script src="../vendor/backbone/test/environment.js"></script>

View File

@@ -4,82 +4,188 @@
<meta charset="utf-8">
<title>Lo-Dash Test Suite</title>
<link rel="stylesheet" href="../vendor/qunit/qunit/qunit.css">
<style>
#exports {
display: none;
}
</style>
</head>
<body>
<div id="qunit"></div>
<script src="../vendor/qunit/qunit/qunit.js"></script>
<script src="../vendor/qunit-extras/qunit-extras.js"></script>
<script src="../vendor/platform.js/platform.js"></script>
<script src="./asset/test-ui.js"></script>
<div id="qunit"></div>
<div id="exports"></div>
<script>
// avoid syntax errors for `QUnit.throws` in older Firefoxes
document.write(platform.name == 'Firefox' && /^1\b/.test(platform.version)
? '<script src="../vendor/qunit/qunit/qunit-1.8.0.js"><\/script>'
: '<script src="../vendor/qunit/qunit/qunit.js"><\/script>'
);
</script>
<script src="test-ui.js"></script>
<script>
// set a bad shim
Object._keys = Object.keys;
Object.keys = function() { return []; };
// set bad shims
Array._isArray = Array.isArray;
Array.isArray = function() {};
// load Lo-Dash and expose it to the bad `Object.keys` shim
document.write('<script src="../' + ui.buildPath + '"><\/script>');
Date._now = Date.now;
Date.now = function() {};
Function.prototype._bind = Function.prototype.bind;
Function.prototype.bind = function() { return function() {}; };
Object._create = Object.create;
Object.create = function() {};
Object._defineProperty = Object.defineProperty;
Object.defineProperty = function() {};
Object._getPrototypeOf = Object.getPrototypeOf;
Object.getPrototypeOf = function() {};
Object._keys = Object.keys;
Object.keys = function() {};
// load Lo-Dash and expose it to the bad shims
document.write('<script src="' + (ui.isModularize ? '../lodash.js' : ui.buildPath) + '"><\/script>');
</script>
<script>
// store Lo-Dash to test for bad shim detection
var lodashBadShim = _;
var lodashBadShim = window._;
// restore nativeKeys
Object.keys = Object._keys;
// restore native methods
if (Array._isArray) {
Array.isArray = Array._isArray;
} else {
delete Array.isArray;
}
if (Date._now) {
Date.now = Date._now;
} else {
delete Date.now;
}
if (Function.prototype._bind) {
Function.prototype.bind = Function.prototype._bind;
} else {
delete Function.prototype.bind;
}
if (Object._create) {
Object.create = Object._create;
} else {
delete Object.create;
}
if (Object._defineProperty) {
Object.defineProperty = Object._defineProperty;
} else {
delete Object.defineProperty;
}
if (Object._getPrototypeOf) {
Object.getPrototypeOf = Object._getPrototypeOf;
} else {
delete Object.getPrototypeOf;
}
if (Object._keys) {
Object.keys = Object._keys;
} else {
delete Object.keys;
}
delete Array._isArray;
delete Date._now;
delete Function.prototype._bind;
delete Object._create;
delete Object._defineProperty;
delete Object._getPrototypeOf;
delete Object._keys;
// load Lo-Dash again to overwrite the existing `_` value
document.write('<script src="../' + ui.buildPath + '"><\/script>');
QUnit.config.hidepassed = true;
// load test.js if not using require.js
document.write(QUnit.urlParams.norequire
? '<script src="test.js"><\/script>'
: '<script src="../vendor/requirejs/require.js"><\/script>'
// assign results to `global_test_results` for Sauce Labs
var global_test_results;
QUnit.done(function(results) {
global_test_results = results;
});
// clear existing `_` value
window._ = undefined;
// load Lo-Dash and test scripts
document.write(ui.urlParams.loader == 'none'
? '<script src="' + ui.buildPath + '"><\/script><script src="test.js"><\/script>'
: '<script data-dojo-config="async:1" src="' + ui.loaderPath + '"><\/script>'
);
</script>
<script>
// load Lo-Dash as a module
var lodashModule,
shimmedModule,
underscoreModule;
window.require && require(
(function() {
var modulePath = ui.buildPath.replace(/\.js$/, '');
return {
'baseUrl': '../vendor/requirejs/',
if (window.curl) {
curl.config({ 'apiName': 'require' });
}
if (!window.require) {
return;
}
var reBasename = /[\w.-]+$/,
basePath = ('//' + location.host + location.pathname.replace(reBasename, '')).replace(/\btest\/$/, ''),
modulePath = ui.buildPath.replace(/\.js$/, ''),
locationPath = modulePath.replace(reBasename, ''),
moduleMain = modulePath.match(reBasename)[0];
QUnit.config.autostart = false;
// load Lo-Dash as a module
require({
'baseUrl': './',
'urlArgs': 't=' + (+new Date),
'paths': {
'lodash': '../../' + modulePath,
'shimmed': './../../' + modulePath,
'underscore': '../underscore/../../' + modulePath
},
'packages': [
{
'name': 'lodash',
'location': locationPath,
'main': moduleMain
},
{
'name': 'shimmed',
'location': './abc/../' + locationPath,
'main': moduleMain
},
{
'name': 'underscore',
'location': './xyz/../' + locationPath,
'main': moduleMain
},
{
'name': 'test',
'location': basePath + '/test',
'main': 'test',
'config': {
// work around no global being exported
'exports': 'QUnit',
'loader': 'curl/loader/legacy'
}
}
],
'shim': {
'shimmed': {
'exports': '_'
'exports': '_'
}
}
};
}()),
['lodash', 'shimmed', 'underscore'], function(lodash, shimmed, underscore) {
if (lodash && lodash.noConflict) {
lodashModule = lodash.noConflict();
lodashModule.moduleName = 'lodash';
}
if (shimmed.noConflict) {
shimmedModule = shimmed.noConflict();
shimmedModule.moduleName = 'shimmed';
}
if (underscore && underscore.noConflict) {
underscoreModule = underscore.noConflict();
underscoreModule.moduleName = 'underscore';
}
require(['test.js']);
});
},
['lodash', 'shimmed', 'underscore'], function(lodash, shimmed, underscore) {
if (shimmed && shimmed.noConflict) {
shimmedModule = shimmed.noConflict();
shimmedModule.moduleName = 'shimmed';
}
if (underscore && underscore.noConflict) {
underscoreModule = underscore.noConflict();
underscoreModule.moduleName = 'underscore';
}
if (lodash) {
lodashModule = lodash;
lodashModule.moduleName = 'lodash';
}
if (ui.isModularize) {
window._ = lodash;
}
require(['test'], function() {
QUnit.start();
});
});
}());
// set a more readable browser name
window.onload = function() {
@@ -89,7 +195,7 @@
ua.innerHTML = platform;
clearInterval(timeoutId);
}
}, 15);
}, 16);
};
</script>
</body>

12
test/run-test.sh Executable file → Normal file
View File

@@ -1,13 +1,13 @@
cd "$(dirname "$0")"
for cmd in rhino ringo narwhal node; do
echo ""
for cmd in rhino "rhino -require" narwhal ringo phantomjs; do
echo "Testing in $cmd..."
$cmd test.js
$cmd test.js ../dist/lodash.compat.js && $cmd test.js ../dist/lodash.compat.min.js
echo ""
done
echo ""
echo "Testing build..."
node test-build.js
echo "Testing in node..."
node test.js ../dist/lodash.js && node test.js ../dist/lodash.min.js
echo ""
echo "Testing in a browser..."

353
test/saucelabs.js Normal file
View File

@@ -0,0 +1,353 @@
;(function() {
'use strict';
/** Environment shortcut */
var env = process.env;
if (isFinite(env.TRAVIS_PULL_REQUEST)) {
console.error('Testing skipped for pull requests');
process.exit(0);
}
/** Load Node.js modules */
var http = require('http'),
path = require('path'),
url = require('url');
/** Load other modules */
var _ = require('../lodash.js'),
ecstatic = require('ecstatic'),
request = require('request'),
SauceTunnel = require('sauce-tunnel');
/** Used by `logInline` to clear previously logged messages */
var prevLine = '';
/** Used to display the wait throbber */
var throbberId,
throbberDelay = 500,
waitCount = -1;
/** Used as request `auth` and `options` values */
var accessKey = env.SAUCE_ACCESS_KEY,
build = env.TRAVIS_COMMIT.slice(0, 10),
port = 9001,
tunnelId = 'lodash_' + env.TRAVIS_JOB_NUMBER,
username = env.SAUCE_USERNAME;
var compatMode = process.argv.reduce(function(result, value) {
return optionToValue('compatMode', value) || result;
}, null);
var runner = process.argv.reduce(function(result, value) {
value = optionToValue('runner', value);
return value == null
? result
: '/' + value.replace(/^\W+/, '');
}, '/test/index.html');
var sessionName = process.argv.reduce(function(result, value) {
return optionToValue('name', value) || result;
}, 'lodash tests');
var tags = process.argv.reduce(function(result, value) {
value = optionToArray('tags', value);
return value.length
? _.union(result, value)
: result;
}, []);
/** List of platforms to load the runner on */
var platforms = [
['Windows 8.1', 'chrome', '31'],
['Windows 8.1', 'chrome', '28'],
['Windows 8.1', 'chrome', '26'],
['OS X 10.6', 'firefox', '25'],
['OS X 10.6', 'firefox', '20'],
['OS X 10.6', 'firefox', '10'],
['OS X 10.6', 'firefox', '6'],
['OS X 10.6', 'firefox', '4'],
['Windows 7', 'firefox', '3.6'],
['Windows 8.1', 'internet explorer', '11'],
['Windows 8', 'internet explorer', '10'],
['Windows 7', 'internet explorer', '9'],
['Windows 7', 'internet explorer', '8'],
['Windows XP', 'internet explorer', '7'],
['Windows XP', 'internet explorer', '6'],
//['Windows 7', 'opera', '12'],
//['Windows 7', 'opera', '11'],
['OS X 10.8', 'safari', '6'],
['Windows 7', 'safari', '5'],
['Windows XP', 'safari', '4']
];
/** Used to tailor the `platforms` array */
var runnerQuery = url.parse(runner, true).query,
isBackbone = /\bbackbone\b/i.test(runner),
isMobile = /\bmobile\b/i.test(runnerQuery.build),
isModern = /\bmodern\b/i.test(runnerQuery.build);
// platforms to test IE compat mode
if (compatMode) {
platforms = [
['Windows 8.1', 'internet explorer', '11'],
['Windows 8', 'internet explorer', '10'],
['Windows 7', 'internet explorer', '9'],
['Windows 7', 'internet explorer', '8']
];
}
// platforms for Backbone tests
if (isBackbone) {
platforms = platforms.filter(function(platform) {
var browser = platform[1],
version = +platform[2];
switch (browser) {
case 'firefox': return version >= 4;
case 'opera': return version >= 12;
}
return true;
});
}
// platforms for mobile and modern builds
if (isMobile || isModern) {
platforms = platforms.filter(function(platform) {
var browser = platform[1],
version = +platform[2];
switch (browser) {
case 'firefox': return version >= 10;
case 'internet explorer': return version >= 9;
case 'opera': return version >= 12;
case 'safari': return version >= (isMobile ? 3 : 6);
}
return true;
});
}
/*--------------------------------------------------------------------------*/
/**
* Writes an inline message to standard output.
*
* @private
* @param {string} text The text to log.
*/
function logInline(text) {
var blankLine = repeat(' ', prevLine.length);
if (text.length > 40) {
text = text.slice(0, 37) + '...';
}
prevLine = text;
process.stdout.write(text + blankLine.slice(text.length) + '\r');
}
/**
* Writes the wait throbber to standard output.
*
* @private
*/
function logThrobber() {
logInline('Please wait' + repeat('.', (++waitCount % 3) + 1));
}
/**
* Converts a comma separated option value into an array.
*
* @private
* @param {string} name The name of the option to inspect.
* @param {string} string The options string.
* @returns {Array} Returns the new converted array.
*/
function optionToArray(name, string) {
return _.compact(_.isArray(string)
? string
: _.invoke((optionToValue(name, string) || '').split(/, */), 'trim')
);
}
/**
* Extracts the option value from an option string.
*
* @private
* @param {string} name The name of the option to inspect.
* @param {string} string The options string.
* @returns {string|undefined} Returns the option value, else `undefined`.
*/
function optionToValue(name, string) {
var result = (result = string.match(RegExp('^' + name + '=([\\s\\S]+)$'))) && result[1].trim();
return result || undefined;
}
/**
* Creates a string with `text` repeated `n` number of times.
*
* @private
* @param {string} text The text to repeat.
* @param {number} n The number of times to repeat `text`.
* @returns {string} The created string.
*/
function repeat(text, n) {
return Array(n + 1).join(text);
}
/*--------------------------------------------------------------------------*/
/**
* Processes the result object of the test session.
*
* @private
* @param {Object} results The result object to process.
*/
function handleTestResults(results) {
var failingTests = results.filter(function(test) {
var result = test.result;
return !result || result.failed || /\berror\b/i.test(result.message);
});
var failingPlatforms = failingTests.map(function(test) {
return test.platform;
});
if (!failingTests.length) {
console.log('Tests passed');
}
else {
console.error('Tests failed on platforms: ' + JSON.stringify(failingPlatforms));
failingTests.forEach(function(test) {
var result = test.result || {},
details = 'See ' + test.url + ' for details.',
failed = result.failed,
platform = JSON.stringify(test.platform);
if (failed) {
console.error(failed + ' failures on ' + platform + '. ' + details);
} else {
var message = result.message || 'no results available. ' + details;
console.error('Testing on ' + platform + ' failed; ' + message);
}
});
}
clearInterval(throbberId);
console.log('Shutting down Sauce Connect tunnel...');
tunnel.stop(function() {
process.exit(failingTests.length ? 1 : 0);
});
}
/**
* Makes a request for Sauce Labs to start the test session.
*
* @private
*/
function runTests() {
var options = {
'build': build,
'framework': 'qunit',
'idle-timeout': 300,
'max-duration': 600,
'name': sessionName,
'public': 'public',
'platforms': platforms,
'record-screenshots': false,
'tags': tags,
'tunnel': 'tunnel-identifier:' + tunnelId,
'url': 'http://localhost:' + port + runner,
'video-upload-on-pass': false
};
console.log('Starting saucelabs tests: ' + JSON.stringify(options));
request.post('https://saucelabs.com/rest/v1/' + username + '/js-tests', {
'auth': { 'user': username, 'pass': accessKey },
'json': options
}, function(error, response, body) {
var statusCode = response && response.statusCode;
if (statusCode == 200) {
waitForTestCompletion(body);
} else {
console.error('Failed to submit test to Sauce Labs; status: ' + statusCode + ', body:\n' + JSON.stringify(body));
if (error) {
console.error(error);
}
process.exit(3);
}
});
// initialize the wait throbber
if (!throbberId) {
throbberId = setInterval(logThrobber, throbberDelay);
logThrobber();
}
}
/**
* Checks the status of the test session. If the session has completed it
* passes the result object to `handleTestResults`, else it checks the status
* again in five seconds.
*
* @private
* @param {Object} testIdentifier The object used to identify the session.
*/
function waitForTestCompletion(testIdentifier) {
request.post('https://saucelabs.com/rest/v1/' + username + '/js-tests/status', {
'auth': { 'user': username, 'pass': accessKey },
'json': testIdentifier
}, function(error, response, body) {
var statusCode = response && response.statusCode;
if (statusCode == 200) {
if (body.completed) {
logInline('');
handleTestResults(body['js tests']);
}
else {
setTimeout(function() {
waitForTestCompletion(testIdentifier);
}, 5000);
}
} else {
logInline('');
console.error('Failed to check test status on Sauce Labs; status: ' + statusCode + ', body:\n' + JSON.stringify(body));
if (error) {
console.error(error);
}
process.exit(4);
}
});
}
/*--------------------------------------------------------------------------*/
// create a web server for the local dir
var mount = ecstatic({
'cache': false,
'root': process.cwd()
});
http.createServer(function(req, res) {
// see http://msdn.microsoft.com/en-us/library/ff955275(v=vs.85).aspx
if (compatMode && path.extname(url.parse(req.url).pathname) == '.html') {
res.setHeader('X-UA-Compatible', 'IE=' + compatMode);
}
mount(req, res);
}).listen(port);
// set up Sauce Connect so we can use this server from Sauce Labs
var tunnelTimeout = 10000,
tunnel = new SauceTunnel(username, accessKey, tunnelId, true, tunnelTimeout);
console.log('Opening Sauce Connect tunnel...');
tunnel.start(function(success) {
if (success) {
console.log('Sauce Connect tunnel opened');
runTests();
} else {
console.error('Failed to open Sauce Connect tunnel');
process.exit(2);
}
});
}());

View File

@@ -1,3 +0,0 @@
<ul>
<% _.forEach(people, function(name) { %><li><%= name %></li><% }); %>
</ul>

View File

@@ -1 +0,0 @@
<% print("Hello " + epithet); %>.

View File

@@ -1 +0,0 @@
Hello ${ name }!

View File

@@ -1 +0,0 @@
Hello {{ name }}!

File diff suppressed because it is too large Load Diff

View File

@@ -1,102 +0,0 @@
;(function(window) {
'use strict';
/** `QUnit.addEvent` shortcut */
var addEvent = QUnit.addEvent;
/** The Lo-Dash build to load */
var build = (/build=([^&]+)/.exec(location.search) || [])[1];
/** A flag to determine if RequireJS should be loaded */
var norequire = /[?&]norequire=true(?:&|$)/.test(location.search);
/** The `ui` object */
var ui = {};
/*--------------------------------------------------------------------------*/
// expose Lo-Dash build file path
ui.buildPath = (function() {
switch (build) {
case 'lodash-prod': return 'lodash.min.js';
case 'lodash-underscore': return 'lodash.underscore.min.js';
case 'lodash-custom': return 'lodash.custom.min.js';
case 'lodash-custom-debug': return 'lodash.custom.js';
}
return 'lodash.js';
}());
// assign `QUnit.urlParams` properties
QUnit.extend(QUnit.urlParams, {
'build': build,
'norequire': norequire
});
// initialize controls
addEvent(window, 'load', function() {
function eventHandler(event) {
var search = location.search.replace(/^\?|&?(?:build|norequire)=[^&]*&?/g, '');
if (event.stopPropagation) {
event.stopPropagation();
} else {
event.cancelBubble = true;
}
location.href =
location.href.split('?')[0] + '?' +
(search ? search + '&' : '') +
'build=' + buildList[buildList.selectedIndex].value +
(checkbox.checked ? '&norequire=true' : '');
}
function init() {
var toolbar = document.getElementById('qunit-testrunner-toolbar');
if (toolbar) {
toolbar.appendChild(span1);
toolbar.appendChild(span2);
buildList.selectedIndex = (function() {
switch (build) {
case 'lodash-prod': return 1;
case 'lodash-underscore': return 2;
case 'lodash-custom': return 3;
case 'lodash-custom-debug': return 4;
}
return 0;
}());
checkbox.checked = norequire;
addEvent(checkbox, 'click', eventHandler);
addEvent(buildList, 'change', eventHandler);
}
else {
setTimeout(init, 15);
}
}
var span1 = document.createElement('span');
span1.innerHTML =
'<input id="qunit-norequire" type="checkbox">' +
'<label for="qunit-norequire">No RequireJS</label>';
var span2 = document.createElement('span');
span2.style.cssText = 'float:right';
span2.innerHTML =
'<label for="qunit-build">Build: </label>' +
'<select id="qunit-build">' +
'<option value="lodash-dev">Developement</option>' +
'<option value="lodash-prod">Production</option>' +
'<option value="lodash-underscore">Underscore</option>' +
'<option value="lodash-custom">Custom</option>' +
'<option value="lodash-custom-debug">Custom (debug)</option>' +
'</select>';
var checkbox = span1.firstChild,
buildList = span2.lastChild;
init();
});
// expose `ui`
window.ui = ui;
}(this));

File diff suppressed because it is too large Load Diff

View File

@@ -19,81 +19,182 @@
</div>
<img id="chart_image" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==">
</div>
<script src="../vendor/qunit/qunit/qunit.js"></script>
<script src="../vendor/qunit-extras/qunit-extras.js"></script>
<script src="../vendor/jquery/jquery.js"></script>
<script src="../vendor/platform.js/platform.js"></script>
<script src="./asset/test-ui.js"></script>
<script>
// avoid syntax errors for `QUnit.throws` in older Firefoxes
document.write(platform.name == 'Firefox' && /^1\b/.test(platform.version)
? '<script src="../vendor/qunit/qunit/qunit-1.8.0.js"><\/script>'
: '<script src="../vendor/qunit/qunit/qunit.js"><\/script>'
QUnit.config.asyncRetries = 10;
QUnit.config.hidepassed = true;
// excuse tests we intentionally fail or those with problems
QUnit.config.excused = {
'Arrays': {
'union': [
'[null,1,2,3]'
]
},
'Chaining': {
'select/reject/sortBy': [
'Died on test #1'
],
'select/reject/sortBy in functional style': [
'Died on test #1'
],
'reverse/concat/unshift/pop/map': [
'"34, 10, 8, 6, 4, 2, 10, 10"'
]
},
'Collections': {
'reduce': [
'handles a null (without initial value) properly',
'throws an error for empty arrays with no initial value'
],
'reduceRight': [
'handles a null (without initial value) properly',
'throws an error for empty arrays with no initial value'
],
'where': [
'Only get the first object matched.'
]
},
'Functions': {
'bind': [
'can bind without specifying a context',
'Died on test #2'
],
'bindAll': [
'throws an error for bindAll with no functions named'
],
'throttle repeatedly with results': true,
'more throttle does not trigger leading call when leading is set to false': true,
'throttle does not trigger trailing call when trailing is set to false': true,
'debounce asap': true
},
'Objects': {
'isEqual': [
'Died on test #60',
'Died on test #63'
],
'keys': [
'throws an error for `null` values',
'throws an error for `undefined` values',
'throws an error for number primitives',
'throws an error for string primitives',
'throws an error for boolean primitives'
]
},
'Utility': {
'_.escape': [
'"&lt;a href=&quot;http://moe.com&quot;&gt;Curly &amp; Moe&#x27;s&lt;/a&gt;"'
],
'_.unescape': [
'"<a href=\\"http://moe.com\\">Curly & Moe&#039;s</a>"'
],
'times': [
'Died on test #1'
],
'uniqueId': [
'Died on test #1'
]
}
};
// only excuse in Sauce Labs (buggy Safari and timers)
if (location.port != '9001') {
delete QUnit.config.excused.Chaining['select/reject/sortBy'];
delete QUnit.config.excused.Chaining['select/reject/sortBy in functional style'];
delete QUnit.config.excused.Functions['throttle repeatedly with results'];
delete QUnit.config.excused.Functions['more throttle does not trigger leading call when leading is set to false'];
delete QUnit.config.excused.Functions['throttle does not trigger trailing call when trailing is set to false'];
delete QUnit.config.excused.Functions['debounce asap'];
delete QUnit.config.excused.Objects.isEqual;
delete QUnit.config.excused.Utility.times;
delete QUnit.config.excused.Utility.uniqueId;
}
// only excuse in non-Underscore builds
if (/\bunderscore\b/i.test(ui.buildPath)) {
delete QUnit.config.excused.Chaining;
delete QUnit.config.excused.Collections.where;
delete QUnit.config.excused.Utility['_.escape'];
delete QUnit.config.excused.Utility['_.unescape'];
}
// assign results to `global_test_results` for Sauce Labs
var global_test_results;
QUnit.done(function(results) {
global_test_results = results;
});
// load Lo-Dash and test scripts
document.write(ui.urlParams.loader != 'none'
? '<script data-dojo-config="async:1" src="' + ui.loaderPath + '"><\/script>'
: ([
'<script src="' + ui.buildPath + '"><\/script>',
'<script src="../vendor/underscore/test/collections.js"><\/script>',
'<script src="../vendor/underscore/test/arrays.js"><\/script>',
'<script src="../vendor/underscore/test/functions.js"><\/script>',
'<script src="../vendor/underscore/test/objects.js"><\/script>',
'<script src="../vendor/underscore/test/utility.js"><\/script>',
'<script src="../vendor/underscore/test/chaining.js"><\/script>'
].join('\n'))
);
</script>
<script src="test-ui.js"></script>
<script>
document.write('<script src="../' + ui.buildPath + '"><\/script>');
</script>
<script>
(function() {
var arrayProto = Array.prototype,
concat = arrayProto.concat,
pop = arrayProto.pop,
push = arrayProto.push,
slice = arrayProto.slice;
if (_.chain) {
if (window.curl) {
curl.config({ 'apiName': 'require' });
}
if (!window.require) {
return;
}
_.mixin = function(object) {
_.forEach(_.functions(object), function(methodName) {
var func = _[methodName] = object[methodName];
_.prototype[methodName] = function() {
var args = [this.__wrapped__];
push.apply(args, arguments);
var reBasename = /[\w.-]+$/,
basePath = ('//' + location.host + location.pathname).replace(/\btest\/$/, ''),
modulePath = ui.buildPath.replace(/\.js$/, ''),
locationPath = modulePath.replace(reBasename, ''),
moduleMain = modulePath.match(reBasename)[0];
var result = func.apply(_, args);
if (this.__chain__) {
result = new _(result);
result.__chain__ = true;
QUnit.config.autostart = false;
// load Lo-Dash as a module
require({
'baseUrl': './',
'urlArgs': 't=' + (+new Date),
'packages': [
{
'name': 'lodash',
'location': locationPath,
'main': moduleMain
},
{
'name': 'test',
'location': '../vendor/underscore/test',
'config': {
// work around no global being exported
'exports': 'QUnit',
'loader': 'curl/loader/legacy'
}
return result;
};
});
};
_.mixin(_);
_.chain = function(value) {
value = new _(value);
value.__chain__ = true;
return value;
};
_.prototype.chain = function() {
this.__chain__ = true;
return this;
};
_.prototype.concat = function() {
var result = concat.apply(this.__wrapped__, arguments);
if (this.__chain__) {
result = new _(result);
result.__chain__ = true;
}
]
},
['lodash'], function(lodash) {
if (ui.isModularize) {
window._ = lodash;
}
return result;
};
_.prototype.pop = function() {
pop.apply(this.__wrapped__, arguments);
return this;
};
require([
'test/collections',
'test/arrays',
'test/functions',
'test/objects',
'test/utility',
'test/chaining'
], function() {
QUnit.start();
});
});
}());
</script>
<script src="../vendor/underscore/test/collections.js"></script>
<script src="../vendor/underscore/test/arrays.js"></script>
<script src="../vendor/underscore/test/functions.js"></script>
<script src="../vendor/underscore/test/objects.js"></script>
<script src="../vendor/underscore/test/utility.js"></script>
<script src="../vendor/underscore/test/chaining.js"></script>
<script type="text/html" id="template">
<%
// a comment

View File

@@ -1,4 +1,4 @@
Copyright (c) 2010-2012 Jeremy Ashkenas, DocumentCloud
Copyright (c) 2010-2013 Jeremy Ashkenas, DocumentCloud
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
@@ -19,4 +19,4 @@ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -1,26 +0,0 @@
____ __ __
/\ _`\ /\ \ /\ \ __
\ \ \ \ \ __ ___\ \ \/'\\ \ \____ ___ ___ __ /\_\ ____
\ \ _ <' /'__`\ /'___\ \ , < \ \ '__`\ / __`\ /' _ `\ /'__`\ \/\ \ /',__\
\ \ \ \ \/\ \ \.\_/\ \__/\ \ \\`\\ \ \ \ \/\ \ \ \/\ \/\ \/\ __/ __ \ \ \/\__, `\
\ \____/\ \__/.\_\ \____\\ \_\ \_\ \_,__/\ \____/\ \_\ \_\ \____\/\_\_\ \ \/\____/
\/___/ \/__/\/_/\/____/ \/_/\/_/\/___/ \/___/ \/_/\/_/\/____/\/_/\ \_\ \/___/
\ \____/
\/___/
(_'_______________________________________________________________________________'_)
(_.———————————————————————————————————————————————————————————————————————————————._)
Backbone supplies structure to JavaScript-heavy applications by providing models key-value binding and custom events, collections with a rich API of enumerable functions, views with declarative event handling, and connects it all to your existing application over a RESTful JSON interface.
For Docs, License, Tests, pre-packed downloads, and everything else, really, see:
http://backbonejs.org
To suggest a feature, report a bug, or general discussion:
http://github.com/documentcloud/backbone/issues/
All contributors are listed here:
http://github.com/documentcloud/backbone/contributors
Special thanks to Robert Kieffer for the original philosophy behind Backbone.
http://github.com/broofa

File diff suppressed because it is too large Load Diff

View File

@@ -1,12 +1,10 @@
$(document).ready(function() {
(function() {
var a, b, c, d, e, col, otherCol;
module("Backbone.Collection", _.extend(new Environment, {
module("Backbone.Collection", {
setup: function() {
Environment.prototype.setup.apply(this, arguments);
a = new Backbone.Model({id: 3, label: 'a'});
b = new Backbone.Model({id: 2, label: 'b'});
c = new Backbone.Model({id: 1, label: 'c'});
@@ -16,7 +14,7 @@ $(document).ready(function() {
otherCol = new Backbone.Collection();
}
}));
});
test("new and sort", 9, function() {
var counter = 0;
@@ -62,25 +60,32 @@ $(document).ready(function() {
strictEqual(collection.last().get('a'), 4);
});
test("get", 3, function() {
test("get", 6, function() {
equal(col.get(0), d);
equal(col.get(d.clone()), d);
equal(col.get(2), b);
equal(col.get({id: 1}), c);
equal(col.get(c.clone()), c);
equal(col.get(col.first().cid), col.first());
});
test("get with non-default ids", 2, function() {
test("get with non-default ids", 5, function() {
var col = new Backbone.Collection();
var MongoModel = Backbone.Model.extend({
idAttribute: '_id'
});
var MongoModel = Backbone.Model.extend({idAttribute: '_id'});
var model = new MongoModel({_id: 100});
col.push(model);
col.add(model);
equal(col.get(100), model);
model.set({_id: 101});
equal(col.get(101), model);
equal(col.get(model.cid), model);
equal(col.get(model), model);
equal(col.get(101), void 0);
var col2 = new Backbone.Collection();
col2.model = MongoModel;
col2.add(model.attributes);
equal(col2.get(model.clone()), col2.first());
});
test("update index when id changes", 3, function() {
test("update index when id changes", 4, function() {
var col = new Backbone.Collection();
col.add([
{id : 0, name : 'one'},
@@ -88,9 +93,10 @@ $(document).ready(function() {
]);
var one = col.get(0);
equal(one.get('name'), 'one');
one.set({id : 101});
col.on('change:name', function (model) { ok(this.get(model)); });
one.set({name: 'dalmatians', id : 101});
equal(col.get(0), null);
equal(col.get(101).get('name'), 'one');
equal(col.get(101).get('name'), 'dalmatians');
});
test("at", 1, function() {
@@ -218,6 +224,19 @@ $(document).ready(function() {
equal(col.at(0).get('value'), 2);
});
test("add with parse and merge", function() {
var collection = new Backbone.Collection();
collection.parse = function(attrs) {
return _.map(attrs, function(model) {
if (model.model) return model.model;
return model;
});
};
collection.add({id: 1});
collection.add({model: {id: 1, name: 'Alf'}}, {parse: true, merge: true});
equal(collection.first().get('name'), 'Alf');
});
test("add model to collection with sort()-style comparator", 3, function() {
var col = new Backbone.Collection;
col.comparator = function(a, b) {
@@ -268,6 +287,39 @@ $(document).ready(function() {
equal(otherRemoved, null);
});
test("add and remove return values", 13, function() {
var Even = Backbone.Model.extend({
validate: function(attrs) {
if (attrs.id % 2 !== 0) return "odd";
}
});
var col = new Backbone.Collection;
col.model = Even;
var list = col.add([{id: 2}, {id: 4}], {validate: true});
equal(list.length, 2);
ok(list[0] instanceof Backbone.Model);
equal(list[1], col.last());
equal(list[1].get('id'), 4);
list = col.add([{id: 3}, {id: 6}], {validate: true});
equal(col.length, 3);
equal(list[0], false);
equal(list[1].get('id'), 6);
var result = col.add({id: 6});
equal(result.cid, list[1].cid);
result = col.remove({id: 6});
equal(col.length, 2);
equal(result.id, 6);
list = col.remove([{id: 2}, {id: 8}]);
equal(col.length, 1);
equal(list[0].get('id'), 2);
equal(list[1], null);
});
test("shift and pop", 2, function() {
var col = new Backbone.Collection([{a: 'a'}, {b: 'b'}, {c: 'c'}]);
equal(col.shift().get('a'), 'a');
@@ -354,7 +406,7 @@ $(document).ready(function() {
test("model destroy removes from all collections", 3, function() {
var e = new Backbone.Model({id: 5, title: 'Othello'});
e.sync = function(method, model, options) { options.success({}); };
e.sync = function(method, model, options) { options.success(); };
var colE = new Backbone.Collection([e]);
var colF = new Backbone.Collection([e]);
e.destroy();
@@ -386,6 +438,15 @@ $(document).ready(function() {
equal(this.syncArgs.options.parse, false);
});
test("fetch with an error response triggers an error event", 1, function () {
var collection = new Backbone.Collection();
collection.on('error', function () {
ok(true);
});
collection.sync = function (method, model, options) { options.error(); };
collection.fetch();
});
test("ensure fetch only parses once", 1, function() {
var collection = new Backbone.Collection;
var counter = 0;
@@ -395,7 +456,7 @@ $(document).ready(function() {
};
collection.url = '/test';
collection.fetch();
this.syncArgs.options.success([]);
this.syncArgs.options.success();
equal(counter, 1);
});
@@ -409,7 +470,7 @@ $(document).ready(function() {
equal(model.collection, collection);
});
test("create enforces validation", 1, function() {
test("create with validate:true enforces validation", 3, function() {
var ValidatingModel = Backbone.Model.extend({
validate: function(attrs) {
return "fail";
@@ -419,10 +480,14 @@ $(document).ready(function() {
model: ValidatingModel
});
var col = new ValidatingCollection();
equal(col.create({"foo":"bar"}), false);
col.on('invalid', function (collection, error, options) {
equal(error, "fail");
equal(options.validationError, 'fail');
});
equal(col.create({"foo":"bar"}, {validate:true}), false);
});
test("a failing create runs the error callback", 1, function() {
test("a failing create returns model with errors", function() {
var ValidatingModel = Backbone.Model.extend({
validate: function(attrs) {
return "fail";
@@ -431,11 +496,10 @@ $(document).ready(function() {
var ValidatingCollection = Backbone.Collection.extend({
model: ValidatingModel
});
var flag = false;
var callback = function(model, error) { flag = true; };
var col = new ValidatingCollection();
col.create({"foo":"bar"}, { error: callback });
equal(flag, true);
var m = col.create({"foo":"bar"});
equal(m.validationError, 'fail');
equal(col.length, 1);
});
test("initialize", 1, function() {
@@ -452,9 +516,10 @@ $(document).ready(function() {
equal(JSON.stringify(col), '[{"id":3,"label":"a"},{"id":2,"label":"b"},{"id":1,"label":"c"},{"id":0,"label":"d"}]');
});
test("where", 6, function() {
test("where and findWhere", 8, function() {
var model = new Backbone.Model({a: 1});
var coll = new Backbone.Collection([
{a: 1},
model,
{a: 1},
{a: 1, b: 2},
{a: 2, b: 2},
@@ -466,19 +531,21 @@ $(document).ready(function() {
equal(coll.where({b: 1}).length, 0);
equal(coll.where({b: 2}).length, 2);
equal(coll.where({a: 1, b: 2}).length, 1);
equal(coll.findWhere({a: 1}), model);
equal(coll.findWhere({a: 4}), void 0);
});
test("Underscore methods", 13, function() {
test("Underscore methods", 14, function() {
equal(col.map(function(model){ return model.get('label'); }).join(' '), 'a b c d');
equal(col.any(function(model){ return model.id === 100; }), false);
equal(col.any(function(model){ return model.id === 0; }), true);
equal(col.indexOf(b), 1);
equal(col.size(), 4);
equal(col.rest().length, 3);
ok(!_.include(col.rest()), a);
ok(!_.include(col.rest()), d);
ok(!_.include(col.rest(), a));
ok(_.include(col.rest(), d));
ok(!col.isEmpty());
ok(!_.include(col.without(d)), d);
ok(!_.include(col.without(d), d));
equal(col.max(function(model){ return model.id; }).id, 3);
equal(col.min(function(model){ return model.id; }).id, 0);
deepEqual(col.chain()
@@ -486,9 +553,10 @@ $(document).ready(function() {
.map(function(o){ return o.id * 2; })
.value(),
[4, 0]);
deepEqual(col.difference([c, d]), [a, b]);
});
test("reset", 10, function() {
test("reset", 12, function() {
var resetCount = 0;
var models = col.models;
col.on('reset', function() { resetCount += 1; });
@@ -505,6 +573,22 @@ $(document).ready(function() {
equal(col.length, 4);
ok(col.last() !== d);
ok(_.isEqual(col.last().attributes, d.attributes));
col.reset();
equal(col.length, 0);
equal(resetCount, 4);
});
test ("reset with different values", function(){
var col = new Backbone.Collection({id: 1});
col.reset({id: 1, a: 1});
equal(col.get(1).get('a'), 1);
});
test("same references in reset", function() {
var model = new Backbone.Model({id: 1});
var collection = new Backbone.Collection({id: 1});
collection.reset(model);
equal(collection.get(1), model);
});
test("reset passes caller options", 3, function() {
@@ -559,7 +643,7 @@ $(document).ready(function() {
equal(col.length, 0);
});
test("#861, adding models to a collection which do not pass validation", function() {
test("#861, adding models to a collection which do not pass validation, with validate:true", function() {
var Model = Backbone.Model.extend({
validate: function(attrs) {
if (attrs.id == 3) return "id can't be 3";
@@ -573,18 +657,18 @@ $(document).ready(function() {
var collection = new Collection;
collection.on("error", function() { ok(true); });
collection.add([{id: 1}, {id: 2}, {id: 3}, {id: 4}, {id: 5}, {id: 6}]);
collection.add([{id: 1}, {id: 2}, {id: 3}, {id: 4}, {id: 5}, {id: 6}], {validate:true});
deepEqual(collection.pluck('id'), [1, 2, 4, 5, 6]);
});
test("Invalid models are discarded.", 5, function() {
test("Invalid models are discarded with validate:true.", 5, function() {
var collection = new Backbone.Collection;
collection.on('test', function() { ok(true); });
collection.model = Backbone.Model.extend({
validate: function(attrs){ if (!attrs.valid) return 'invalid'; }
});
var model = new collection.model({id: 1, valid: true});
collection.add([model, {id: 2}]);
collection.add([model, {id: 2}], {validate:true});
model.trigger('test');
ok(collection.get(model.cid));
ok(collection.get(1));
@@ -648,19 +732,34 @@ $(document).ready(function() {
}
};
col.sync = m.sync = function( method, collection, options ){
options.success();
options.success(collection, [], options);
};
col.fetch(opts);
col.create(m, opts);
});
test("#1412 - Trigger 'sync' event.", 2, function() {
test("#1412 - Trigger 'request' and 'sync' events.", 4, function() {
var collection = new Backbone.Collection;
collection.url = '/test';
collection.on('sync', function() { ok(true); });
Backbone.ajax = function(settings){ settings.success(); };
collection.on('request', function(obj, xhr, options) {
ok(obj === collection, "collection has correct 'request' event after fetching");
});
collection.on('sync', function(obj, response, options) {
ok(obj === collection, "collection has correct 'sync' event after fetching");
});
collection.fetch();
collection.off();
collection.on('request', function(obj, xhr, options) {
ok(obj === collection.get(1), "collection has correct 'request' event after one of its models save");
});
collection.on('sync', function(obj, response, options) {
ok(obj === collection.get(1), "collection has correct 'sync' event after one of its models save");
});
collection.create({id: 1});
collection.off();
});
test("#1447 - create with wait adds model.", 1, function() {
@@ -796,7 +895,7 @@ $(document).ready(function() {
collection.reset([]);
});
test("update", function() {
test("set", function() {
var m1 = new Backbone.Model();
var m2 = new Backbone.Model({id: 2});
var m3 = new Backbone.Model();
@@ -814,24 +913,24 @@ $(document).ready(function() {
});
// remove: false doesn't remove any models
c.update([], {remove: false});
c.set([], {remove: false});
strictEqual(c.length, 2);
// add: false doesn't add any models
c.update([m1, m2, m3], {add: false});
c.set([m1, m2, m3], {add: false});
strictEqual(c.length, 2);
// merge: false doesn't change any models
c.update([m1, {id: 2, a: 1}], {merge: false});
c.set([m1, {id: 2, a: 1}], {merge: false});
strictEqual(m2.get('a'), void 0);
// add: false, remove: false only merges existing models
c.update([m1, {id: 2, a: 0}, m3, {id: 4}], {add: false, remove: false});
c.set([m1, {id: 2, a: 0}, m3, {id: 4}], {add: false, remove: false});
strictEqual(c.length, 2);
strictEqual(m2.get('a'), 0);
// default options add/remove/merge as appropriate
c.update([{id: 2, a: 1}, m3]);
c.set([{id: 2, a: 1}, m3]);
strictEqual(c.length, 2);
strictEqual(m2.get('a'), 1);
@@ -839,23 +938,37 @@ $(document).ready(function() {
c.off('remove').on('remove', function(model) {
ok(model === m2 || model === m3);
});
c.update([]);
c.set([]);
strictEqual(c.length, 0);
});
test("update with only cids", 3, function() {
test("set with many models does not overflow the stack", function() {
var n = 150000;
var collection = new Backbone.Collection();
var models = [];
for (var i = 0; i < n; i++) {
models.push({id: i});
}
collection.set(models);
equal(collection.length, n);
collection.reset();
collection.set(models, {at: 0});
equal(collection.length, n);
});
test("set with only cids", 3, function() {
var m1 = new Backbone.Model;
var m2 = new Backbone.Model;
var c = new Backbone.Collection;
c.update([m1, m2]);
c.set([m1, m2]);
equal(c.length, 2);
c.update([m1]);
c.set([m1]);
equal(c.length, 1);
c.update([m1, m1, m1, m2, m2], {remove: false});
c.set([m1, m1, m1, m2, m2], {remove: false});
equal(c.length, 2);
});
test("update with only idAttribute", 3, function() {
test("set with only idAttribute", 3, function() {
var m1 = { _id: 1 };
var m2 = { _id: 2 };
var col = Backbone.Collection.extend({
@@ -864,14 +977,96 @@ $(document).ready(function() {
})
});
var c = new col;
c.update([m1, m2]);
c.set([m1, m2]);
equal(c.length, 2);
c.update([m1]);
c.set([m1]);
equal(c.length, 1);
c.update([m1, m1, m1, m2, m2], {remove: false});
c.set([m1, m1, m1, m2, m2], {remove: false});
equal(c.length, 2);
});
test("set + merge with default values defined", function() {
var Model = Backbone.Model.extend({
defaults: {
key: 'value'
}
});
var m = new Model({id: 1});
var col = new Backbone.Collection([m], {model: Model});
equal(col.first().get('key'), 'value');
col.set({id: 1, key: 'other'});
equal(col.first().get('key'), 'other');
col.set({id: 1, other: 'value'});
equal(col.first().get('key'), 'other');
equal(col.length, 1);
});
test('merge without mutation', function () {
var Model = Backbone.Model.extend({
initialize: function (attrs, options) {
if (attrs.child) {
this.set('child', new Model(attrs.child, options), options);
}
}
});
var Collection = Backbone.Collection.extend({model: Model});
var data = [{id: 1, child: {id: 2}}];
var collection = new Collection(data);
equal(collection.first().id, 1);
collection.set(data);
equal(collection.first().id, 1);
collection.set([{id: 2, child: {id: 2}}].concat(data));
deepEqual(collection.pluck('id'), [2, 1]);
});
test("`set` and model level `parse`", function() {
var Model = Backbone.Model.extend({});
var Collection = Backbone.Collection.extend({
model: Model,
parse: function (res) { return _.pluck(res.models, 'model'); }
});
var model = new Model({id: 1});
var collection = new Collection(model);
collection.set({models: [
{model: {id: 1}},
{model: {id: 2}}
]}, {parse: true});
equal(collection.first(), model);
});
test("`set` data is only parsed once", function() {
var collection = new Backbone.Collection();
collection.model = Backbone.Model.extend({
parse: function (data) {
equal(data.parsed, void 0);
data.parsed = true;
return data;
}
});
collection.set({}, {parse: true});
});
test('`set` matches input order in the absence of a comparator', function () {
var one = new Backbone.Model({id: 1});
var two = new Backbone.Model({id: 2});
var three = new Backbone.Model({id: 3});
var collection = new Backbone.Collection([one, two, three]);
collection.set([{id: 3}, {id: 2}, {id: 1}]);
deepEqual(collection.models, [three, two, one]);
collection.set([{id: 1}, {id: 2}]);
deepEqual(collection.models, [one, two]);
collection.set([two, three, one]);
deepEqual(collection.models, [two, three, one]);
collection.set([{id: 1}, {id: 2}], {remove: false});
deepEqual(collection.models, [two, three, one]);
collection.set([{id: 1}, {id: 2}, {id: 3}], {merge: false});
deepEqual(collection.models, [one, two, three]);
collection.set([three, two, one, {id: 4}], {add: false});
deepEqual(collection.models, [one, two, three]);
});
test("#1894 - Push should not trigger a sort", 0, function() {
var Collection = Backbone.Collection.extend({
comparator: 'id',
@@ -882,14 +1077,21 @@ $(document).ready(function() {
new Collection().push({id: 1});
});
// test("`update` with non-normal id", function() {
// var Collection = Backbone.Collection.extend({
// model: Backbone.Model.extend({idAttribute: '_id'})
// });
// var collection = new Collection({_id: 1});
// collection.update([{_id: 1, a: 1}], {add: false});
// equal(collection.first().get('a'), 1);
// });
test("#2428 - push duplicate models, return the correct one", 1, function() {
var col = new Backbone.Collection;
var model1 = col.push({id: 101});
var model2 = col.push({id: 101})
ok(model2.cid == model1.cid);
});
test("`set` with non-normal id", function() {
var Collection = Backbone.Collection.extend({
model: Backbone.Model.extend({idAttribute: '_id'})
});
var collection = new Collection({_id: 1});
collection.set([{_id: 1, a: 1}], {add: false});
equal(collection.first().get('a'), 1);
});
test("#1894 - `sort` can optionally be turned off", 0, function() {
var Collection = Backbone.Collection.extend({
@@ -899,15 +1101,177 @@ $(document).ready(function() {
new Collection().add({id: 1}, {sort: false});
});
test("#1915 - `parse` data in the right order in `update`", function() {
test("#1915 - `parse` data in the right order in `set`", function() {
var collection = new (Backbone.Collection.extend({
parse: function (data) {
strictEqual(data.status, 'ok');
return data.data;
}
}));
var res = {status: 'ok', data:[{id: 1}]}
collection.update(res, {parse: true});
var res = {status: 'ok', data:[{id: 1}]};
collection.set(res, {parse: true});
});
});
asyncTest("#1939 - `parse` is passed `options`", 1, function () {
var collection = new (Backbone.Collection.extend({
url: '/',
parse: function (data, options) {
strictEqual(options.xhr.someHeader, 'headerValue');
return data;
}
}));
var ajax = Backbone.ajax;
Backbone.ajax = function (params) {
_.defer(params.success);
return {someHeader: 'headerValue'};
};
collection.fetch({
success: function () { start(); }
});
Backbone.ajax = ajax;
});
test("`add` only `sort`s when necessary", 2, function () {
var collection = new (Backbone.Collection.extend({
comparator: 'a'
}))([{id: 1}, {id: 2}, {id: 3}]);
collection.on('sort', function () { ok(true); });
collection.add({id: 4}); // do sort, new model
collection.add({id: 1, a: 1}, {merge: true}); // do sort, comparator change
collection.add({id: 1, b: 1}, {merge: true}); // don't sort, no comparator change
collection.add({id: 1, a: 1}, {merge: true}); // don't sort, no comparator change
collection.add(collection.models); // don't sort, nothing new
collection.add(collection.models, {merge: true}); // don't sort
});
test("`add` only `sort`s when necessary with comparator function", 3, function () {
var collection = new (Backbone.Collection.extend({
comparator: function(a, b) {
return a.get('a') > b.get('a') ? 1 : (a.get('a') < b.get('a') ? -1 : 0);
}
}))([{id: 1}, {id: 2}, {id: 3}]);
collection.on('sort', function () { ok(true); });
collection.add({id: 4}); // do sort, new model
collection.add({id: 1, a: 1}, {merge: true}); // do sort, model change
collection.add({id: 1, b: 1}, {merge: true}); // do sort, model change
collection.add({id: 1, a: 1}, {merge: true}); // don't sort, no model change
collection.add(collection.models); // don't sort, nothing new
collection.add(collection.models, {merge: true}); // don't sort
});
test("Attach options to collection.", 2, function() {
var model = new Backbone.Model;
var comparator = function(){};
var collection = new Backbone.Collection([], {
model: model,
comparator: comparator
});
ok(collection.model === model);
ok(collection.comparator === comparator);
});
test("`add` overrides `set` flags", function () {
var collection = new Backbone.Collection();
collection.once('add', function (model, collection, options) {
collection.add({id: 2}, options);
});
collection.set({id: 1});
equal(collection.length, 2);
});
test("#2606 - Collection#create, success arguments", 1, function() {
var collection = new Backbone.Collection;
collection.url = 'test';
collection.create({}, {
success: function(model, resp, options) {
strictEqual(resp, 'response');
}
});
this.ajaxSettings.success('response');
});
test("#2612 - nested `parse` works with `Collection#set`", function() {
var Job = Backbone.Model.extend({
constructor: function() {
this.items = new Items();
Backbone.Model.apply(this, arguments);
},
parse: function(attrs) {
this.items.set(attrs.items, {parse: true});
return _.omit(attrs, 'items');
}
});
var Item = Backbone.Model.extend({
constructor: function() {
this.subItems = new Backbone.Collection();
Backbone.Model.apply(this, arguments);
},
parse: function(attrs) {
this.subItems.set(attrs.subItems, {parse: true});
return _.omit(attrs, 'subItems');
}
});
var Items = Backbone.Collection.extend({
model: Item
});
var data = {
name: 'JobName',
id: 1,
items: [{
id: 1,
name: 'Sub1',
subItems: [
{id: 1, subName: 'One'},
{id: 2, subName: 'Two'}
]
}, {
id: 2,
name: 'Sub2',
subItems: [
{id: 3, subName: 'Three'},
{id: 4, subName: 'Four'}
]
}]
};
var newData = {
name: 'NewJobName',
id: 1,
items: [{
id: 1,
name: 'NewSub1',
subItems: [
{id: 1,subName: 'NewOne'},
{id: 2,subName: 'NewTwo'}
]
}, {
id: 2,
name: 'NewSub2',
subItems: [
{id: 3,subName: 'NewThree'},
{id: 4,subName: 'NewFour'}
]
}]
};
var job = new Job(data, {parse: true});
equal(job.get('name'), 'JobName');
equal(job.items.at(0).get('name'), 'Sub1');
equal(job.items.length, 2);
equal(job.items.get(1).subItems.get(1).get('subName'), 'One');
equal(job.items.get(2).subItems.get(3).get('subName'), 'Three');
job.set(job.parse(newData, {parse: true}));
equal(job.get('name'), 'NewJobName');
equal(job.items.at(0).get('name'), 'NewSub1');
equal(job.items.length, 2);
equal(job.items.get(1).subItems.get(1).get('subName'), 'NewOne');
equal(job.items.get(2).subItems.get(3).get('subName'), 'NewThree');
});
})();

View File

@@ -1,45 +1,35 @@
(function() {
var Environment = this.Environment = function(){};
var sync = Backbone.sync;
var ajax = Backbone.ajax;
var emulateHTTP = Backbone.emulateHTTP;
var emulateJSON = Backbone.emulateJSON;
_.extend(Environment.prototype, {
QUnit.testStart(function() {
var env = this.config.current.testEnvironment;
ajax: Backbone.ajax,
// Capture ajax settings for comparison.
Backbone.ajax = function(settings) {
env.ajaxSettings = settings;
};
sync: Backbone.sync,
emulateHTTP: Backbone.emulateHTTP,
emulateJSON: Backbone.emulateJSON,
setup: function() {
var env = this;
// Capture ajax settings for comparison.
Backbone.ajax = function(settings) {
env.ajaxSettings = settings;
// Capture the arguments to Backbone.sync for comparison.
Backbone.sync = function(method, model, options) {
env.syncArgs = {
method: method,
model: model,
options: options
};
// Capture the arguments to Backbone.sync for comparison.
Backbone.sync = function(method, model, options) {
env.syncArgs = {
method: method,
model: model,
options: options
};
env.sync.apply(this, arguments);
};
},
teardown: function() {
this.syncArgs = null;
this.ajaxSettings = null;
Backbone.sync = this.sync;
Backbone.ajax = this.ajax;
Backbone.emulateHTTP = this.emulateHTTP;
Backbone.emulateJSON = this.emulateJSON;
}
sync.apply(this, arguments);
};
});
QUnit.testDone(function() {
Backbone.sync = sync;
Backbone.ajax = ajax;
Backbone.emulateHTTP = emulateHTTP;
Backbone.emulateJSON = emulateJSON;
});
})();

View File

@@ -1,4 +1,4 @@
$(document).ready(function() {
(function() {
module("Backbone.Events");
@@ -76,6 +76,58 @@ $(document).ready(function() {
b.trigger('anything');
});
test("listenTo and stopListening with event maps", 4, function() {
var a = _.extend({}, Backbone.Events);
var b = _.extend({}, Backbone.Events);
var cb = function(){ ok(true); };
a.listenTo(b, {event: cb});
b.trigger('event');
a.listenTo(b, {event2: cb});
b.on('event2', cb);
a.stopListening(b, {event2: cb});
b.trigger('event event2');
a.stopListening();
b.trigger('event event2');
});
test("stopListening with omitted args", 2, function () {
var a = _.extend({}, Backbone.Events);
var b = _.extend({}, Backbone.Events);
var cb = function () { ok(true); };
a.listenTo(b, 'event', cb);
b.on('event', cb);
a.listenTo(b, 'event2', cb);
a.stopListening(null, {event: cb});
b.trigger('event event2');
b.off();
a.listenTo(b, 'event event2', cb);
a.stopListening(null, 'event');
a.stopListening();
b.trigger('event2');
});
test("listenToOnce and stopListening", 1, function() {
var a = _.extend({}, Backbone.Events);
var b = _.extend({}, Backbone.Events);
a.listenToOnce(b, 'all', function() { ok(true); });
b.trigger('anything');
b.trigger('anything');
a.listenToOnce(b, 'all', function() { ok(false); });
a.stopListening();
b.trigger('anything');
});
test("listenTo, listenToOnce and stopListening", 1, function() {
var a = _.extend({}, Backbone.Events);
var b = _.extend({}, Backbone.Events);
a.listenToOnce(b, 'all', function() { ok(true); });
b.trigger('anything');
b.trigger('anything');
a.listenTo(b, 'all', function() { ok(false); });
a.stopListening();
b.trigger('anything');
});
test("listenTo and stopListening with event maps", 1, function() {
var a = _.extend({}, Backbone.Events);
var b = _.extend({}, Backbone.Events);
@@ -86,6 +138,52 @@ $(document).ready(function() {
b.trigger('change');
});
test("listenTo yourself", 1, function(){
var e = _.extend({}, Backbone.Events);
e.listenTo(e, "foo", function(){ ok(true); });
e.trigger("foo");
});
test("listenTo yourself cleans yourself up with stopListening", 1, function(){
var e = _.extend({}, Backbone.Events);
e.listenTo(e, "foo", function(){ ok(true); });
e.trigger("foo");
e.stopListening();
e.trigger("foo");
});
test("stopListening cleans up references", 4, function() {
var a = _.extend({}, Backbone.Events);
var b = _.extend({}, Backbone.Events);
var fn = function() {};
a.listenTo(b, 'all', fn).stopListening();
equal(_.size(a._listeningTo), 0);
a.listenTo(b, 'all', fn).stopListening(b);
equal(_.size(a._listeningTo), 0);
a.listenTo(b, 'all', fn).stopListening(null, 'all');
equal(_.size(a._listeningTo), 0);
a.listenTo(b, 'all', fn).stopListening(null, null, fn);
equal(_.size(a._listeningTo), 0);
});
test("listenTo and stopListening cleaning up references", 2, function() {
var a = _.extend({}, Backbone.Events);
var b = _.extend({}, Backbone.Events);
a.listenTo(b, 'all', function(){ ok(true); });
b.trigger('anything');
a.listenTo(b, 'other', function(){ ok(false); });
a.stopListening(b, 'other');
a.stopListening(b, 'all');
equal(_.keys(a._listeningTo).length, 0);
});
test("listenTo with empty callback doesn't throw an error", 1, function(){
var e = _.extend({}, Backbone.Events);
e.listenTo(e, "foo", null);
e.trigger("foo");
ok(true);
});
test("trigger all for each event", 3, function() {
var a, b, obj = { counter: 0 };
_.extend(obj, Backbone.Events);
@@ -205,6 +303,13 @@ $(document).ready(function() {
_.extend({}, Backbone.Events).on('test').trigger('test');
});
test("if callback is truthy but not a function, `on` should throw an error just like jQuery", 1, function() {
var view = _.extend({}, Backbone.Events).on('test', 'noop');
throws(function() {
view.trigger('test');
});
});
test("remove all events for a specific context", 4, function() {
var obj = _.extend({}, Backbone.Events);
obj.on('x y all', function() { ok(true); });
@@ -223,18 +328,6 @@ $(document).ready(function() {
obj.trigger('x y');
});
test("off is chainable", 3, function() {
var obj = _.extend({}, Backbone.Events);
// With no events
ok(obj.off() === obj);
// When removing all events
obj.on('event', function(){}, obj);
ok(obj.off() === obj);
// When removing some events
obj.on('event', function(){}, obj);
ok(obj.off('event') === obj);
});
test("#1310 - off does not skip consecutive events", 0, function() {
var obj = _.extend({}, Backbone.Events);
obj.on('event', function() { ok(false); }, obj);
@@ -360,4 +453,25 @@ $(document).ready(function() {
Backbone.trigger('all');
});
});
test("once without a callback is a noop", 0, function() {
_.extend({}, Backbone.Events).once('event').trigger('event');
});
test("event functions are chainable", function() {
var obj = _.extend({}, Backbone.Events);
var obj2 = _.extend({}, Backbone.Events);
var fn = function() {};
equal(obj, obj.trigger('noeventssetyet'));
equal(obj, obj.off('noeventssetyet'));
equal(obj, obj.stopListening('noeventssetyet'));
equal(obj, obj.on('a', fn));
equal(obj, obj.once('c', fn));
equal(obj, obj.trigger('a'));
equal(obj, obj.listenTo(obj2, 'a', fn));
equal(obj, obj.listenToOnce(obj2, 'b', fn));
equal(obj, obj.off('a c'));
equal(obj, obj.stopListening(obj2, 'a'));
equal(obj, obj.stopListening());
});
})();

View File

@@ -1,4 +1,4 @@
$(document).ready(function() {
(function() {
var proxy = Backbone.Model.extend();
var klass = Backbone.Collection.extend({
@@ -6,10 +6,9 @@ $(document).ready(function() {
});
var doc, collection;
module("Backbone.Model", _.extend(new Environment, {
module("Backbone.Model", {
setup: function() {
Environment.prototype.setup.apply(this, arguments);
doc = new proxy({
id : '1-the-tempest',
title : "The Tempest",
@@ -20,7 +19,7 @@ $(document).ready(function() {
collection.add(doc);
}
}));
});
test("initialize", 3, function() {
var Model = Backbone.Model.extend({
@@ -46,9 +45,9 @@ $(document).ready(function() {
test("initialize with parsed attributes", 1, function() {
var Model = Backbone.Model.extend({
parse: function(obj) {
obj.value += 1;
return obj;
parse: function(attrs) {
attrs.value += 1;
return attrs;
}
});
var model = new Model({value: 1}, {parse: true});
@@ -69,8 +68,8 @@ $(document).ready(function() {
test("parse can return null", 1, function() {
var Model = Backbone.Model.extend({
parse: function(obj) {
obj.value += 1;
parse: function(attrs) {
attrs.value += 1;
return null;
}
});
@@ -111,6 +110,16 @@ $(document).ready(function() {
equal(model.url(), '/nested/1/collection/2');
});
test("underscore methods", 5, function() {
var model = new Backbone.Model({ 'foo': 'a', 'bar': 'b', 'baz': 'c' });
var model2 = model.clone();
deepEqual(model.keys(), ['foo', 'bar', 'baz']);
deepEqual(model.values(), ['a', 'b', 'c']);
deepEqual(model.invert(), { 'a': 'foo', 'b': 'bar', 'c': 'baz' });
deepEqual(model.pick('foo', 'baz'), {'foo': 'a', 'baz': 'c'});
deepEqual(model.omit('foo', 'bar'), {'baz': 'c'});
});
test("clone", 10, function() {
var a = new Backbone.Model({ 'foo': 1, 'bar': 2, 'baz': 3});
var b = a.clone();
@@ -202,9 +211,9 @@ $(document).ready(function() {
ok(changeCount == 1, "Change count should NOT have incremented.");
a.validate = function(attrs) {
equal(attrs.foo, void 0, "don't ignore values when unsetting");
equal(attrs.foo, void 0, "validate:true passed while unsetting");
};
a.unset('foo');
a.unset('foo', {validate: true});
equal(a.get('foo'), void 0, "Foo should have changed");
delete a.validate;
ok(changeCount == 2, "Change count should have incremented for unset.");
@@ -213,6 +222,24 @@ $(document).ready(function() {
equal(a.id, undefined, "Unsetting the id should remove the id property.");
});
test("#2030 - set with failed validate, followed by another set triggers change", function () {
var attr = 0, main = 0, error = 0;
var Model = Backbone.Model.extend({
validate: function (attr) {
if (attr.x > 1) {
error++;
return "this is an error";
}
}
});
var model = new Model({x:0});
model.on('change:x', function () { attr++; });
model.on('change', function () { main++; });
model.set({x:2}, {validate:true});
model.set({x:1}, {validate:true});
deepEqual([attr, main, error], [1, 1, 1]);
});
test("set triggers changes in the correct order", function() {
var value = null;
var model = new Backbone.Model;
@@ -223,15 +250,16 @@ $(document).ready(function() {
equal(value, 'last');
});
test("set falsy values in the correct order", 1, function() {
test("set falsy values in the correct order", 2, function() {
var model = new Backbone.Model({result: 'result'});
model.on('change', function() {
equal(model.changed.result, false);
equal(model.changed.result, void 0);
equal(model.previous('result'), false);
});
model.set({result: void 0}, {silent: true});
model.set({result: null}, {silent: true});
model.set({result: false}, {silent: true});
model.change();
model.set({result: void 0});
});
test("multiple unsets", 1, function() {
@@ -245,14 +273,12 @@ $(document).ready(function() {
equal(i, 2, 'Unset does not fire an event for missing attributes.');
});
test("unset and changedAttributes", 2, function() {
test("unset and changedAttributes", 1, function() {
var model = new Backbone.Model({a: 1});
model.unset('a', {silent: true});
var changedAttributes = model.changedAttributes();
ok('a' in changedAttributes, 'changedAttributes should contain unset properties');
changedAttributes = model.changedAttributes();
ok('a' in changedAttributes, 'changedAttributes should contain unset properties when running changedAttributes again after an unset.');
model.on('change', function() {
ok('a' in model.changedAttributes(), 'changedAttributes should contain unset properties');
});
model.unset('a');
});
test("using a non-default id attribute.", 5, function() {
@@ -272,6 +298,21 @@ $(document).ready(function() {
equal(model.get('name'), '');
});
test("setting an object", 1, function() {
var model = new Backbone.Model({
custom: { foo: 1 }
});
model.on('change', function() {
ok(1);
});
model.set({
custom: { foo: 1 } // no change should be fired
});
model.set({
custom: { foo: 2 } // change event should be fired
});
});
test("clear", 3, function() {
var changed;
var model = new Backbone.Model({id: 1, name : "Model"});
@@ -292,7 +333,7 @@ $(document).ready(function() {
"two": 2
}
});
var model = new Defaulted({two: null});
var model = new Defaulted({two: undefined});
equal(model.get('one'), 1);
equal(model.get('two'), 2);
Defaulted = Backbone.Model.extend({
@@ -303,14 +344,14 @@ $(document).ready(function() {
};
}
});
model = new Defaulted({two: null});
model = new Defaulted({two: undefined});
equal(model.get('one'), 3);
equal(model.get('two'), 4);
});
test("change, hasChanged, changedAttributes, previous, previousAttributes", 12, function() {
var model = new Backbone.Model({name : "Tim", age : 10});
equal(model.changedAttributes(), false);
test("change, hasChanged, changedAttributes, previous, previousAttributes", 9, function() {
var model = new Backbone.Model({name: "Tim", age: 10});
deepEqual(model.changedAttributes(), false);
model.on('change', function() {
ok(model.hasChanged('name'), 'name changed');
ok(!model.hasChanged('age'), 'age did not');
@@ -320,17 +361,13 @@ $(document).ready(function() {
});
equal(model.hasChanged(), false);
equal(model.hasChanged(undefined), false);
model.set({name : 'Rob'}, {silent : true});
equal(model.hasChanged(), true);
equal(model.hasChanged(undefined), true);
equal(model.hasChanged('name'), true);
model.change();
model.set({name : 'Rob'});
equal(model.get('name'), 'Rob');
});
test("changedAttributes", 3, function() {
var model = new Backbone.Model({a: 'a', b: 'b'});
equal(model.changedAttributes(), false);
deepEqual(model.changedAttributes(), false);
equal(model.changedAttributes({a: 'a'}), false);
equal(model.changedAttributes({a: 'b'}).a, 'b');
});
@@ -341,8 +378,7 @@ $(document).ready(function() {
model.on('change', function(model, options) {
value = options.prefix + model.get('name');
});
model.set({name: 'Bob'}, {silent: true});
model.change({prefix: 'Mr. '});
model.set({name: 'Bob'}, {prefix: 'Mr. '});
equal(value, 'Mr. Bob');
model.set({name: 'Sue'}, {prefix: 'Ms. '});
equal(value, 'Ms. Sue');
@@ -368,7 +404,7 @@ $(document).ready(function() {
model.set({lastName: 'Hicks'});
});
test("validate after save", 1, function() {
test("validate after save", 2, function() {
var lastError, model = new Backbone.Model();
model.validate = function(attrs) {
if (attrs.admin) return "Can't change admin status.";
@@ -376,11 +412,13 @@ $(document).ready(function() {
model.sync = function(method, model, options) {
options.success.call(this, {admin: true});
};
model.save(null, {error: function(model, error) {
model.on('invalid', function(model, error) {
lastError = error;
}});
});
model.save(null);
equal(lastError, "Can't change admin status.");
equal(model.validationError, "Can't change admin status.");
});
test("save", 2, function() {
@@ -389,6 +427,19 @@ $(document).ready(function() {
ok(_.isEqual(this.syncArgs.model, doc));
});
test("save, fetch, destroy triggers error event when an error occurs", 3, function () {
var model = new Backbone.Model();
model.on('error', function () {
ok(true);
});
model.sync = function (method, model, options) {
options.error();
};
model.save({data: 2, id: 1});
model.fetch();
model.destroy();
});
test("save with PATCH", function() {
doc.clear().set({id: 1, a: 1, b: 2, c: 3, d: 4});
doc.save();
@@ -412,7 +463,18 @@ $(document).ready(function() {
equal(model.get('title'), 'Twelfth Night');
});
test("save with non-object success response", 2, function () {
var model = new Backbone.Model();
model.sync = function(method, model, options) {
options.success('', options);
options.success(null, options);
};
model.save({testing:'empty'}, {
success: function (model) {
deepEqual(model.attributes, {testing:'empty'});
}
});
});
test("fetch", 2, function() {
doc.fetch();
@@ -442,14 +504,16 @@ $(document).ready(function() {
model.validate = function(attrs) {
if (attrs.admin != this.get('admin')) return "Can't change admin status.";
};
model.on('error', function(model, error) {
model.on('invalid', function(model, error) {
lastError = error;
});
var result = model.set({a: 100});
equal(result, model);
equal(model.get('a'), 100);
equal(lastError, undefined);
result = model.set({a: 200, admin: false});
result = model.set({admin: true});
equal(model.get('admin'), true);
result = model.set({a: 200, admin: false}, {validate:true});
equal(lastError, "Can't change admin status.");
equal(result, false);
equal(model.get('a'), 100);
@@ -467,10 +531,10 @@ $(document).ready(function() {
model.set({name: "Two"});
equal(model.get('name'), 'Two');
equal(error, undefined);
model.unset('name');
model.unset('name', {validate: true});
equal(error, true);
equal(model.get('name'), 'Two');
model.clear();
model.clear({validate:true});
equal(model.get('name'), 'Two');
delete model.validate;
model.clear();
@@ -483,21 +547,18 @@ $(document).ready(function() {
model.validate = function(attrs) {
if (attrs.admin) return "Can't change admin status.";
};
var callback = function(model, error) {
lastError = error;
};
model.on('error', function(model, error) {
model.on('invalid', function(model, error) {
boundError = true;
});
var result = model.set({a: 100}, {error: callback});
var result = model.set({a: 100}, {validate:true});
equal(result, model);
equal(model.get('a'), 100);
equal(lastError, undefined);
equal(model.validationError, null);
equal(boundError, undefined);
result = model.set({a: 200, admin: true}, {error: callback});
result = model.set({a: 200, admin: true}, {validate:true});
equal(result, false);
equal(model.get('a'), 100);
equal(lastError, "Can't change admin status.");
equal(model.validationError, "Can't change admin status.");
equal(boundError, true);
});
@@ -592,6 +653,13 @@ $(document).ready(function() {
ok(model.get('x') === a);
});
test("set same value does not trigger change", 0, function() {
var model = new Backbone.Model({x: 1});
model.on('change change:x', function() { ok(false); });
model.set({x: 1});
model.set({x: 1});
});
test("unset does not fire a change for undefined attributes", 0, function() {
var model = new Backbone.Model({x: undefined});
model.on('change:x', function(){ ok(false); });
@@ -603,19 +671,29 @@ $(document).ready(function() {
ok('x' in model.attributes);
});
test("change fires change:attr", 1, function() {
test("hasChanged works outside of change events, and true within", 6, function() {
var model = new Backbone.Model({x: 1});
model.set({x: 2}, {silent: true});
model.on('change:x', function(){ ok(true); });
model.change();
});
test("hasChanged is false after original values are set", 2, function() {
var model = new Backbone.Model({x: 1});
model.on('change:x', function(){ ok(false); });
model.on('change:x', function() {
ok(model.hasChanged('x'));
equal(model.get('x'), 1);
});
model.set({x: 2}, {silent: true});
ok(model.hasChanged());
model.set({x: 1}, {silent: true});
equal(model.hasChanged('x'), true);
model.set({x: 1});
ok(model.hasChanged());
equal(model.hasChanged('x'), true);
});
test("hasChanged gets cleared on the following set", 4, function() {
var model = new Backbone.Model;
model.set({x: 1});
ok(model.hasChanged());
model.set({x: 1});
ok(!model.hasChanged());
model.set({x: 2});
ok(model.hasChanged());
model.set({});
ok(!model.hasChanged());
});
@@ -626,6 +704,22 @@ $(document).ready(function() {
ok(this.syncArgs.model === model);
});
test("save without `wait` doesn't set invalid attributes", function () {
var model = new Backbone.Model();
model.validate = function () { return 1; }
model.save({a: 1});
equal(model.get('a'), void 0);
});
test("save doesn't validate twice", function () {
var model = new Backbone.Model();
var times = 0;
model.sync = function () {};
model.validate = function () { ++times; }
model.save({});
equal(times, 1);
});
test("`hasChanged` for falsey keys", 2, function() {
var model = new Backbone.Model();
model.set({x: true}, {silent: true});
@@ -678,6 +772,13 @@ $(document).ready(function() {
model.save({x: 1}, {wait: true});
});
test("save turns on parse flag", function () {
var Model = Backbone.Model.extend({
sync: function(method, model, options) { ok(options.parse); }
});
new Model().save();
});
test("nested `set` during `'change:attr'`", 2, function() {
var events = [];
var model = new Backbone.Model();
@@ -691,25 +792,19 @@ $(document).ready(function() {
model.set({x: true});
deepEqual(events, ['change:y', 'change:x', 'change']);
events = [];
model.change();
deepEqual(events, ['change:z', 'change']);
model.set({z: true});
deepEqual(events, []);
});
test("nested `change` only fires once", 1, function() {
var model = new Backbone.Model();
model.on('change', function() {
ok(true);
model.change();
model.set({x: true});
});
model.set({x: true});
});
test("no `'change'` event if no changes", 0, function() {
var model = new Backbone.Model();
model.on('change', function() { ok(false); });
model.change();
});
test("nested `set` during `'change'`", 6, function() {
var count = 0;
var model = new Backbone.Model();
@@ -721,13 +816,13 @@ $(document).ready(function() {
model.set({y: true});
break;
case 1:
deepEqual(this.changedAttributes(), {y: true});
equal(model.previous('x'), true);
deepEqual(this.changedAttributes(), {x: true, y: true});
equal(model.previous('x'), undefined);
model.set({z: true});
break;
case 2:
deepEqual(this.changedAttributes(), {z: true});
equal(model.previous('y'), true);
deepEqual(this.changedAttributes(), {x: true, y: true, z: true});
equal(model.previous('y'), undefined);
break;
default:
ok(false);
@@ -736,30 +831,34 @@ $(document).ready(function() {
model.set({x: true});
});
test("nested `'change'` with silent", 3, function() {
test("nested `change` with silent", 3, function() {
var count = 0;
var model = new Backbone.Model();
model.on('change:y', function() { ok(true); });
model.on('change:y', function() { ok(false); });
model.on('change', function() {
switch(count++) {
case 0:
deepEqual(this.changedAttributes(), {x: true});
model.set({y: true}, {silent: true});
model.set({z: true});
break;
case 1:
deepEqual(this.changedAttributes(), {y: true, z: true});
deepEqual(this.changedAttributes(), {x: true, y: true, z: true});
break;
case 2:
deepEqual(this.changedAttributes(), {z: false});
break;
default:
ok(false);
}
});
model.set({x: true});
model.set({z: true});
model.set({z: false});
});
test("nested `'change:attr'` with silent", 1, function() {
test("nested `change:attr` with silent", 0, function() {
var model = new Backbone.Model();
model.on('change:y', function(){ ok(true); });
model.on('change:y', function(){ ok(false); });
model.on('change', function() {
model.set({y: true}, {silent: true});
model.set({z: true});
@@ -777,21 +876,25 @@ $(document).ready(function() {
equal(val, 2);
});
model.set({x: true});
model.change();
});
test("multiple nested changes with silent", 2, function() {
test("multiple nested changes with silent", 1, function() {
var changes = [];
var model = new Backbone.Model();
model.on('change:b', function(model, val) { changes.push(val); });
model.on('change', function() {
model.set({b: 1});
model.set({b: 2}, {silent: true});
});
model.set({b: 0});
deepEqual(changes, [0, 1]);
model.change();
deepEqual(changes, [0, 1, 2, 1]);
});
test("basic silent change semantics", 1, function() {
var model = new Backbone.Model;
model.set({x: 1});
model.on('change', function(){ ok(true); });
model.set({x: 2}, {silent: true});
model.set({x: 1});
});
test("nested set multiple times", 1, function() {
@@ -837,9 +940,8 @@ $(document).ready(function() {
test("#1412 - Trigger 'sync' event.", 3, function() {
var model = new Backbone.Model({id: 1});
model.url = '/test';
model.sync = function (method, model, options) { options.success(); };
model.on('sync', function(){ ok(true); });
Backbone.ajax = function(settings){ settings.success(); };
model.fetch();
model.save();
model.destroy();
@@ -866,7 +968,7 @@ $(document).ready(function() {
validate: function(){ return 'invalid'; }
});
var model = new Model({id: 1});
model.on('error', function(){ ok(true); });
model.on('invalid', function(){ ok(true); });
model.save();
});
@@ -895,9 +997,9 @@ $(document).ready(function() {
.save(null, {wait: true});
});
test("#1664 - Changing from one value, silently to another, back to original does not trigger change.", 0, function() {
test("#1664 - Changing from one value, silently to another, back to original triggers a change.", 1, function() {
var model = new Backbone.Model({x:1});
model.on('change:x', function() { ok(false); });
model.on('change:x', function() { ok(true); });
model.set({x:2},{silent:true});
model.set({x:3},{silent:true});
model.set({x:1});
@@ -910,15 +1012,11 @@ $(document).ready(function() {
model.set({a:'c'}, {silent:true});
model.set({b:2}, {silent:true});
model.unset('c', {silent:true});
model.set({a:'a'}, {silent:true});
model.set({b:1}, {silent:true});
model.set({c:'item'}, {silent:true});
});
model.on('change:a change:b change:c', function(model, val) { changes.push(val); });
model.set({a:'a', b:1, c:'item'});
deepEqual(changes, ['a',1,'item']);
model.change();
deepEqual(changes, ['a',1,'item']);
deepEqual(model.attributes, {a: 'c', b: 2});
});
test("#1791 - `attributes` is available for `parse`", function() {
@@ -929,7 +1027,7 @@ $(document).ready(function() {
expect(0);
});
test("silent changes in last `change` event back to original does not trigger change", 2, function() {
test("silent changes in last `change` event back to original triggers change", 2, function() {
var changes = [];
var model = new Backbone.Model();
model.on('change:a change:b change:c', function(model, val) { changes.push(val); });
@@ -938,9 +1036,8 @@ $(document).ready(function() {
});
model.set({a:'a'});
deepEqual(changes, ['a']);
model.set({a:'a'}, {silent:true});
model.change();
deepEqual(changes, ['a']);
model.set({a:'a'});
deepEqual(changes, ['a', 'a']);
});
test("#1943 change calculations should use _.isEqual", function() {
@@ -949,4 +1046,65 @@ $(document).ready(function() {
equal(model.changedAttributes(), false);
});
});
test("#1964 - final `change` event is always fired, regardless of interim changes", 1, function () {
var model = new Backbone.Model();
model.on('change:property', function() {
model.set('property', 'bar');
});
model.on('change', function() {
ok(true);
});
model.set('property', 'foo');
});
test("isValid", function() {
var model = new Backbone.Model({valid: true});
model.validate = function(attrs) {
if (!attrs.valid) return "invalid";
};
equal(model.isValid(), true);
equal(model.set({valid: false}, {validate:true}), false);
equal(model.isValid(), true);
model.set({valid:false});
equal(model.isValid(), false);
ok(!model.set('valid', false, {validate: true}));
});
test("#1179 - isValid returns true in the absence of validate.", 1, function() {
var model = new Backbone.Model();
model.validate = null;
ok(model.isValid());
});
test("#1961 - Creating a model with {validate:true} will call validate and use the error callback", function () {
var Model = Backbone.Model.extend({
validate: function (attrs) {
if (attrs.id === 1) return "This shouldn't happen";
}
});
var model = new Model({id: 1}, {validate: true});
equal(model.validationError, "This shouldn't happen");
});
test("toJSON receives attrs during save(..., {wait: true})", 1, function() {
var Model = Backbone.Model.extend({
url: '/test',
toJSON: function() {
strictEqual(this.attributes.x, 1);
return _.clone(this.attributes);
}
});
var model = new Model;
model.save({x: 1}, {wait: true});
});
test("#2034 - nested set with silent only triggers one change", 1, function() {
var model = new Backbone.Model();
model.on('change', function() {
model.set({b: true}, {silent: true});
ok(true);
});
model.set({a: true});
});
})();

View File

@@ -1,4 +1,4 @@
$(document).ready(function() {
(function() {
module("Backbone.noConflict");
@@ -9,4 +9,4 @@ $(document).ready(function() {
equal(window.Backbone, noconflictBackbone, 'Backbone is still pointing to the original Backbone');
});
});
})();

View File

@@ -1,4 +1,4 @@
$(document).ready(function() {
(function() {
var router = null;
var location = null;
@@ -57,6 +57,15 @@ $(document).ready(function() {
});
var ExternalObject = {
value: 'unset',
routingFunction: function(value) {
this.value = value;
}
};
_.bindAll(ExternalObject);
var Router = Backbone.Router.extend({
count: 0,
@@ -66,13 +75,20 @@ $(document).ready(function() {
"counter": "counter",
"search/:query": "search",
"search/:query/p:page": "search",
"charñ": "charUTF",
"char%C3%B1": "charEscaped",
"contacts": "contacts",
"contacts/new": "newContact",
"contacts/:id": "loadContact",
"route-event/:arg": "routeEvent",
"optional(/:item)": "optionalItem",
"named/optional/(y:z)": "namedOptional",
"splat/*args/end": "splat",
"*first/complex-:part/*rest": "complex",
":repo/compare/*from...*to": "github",
"decode/:named/*splat": "decode",
"*first/complex-*part/*rest": "complex",
":entity?*args": "query",
"function/:value": ExternalObject.routingFunction,
"*anything": "anything"
},
@@ -89,11 +105,19 @@ $(document).ready(function() {
this.count++;
},
search : function(query, page) {
search: function(query, page) {
this.query = query;
this.page = page;
},
charUTF: function() {
this.charType = 'UTF';
},
charEscaped: function() {
this.charType = 'escaped';
},
contacts: function(){
this.contact = 'index';
},
@@ -110,23 +134,41 @@ $(document).ready(function() {
this.arg = arg != void 0 ? arg : null;
},
splat : function(args) {
splat: function(args) {
this.args = args;
},
complex : function(first, part, rest) {
github: function(repo, from, to) {
this.repo = repo;
this.from = from;
this.to = to;
},
complex: function(first, part, rest) {
this.first = first;
this.part = part;
this.rest = rest;
},
query : function(entity, args) {
query: function(entity, args) {
this.entity = entity;
this.queryArgs = args;
},
anything : function(whatever) {
anything: function(whatever) {
this.anything = whatever;
},
namedOptional: function(z) {
this.z = z;
},
decode: function(named, path) {
this.named = named;
this.path = path;
},
routeEvent: function(arg) {
}
});
@@ -144,6 +186,15 @@ $(document).ready(function() {
equal(lastArgs[0], 'news');
});
test("routes (simple, but unicode)", 4, function() {
location.replace('http://example.com#search/тест');
Backbone.history.checkUrl();
equal(router.query, "тест");
equal(router.page, void 0);
equal(lastRoute, 'search');
equal(lastArgs[0], "тест");
});
test("routes (two part)", 2, function() {
location.replace('http://example.com#search/nyc/p10');
Backbone.history.checkUrl();
@@ -163,6 +214,10 @@ $(document).ready(function() {
equal(router.page, '20');
});
test("reports matched route via nagivate", 1, function() {
ok(Backbone.history.navigate('search/manhattan/p20', true));
});
test("route precedence via navigate", 6, function(){
// check both 0.9.x and backwards-compatibility options
_.each([ { trigger: true }, true ], function( options ){
@@ -204,6 +259,14 @@ $(document).ready(function() {
equal(router.args, 'long-list/of/splatted_99args');
});
test("routes (github)", 3, function() {
location.replace('http://example.com#backbone/compare/1.0...braddunbar:with/slash');
Backbone.history.checkUrl();
equal(router.repo, 'backbone');
equal(router.from, '1.0');
equal(router.to, 'braddunbar:with/slash');
});
test("routes (optional)", 2, function() {
location.replace('http://example.com#optional');
Backbone.history.checkUrl();
@@ -237,6 +300,23 @@ $(document).ready(function() {
equal(router.anything, 'doesnt-match-a-route');
});
test("routes (function)", 3, function() {
router.on('route', function(name) {
ok(name === '');
});
equal(ExternalObject.value, 'unset');
location.replace('http://example.com#function/set');
Backbone.history.checkUrl();
equal(ExternalObject.value, 'set');
});
test("Decode named parameters, not splats.", 2, function() {
location.replace('http://example.com#decode/a%2Fb/c%2Fd/e');
Backbone.history.checkUrl();
strictEqual(router.named, 'a/b');
strictEqual(router.path, 'c/d/e');
});
test("fires event when router doesn't have callback on it", 1, function() {
router.on("route:noCallback", function(){ ok(true); });
location.replace('http://example.com#noCallback');
@@ -268,9 +348,9 @@ $(document).ready(function() {
test("#967 - Route callback gets passed encoded values.", 3, function() {
var route = 'has%2Fslash/complex-has%23hash/has%20space';
Backbone.history.navigate(route, {trigger: true});
strictEqual(router.first, 'has%2Fslash');
strictEqual(router.part, 'has%23hash');
strictEqual(router.rest, 'has%20space');
strictEqual(router.first, 'has/slash');
strictEqual(router.part, 'has#hash');
strictEqual(router.rest, 'has space');
});
test("correctly handles URLs with % (#868)", 3, function() {
@@ -283,6 +363,13 @@ $(document).ready(function() {
equal(lastRoute, 'search');
});
test("#2666 - Hashes with UTF8 in them.", 2, function() {
Backbone.history.navigate('charñ', {trigger: true});
equal(router.charType, 'UTF');
Backbone.history.navigate('char%C3%B1', {trigger: true});
equal(router.charType, 'escaped');
});
test("#1185 - Use pathname when hashChange is not wanted.", 1, function() {
Backbone.history.stop();
location.replace('http://example.com/path/name#hash');
@@ -502,4 +589,141 @@ $(document).ready(function() {
strictEqual(history.getFragment('/fragment '), 'fragment');
});
});
test("#1980 - Optional parameters.", 2, function() {
location.replace('http://example.com#named/optional/y');
Backbone.history.checkUrl();
strictEqual(router.z, undefined);
location.replace('http://example.com#named/optional/y123');
Backbone.history.checkUrl();
strictEqual(router.z, '123');
});
test("#2062 - Trigger 'route' event on router instance.", 2, function() {
router.on('route', function(name, args) {
strictEqual(name, 'routeEvent');
deepEqual(args, ['x']);
});
location.replace('http://example.com#route-event/x');
Backbone.history.checkUrl();
});
test("#2255 - Extend routes by making routes a function.", 1, function() {
var RouterBase = Backbone.Router.extend({
routes: function() {
return {
home: "root",
index: "index.html"
};
}
});
var RouterExtended = RouterBase.extend({
routes: function() {
var _super = RouterExtended.__super__.routes;
return _.extend(_super(),
{ show: "show",
search: "search" });
}
});
var router = new RouterExtended();
deepEqual({home: "root", index: "index.html", show: "show", search: "search"}, router.routes);
});
test("#2538 - hashChange to pushState only if both requested.", 0, function() {
Backbone.history.stop();
location.replace('http://example.com/root?a=b#x/y');
Backbone.history = _.extend(new Backbone.History, {
location: location,
history: {
pushState: function(){},
replaceState: function(){ ok(false); }
}
});
Backbone.history.start({
root: 'root',
pushState: true,
hashChange: false
});
});
test('No hash fallback.', 0, function() {
Backbone.history.stop();
Backbone.history = _.extend(new Backbone.History, {
location: location,
history: {
pushState: function(){},
replaceState: function(){}
}
});
var Router = Backbone.Router.extend({
routes: {
hash: function() { ok(false); }
}
});
var router = new Router;
location.replace('http://example.com/');
Backbone.history.start({
pushState: true,
hashChange: false
});
location.replace('http://example.com/nomatch#hash');
Backbone.history.checkUrl();
});
test('#2656 - No trailing slash on root.', 1, function() {
Backbone.history.stop();
Backbone.history = _.extend(new Backbone.History, {
location: location,
history: {
pushState: function(state, title, url){
strictEqual(url, '/root');
}
}
});
location.replace('http://example.com/root/path');
Backbone.history.start({pushState: true, root: 'root'});
Backbone.history.navigate('');
});
test('#2656 - No trailing slash on root.', 1, function() {
Backbone.history.stop();
Backbone.history = _.extend(new Backbone.History, {
location: location,
history: {
pushState: function(state, title, url) {
strictEqual(url, '/');
}
}
});
location.replace('http://example.com/path');
Backbone.history.start({pushState: true});
Backbone.history.navigate('');
});
test('#2765 - Fragment matching sans query/hash.', 2, function() {
Backbone.history.stop();
Backbone.history = _.extend(new Backbone.History, {
location: location,
history: {
pushState: function(state, title, url) {
strictEqual(url, '/path?query#hash');
}
}
});
var Router = Backbone.Router.extend({
routes: {
path: function() { ok(true); }
}
});
var router = new Router;
location.replace('http://example.com/');
Backbone.history.start({pushState: true});
Backbone.history.navigate('path?query#hash', true);
});
})();

View File

@@ -1,4 +1,4 @@
$(document).ready(function() {
(function() {
var Library = Backbone.Collection.extend({
url : function() { return '/library'; }
@@ -11,20 +11,18 @@ $(document).ready(function() {
length : 123
};
module("Backbone.sync", _.extend(new Environment, {
module("Backbone.sync", {
setup : function() {
Environment.prototype.setup.apply(this, arguments);
library = new Library;
library.create(attrs, {wait: false});
},
teardown: function() {
Environment.prototype.teardown.apply(this, arguments);
Backbone.emulateHTTP = false;
}
}));
});
test("read", 4, function() {
library.fetch();
@@ -209,4 +207,4 @@ $(document).ready(function() {
strictEqual(this.ajaxSettings.beforeSend(xhr), false);
});
});
})();

View File

@@ -1,4 +1,4 @@
$(document).ready(function() {
(function() {
var view;
@@ -14,13 +14,10 @@ $(document).ready(function() {
});
test("constructor", 6, function() {
test("constructor", 3, function() {
equal(view.el.id, 'test-view');
equal(view.el.className, 'test-view');
equal(view.el.other, void 0);
equal(view.options.id, 'test-view');
equal(view.options.className, 'test-view');
equal(view.options.other, 'non-special-option');
});
test("jQuery", 1, function() {
@@ -29,22 +26,6 @@ $(document).ready(function() {
strictEqual(view.$('a b').html(), 'test');
});
test("make", 3, function() {
var div = view.make('div', {id: 'test-div'}, "one two three");
equal(div.tagName.toLowerCase(), 'div');
equal(div.id, 'test-div');
equal($(div).text(), 'one two three');
});
test("make can take falsy values for content", 2, function() {
var div = view.make('div', {id: 'test-div'}, 0);
equal($(div).text(), '0');
div = view.make('div', {id: 'test-div'}, '');
equal($(div).text(), '');
});
test("initialize", 1, function() {
var View = Backbone.View.extend({
initialize: function() {
@@ -101,6 +82,13 @@ $(document).ready(function() {
equal(view.counter, 3);
});
test("delegateEvents ignore undefined methods", 0, function() {
var view = new Backbone.View({el: '<p></p>'});
view.delegateEvents({'click': 'undefinedMethod'});
view.$el.trigger('click');
});
test("undelegateEvents", 6, function() {
var counter1 = 0, counter2 = 0;
@@ -165,30 +153,6 @@ $(document).ready(function() {
strictEqual(new View().el.id, 'id');
});
test("with options function", 3, function() {
var View1 = Backbone.View.extend({
options: function() {
return {
title: 'title1',
acceptText: 'confirm'
};
}
});
var View2 = View1.extend({
options: function() {
return _.extend(View1.prototype.options.call(this), {
title: 'title2',
fixed: true
});
}
});
strictEqual(new View2().options.title, 'title2');
strictEqual(new View2().options.acceptText, 'confirm');
strictEqual(new View2().options.fixed, true);
});
test("with attributes", 2, function() {
var View = Backbone.View.extend({
attributes: {
@@ -328,7 +292,7 @@ $(document).ready(function() {
view.collection.trigger('x');
});
test("Provide function for el.", 1, function() {
test("Provide function for el.", 2, function() {
var View = Backbone.View.extend({
el: function() {
return "<p><a></a></p>";
@@ -336,7 +300,8 @@ $(document).ready(function() {
});
var view = new View;
ok(view.$el.is('p:has(a)'));
ok(view.$el.is('p'));
ok(view.$el.has('a'));
});
test("events passed in options", 2, function() {
@@ -363,4 +328,4 @@ $(document).ready(function() {
equal(counter, 4);
});
});
})();

View File

@@ -1,4 +1,4 @@
Copyright 2010-2012 Mathias Bynens <http://mathiasbynens.be/>
Copyright 2010-2013 Mathias Bynens <http://mathiasbynens.be/>
Based on JSLitmus.js, copyright Robert Kieffer <http://broofa.com/>
Modified by John-David Dalton <http://allyoucanleet.com/>
@@ -19,4 +19,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -1,136 +0,0 @@
# Benchmark.js <sup>v1.0.0</sup>
[![build status](https://secure.travis-ci.org/bestiejs/benchmark.js.png)](http://travis-ci.org/bestiejs/benchmark.js)
A [robust](http://calendar.perfplanet.com/2010/bulletproof-javascript-benchmarks/ "Bulletproof JavaScript benchmarks") benchmarking library that works on nearly all JavaScript platforms<sup><a name="fnref1" href="#fn1">1</a></sup>, supports high-resolution timers, and returns statistically significant results. As seen on [jsPerf](http://jsperf.com/).
## Download
* [Development source](https://raw.github.com/bestiejs/benchmark.js/v1.0.0/benchmark.js)
## Dive in
Weve got [API docs](http://benchmarkjs.com/docs) and [unit tests](http://benchmarkjs.com/tests).
For a list of upcoming features, check out our [roadmap](https://github.com/bestiejs/benchmark.js/wiki/Roadmap).
## Support
Benchmark.js has been tested in at least Adobe AIR 3.1, Chrome 5-21, Firefox 1-15, IE 6-9, Opera 9.25-12, Safari 3-6, Node.js 0.8.8, Narwhal 0.3.2, RingoJS 0.8, and Rhino 1.7RC5.
## Installation and usage
In a browser or Adobe AIR:
```html
<script src="benchmark.js"></script>
```
Optionally, expose Javas nanosecond timer by adding the `nano` applet to the `<body>`:
```html
<applet code="nano" archive="nano.jar"></applet>
```
Or enable Chromes microsecond timer by using the [command line switch](http://peter.sh/experiments/chromium-command-line-switches/#enable-benchmarking):
--enable-benchmarking
Via [npm](http://npmjs.org/):
```bash
npm install benchmark
```
In [Node.js](http://nodejs.org/) and [RingoJS v0.8.0+](http://ringojs.org/):
```js
var Benchmark = require('benchmark');
```
Optionally, use the [microtime module](https://github.com/wadey/node-microtime) by Wade Simmons:
```bash
npm install microtime
```
In [RingoJS v0.7.0-](http://ringojs.org/):
```js
var Benchmark = require('benchmark').Benchmark;
```
In [Rhino](http://www.mozilla.org/rhino/):
```js
load('benchmark.js');
```
In an AMD loader like [RequireJS](http://requirejs.org/):
```js
require({
'paths': {
'benchmark': 'path/to/benchmark'
}
},
['benchmark'], function(Benchmark) {
console.log(Benchmark.version);
});
// or with platform.js
// https://github.com/bestiejs/platform.js
require({
'paths': {
'benchmark': 'path/to/benchmark',
'platform': 'path/to/platform'
}
},
['benchmark', 'platform'], function(Benchmark, platform) {
Benchmark.platform = platform;
console.log(Benchmark.platform.name);
});
```
Usage example:
```js
var suite = new Benchmark.Suite;
// add tests
suite.add('RegExp#test', function() {
/o/.test('Hello World!');
})
.add('String#indexOf', function() {
'Hello World!'.indexOf('o') > -1;
})
// add listeners
.on('cycle', function(event) {
console.log(String(event.target));
})
.on('complete', function() {
console.log('Fastest is ' + this.filter('fastest').pluck('name'));
})
// run async
.run({ 'async': true });
// logs:
// > RegExp#test x 4,161,532 +-0.99% (59 cycles)
// > String#indexOf x 6,139,623 +-1.00% (131 cycles)
// > Fastest is String#indexOf
```
## BestieJS
Benchmark.js is part of the BestieJS *"Best in Class"* module collection. This means we promote solid browser/environment support, ES5 precedents, unit testing, and plenty of documentation.
## Authors
* [Mathias Bynens](http://mathiasbynens.be/)
[![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter")
* [John-David Dalton](http://allyoucanleet.com/)
[![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter")
## Contributors
* [Kit Cambridge](http://kitcambridge.github.com/)
[![twitter/kitcambridge](http://gravatar.com/avatar/6662a1d02f351b5ef2f8b4d815804661?s=70)](https://twitter.com/kitcambridge "Follow @kitcambridge on Twitter")

File diff suppressed because it is too large Load Diff

24
vendor/curl/LICENSE.txt vendored Normal file
View File

@@ -0,0 +1,24 @@
Open Source Initiative OSI - The MIT License
http://www.opensource.org/licenses/mit-license.php
Copyright (c) 2010-2013 Brian Cavalier and John Hann
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,48 @@
(function(){/*
MIT License (c) copyright 2010-2013 B Cavalier & J Hann MIT (c) copyright 2010-2013 B Cavalier & J Hann */
(function(f){function k(){}function g(a,e){return 0==T.call(a).indexOf("[object "+e)}function n(a){return a&&"/"==a.charAt(a.length-1)?a.substr(0,a.length-1):a}function d(a,e){var l,h,D,m;l=1;h=a;"."==h.charAt(0)&&(D=!0,h=h.replace(U,function(a,e,h,D){h&&l++;return D||""}));if(D){D=e.split("/");m=D.length-l;if(0>m)return a;D.splice(m,l);return D.concat(h||[]).join("/")}return h}function s(a){var e=a.indexOf("!");return{g:a.substr(e+1),d:0<=e&&a.substr(0,e)}}function v(){}function q(a,e){v.prototype=
a||Q;var l=new v;v.prototype=Q;for(var h in e)l[h]=e[h];return l}function y(){function a(a,e,l){h.push([a,e,l])}function e(a,e){for(var l,D=0;l=h[D++];)(l=l[a])&&l(e)}var l,h,D;l=this;h=[];D=function(l,m){a=l?function(a){a&&a(m)}:function(a,e){e&&e(m)};D=k;e(l?0:1,m);e=k;h=G};this.l=function(e,h,D){a(e,h,D);return l};this.k=function(a){l.H=a;D(!0,a)};this.e=function(a){l.Ba=a;D(!1,a)};this.F=function(a){e(2,a)}}function x(a){return a instanceof y||a instanceof u}function r(a,e,l,h){x(a)?a.l(e,l,h):
e(a)}function w(a,e,l){var h;return function(){0<=--a&&e&&(h=e.apply(G,arguments));0==a&&l&&l(h);return h}}function b(){var a,e;p="";a=[].slice.call(arguments);g(a[0],"Object")&&(e=a.shift(),e=c(e));return new u(a[0],a[1],a[2],e)}function c(a,e,l){var h;p="";if(a&&(t.V(a),E=t.b(a),"preloads"in a&&(h=new u(a.preloads,G,l,J,!0),t.n(function(){J=h})),a=a.main))return new u(a,e,l)}function u(a,e,l,h,D){var m;m=t.i(E,G,[].concat(a),D);this.then=this.l=a=function(a,e){r(m,function(e){a&&a.apply(G,e)},function(a){if(e)e(a);
else throw a;});return this};this.next=function(a,e,h){return new u(a,e,h,m)};this.config=c;(e||l)&&a(e,l);t.n(function(){r(D||J,function(){r(h,function(){t.A(m)},l)})})}function z(a){var e,l;e=a.id;e==G&&(K!==G?K={L:"Multiple anonymous defines encountered"}:(e=t.ja())||(K=a));if(e!=G){l=F[e];e in F||(l=t.o(e,E),l=t.I(l.b,e),F[e]=l);if(!x(l))throw Error("duplicate define: "+e);l.oa=!1;t.J(l,a)}}function A(){var a=t.ga(arguments);z(a)}var p,E,C,H,B=f.document,L=B&&(B.head||B.getElementsByTagName("head")[0]),
N=L&&L.getElementsByTagName("base")[0]||null,M={},I={},m={},V="addEventListener"in f?{}:{loaded:1,complete:1},Q={},T=Q.toString,G,F={},O={},J=!1,K,S=/^\/|^[^:]+:\/\//,U=/(\.)(\.?)(?:$|\/([^\.\/]+.*)?)/g,W=/\/\*[\s\S]*?\*\/|\/\/.*?[\n\r]/g,X=/require\s*\(\s*(["'])(.*?[^\\])\1\s*\)|[^\\]?(["'])/g,Y=/\s*,\s*/,R,t;t={t:function(a,e,l){var h;a=d(a,e);if("."==a.charAt(0))return a;h=s(a);a=(e=h.d)||h.g;a in l.c&&(a=l.c[a].Q||a);e&&(0>e.indexOf("/")&&!(e in l.c)&&(a=n(l.T)+"/"+e),a=a+"!"+h.g);return a},i:function(a,
e,l,h){function m(e,h){var l,c;l=t.t(e,b.id,a);if(!h)return l;c=s(l);if(!c.d)return l;l=F[c.d];c.g="normalize"in l?l.normalize(c.g,m,b.b)||"":m(c.g);return c.d+"!"+c.g}function c(e,l,d){var s;s=l&&function(a){l.apply(G,a)};if(g(e,"String")){if(s)throw Error("require(id, callback) not allowed");d=m(e,!0);e=F[d];if(!(d in F))throw Error("Module not resolved: "+d);return(d=x(e)&&e.a)||e}r(t.A(t.i(a,b.id,e,h)),s,d)}var b;b=new y;b.id=e||"";b.ka=h;b.K=l;b.b=a;b.s=c;c.toUrl=function(e){return t.o(m(e,!0),
a).url};b.t=m;return b},I:function(a,e,l){var h,m,c;h=t.i(a,e,G,l);m=h.k;c=w(1,function(a){h.w=a;try{return t.ba(h)}catch(e){h.e(e)}});h.k=function(a){r(l||J,function(){m(F[h.id]=O[h.url]=c(a))})};h.M=function(a){r(l||J,function(){h.a&&(c(a),h.F(I))})};return h},$:function(a,e,l,h){return t.i(a,l,G,h)},ia:function(a){return a.s},O:function(a){return a.a||(a.a={})},ha:function(a){var e=a.B;e||(e=a.B={id:a.id,uri:t.P(a),exports:t.O(a),config:function(){return a.b}},e.a=e.exports);return e},P:function(a){return a.url||
(a.url=t.u(a.s.toUrl(a.id),a.b))},V:function(a){var e,l,h,m,c;e="curl";l="define";h=m=f;if(a&&(c=a.overwriteApi||a.ya,e=a.apiName||a.qa||e,h=a.apiContext||a.pa||h,l=a.defineName||a.ua||l,m=a.defineContext||a.ta||m,C&&g(C,"Function")&&(f.curl=C),C=null,H&&g(H,"Function")&&(f.define=H),H=null,!c)){if(h[e]&&h[e]!=b)throw Error(e+" already exists");if(m[l]&&m[l]!=A)throw Error(l+" already exists");}h[e]=b;m[l]=A},b:function(a){function e(a,e){var l,h,b,p,f;for(f in a){b=a[f];g(b,"String")&&(b={path:a[f]});
b.name=b.name||f;p=m;h=s(n(b.name));l=h.g;if(h=h.d)p=c[h],p||(p=c[h]=q(m),p.c=q(m.c),p.f=[]),delete a[f];h=b;var k=e,r=void 0;h.path=n(h.path||h.location||"");k&&(r=h.main||"./main","."==r.charAt(0)||(r="./"+r),h.Q=d(r,h.name+"/"));h.b=h.config;h.b&&(h.b=q(m,h.b));h.W=l.split("/").length;l?(p.c[l]=h,p.f.push(l)):p.p=t.U(b.path,m)}}function l(a){var e=a.c;a.S=RegExp("^("+a.f.sort(function(a,h){return e[h].W-e[a].W}).join("|").replace(/\/|\./g,"\\$&")+")(?=\\/|$)");delete a.f}var h,m,c,b;"baseUrl"in
a&&(a.p=a.baseUrl);"main"in a&&(a.Q=a.main);"preloads"in a&&(a.za=a.preloads);"pluginPath"in a&&(a.T=a.pluginPath);if("dontAddFileExt"in a||a.j)a.j=RegExp(a.dontAddFileExt||a.j);h=E;m=q(h,a);m.c=q(h.c);c=a.plugins||{};m.plugins=q(h.plugins);m.D=q(h.D,a.D);m.C=q(h.C,a.C);m.f=[];e(a.packages,!0);e(a.paths,!1);for(b in c)a=t.t(b+"!","",m),m.plugins[a.substr(0,a.length-1)]=c[b];c=m.plugins;for(b in c)if(c[b]=q(m,c[b]),a=c[b].f)c[b].f=a.concat(m.f),l(c[b]);for(b in h.c)m.c.hasOwnProperty(b)||m.f.push(b);
l(m);return m},o:function(a,e){var m,h,b,c;m=e.c;b=S.test(a)?a:a.replace(e.S,function(a){h=m[a]||{};c=h.b;return h.path||""});return{b:c||E,url:t.U(b,e)}},U:function(a,e){var m=e.p;return m&&!S.test(a)?n(m)+"/"+a:a},u:function(a,e){return a+((e||E).j.test(a)?"":".js")},m:function(a,e,l){var h=B.createElement("script");h.onload=h.onreadystatechange=function(l){l=l||f.event;if("load"==l.type||V[h.readyState])delete m[a.id],h.onload=h.onreadystatechange=h.onerror="",e()};h.onerror=function(){l(Error("Syntax or http error: "+
a.url))};h.type=a.r||"text/javascript";h.charset="utf-8";h.async=!a.R;h.src=a.url;m[a.id]=h;L.insertBefore(h,N);return h},N:function(a){var e=[],m;("string"==typeof a?a:a.toSource?a.toSource():a.toString()).replace(W,"").replace(X,function(a,b,c,d){d?m=m==d?G:m:m||e.push(c);return""});return e},ga:function(a){var e,m,h,b,c,d;c=a.length;h=a[c-1];b=g(h,"Function")?h.length:-1;2==c?g(a[0],"Array")?m=a[0]:e=a[0]:3==c&&(e=a[0],m=a[1]);!m&&0<b&&(d=!0,m=["require","exports","module"].slice(0,b).concat(t.N(h)));
return{id:e,w:m||[],G:0<=b?h:function(){return h},v:d}},ba:function(a){var e;e=a.G.apply(a.v?a.a:G,a.w);e===G&&a.a&&(e=a.B?a.a=a.B.a:a.a);return e},J:function(a,e){a.G=e.G;a.v=e.v;a.K=e.w;t.A(a)},A:function(a){function e(a,e,m){d[e]=a;m&&s(a,e)}function m(e,h){var b,c,l,d;b=w(1,function(a){c(a);g(a,h)});c=w(1,function(a){s(a,h)});l=t.da(e,a);(d=x(l)&&l.a)&&c(d);r(l,b,a.e,a.a&&function(a){l.a&&(a==M?c(l.a):a==I&&b(l.a))})}function h(){a.k(d)}var b,c,d,p,f,s,g;d=[];c=a.K;p=c.length;0==c.length&&h();
s=w(p,e,function(){a.M&&a.M(d)});g=w(p,e,h);for(b=0;b<p;b++)f=c[b],f in R?(g(R[f](a),b,!0),a.a&&a.F(M)):f?m(f,b):g(G,b,!0);return a},ea:function(a){t.P(a);t.m(a,function(){var e=K;K=G;!1!==a.oa&&(!e||e.L?a.e(Error(e&&e.L||"define() missing or duplicated: "+a.url)):t.J(a,e))},a.e);return a},da:function(a,e){var m,h,b,c,d,p,f,g,q,k,n,u;m=e.t;h=e.ka;b=e.b||E;d=m(a);d in F?p=d:(c=s(d),g=c.g,p=c.d||g,q=t.o(p,b));if(!(d in F))if(u=t.o(g,b).b,c.d)f=p;else if(f=u.moduleLoader||u.xa||u.loader||u.wa)g=p,p=
f,q=t.o(f,b);p in F?k=F[p]:q.url in O?k=F[p]=O[q.url]:(k=t.I(u,p,h),k.url=t.u(q.url,q.b),F[p]=O[q.url]=k,t.ea(k));p==f&&(c.d&&b.plugins[c.d]&&(u=b.plugins[c.d]),n=new y,r(k,function(a){var e,b,c;c=a.dynamic;g="normalize"in a?a.normalize(g,m,k.b)||"":m(g);b=f+"!"+g;e=F[b];if(!(b in F)){e=t.$(u,b,g,h);c||(F[b]=e);var d=function(a){c||(F[b]=a);e.k(a)};d.resolve=d;d.reject=d.error=e.e;a.load(g,e.s,d,u)}n!=e&&r(e,n.k,n.e,n.F)},n.e));return n||k},ja:function(){var a;if(!g(f.opera,"Opera"))for(var e in m)if("interactive"==
m[e].readyState){a=e;break}return a},fa:function(a){var e=0,m,b;for(m=B&&(B.scripts||B.getElementsByTagName("script"));m&&(b=m[e++]);)if(a(b))return b},ca:function(){var a,e="";(a=t.fa(function(a){(a=a.getAttribute("data-curl-run"))&&(e=a);return a}))&&a.setAttribute("data-curl-run","");return e},X:function(){function a(){t.m({url:b.shift()},e,e)}function e(){p&&(b.length?(t.n(m),a()):m("run.js script did not run."))}function m(a){throw Error(a||"Primary run.js failed. Trying fallback.");}var b=p.split(Y);
b.length&&a()},n:function(a){setTimeout(a,0)}};R={require:t.ia,exports:t.O,module:t.ha};b.version="0.8.4";b.config=c;A.amd={plugins:!0,jQuery:!0,curl:"0.8.4"};E={p:"",T:"curl/plugin",j:/\?|\.js\b/,D:{},C:{},plugins:{},c:{},S:/$^/};C=f.curl;H=f.define;C&&g(C,"Object")?(f.curl=G,c(C)):t.V();(p=t.ca())&&t.n(t.X);F.curl=b;F["curl/_privileged"]={core:t,cache:F,config:function(){return E},_define:z,_curl:b,Promise:y}})(this.window||"undefined"!=typeof global&&global||this);
(function(f,k){function g(){if(!k.body)return!1;A||(A=k.createTextNode(""));try{return k.body.removeChild(k.body.appendChild(A)),A=z,!0}catch(b){return!1}}function n(){var d;d=v[k[s]]&&g();if(!x&&d){x=!0;for(clearTimeout(u);b=c.pop();)b();y&&(k[s]="complete");for(var f;f=q.shift();)f()}return d}function d(){n();x||(u=setTimeout(d,r))}var s="readyState",v={loaded:1,interactive:1,complete:1},q=[],y=k&&"string"!=typeof k[s],x=!1,r=10,w,b,c=[],u,z,A;w="addEventListener"in f?function(b,c){b.addEventListener(c,
n,!1);return function(){b.removeEventListener(c,n,!1)}}:function(b,c){b.attachEvent("on"+c,n);return function(){b.detachEvent(c,n)}};k&&!n()&&(c=[w(f,"load"),w(k,"readystatechange"),w(f,"DOMContentLoaded")],u=setTimeout(d,r));define("curl/domReady",function(){function b(c){x?c():q.push(c)}b.then=b;b.amd=!0;return b})})(this,this.document);var P;
(function(f,k){define("curl/shim/dojo18",["curl/_privileged"],function(g){function n(c){c.has||(c.has=b);c.on||(c.on=s);c.idle||(c.idle=d);c.async=!0}function d(){for(var b in q)if(q[b]instanceof y)return!1;return!0}function s(){}var v,q,y,x;v=g._curl;q=g.cache;y=g.Promise;x=g.core.i;var r,w,b;r=g.b().va||{};w=k&&k.createElement("div");b=function(b){return"function"==typeof r[b]?r[b]=r[b](f,k,w):r[b]};b.add=function(c,d,f,g){if(void 0===r[c]||g)r[c]=d;if(f)return b(c)};r["dojo-loader"]=!1;q["dojo/_base/loader"]=
0;"undefined"==typeof P&&(n(v),P=v);g.core.i=function(){var b=x.apply(this,arguments);n(b.s);return b};return!0})})("object"==typeof global?global:this.window||this.global,"object"==typeof document&&document);
(function(f,k,g){define("curl/plugin/js",["curl/_privileged"],function(f){function d(b,c,d){function s(){p||(k<new Date?d():setTimeout(s,10))}var k,p,q;k=(new Date).valueOf()+(b.na||3E5);d&&b.a&&setTimeout(s,10);q=f.core.m(b,function(){p=!0;b.a&&(b.H=g(b.a));!b.a||b.H?c(q):d()},function(b){p=!0;d(b)})}function s(b,c){d(b,function(){var d=q.shift();r=0<q.length;d&&s.apply(null,d);c.k(b.H||!0)},function(b){c.e(b)})}var v={},q=[],y=k&&!0==k.createElement("script").async,x,r,w=/\?|\.js\b/;x=f.Promise;
return{dynamic:!0,normalize:function(b,c){var d=b.indexOf("!");return 0<=d?c(b.substr(0,d))+b.substr(d):c(b)},load:function(b,c,f,g){function k(b){(f.error||function(b){throw b;})(b)}var p,n,C,H,B;p=0<b.indexOf("!order");n=b.indexOf("!exports=");C=0<n?b.substr(n+9):g.a;H="prefetch"in g?g.prefetch:!0;b=p||0<n?b.substr(0,b.indexOf("!")):b;n=(n=g.dontAddFileExt||g.j)?RegExp(n):w;B=c.toUrl(b);n.test(B)||(B=B.lastIndexOf(".")<=B.lastIndexOf("/")?B+".js":B);B in v?v[B]instanceof x?v[B].l(f,k):f(v[B]):(b=
{name:b,url:B,R:p,a:C,na:g.timeout},v[B]=c=new x,c.l(function(b){v[B]=b;f(b)},k),p&&!y&&r?(q.push([b,c]),H&&(b.r="text/cache",d(b,function(b){b&&b.parentNode.removeChild(b)},function(){}),b.r="")):(r=r||p,s(b,c)))},cramPlugin:"../cram/js"}})})(this,this.document,function(f){try{return eval(f)}catch(k){}});
define("curl/plugin/_fetchText",[],function(){var f,k;k=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];f=function(){if("undefined"!==typeof XMLHttpRequest)f=function(){return new XMLHttpRequest};else for(var g=f=function(){throw Error("getXhr(): XMLHttpRequest not available");};0<k.length&&f===g;)(function(g){try{new ActiveXObject(g),f=function(){return new ActiveXObject(g)}}catch(d){}})(k.shift());return f()};return function(g,k,d){var s=f();s.open("GET",g,!0);s.onreadystatechange=function(){4===
s.readyState&&(400>s.status?k(s.responseText):d(Error("fetchText() failed. status: "+s.statusText)))};s.send(null)}});define("curl/plugin/text",["./_fetchText"],function(f){function k(f){throw f;}return{load:function(g,n,d){f(n.toUrl(g),d,d.error||k)},cramPlugin:"../cram/text"}});
define("curl/plugin/async",function(){return{load:function(f,k,g){function n(d){"function"==typeof g.error&&g.error(d)}k([f],function(d){"function"==typeof d.l?d.l(function(f){0==arguments.length&&(f=d);g(f)},n):g(d)},g.error||function(d){throw d;})},analyze:function(f,k,g){g(f)}}});
(function(f){function k(){var b;b=p[z]("link");b.rel="stylesheet";b.type="text/css";return b}function g(b,c){b.onload=function(){I.load=I.load||!0;c()}}function n(b,c){b.onerror=function(){I.error=I.error||!0;c()}}function d(b,c,d){B.push({url:b,Y:c,aa:function(){d(Error(M))}});(b=v())&&s(b)}function s(b){var c,d;c=B.shift();d=b.styleSheet;c?(b.onload=function(){c.Y(c.ma);s(b)},b.onerror=function(){c.aa();s(b)},c.ma=d.imports[d.addImport(c.url)]):(b.onload=b.onerror=u,H.push(b))}function v(){var b;
b=H.shift();!b&&C.length<L&&(b=p.createElement("style"),C.push(b),E.appendChild(b));return b}function q(b){var c,d,f;if(!b.href||p.readyState&&"complete"!=p.readyState)return!1;c=!1;try{if(d=b.sheet)f=d.cssRules,c=null===f,!c&&f&&(d.insertRule("-curl-css-test {}",0),d.deleteRule(0),c=!0)}catch(g){c="[object Opera]"!=Object.prototype.toString.call(window.opera)&&/security|denied/i.test(g.message)}return c}function y(b,c,d){I.load||(q(b)?d(b.sheet):b.onload==u||!b.onload||A(function(){y(b,c,d)},c))}
function x(c,d,f){function k(){c.onload!=u&&c.onload&&(c.onload=c.onerror=u,b(function(){f(c.sheet)}))}g(c,k);y(c,d,k)}function r(b,c){n(b,function(){b.onload!=u&&b.onload&&(b.onload=b.onerror=u,c(Error(M)))})}function w(b,c,d,f){var g;g=k();x(g,f,c);r(g,d);g.href=b;E.appendChild(g)}function b(b){function c(){p.readyState&&"complete"!=p.readyState?A(c,10):b()}c()}function c(b){return b.lastIndexOf(".")<=b.lastIndexOf("/")?b+".css":b}function u(){}var z="createElement",A=f.setTimeout,p=f.document,
E;f=p&&p.createStyleSheet&&!(10<=p.documentMode);var C=[],H=[],B=[],L=12,N,M="HTTP or network error.",I={};p&&(E=p.head||p.getElementsByTagName("head")[0],N=f?d:w);define("curl/plugin/css",{normalize:function(b,c){var d,f;if(!b)return b;d=b.split(",");f=[];for(var g=0,k=d.length;g<k;g++)f.push(c(d[g]));return f.join(",")},load:function(b,d,f,g){function p(b){1<n.length&&q.push(b);0==--C&&f(1==n.length?b:q)}function s(b){(f.e||function(b){throw b;})(b)}var q,n,r,C,w;q=[];n=(b||"").split(",");r=g.cssWatchPeriod||
50;g=g.cssNoWait;C=n.length;for(w=0;w<n.length;w++){b=n[w];var u;b=c(d.toUrl(b));g?(u=k(),u.href=b,E.appendChild(u),p(u.sheet||u.styleSheet)):N(b,p,s,r)}},cramPlugin:"../cram/css"})})(this);
(function(f){var k=f.document,g=/^\/\//,n;k&&(n=k.head||(k.head=k.getElementsByTagName("head")[0]));define("curl/plugin/link",{load:function(d,f,v,q){d=f.toUrl(d);d=d.lastIndexOf(".")<=d.lastIndexOf("/")?d+".css":d;q=d=(q="fixSchemalessUrls"in q?q.fixSchemalessUrls:k.location.protocol)?d.replace(g,q+"//"):d;d=k.createElement("link");d.rel="stylesheet";d.type="text/css";d.href=q;n.appendChild(d);v(d.sheet||d.styleSheet)}})})(this);
define("curl/plugin/domReady",["../domReady"],function(f){return{load:function(k,g,n){f(n)}}});(function(f){define("curl/shim/_fetchText",function(){function k(d,f,g){n.Aa(d,function(d,k){d?g(d):f(k.toString())})}function g(f,g,k){var n;f=s.parse(f,!1,!0);n="";d.get(f,function(d){d.h("data",function(b){n+=b}).h("end",function(){g(n)}).h("error",k)}).h("error",k)}var n,d,s;n=f("fs");d=f("http");s=f("url");var v;v=/^https?:/;return function(d,f,n){v.test(d)?g(d,f,n):k(d,f,n)}})})(P);define.amd.Da=!0;
(function(f,k){define("curl/shim/ssjs",["curl/_privileged","./_fetchText"],function(g,n){function d(b,c,d){try{k(b.url),c()}catch(f){d(f)}}function s(b,c,d){var g;try{g=b.url.replace(/\.js$/,""),f(g),c()}catch(k){d(k)}}function v(b,c,d){var g;b=f("url").parse(b.url,!1,!0);g="";z.get(b,function(b){b.h("data",function(b){g+=b}).h("end",function(){y(g);c()}).h("error",d)}).h("error",d)}function q(b){throw Error("ssjs: unable to load module in current environment: "+b.url);}function y(b){eval(b)}function x(b){return b&&
b.replace(c,function(b,c){return c})}var r,w,b,c,u,z,A,p;if("object"!=typeof window||!window.sa&&!window.navigator){r=g.ra;w=g.b();b=/^\w+:\/\//;c=/(^\w+:)?.*$/;"undefined"==typeof XMLHttpRequest&&(r["curl/plugin/_fetchText"]=n);u=(w.q&&":"!=w.q[w.q.length-1]?w.q+":":w.q)||x(w.p)||"http:";if(k)A=p=d;else if(f){A=s;try{z=f("http"),p=v}catch(E){p=q}}else A=p=q;"object"===typeof process&&process.la&&(g.Z.n=process.la);g.Z.m=function(c,d,f){/^\/\//.test(c.url)&&(c.url=u+c.url);return b.test(c.url)?p(c,
d,f):A(c,d,f)}}})})(P,void 0);
(function(f,k,g){define("curl/loader/cjsm11",["../plugin/_fetchText","curl/_privileged"],function(f,d){function s(d,b){s="text"in d?function(b,d){b.text=d}:function(b,d){b.appendChild(k.createTextNode(d))};s(d,b)}function v(d,b,c){c=c?"/*\n////@ sourceURL="+c.replace(/\s/g,"%20")+".js\n*/":"";return"define('"+b+"',['require','exports','module'],function(require,exports,module){"+d+"\n});\n"+c+"\n"}var q,y,x,r;y=(q=k&&(k.head||k.getElementsByTagName("head")[0]))&&q.getElementsByTagName("base")[0]||null;
x=d.core.N;r=d.core.u;v.load=function(d,b,c,u){var z,A,p;z=c.error||function(b){throw b;};A=r(b.Fa(d),u);p=!1!==u.injectSourceUrl&&A;f(A,function(f){var n;n=x(f);b(n,function(){f=v(f,d,p);if(u.injectScript){var n=f,r=k.createElement("script");s(r,n);r.charset="utf-8";q.insertBefore(r,y)}else g(f);c(b(d))},z)},z)};v.cramPlugin="../cram/cjsm11";return v})})(this,this.document,function(f){eval(f)});
define("curl/plugin/locale",function(){function f(f,d){var g;if(f&&(g=f.locale,"function"==typeof g&&(g=g(f,d)),"string"==typeof g))return g;if("undefined"==typeof window)return!1;g=window.clientInformation||window.navigator;return(g&&(g.language||g.userLanguage)||"").toLowerCase()}function k(f,d){return f.replace(g,(d?"/"+d:"")+"$&")}var g;g=/(\.js)?$/;f.toModuleId=k;f.load=function(g,d,s,v){function q(){var b=Error("Unable to find correct locale for "+g);if(s.error)s.error(b);else throw b;}var y,
x;y=f(v,g);x=v.localeToModuleId||k;v=y?x(g,y):g;try{s(d(v))}catch(r){x=y?x(g,!1):g;if(x==v)return q();try{s(d(x))}catch(w){if(!0!==y)return q();d(["i18n!"+g],s,q)}}};return f});
define("curl/plugin/i18n",["./locale"],function(f){function k(f,k,d,s,v){f([k],function(f){s(f,d)},v)}return{load:function(g,n,d,s){function v(b,c){w[c]=b;q()}function q(){var f;if(++b==c.length)if(0==w.length)y(Error('No i18n bundles found: "'+g+'", locale "'+r+'"'));else{f=w[0]||{};for(z=1;z<w.length;z++){var k=w[z],n={},q=void 0;for(q in f)n[q]=f[q];if(k)for(q in k)n[q]=k[q];f=n}d(f)}}var y,x,r,w,b,c,u,z;y=d.error;g||y(Error("blank i18n bundle id."));x=s.localeToModuleId||f.Ea;r=f(s,g);c=[g];w=
[];b=0;if(r&&!1!==s.locale)for(c=c.concat(r.split("-")),u=[],z=1;z<c.length;z++)u[z-1]=c[z],s=x(g,u.join("-")),k(n,s,z,v,q);k(n,g,0,v,q)},cramPlugin:"../cram/i18n"}});
(function(f,k,g){define("curl/loader/legacy",["curl/_privileged"],function(n){var d,s,v;d=k&&!0==k.createElement("script").async;s=n.core.m;v=/\?|\.js\b/;return{load:function(k,n,x,r){function w(){E.r="";s(E,b,c)}function b(){var b;if(!(0<--C)){if(z)try{b=z.call(f,k)}catch(d){c(Error("Factory for legacy "+k+" failed: "+d.message))}else try{b=g(u)}catch(n){c(Error("Failed to find exports "+u+" for legacy "+k))}define(k,b);x(b)}}function c(b){(x.error||function(b){throw b;})(b)}var u,z,A,p,E,C;u=r.exports||
r.a;z=r.factory||r.factory;if(!u&&!z)throw Error("`exports` or `factory` required for legacy: "+k);A=[].concat(r.requires||r.Ca||[]);r=(r=r.dontAddFileExt||r.j)?RegExp(r):v;p=n.toUrl(k);r.test(p)||(p=p.lastIndexOf(".")<=p.lastIndexOf("/")?p+".js":p);E={url:p,R:!0,r:d||!A.length?"":"text/cache"};A.length?(C=2,n(A,d?b:w,c)):C=1;s(E,b,c)},cramPlugin:"../cram/legacy"}})})(this,this.document,function(f){return(0,eval)(f)});
}).call(this);

View File

@@ -1,4 +1,4 @@
Copyright 2011-2012 John-David Dalton <http://allyoucanleet.com/>
Copyright 2011-2013 John-David Dalton <http://allyoucanleet.com/>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the

View File

@@ -1,33 +0,0 @@
# Docdown <sup>v1.0.0</sup>
A simple JSDoc to Markdown documentation generator.
## Documentation
The documentation for Docdown can be viewed here: [/doc/README.md](https://github.com/jdalton/docdown/blob/master/doc/README.md#readme)
For a list of upcoming features, check out our [roadmap](https://github.com/jdalton/docdown/wiki/Roadmap).
## Installation and usage
Usage example:
```php
require("docdown.php");
// generate Markdown
$markdown = docdown(array(
"path" => $filepath,
"url" => "https://github.com/username/project/blob/master/my.js"
));
```
## Author
* [John-David Dalton](http://allyoucanleet.com/)
[![twitter/jdalton](http://gravatar.com/avatar/299a3d891ff1920b69c364d061007043?s=70)](https://twitter.com/jdalton "Follow @jdalton on Twitter")
## Contributors
* [Mathias Bynens](http://mathiasbynens.be/)
[![twitter/mathias](http://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter")

View File

@@ -1,16 +1,16 @@
<?php
/*!
* Docdown v1.0.0-pre
* Copyright 2011-2012 John-David Dalton <http://allyoucanleet.com/>
* Copyright 2011-2013 John-David Dalton <http://allyoucanleet.com/>
* Available under MIT license <http://mths.be/mit>
*/
require(dirname(__FILE__) . '/src/DocDown/Generator.php');
require(dirname(__FILE__) . '/src/DocDown/MarkdownGenerator.php');
/**
* Generates Markdown from JSDoc entries in a given file.
*
* @param {Array} [$options=array()] The options array.
* @returns {String} The generated Markdown.
* @returns {string} The generated Markdown.
* @example
*
* // specify a file path
@@ -32,7 +32,7 @@ require(dirname(__FILE__) . '/src/DocDown/Generator.php');
* ));
*/
function docdown( $options = array() ) {
$gen = new Generator($options);
$gen = new MarkdownGenerator($options);
return $gen->generate();
}
?>

View File

@@ -19,7 +19,7 @@ class Alias {
* The Alias constructor.
*
* @constructor
* @param {String} $name The alias name.
* @param {string} $name The alias name.
* @param {Object} $owner The alias owner.
*/
public function __construct( $name, $owner ) {
@@ -29,15 +29,16 @@ class Alias {
$this->_category = $owner->getCategory();
$this->_desc = $owner->getDesc();
$this->_example = $owner->getExample();
$this->_isCtor = $owner->isCtor();
$this->_isLicense = $owner->isLicense();
$this->_isPlugin = $owner->isPlugin();
$this->_isPrivate = $owner->isPrivate();
$this->_isStatic = $owner->isStatic();
$this->_lineNumber = $owner->getLineNumber();
$this->_members = $owner->getMembers();
$this->_params = $owner->getParams();
$this->_returns = $owner->getReturns();
$this->_type = $owner->getType();
$this->_isCtor = $owner->isCtor();
$this->_isPlugin = $owner->isPlugin();
$this->_isPrivate = $owner->isPrivate();
$this->_isStatic = $owner->isStatic();
}
/*--------------------------------------------------------------------------*/
@@ -46,8 +47,8 @@ class Alias {
* Extracts the entry's `alias` objects.
*
* @memberOf Alias
* @param {Number} $index The index of the array value to return.
* @returns {Array|String} The entry's `alias` objects.
* @param {number} $index The index of the array value to return.
* @returns {Array|string} The entry's `alias` objects.
*/
public function getAliases( $index = null ) {
$result = array();
@@ -60,7 +61,7 @@ class Alias {
* Extracts the function call from the owner entry.
*
* @memberOf Alias
* @returns {String} The function call.
* @returns {string} The function call.
*/
public function getCall() {
return $this->_call;
@@ -70,7 +71,7 @@ class Alias {
* Extracts the owner entry's `category` data.
*
* @memberOf Alias
* @returns {String} The owner entry's `category` data.
* @returns {string} The owner entry's `category` data.
*/
public function getCategory() {
return $this->_category;
@@ -80,7 +81,7 @@ class Alias {
* Extracts the owner entry's description.
*
* @memberOf Alias
* @returns {String} The owner entry's description.
* @returns {string} The owner entry's description.
*/
public function getDesc() {
return $this->_desc;
@@ -90,17 +91,77 @@ class Alias {
* Extracts the owner entry's `example` data.
*
* @memberOf Alias
* @returns {String} The owner entry's `example` data.
* @returns {string} The owner entry's `example` data.
*/
public function getExample() {
return $this->_example;
}
/**
* Checks if the entry is an alias.
*
* @memberOf Alias
* @returns {boolean} Returns `true`.
*/
public function isAlias() {
return true;
}
/**
* Checks if the owner entry is a constructor.
*
* @memberOf Alias
* @returns {boolean} Returns `true` if a constructor, else `false`.
*/
public function isCtor() {
return $this->_isCtor;
}
/**
* Checks if the owner entry is a license.
*
* @memberOf Alias
* @returns {boolean} Returns `true` if a license, else `false`.
*/
public function isLicense() {
return $this->_isLicense;
}
/**
* Checks if the owner entry *is* assigned to a prototype.
*
* @memberOf Alias
* @returns {boolean} Returns `true` if assigned to a prototype, else `false`.
*/
public function isPlugin() {
return $this->_isPlugin;
}
/**
* Checks if the owner entry is private.
*
* @memberOf Alias
* @returns {boolean} Returns `true` if private, else `false`.
*/
public function isPrivate() {
return $this->_isPrivate;
}
/**
* Checks if the owner entry is *not* assigned to a prototype.
*
* @memberOf Alias
* @returns {boolean} Returns `true` if not assigned to a prototype, else `false`.
*/
public function isStatic() {
return $this->_isStatic;
}
/**
* Resolves the owner entry's line number.
*
* @memberOf Alias
* @returns {Number} The owner entry's line number.
* @returns {number} The owner entry's line number.
*/
public function getLineNumber() {
return $this->_lineNumber;
@@ -110,8 +171,8 @@ class Alias {
* Extracts the owner entry's `member` data.
*
* @memberOf Alias
* @param {Number} $index The index of the array value to return.
* @returns {Array|String} The owner entry's `member` data.
* @param {number} $index The index of the array value to return.
* @returns {Array|string} The owner entry's `member` data.
*/
public function getMembers( $index = null ) {
return $index !== null
@@ -123,7 +184,7 @@ class Alias {
* Extracts the owner entry's `name` data.
*
* @memberOf Alias
* @returns {String} The owner entry's `name` data.
* @returns {string} The owner entry's `name` data.
*/
public function getName() {
return $this->_name;
@@ -133,7 +194,7 @@ class Alias {
* Extracts the owner entry's `param` data.
*
* @memberOf Alias
* @param {Number} $index The index of the array value to return.
* @param {number} $index The index of the array value to return.
* @returns {Array} The owner entry's `param` data.
*/
public function getParams( $index = null ) {
@@ -146,7 +207,7 @@ class Alias {
* Extracts the owner entry's `returns` data.
*
* @memberOf Alias
* @returns {String} The owner entry's `returns` data.
* @returns {string} The owner entry's `returns` data.
*/
public function getReturns() {
return $this->_returns;
@@ -156,60 +217,10 @@ class Alias {
* Extracts the owner entry's `type` data.
*
* @memberOf Alias
* @returns {String} The owner entry's `type` data.
* @returns {string} The owner entry's `type` data.
*/
public function getType() {
return $this->_type;
}
/**
* Checks if the entry is an alias.
*
* @memberOf Alias
* @returns {Boolean} Returns `true`.
*/
public function isAlias() {
return true;
}
/**
* Checks if the owner entry is a constructor.
*
* @memberOf Alias
* @returns {Boolean} Returns `true` if a constructor, else `false`.
*/
public function isCtor() {
return $this->_isCtor;
}
/**
* Checks if the owner entry *is* assigned to a prototype.
*
* @memberOf Alias
* @returns {Boolean} Returns `true` if assigned to a prototype, else `false`.
*/
public function isPlugin() {
return $this->_isPlugin;
}
/**
* Checks if the owner entry is private.
*
* @memberOf Alias
* @returns {Boolean} Returns `true` if private, else `false`.
*/
public function isPrivate() {
return $this->_isPrivate;
}
/**
* Checks if the owner entry is *not* assigned to a prototype.
*
* @memberOf Alias
* @returns {Boolean} Returns `true` if not assigned to a prototype, else `false`.
*/
public function isStatic() {
return $this->_isStatic;
}
}
?>

View File

@@ -11,7 +11,7 @@ class Entry {
* The documentation entry.
*
* @memberOf Entry
* @type String
* @type string
*/
public $entry = '';
@@ -19,7 +19,7 @@ class Entry {
* The language highlighter used for code examples.
*
* @memberOf Entry
* @type String
* @type string
*/
public $lang = '';
@@ -27,7 +27,7 @@ class Entry {
* The source code.
*
* @memberOf Entry
* @type String
* @type string
*/
public $source = '';
@@ -37,9 +37,9 @@ class Entry {
* The Entry constructor.
*
* @constructor
* @param {String} $entry The documentation entry to analyse.
* @param {String} $source The source code.
* @param {String} [$lang ='js'] The language highlighter used for code examples.
* @param {string} $entry The documentation entry to analyse.
* @param {string} $source The source code.
* @param {string} [$lang ='js'] The language highlighter used for code examples.
*/
public function __construct( $entry, $source, $lang = 'js' ) {
$this->entry = $entry;
@@ -54,11 +54,11 @@ class Entry {
*
* @static
* @memberOf Entry
* @param {String} $source The source code.
* @param {string} $source The source code.
* @returns {Array} The array of entries.
*/
public static function getEntries( $source ) {
preg_match_all('#/\*\*(?![-!])[\s\S]*?\*/\s*[^\n]+#', $source, $result);
preg_match_all('#/\*\*(?![-!])[\s\S]*?\*/\s*.+#', $source, $result);
return array_pop($result);
}
@@ -69,7 +69,7 @@ class Entry {
*
* @private
* @memberOf Entry
* @returns {Boolean} Returns `true` if the entry is a function reference, else `false`.
* @returns {boolean} Returns `true` if the entry is a function reference, else `false`.
*/
private function isFunction() {
if (!isset($this->_isFunction)) {
@@ -77,7 +77,8 @@ class Entry {
$this->isCtor() ||
count($this->getParams()) ||
count($this->getReturns()) ||
preg_match('/\* *@function\b/', $this->entry)
preg_match('/\*[\t ]*@function\b/', $this->entry) ||
preg_match('#\*/\s*function #', $this->entry)
);
}
return $this->_isFunction;
@@ -89,15 +90,15 @@ class Entry {
* Extracts the entry's `alias` objects.
*
* @memberOf Entry
* @param {Number} $index The index of the array value to return.
* @returns {Array|String} The entry's `alias` objects.
* @param {number} $index The index of the array value to return.
* @returns {Array|string} The entry's `alias` objects.
*/
public function getAliases( $index = null ) {
if (!isset($this->_aliases)) {
preg_match('#\* *@alias\s+([^\n]+)#', $this->entry, $result);
preg_match('#\*[\t ]*@alias\s+(.+)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
$result = preg_split('/,\s*/', $result);
natsort($result);
@@ -116,7 +117,7 @@ class Entry {
* Extracts the function call from the entry.
*
* @memberOf Entry
* @returns {String} The function call.
* @returns {string} The function call.
*/
public function getCall() {
if (isset($this->_call)) {
@@ -129,7 +130,7 @@ class Entry {
}
// resolve name
// avoid $this->getName() because it calls $this->getCall()
preg_match('#\* *@name\s+([^\n]+)#', $this->entry, $name);
preg_match('#\*[\t ]*@name\s+(.+)#', $this->entry, $name);
if (count($name)) {
$name = trim($name[1]);
} else {
@@ -140,12 +141,15 @@ class Entry {
// compose parts
$result = array($result);
$params = $this->getParams();
foreach ($params as $param) {
$result[] = $param[1];
// skip params that are properties of other params (e.g. `options.leading`)
if (!preg_match('/\w+\.[\w.]+\s*=/', $param[1])) {
$result[] = $param[1];
}
}
// format
$result = $name .'('. implode(array_slice($result, 1), ', ') .')';
$result = str_replace(', [', ' [, ', str_replace('], [', ', ', $result));
}
$this->_call = $result ? $result : $name;
@@ -156,16 +160,16 @@ class Entry {
* Extracts the entry's `category` data.
*
* @memberOf Entry
* @returns {String} The entry's `category` data.
* @returns {string} The entry's `category` data.
*/
public function getCategory() {
if (isset($this->_category)) {
return $this->_category;
}
preg_match('#\* *@category\s+([^\n]+)#', $this->entry, $result);
preg_match('#\*[\t ]*@category\s+(.+)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
} else {
$result = $this->getType() == 'Function' ? 'Methods' : 'Properties';
}
@@ -177,7 +181,7 @@ class Entry {
* Extracts the entry's description.
*
* @memberOf Entry
* @returns {String} The entry's description.
* @returns {string} The entry's description.
*/
public function getDesc() {
if (isset($this->_desc)) {
@@ -187,9 +191,9 @@ class Entry {
preg_match('#/\*\*(?:\s*\*)?([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
if (count($result)) {
$type = $this->getType();
$result = preg_replace('/:\n *\* */', ":<br>\n", $result[1]);
$result = preg_replace('/(?:^|\n) *\*\n *\* */', "\n\n", $result);
$result = preg_replace('/(?:^|\n) *\* ?/', ' ', $result);
$result = preg_replace('/:\n[\t ]*\*[\t ]*/', ":<br>\n", $result[1]);
$result = preg_replace('/(?:^|\n)[\t ]*\*\n[\t ]*\*[\t ]*/', "\n\n", $result);
$result = preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result);
$result = trim($result);
$result = ($type == 'Function' ? '' : '(' . str_replace('|', ', ', trim($type, '{}')) . '): ') . $result;
}
@@ -201,155 +205,27 @@ class Entry {
* Extracts the entry's `example` data.
*
* @memberOf Entry
* @returns {String} The entry's `example` data.
* @returns {string} The entry's `example` data.
*/
public function getExample() {
if (isset($this->_example)) {
return $this->_example;
}
preg_match('#\* *@example\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
preg_match('#\*[\t ]*@example\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', "\n", $result[1]));
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', "\n", $result[1]));
$result = '```' . $this->lang . "\n" . $result . "\n```";
}
$this->_example = $result;
return $result;
}
/**
* Resolves the entry's line number.
*
* @memberOf Entry
* @returns {Number} The entry's line number.
*/
public function getLineNumber() {
if (!isset($this->_lineNumber)) {
preg_match_all('/\n/', substr($this->source, 0, strrpos($this->source, $this->entry) + strlen($this->entry)), $lines);
$this->_lineNumber = count(array_pop($lines)) + 1;
}
return $this->_lineNumber;
}
/**
* Extracts the entry's `member` data.
*
* @memberOf Entry
* @param {Number} $index The index of the array value to return.
* @returns {Array|String} The entry's `member` data.
*/
public function getMembers( $index = null ) {
if (!isset($this->_members)) {
preg_match('#\* *@member(?:Of)?\s+([^\n]+)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
$result = preg_split('/,\s*/', $result);
natsort($result);
}
$this->_members = $result;
}
return $index !== null
? @$this->_members[$index]
: $this->_members;
}
/**
* Extracts the entry's `name` data.
*
* @memberOf Entry
* @returns {String} The entry's `name` data.
*/
public function getName() {
if (isset($this->_name)) {
return $this->_name;
}
preg_match('#\* *@name\s+([^\n]+)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
} else {
$result = array_shift(explode('(', $this->getCall()));
}
$this->_name = $result;
return $result;
}
/**
* Extracts the entry's `param` data.
*
* @memberOf Entry
* @param {Number} $index The index of the array value to return.
* @returns {Array} The entry's `param` data.
*/
public function getParams( $index = null ) {
if (!isset($this->_params)) {
preg_match_all('#\* *@param\s+\{([^}]+)\}\s+(\[.+\]|[$\w|]+(?:\[.+\])?)\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#i', $this->entry, $result);
if (count($result = array_filter(array_slice($result, 1)))) {
// repurpose array
foreach ($result as $param) {
foreach ($param as $key => $value) {
if (!is_array($result[0][$key])) {
$result[0][$key] = array();
}
$result[0][$key][] = trim(preg_replace('/(?:^|\n)\s*\* */', ' ', $value));
}
}
$result = $result[0];
}
$this->_params = $result;
}
return $index !== null
? @$this->_params[$index]
: $this->_params;
}
/**
* Extracts the entry's `returns` data.
*
* @memberOf Entry
* @returns {String} The entry's `returns` data.
*/
public function getReturns() {
if (isset($this->_returns)) {
return $this->_returns;
}
preg_match('#\* *@returns\s+\{([^}]+)\}\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
if (count($result)) {
$result = array_map('trim', array_slice($result, 1));
$result[0] = str_replace('|', ', ', $result[0]);
$result[1] = preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]);
}
$this->_returns = $result;
return $result;
}
/**
* Extracts the entry's `type` data.
*
* @memberOf Entry
* @returns {String} The entry's `type` data.
*/
public function getType() {
if (isset($this->_type)) {
return $this->_type;
}
preg_match('#\* *@type\s+([^\n]+)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)\s*\* ?/', ' ', $result[1]));
} else {
$result = $this->isFunction() ? 'Function' : 'Unknown';
}
$this->_type = $result;
return $result;
}
/**
* Checks if the entry is an alias.
*
* @memberOf Entry
* @returns {Boolean} Returns `false`.
* @returns {boolean} Returns `false`.
*/
public function isAlias() {
return false;
@@ -359,20 +235,33 @@ class Entry {
* Checks if the entry is a constructor.
*
* @memberOf Entry
* @returns {Boolean} Returns `true` if a constructor, else `false`.
* @returns {boolean} Returns `true` if a constructor, else `false`.
*/
public function isCtor() {
if (!isset($this->_isCtor)) {
$this->_isCtor = !!preg_match('/\* *@constructor\b/', $this->entry);
$this->_isCtor = !!preg_match('/\*[\t ]*@constructor\b/', $this->entry);
}
return $this->_isCtor;
}
/**
* Checks if the entry is a license.
*
* @memberOf Entry
* @returns {boolean} Returns `true` if a license, else `false`.
*/
public function isLicense() {
if (!isset($this->_isLicense)) {
$this->_isLicense = !!preg_match('/\*[\t ]*@license\b/', $this->entry);
}
return $this->_isLicense;
}
/**
* Checks if the entry *is* assigned to a prototype.
*
* @memberOf Entry
* @returns {Boolean} Returns `true` if assigned to a prototype, else `false`.
* @returns {boolean} Returns `true` if assigned to a prototype, else `false`.
*/
public function isPlugin() {
if (!isset($this->_isPlugin)) {
@@ -385,11 +274,11 @@ class Entry {
* Checks if the entry is private.
*
* @memberOf Entry
* @returns {Boolean} Returns `true` if private, else `false`.
* @returns {boolean} Returns `true` if private, else `false`.
*/
public function isPrivate() {
if (!isset($this->_isPrivate)) {
$this->_isPrivate = !!preg_match('/\* *@private\b/', $this->entry) || !preg_match('/\* *@[a-z]+\b/', $this->entry);
$this->_isPrivate = $this->isLicense() || !!preg_match('/\*[\t ]*@private\b/', $this->entry) || !preg_match('/\*[\t ]*@[a-z]+\b/', $this->entry);
}
return $this->_isPrivate;
}
@@ -398,7 +287,7 @@ class Entry {
* Checks if the entry is *not* assigned to a prototype.
*
* @memberOf Entry
* @returns {Boolean} Returns `true` if not assigned to a prototype, else `false`.
* @returns {boolean} Returns `true` if not assigned to a prototype, else `false`.
*/
public function isStatic() {
if (isset($this->_isStatic)) {
@@ -406,7 +295,7 @@ class Entry {
}
$public = !$this->isPrivate();
$result = $public && !!preg_match('/\* *@static\b/', $this->entry);
$result = $public && !!preg_match('/\*[\t ]*@static\b/', $this->entry);
// set in cases where it isn't explicitly stated
if ($public && !$result) {
@@ -425,5 +314,139 @@ class Entry {
$this->_isStatic = $result;
return $result;
}
/**
* Resolves the entry's line number.
*
* @memberOf Entry
* @returns {number} The entry's line number.
*/
public function getLineNumber() {
if (!isset($this->_lineNumber)) {
preg_match_all('/\n/', substr($this->source, 0, strrpos($this->source, $this->entry) + strlen($this->entry)), $lines);
$this->_lineNumber = count(array_pop($lines)) + 1;
}
return $this->_lineNumber;
}
/**
* Extracts the entry's `member` data.
*
* @memberOf Entry
* @param {number} $index The index of the array value to return.
* @returns {Array|string} The entry's `member` data.
*/
public function getMembers( $index = null ) {
if (!isset($this->_members)) {
preg_match('#\*[\t ]*@member(?:Of)?\s+(.+)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
$result = preg_split('/,\s*/', $result);
natsort($result);
}
$this->_members = $result;
}
return $index !== null
? @$this->_members[$index]
: $this->_members;
}
/**
* Extracts the entry's `name` data.
*
* @memberOf Entry
* @returns {string} The entry's `name` data.
*/
public function getName() {
if (isset($this->_name)) {
return $this->_name;
}
preg_match('#\*[\t ]*@name\s+(.+)#', $this->entry, $result);
if (count($result)) {
$result = trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]));
} else {
$result = array_shift(explode('(', $this->getCall()));
}
$this->_name = $result;
return $result;
}
/**
* Extracts the entry's `param` data.
*
* @memberOf Entry
* @param {number} $index The index of the array value to return.
* @returns {Array} The entry's `param` data.
*/
public function getParams( $index = null ) {
if (!isset($this->_params)) {
preg_match_all('#\*[\t ]*@param\s+\{\(?([^})]+)\)?\}\s+(\[.+\]|[$\w|]+(?:\[.+\])?)\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#i', $this->entry, $matchTuples);
$matchTuples = array_filter(array_slice($matchTuples, 1));
$result = array();
if (count($matchTuples)) {
foreach ($matchTuples as $tupleKey => $tuple) {
foreach ($tuple as $key => $value) {
if (!isset($result[$key])) {
$result[$key] = array();
}
$result[$key][] = $tupleKey
? trim(preg_replace('/(?:^|\n)[\t ]*\*[\t ]*/', ' ', $value))
: trim($value);
}
}
}
$this->_params = $result;
}
return $index !== null
? @$this->_params[$index]
: $this->_params;
}
/**
* Extracts the entry's `returns` data.
*
* @memberOf Entry
* @returns {string} The entry's `returns` data.
*/
public function getReturns() {
if (isset($this->_returns)) {
return $this->_returns;
}
preg_match('#\*[\t ]*@returns\s+\{([^}]+)\}\s+([\s\S]*?)(?=\*\s\@[a-z]|\*/)#', $this->entry, $result);
if (count($result)) {
$result = array_map('trim', array_slice($result, 1));
$result[0] = str_replace('|', ', ', $result[0]);
$result[1] = preg_replace('/(?:^|\n)[\t ]*\*[\t ]?/', ' ', $result[1]);
}
$this->_returns = $result;
return $result;
}
/**
* Extracts the entry's `type` data.
*
* @memberOf Entry
* @returns {string} The entry's `type` data.
*/
public function getType() {
if (isset($this->_type)) {
return $this->_type;
}
preg_match('#\*[\t ]*@type\s(?:\{\(?)?([^)}\n]+)#', $this->entry, $result);
if (count($result)) {
$result = trim($result[1]);
if (preg_match('/^(?:array|function|object|regexp)$/', $result)) {
$result = ucfirst($result);
}
} else {
$result = $this->isFunction() ? 'Function' : 'unknown';
}
$this->_type = $result;
return $result;
}
}
?>

View File

@@ -5,21 +5,21 @@ require(dirname(__FILE__) . "/Entry.php");
/**
* Generates Markdown from JSDoc entries.
*/
class Generator {
class MarkdownGenerator {
/**
* The HTML for the close tag.
*
* @static
* @memberOf Generator
* @type String
* @memberOf MarkdownGenerator
* @type string
*/
public $closeTag = "\n<!-- /div -->\n";
/**
* An array of JSDoc entries.
*
* @memberOf Generator
* @memberOf MarkdownGenerator
* @type Array
*/
public $entries = array();
@@ -27,16 +27,15 @@ class Generator {
/**
* The HTML for the open tag.
*
* @static
* @memberOf Generator
* @type String
* @memberOf MarkdownGenerator
* @type string
*/
public $openTag = "\n<!-- div -->\n";
/**
* An options array used to configure the generator.
*
* @memberOf Generator
* @memberOf MarkdownGenerator
* @type Array
*/
public $options = array();
@@ -44,18 +43,27 @@ class Generator {
/**
* The file's source code.
*
* @memberOf Generator
* @type String
* @memberOf MarkdownGenerator
* @type string
*/
public $source = '';
/**
* The array of code snippets that are tokenized by `escape`.
*
* @private
* @memberOf MarkdownGenerator
* @type Array
*/
private $snippets = array();
/*--------------------------------------------------------------------------*/
/**
* The Generator constructor.
* The MarkdownGenerator constructor.
*
* @constructor
* @param {String} $source The source code to parse.
* @param {string} $source The source code to parse.
* @param {Array} $options The options array.
*/
public function __construct( $source, $options = array() ) {
@@ -103,9 +111,9 @@ class Generator {
*
* @private
* @static
* @memberOf Generator
* @param {String} $string The string to format.
* @returns {String} The formatted string.
* @memberOf MarkdownGenerator
* @param {string} $string The string to format.
* @returns {string} The formatted string.
*/
private static function format( $string ) {
$counter = 0;
@@ -121,7 +129,7 @@ class Generator {
$string = preg_replace('/(^|\s)(\([^)]+\))/', '$1*$2*', $string);
// mark numbers as inline code
$string = preg_replace('/ (-?\d+(?:.\d+)?)(?!\.[^\n])/', ' `$1`', $string);
$string = preg_replace('/[\t ](-?\d+(?:.\d+)?)(?!\.[^\n])/', ' `$1`', $string);
// detokenize inline code snippets
$counter = 0;
@@ -137,23 +145,23 @@ class Generator {
*
* @private
* @static
* @memberOf Generator
* @param {String} $string The string to modify.
* @memberOf MarkdownGenerator
* @param {string} $string The string to modify.
* @param {Array|Object} $object The template object.
* @returns {String} The modified string.
* @returns {string} The modified string.
*/
private static function interpolate( $string, $object ) {
preg_match_all('/#\{([^}]+)\}/', $string, $tokens);
$tokens = array_unique(array_pop($tokens));
foreach ($tokens as $token) {
$pattern = '/#\{' . $token . '\}/';
$pattern = '/#\{' . preg_replace('/([.*+?^${}()|[\]\\\])/', '\\\$1', $token) . '\}/';
$replacement = '';
if (is_object($object)) {
preg_match('/\(([^)]+?)\)$/', $token, $args);
$args = preg_split('/,\s*/', array_pop($args));
$method = 'get' . ucfirst(str_replace('/\([^)]+?\)$/', '', $token));
$method = 'get' . ucfirst(preg_replace('/\([^)]+?\)$/', '', $token));
if (method_exists($object, $method)) {
$replacement = (string) call_user_func_array(array($object, $method), $args);
@@ -165,7 +173,7 @@ class Generator {
}
$string = preg_replace($pattern, trim($replacement), $string);
}
return Generator::format($string);
return MarkdownGenerator::format($string);
}
/*--------------------------------------------------------------------------*/
@@ -174,7 +182,7 @@ class Generator {
* Adds the given `$entries` to the `$result` array.
*
* @private
* @memberOf Generator
* @memberOf MarkdownGenerator
* @param {Array} $result The result array to modify.
* @param {Array} $entries The entries to add to the `$result`.
*/
@@ -188,14 +196,21 @@ class Generator {
array_push(
$result,
$this->openTag,
Generator::interpolate("### <a id=\"#{hash}\"></a>`#{member}#{separator}#{call}`\n<a href=\"##{hash}\">#</a> [&#x24C8;](#{href} \"View in source\") [&#x24C9;][1]\n\n#{desc}", $entry)
MarkdownGenerator::interpolate("### <a id=\"#{hash}\"></a>`#{member}#{separator}#{call}`\n<a href=\"##{hash}\">#</a> [&#x24C8;](#{href} \"View in source\") [&#x24C9;][1]\n\n#{desc}", array(
'call' => $entry->getCall(),
'desc' => $this->escape($entry->getDesc()),
'hash' => $entry->hash,
'href' => $entry->href,
'member' => $entry->member,
'separator' => $entry->separator
))
);
// @alias
if (count($aliases = $entry->getAliases())) {
array_push($result, '', '#### Aliases');
foreach ($aliases as $index => $alias) {
$aliases[$index] = $alias->getName();
$aliases[$index] = MarkdownGenerator::interpolate('#{member}#{separator}#{name}', $alias);
}
$result[] = '*' . implode(', ', $aliases) . '*';
}
@@ -203,11 +218,11 @@ class Generator {
if (count($params = $entry->getParams())) {
array_push($result, '', '#### Arguments');
foreach ($params as $index => $param) {
$result[] = Generator::interpolate('#{num}. `#{name}` (#{type}): #{desc}', array(
'desc' => $param[2],
$result[] = MarkdownGenerator::interpolate('#{num}. `#{name}` (#{type}): #{desc}', array(
'desc' => $this->escape($param[2]),
'name' => $param[1],
'num' => $index + 1,
'type' => $param[0]
'type' => $this->escape($param[0])
));
}
}
@@ -216,7 +231,10 @@ class Generator {
array_push(
$result, '',
'#### Returns',
Generator::interpolate('(#{type}): #{desc}', array('desc' => $returns[1], 'type' => $returns[0]))
MarkdownGenerator::interpolate('(#{type}): #{desc}', array(
'desc' => $this->escape($returns[1]),
'type' => $this->escape($returns[0])
))
);
}
// @example
@@ -227,22 +245,40 @@ class Generator {
}
}
/**
* Escapes special Markdown characters.
*
* @private
* @memberOf Entry
* @param {string} $string The string to escape.
* @returns {string} Returns the escaped string.
*/
private function escape( $string ) {
$string = preg_replace_callback('/`.*?\`/', array($this, 'swapSnippetsToTokens'), $string);
$string = preg_replace('/(?<!\\\)\*/', '&#42;', $string);
$string = preg_replace('/(?<!\\\)\[/', '&#91;', $string);
$string = preg_replace('/(?<!\\\)\]/', '&#93;', $string);
$string = preg_replace_callback('/@@token@@/', array($this, 'swapTokensToSnippets'), $string);
return $string;
}
/**
* Resolves the entry's hash used to navigate the documentation.
*
* @private
* @memberOf Generator
* @param {Number|Object} $entry The entry object.
* @param {String} $member The name of the member.
* @returns {String} The url hash.
* @memberOf MarkdownGenerator
* @param {number|Object} $entry The entry object.
* @param {string} $member The name of the member.
* @returns {string} The url hash.
*/
private function getHash( $entry, $member = '' ) {
$entry = is_numeric($entry) ? $this->entries[$entry] : $entry;
$member = !$member ? $entry->getMembers(0) : $member;
$result = ($member ? $member . ($entry->isPlugin() ? 'prototype' : '') : '') . $entry->getCall();
$result = preg_replace('/\(\[|\[\]/', '', $result);
$result = preg_replace('/[ =|\'"{}.()\]]/', '', $result);
$result = preg_replace('/[[#,]/', '-', $result);
$result = preg_replace('/[\t =|\'"{}.()\]]/', '', $result);
$result = preg_replace('/[\[#,]+/', '-', $result);
return strtolower($result);
}
@@ -250,9 +286,9 @@ class Generator {
* Resolves the entry's url for the specific line number.
*
* @private
* @memberOf Generator
* @param {Number|Object} $entry The entry object.
* @returns {String} The url.
* @memberOf MarkdownGenerator
* @param {number|Object} $entry The entry object.
* @returns {string} The url.
*/
private function getLineUrl( $entry ) {
$entry = is_numeric($entry) ? $this->entries($entry) : $entry;
@@ -263,22 +299,48 @@ class Generator {
* Extracts the character used to separate the entry's name from its member.
*
* @private
* @memberOf Generator
* @param {Number|Object} $entry The entry object.
* @returns {String} The separator.
* @memberOf MarkdownGenerator
* @param {number|Object} $entry The entry object.
* @returns {string} The separator.
*/
private function getSeparator( $entry ) {
$entry = is_numeric($entry) ? $this->entries($entry) : $entry;
return $entry->isPlugin() ? '.prototype.' : '.';
}
/**
* Swaps code snippets with tokens as a `preg_replace_callback` callback
* used by `escape`.
*
* @private
* @memberOf Entry
* @param {Array} $matches The array of regexp matches.
* @returns {string} Returns the token.
*/
private function swapSnippetsToTokens( $matches ) {
$this->snippets[] = $matches[0];
return '@@token@@';
}
/**
* Swaps tokens with code snippets as a `preg_replace_callback` callback
* used by `escape`.
*
* @private
* @memberOf Entry
* @returns {string} Returns the code snippet.
*/
private function swapTokensToSnippets() {
return array_shift($this->snippets);
}
/*--------------------------------------------------------------------------*/
/**
* Generates Markdown from JSDoc entries.
*
* @memberOf Generator
* @returns {String} The rendered Markdown.
* @memberOf MarkdownGenerator
* @returns {string} The rendered Markdown.
*/
public function generate() {
$api = array();
@@ -321,9 +383,7 @@ class Generator {
$api[$member] = $entry;
foreach ($entry->getAliases() as $alias) {
$api[$member] = $alias;
$alias->static = array();
$alias->plugin = array();
$api[$member]->static[] = $alias;
}
}
else if ($entry->isStatic()) {
@@ -345,9 +405,10 @@ class Generator {
foreach ($api as $entry) {
$entry->hash = $this->getHash($entry);
$entry->href = $this->getLineUrl($entry);
$entry->separator = '';
$member = $entry->getMembers(0);
$member = ($member ? $member . ($entry->isPlugin() ? '.prototype.' : '.') : '') . $entry->getName();
$member = ($member ? $member . $this->getSeparator($entry) : '') . $entry->getName();
$entry->member = preg_replace('/' . $entry->getName() . '$/', '', $member);
// add properties to static and plugin sub-entries
@@ -446,7 +507,7 @@ class Generator {
}
// assign TOC hash
if (count($result) == 2) {
$toc = $category;
$toc = strtolower($category);
}
// add category
array_push(
@@ -455,7 +516,18 @@ class Generator {
);
// add entries
foreach ($entries as $entry) {
$result[] = Generator::interpolate('* [`#{member}#{separator}#{name}`](##{hash})', $entry);
if ($entry->isAlias()) {
$result[] = MarkdownGenerator::interpolate('* <a href="##{hash}" class="alias">`#{member}#{separator}#{name}` -> `#{realName}`</a>', array(
'hash' => $entry->hash,
'member' => $entry->member,
'name' => $entry->getName(),
'realName' => $entry->owner->getName(),
'separator' => $entry->separator
));
}
else {
$result[] = MarkdownGenerator::interpolate('* <a href="##{hash}">`#{member}#{separator}#{name}`</a>', $entry);
}
}
}
}
@@ -477,7 +549,7 @@ class Generator {
array_push(
$result,
$openTag, '## ' . (count($result) == 2 ? '<a id="' . $toc . '"></a>' : '') . '`' . $member . '`',
Generator::interpolate('* [`' . $member . '`](##{hash})', $entry)
MarkdownGenerator::interpolate('* [`' . $member . '`](##{hash})', $entry)
);
// add static and plugin sub-entries
@@ -492,7 +564,18 @@ class Generator {
}
foreach ($entry->{$kind} as $subentry) {
$subentry->member = $member;
$result[] = Generator::interpolate('* [`#{member}#{separator}#{name}`](##{hash})', $subentry);
if ($subentry->isAlias()) {
$result[] = MarkdownGenerator::interpolate('* <a href="##{hash}" class="alias">`#{member}#{separator}#{name}` -> `#{realName}`</a>', array(
'hash' => $subentry->hash,
'member' => $subentry->member,
'name' => $subentry->getName(),
'realName' => $subentry->owner->getName(),
'separator' => $subentry->separator
));
}
else {
$result[] = MarkdownGenerator::interpolate('* <a href="##{hash}">`#{member}#{separator}#{name}`</a>', $subentry);
}
}
}
}
@@ -559,7 +642,7 @@ class Generator {
array_push($result, $closeTag, $closeTag, '', ' [1]: #' . $toc . ' "Jump back to the TOC."');
// cleanup whitespace
return trim(preg_replace('/ +\n/', "\n", join($result, "\n")));
return trim(preg_replace('/[\t ]+\n/', "\n", join($result, "\n")));
}
}
?>
?>

195
vendor/dojo/LICENSE vendored Normal file
View File

@@ -0,0 +1,195 @@
Dojo is available under *either* the terms of the modified BSD license *or* the
Academic Free License version 2.1. As a recipient of Dojo, you may choose which
license to receive this code under (except as noted in per-module LICENSE
files). Some modules may not be the copyright of the Dojo Foundation. These
modules contain explicit declarations of copyright in both the LICENSE files in
the directories in which they reside and in the code itself. No external
contributions are allowed under licenses which are fundamentally incompatible
with the AFL or BSD licenses that Dojo is distributed under.
The text of the AFL and BSD licenses is reproduced below.
-------------------------------------------------------------------------------
The "New" BSD License:
**********************
Copyright (c) 2005-2013, The Dojo Foundation
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* Neither the name of the Dojo Foundation nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------
The Academic Free License, v. 2.1:
**********************************
This Academic Free License (the "License") applies to any original work of
authorship (the "Original Work") whose owner (the "Licensor") has placed the
following notice immediately following the copyright notice for the Original
Work:
Licensed under the Academic Free License version 2.1
1) Grant of Copyright License. Licensor hereby grants You a world-wide,
royalty-free, non-exclusive, perpetual, sublicenseable license to do the
following:
a) to reproduce the Original Work in copies;
b) to prepare derivative works ("Derivative Works") based upon the Original
Work;
c) to distribute copies of the Original Work and Derivative Works to the
public;
d) to perform the Original Work publicly; and
e) to display the Original Work publicly.
2) Grant of Patent License. Licensor hereby grants You a world-wide,
royalty-free, non-exclusive, perpetual, sublicenseable license, under patent
claims owned or controlled by the Licensor that are embodied in the Original
Work as furnished by the Licensor, to make, use, sell and offer for sale the
Original Work and Derivative Works.
3) Grant of Source Code License. The term "Source Code" means the preferred
form of the Original Work for making modifications to it and all available
documentation describing how to modify the Original Work. Licensor hereby
agrees to provide a machine-readable copy of the Source Code of the Original
Work along with each copy of the Original Work that Licensor distributes.
Licensor reserves the right to satisfy this obligation by placing a
machine-readable copy of the Source Code in an information repository
reasonably calculated to permit inexpensive and convenient access by You for as
long as Licensor continues to distribute the Original Work, and by publishing
the address of that information repository in a notice immediately following
the copyright notice that applies to the Original Work.
4) Exclusions From License Grant. Neither the names of Licensor, nor the names
of any contributors to the Original Work, nor any of their trademarks or
service marks, may be used to endorse or promote products derived from this
Original Work without express prior written permission of the Licensor. Nothing
in this License shall be deemed to grant any rights to trademarks, copyrights,
patents, trade secrets or any other intellectual property of Licensor except as
expressly stated herein. No patent license is granted to make, use, sell or
offer to sell embodiments of any patent claims other than the licensed claims
defined in Section 2. No right is granted to the trademarks of Licensor even if
such marks are included in the Original Work. Nothing in this License shall be
interpreted to prohibit Licensor from licensing under different terms from this
License any Original Work that Licensor otherwise would have a right to
license.
5) This section intentionally omitted.
6) Attribution Rights. You must retain, in the Source Code of any Derivative
Works that You create, all copyright, patent or trademark notices from the
Source Code of the Original Work, as well as any notices of licensing and any
descriptive text identified therein as an "Attribution Notice." You must cause
the Source Code for any Derivative Works that You create to carry a prominent
Attribution Notice reasonably calculated to inform recipients that You have
modified the Original Work.
7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that
the copyright in and to the Original Work and the patent rights granted herein
by Licensor are owned by the Licensor or are sublicensed to You under the terms
of this License with the permission of the contributor(s) of those copyrights
and patent rights. Except as expressly stated in the immediately proceeding
sentence, the Original Work is provided under this License on an "AS IS" BASIS
and WITHOUT WARRANTY, either express or implied, including, without limitation,
the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU.
This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No
license to Original Work is granted hereunder except under this disclaimer.
8) Limitation of Liability. Under no circumstances and under no legal theory,
whether in tort (including negligence), contract, or otherwise, shall the
Licensor be liable to any person for any direct, indirect, special, incidental,
or consequential damages of any character arising as a result of this License
or the use of the Original Work including, without limitation, damages for loss
of goodwill, work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses. This limitation of liability shall not
apply to liability for death or personal injury resulting from Licensor's
negligence to the extent applicable law prohibits such limitation. Some
jurisdictions do not allow the exclusion or limitation of incidental or
consequential damages, so this exclusion and limitation may not apply to You.
9) Acceptance and Termination. If You distribute copies of the Original Work or
a Derivative Work, You must make a reasonable effort under the circumstances to
obtain the express assent of recipients to the terms of this License. Nothing
else but this License (or another written agreement between Licensor and You)
grants You permission to create Derivative Works based upon the Original Work
or to exercise any of the rights granted in Section 1 herein, and any attempt
to do so except under the terms of this License (or another written agreement
between Licensor and You) is expressly prohibited by U.S. copyright law, the
equivalent laws of other countries, and by international treaty. Therefore, by
exercising any of the rights granted to You in Section 1 herein, You indicate
Your acceptance of this License and all of its terms and conditions.
10) Termination for Patent Action. This License shall terminate automatically
and You may no longer exercise any of the rights granted to You by this License
as of the date You commence an action, including a cross-claim or counterclaim,
against Licensor or any licensee alleging that the Original Work infringes a
patent. This termination provision shall not apply for an action alleging
patent infringement by combinations of the Original Work with other software or
hardware.
11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this
License may be brought only in the courts of a jurisdiction wherein the
Licensor resides or in which Licensor conducts its primary business, and under
the laws of that jurisdiction excluding its conflict-of-law provisions. The
application of the United Nations Convention on Contracts for the International
Sale of Goods is expressly excluded. Any use of the Original Work outside the
scope of this License or after its termination shall be subject to the
requirements and penalties of the U.S. Copyright Act, 17 U.S.C. § 101 et
seq., the equivalent laws of other countries, and international treaty. This
section shall survive the termination of this License.
12) Attorneys Fees. In any action to enforce the terms of this License or
seeking damages relating thereto, the prevailing party shall be entitled to
recover its costs and expenses, including, without limitation, reasonable
attorneys' fees and costs incurred in connection with such action, including
any appeal of such action. This section shall survive the termination of this
License.
13) Miscellaneous. This License represents the complete agreement concerning
the subject matter hereof. If any provision of this License is held to be
unenforceable, such provision shall be reformed only to the extent necessary to
make it enforceable.
14) Definition of "You" in This License. "You" throughout this License, whether
in upper or lower case, means an individual or a legal entity exercising rights
under, and complying with all of the terms of, this License. For legal
entities, "You" includes any entity that controls, is controlled by, or is
under common control with you. For purposes of this definition, "control" means
(i) the power, direct or indirect, to cause the direction or management of such
entity, whether by contract or otherwise, or (ii) ownership of fifty percent
(50%) or more of the outstanding shares, or (iii) beneficial ownership of such
entity.
15) Right to Use. You may use the Original Work in all ways not otherwise
restricted or conditioned by this License or by law, and Licensor promises not
to interfere with or be responsible for such uses by You.
This license is Copyright (C) 2003-2004 Lawrence E. Rosen. All rights reserved.
Permission is hereby granted to copy and distribute this license without
modification. This license may not be modified without the express written
permission of its copyright owner.

1997
vendor/dojo/dojo.js vendored Normal file

File diff suppressed because it is too large Load Diff

0
vendor/firebug-lite/license.txt vendored Normal file → Executable file
View File

0
vendor/firebug-lite/skin/xp/blank.gif vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 43 B

After

Width:  |  Height:  |  Size: 43 B

0
vendor/firebug-lite/skin/xp/buttonBg.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 167 B

After

Width:  |  Height:  |  Size: 167 B

0
vendor/firebug-lite/skin/xp/buttonBgHover.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 171 B

After

Width:  |  Height:  |  Size: 171 B

0
vendor/firebug-lite/skin/xp/debugger.css vendored Normal file → Executable file
View File

0
vendor/firebug-lite/skin/xp/detach.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 655 B

After

Width:  |  Height:  |  Size: 655 B

0
vendor/firebug-lite/skin/xp/detachHover.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 586 B

After

Width:  |  Height:  |  Size: 586 B

0
vendor/firebug-lite/skin/xp/disable.gif vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 340 B

After

Width:  |  Height:  |  Size: 340 B

0
vendor/firebug-lite/skin/xp/disable.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 543 B

After

Width:  |  Height:  |  Size: 543 B

0
vendor/firebug-lite/skin/xp/disableHover.gif vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 344 B

After

Width:  |  Height:  |  Size: 344 B

0
vendor/firebug-lite/skin/xp/disableHover.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 512 B

After

Width:  |  Height:  |  Size: 512 B

0
vendor/firebug-lite/skin/xp/down.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 637 B

After

Width:  |  Height:  |  Size: 637 B

0
vendor/firebug-lite/skin/xp/downActive.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 543 B

After

Width:  |  Height:  |  Size: 543 B

0
vendor/firebug-lite/skin/xp/downHover.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 526 B

After

Width:  |  Height:  |  Size: 526 B

0
vendor/firebug-lite/skin/xp/errorIcon-sm.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 447 B

After

Width:  |  Height:  |  Size: 447 B

0
vendor/firebug-lite/skin/xp/errorIcon.gif vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 365 B

After

Width:  |  Height:  |  Size: 365 B

0
vendor/firebug-lite/skin/xp/errorIcon.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 457 B

After

Width:  |  Height:  |  Size: 457 B

0
vendor/firebug-lite/skin/xp/firebug-1.3a2.css vendored Normal file → Executable file
View File

0
vendor/firebug-lite/skin/xp/firebug.IE6.css vendored Normal file → Executable file
View File

0
vendor/firebug-lite/skin/xp/firebug.css vendored Normal file → Executable file
View File

0
vendor/firebug-lite/skin/xp/firebug.html vendored Normal file → Executable file
View File

0
vendor/firebug-lite/skin/xp/firebug.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

0
vendor/firebug-lite/skin/xp/group.gif vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 158 B

After

Width:  |  Height:  |  Size: 158 B

0
vendor/firebug-lite/skin/xp/html.css vendored Normal file → Executable file
View File

0
vendor/firebug-lite/skin/xp/infoIcon.gif vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 359 B

After

Width:  |  Height:  |  Size: 359 B

0
vendor/firebug-lite/skin/xp/infoIcon.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 524 B

After

Width:  |  Height:  |  Size: 524 B

0
vendor/firebug-lite/skin/xp/loading_16.gif vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

0
vendor/firebug-lite/skin/xp/min.png vendored Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 552 B

After

Width:  |  Height:  |  Size: 552 B

Some files were not shown because too many files have changed in this diff Show More